use of org.apache.phoenix.hbase.index.table.CoprocessorHTableFactory in project phoenix by apache.
the class IndexWriterUtils method getDefaultDelegateHTableFactory.
public static HTableFactory getDefaultDelegateHTableFactory(CoprocessorEnvironment env) {
// create a simple delegate factory, setup the way we need
Configuration conf = env.getConfiguration();
// set the number of threads allowed per table.
int htableThreads = conf.getInt(IndexWriterUtils.INDEX_WRITER_PER_TABLE_THREADS_CONF_KEY, IndexWriterUtils.DEFAULT_NUM_PER_TABLE_THREADS);
LOG.trace("Creating HTableFactory with " + htableThreads + " threads for each HTable.");
IndexManagementUtil.setIfNotSet(conf, HTABLE_THREAD_KEY, htableThreads);
if (env instanceof RegionCoprocessorEnvironment) {
RegionCoprocessorEnvironment e = (RegionCoprocessorEnvironment) env;
RegionServerServices services = e.getRegionServerServices();
if (services instanceof HRegionServer) {
return new CoprocessorHConnectionTableFactory(conf, (HRegionServer) services);
}
}
return new CoprocessorHTableFactory(env);
}
Aggregations