protected HBaseQueueAdmin(Configuration hConf, CConfiguration cConf, LocationFactory locationFactory, HBaseTableUtil tableUtil, DatasetFramework datasetFramework, TransactionExecutorFactory txExecutorFactory, QueueConstants.QueueType type, NamespaceQueryAdmin namespaceQueryAdmin, Impersonator impersonator) { super(type); this.hConf = hConf; this.cConf = cConf; this.tableUtil = tableUtil; this.txExecutorFactory = txExecutorFactory; this.datasetFramework = datasetFramework; this.type = type; this.namespaceQueryAdmin = namespaceQueryAdmin; this.impersonator = impersonator; this.locationFactory = locationFactory; this.ddlExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); }
@Inject HBaseStreamConsumerStateStoreFactory(CConfiguration cConf, Configuration hConf, HBaseTableUtil tableUtil) { this.cConf = cConf; this.hConf = hConf; this.tableUtil = tableUtil; this.ddlExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); }
@Inject HBaseStreamFileConsumerFactory(StreamAdmin streamAdmin, StreamConsumerStateStoreFactory stateStoreFactory, CConfiguration cConf, Configuration hConf, HBaseTableUtil tableUtil) { super(cConf, streamAdmin, stateStoreFactory); this.hConf = hConf; this.cConf = cConf; this.tableUtil = tableUtil; this.ddlExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); }
@Inject DistributedStorageProviderNamespaceAdmin(CConfiguration cConf, NamespacedLocationFactory namespacedLocationFactory, ExploreFacade exploreFacade, HBaseTableUtil tableUtil, NamespaceQueryAdmin namespaceQueryAdmin) { super(cConf, namespacedLocationFactory, exploreFacade, namespaceQueryAdmin); this.hConf = HBaseConfiguration.create(); this.tableUtil = tableUtil; this.namespaceQueryAdmin = namespaceQueryAdmin; this.hBaseDDLExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); }
@Inject DistributedStorageProviderNamespaceAdmin(CConfiguration cConf, NamespacePathLocator namespacePathLocator, ExploreFacade exploreFacade, HBaseTableUtil tableUtil, NamespaceQueryAdmin namespaceQueryAdmin) { super(cConf, namespacePathLocator, exploreFacade, namespaceQueryAdmin); this.hConf = HBaseConfiguration.create(); this.tableUtil = tableUtil; this.namespaceQueryAdmin = namespaceQueryAdmin; this.hBaseDDLExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); }
private void checkHBaseDDLExtension(Set<String> problemKeys) { HBaseDDLExecutorFactory factory = new HBaseDDLExecutorFactory(cConf, hConf); try { factory.get(); } catch (Exception e) { LOG.error(e.getMessage()); problemKeys.add(Constants.HBaseDDLExecutor.EXTENSIONS_DIR); } }
@Inject DatasetUpgrader(CConfiguration cConf, Configuration hConf, LocationFactory locationFactory, NamespacePathLocator namespacePathLocator, HBaseTableUtil hBaseTableUtil, DatasetFramework dsFramework, NamespaceQueryAdmin namespaceQueryAdmin, Impersonator impersonator) { super(locationFactory, namespacePathLocator); this.cConf = cConf; this.hConf = hConf; this.locationFactory = locationFactory; this.hBaseTableUtil = hBaseTableUtil; this.dsFramework = dsFramework; this.namespaceQueryAdmin = namespaceQueryAdmin; this.impersonator = impersonator; this.datasetTablePrefix = cConf.get(Constants.Dataset.TABLE_PREFIX); this.defaultNSUserTablePrefix = Pattern.compile(String.format("^%s\\.user\\..*", datasetTablePrefix)); this.ddlExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); }
protected AbstractHBaseDataSetAdmin(TableId tableId, Configuration hConf, CConfiguration cConf, HBaseTableUtil tableUtil, LocationFactory locationFactory) { this.tableId = tableId; this.hConf = hConf; this.cConf = cConf; this.tableUtil = tableUtil; this.tablePrefix = cConf.get(Constants.Dataset.TABLE_PREFIX); this.ddlExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); this.coprocessorManager = new CoprocessorManager(cConf, locationFactory, tableUtil); }
protected AbstractHBaseDataSetAdmin(TableId tableId, Configuration hConf, CConfiguration cConf, HBaseTableUtil tableUtil, LocationFactory locationFactory) { this.tableId = tableId; this.hConf = hConf; this.cConf = cConf; this.tableUtil = tableUtil; this.tablePrefix = cConf.get(Constants.Dataset.TABLE_PREFIX); this.ddlExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); this.coprocessorManager = new CoprocessorManager(cConf, locationFactory, tableUtil); }
@Inject HBaseTableFactory(CConfiguration cConf, Configuration hConf, HBaseTableUtil tableUtil, LocationFactory locationFactory) { this.cConf = cConf; this.hConf = hConf; this.tableUtil = tableUtil; this.tableDescriptors = new ConcurrentHashMap<>(); this.coprocessorManager = new CoprocessorManager(cConf, locationFactory, tableUtil); RejectedExecutionHandler callerRunsPolicy = new RejectedExecutionHandler() { @Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { REJECTION_LOG.info( "No more threads in the HBase scan thread pool. Consider increase {}. Scan from caller thread {}", Constants.MessagingSystem.HBASE_MAX_SCAN_THREADS, Thread.currentThread().getName() ); // Runs it from the caller thread if (!executor.isShutdown()) { r.run(); } } }; // Creates a executor that will shrink to 0 threads if left idle // Uses daemon thread, hence no need to worry about shutdown // When all threads are busy, use the caller thread to execute this.scanExecutor = new ThreadPoolExecutor(0, cConf.getInt(Constants.MessagingSystem.HBASE_MAX_SCAN_THREADS), 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), Threads.createDaemonThreadFactory("messaging-hbase-scanner-%d"), callerRunsPolicy); this.ddlExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); }
private DatasetAdminImpl(DatasetContext datasetContext, String tableName, HBaseTableUtil tableUtil, Configuration hConf, CConfiguration cConf) throws IOException { this.hConf = hConf; this.cConf = cConf; this.tableUtil = tableUtil; this.tableId = tableUtil.createHTableId(new NamespaceId(datasetContext.getNamespaceId()), tableName); this.ddlExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); }
private DatasetAdminImpl(DatasetContext datasetContext, String tableName, HBaseTableUtil tableUtil, Configuration hConf, CConfiguration cConf) throws IOException { this.hConf = hConf; this.cConf = cConf; this.tableUtil = tableUtil; this.tableId = tableUtil.createHTableId(new NamespaceId(datasetContext.getNamespaceId()), tableName); this.ddlExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf); }
/** * Creates HBase namespace for the cdap system namespace. */ private void createSystemHBaseNamespace() { HBaseTableUtil tableUtil = new HBaseTableUtilFactory(cConf).get(); try (HBaseDDLExecutor ddlExecutor = new HBaseDDLExecutorFactory(cConf, hConf).get()) { ddlExecutor.createNamespaceIfNotExists(tableUtil.getHBaseNamespace(NamespaceId.SYSTEM)); } catch (IOException e) { throw Throwables.propagate(e); } }
callerRunsPolicy); this.ddlExecutorFactory = new HBaseDDLExecutorFactory(cConf, hConf);
/** * Creates the configuration HBase table if it does not exist. */ @VisibleForTesting void createTableIfNecessary() throws IOException { try (HBaseDDLExecutor ddlExecutor = new HBaseDDLExecutorFactory(cConf, hConf).get()) { HBaseTableUtil tableUtil = new HBaseTableUtilFactory(cConf).get(); TableId tableId = tableUtil.createHTableId(NamespaceId.SYSTEM, TABLE_NAME); ColumnFamilyDescriptorBuilder cfdBuilder = HBaseTableUtil.getColumnFamilyDescriptorBuilder(Bytes.toString(FAMILY), hConf); TableDescriptorBuilder tdBuilder = HBaseTableUtil.getTableDescriptorBuilder(tableId, cConf).addColumnFamily(cfdBuilder.build()); ddlExecutor.createTableIfNotExists(tdBuilder.build(), null); } } }
/** * Creates the configuration HBase table if it does not exist. */ @VisibleForTesting void createTableIfNecessary() throws IOException { try (HBaseDDLExecutor ddlExecutor = new HBaseDDLExecutorFactory(cConf, hConf).get()) { HBaseTableUtil tableUtil = new HBaseTableUtilFactory(cConf).get(); TableId tableId = tableUtil.createHTableId(NamespaceId.SYSTEM, TABLE_NAME); ColumnFamilyDescriptorBuilder cfdBuilder = HBaseTableUtil.getColumnFamilyDescriptorBuilder(Bytes.toString(FAMILY), hConf); TableDescriptorBuilder tdBuilder = HBaseTableUtil.getTableDescriptorBuilder(tableId, cConf).addColumnFamily(cfdBuilder.build()); ddlExecutor.createTableIfNotExists(tdBuilder.build(), null); } } }
@BeforeClass public static void beforeClass() throws Exception { hAdmin = new HBaseAdmin(TEST_HBASE.getConfiguration()); cConf = CConfiguration.create(); ddlExecutor = new HBaseDDLExecutorFactory(cConf, TEST_HBASE.getConfiguration()).get(); }