@SuppressWarnings("deprecation") @Test public void getDefaultFailurePolicy() throws Exception { Configuration conf = new Configuration(false); RegionCoprocessorEnvironment env = Mockito.mock(RegionCoprocessorEnvironment.class); Region region = Mockito.mock(Region.class); Mockito.when(env.getRegion()).thenReturn(region); Mockito.when(env.getConfiguration()).thenReturn(conf); Mockito.when(region.getTableDesc()).thenReturn(new HTableDescriptor()); assertNotNull(IndexWriter.getFailurePolicy(env)); }
public static IndexFailurePolicy getFailurePolicy(RegionCoprocessorEnvironment env) throws IOException { Configuration conf = env.getConfiguration(); try { IndexFailurePolicy committer = conf.getClass(INDEX_FAILURE_POLICY_CONF_KEY, PhoenixIndexFailurePolicy.class, IndexFailurePolicy.class).newInstance(); return committer; } catch (InstantiationException e) { throw new IOException(e); } catch (IllegalAccessException e) { throw new IOException(e); } }
IndexWriter implements Stoppable { public static IndexFailurePolicy getFailurePolicy(RegionCoprocessorEnvironment env) throws IOException { Configuration conf = env.getConfiguration(); try { IndexFailurePolicy committer = conf.getClass(INDEX_FAILURE_POLICY_CONF_KEY, PhoenixIndexFailurePolicy.class, IndexFailurePolicy.class).newInstance(); return committer; } catch (InstantiationException e) { throw new IOException(e); } catch (IllegalAccessException e) { throw new IOException(e); } } }
IndexWriter implements Stoppable { public static IndexFailurePolicy getFailurePolicy(RegionCoprocessorEnvironment env) throws IOException { Configuration conf = env.getConfiguration(); try { IndexFailurePolicy committer = conf.getClass(INDEX_FAILURE_POLICY_CONF_KEY, PhoenixIndexFailurePolicy.class, IndexFailurePolicy.class).newInstance(); return committer; } catch (InstantiationException e) { throw new IOException(e); } catch (IllegalAccessException e) { throw new IOException(e); } } IndexWriter(RegionCoprocessorEnvironment env, String name);  IndexWriter(IndexFailurePolicy failurePolicy, RegionCoprocessorEnvironment env, String name);  IndexWriter(IndexCommitter committer, IndexFailurePolicy policy,
      RegionCoprocessorEnvironment env, String name);   IndexWriter(IndexCommitter committer, IndexFailurePolicy policy); }
IndexWriter implements Stoppable { public static IndexFailurePolicy getFailurePolicy(RegionCoprocessorEnvironment env) throws IOException { Configuration conf = env.getConfiguration(); try { IndexFailurePolicy committer = conf.getClass(INDEX_FAILURE_POLICY_CONF_KEY, PhoenixIndexFailurePolicy.class, IndexFailurePolicy.class).newInstance(); return committer; } catch (InstantiationException e) { throw new IOException(e); } catch (IllegalAccessException e) { throw new IOException(e); } } IndexWriter(RegionCoprocessorEnvironment env, String name);  IndexWriter(IndexFailurePolicy failurePolicy, RegionCoprocessorEnvironment env, String name);  IndexWriter(IndexCommitter committer, IndexFailurePolicy policy,
      RegionCoprocessorEnvironment env, String name);   IndexWriter(IndexCommitter committer, IndexFailurePolicy policy); static IndexCommitter getCommitter(RegionCoprocessorEnvironment env); static IndexCommitter getCommitter(RegionCoprocessorEnvironment env, Class<? extends IndexCommitter> defaultClass); static IndexFailurePolicy getFailurePolicy(RegionCoprocessorEnvironment env); void writeAndKillYourselfOnFailure(Collection<Pair<Mutation, byte[]>> indexUpdates,
            boolean allowLocalUpdates, int clientVersion); void writeAndKillYourselfOnFailure(Multimap<HTableInterfaceReference, Mutation> toWrite,
            boolean allowLocalUpdates, int clientVersion); void write(Collection<Pair<Mutation, byte[]>> toWrite, int clientVersion); void write(Collection<Pair<Mutation, byte[]>> toWrite, boolean allowLocalUpdates, int clientVersion); void write(Multimap<HTableInterfaceReference, Mutation> toWrite, boolean allowLocalUpdates, int clientVersion); @Override void stop(String why); @Override boolean isStopped(); }
IndexWriter implements Stoppable { public static IndexFailurePolicy getFailurePolicy(RegionCoprocessorEnvironment env) throws IOException { Configuration conf = env.getConfiguration(); try { IndexFailurePolicy committer = conf.getClass(INDEX_FAILURE_POLICY_CONF_KEY, PhoenixIndexFailurePolicy.class, IndexFailurePolicy.class).newInstance(); return committer; } catch (InstantiationException e) { throw new IOException(e); } catch (IllegalAccessException e) { throw new IOException(e); } } IndexWriter(RegionCoprocessorEnvironment env, String name);  IndexWriter(IndexFailurePolicy failurePolicy, RegionCoprocessorEnvironment env, String name);  IndexWriter(IndexCommitter committer, IndexFailurePolicy policy,
      RegionCoprocessorEnvironment env, String name);   IndexWriter(IndexCommitter committer, IndexFailurePolicy policy); static IndexCommitter getCommitter(RegionCoprocessorEnvironment env); static IndexCommitter getCommitter(RegionCoprocessorEnvironment env, Class<? extends IndexCommitter> defaultClass); static IndexFailurePolicy getFailurePolicy(RegionCoprocessorEnvironment env); void writeAndKillYourselfOnFailure(Collection<Pair<Mutation, byte[]>> indexUpdates,
            boolean allowLocalUpdates, int clientVersion); void writeAndKillYourselfOnFailure(Multimap<HTableInterfaceReference, Mutation> toWrite,
            boolean allowLocalUpdates, int clientVersion); void write(Collection<Pair<Mutation, byte[]>> toWrite, int clientVersion); void write(Collection<Pair<Mutation, byte[]>> toWrite, boolean allowLocalUpdates, int clientVersion); void write(Multimap<HTableInterfaceReference, Mutation> toWrite, boolean allowLocalUpdates, int clientVersion); @Override void stop(String why); @Override boolean isStopped(); static final String INDEX_COMMITTER_CONF_KEY; static final String INDEX_FAILURE_POLICY_CONF_KEY; }