@Override public boolean exists() throws IOException { try (HBaseAdmin admin = new HBaseAdmin(hConf)) { return tableUtil.tableExists(admin, tableId); } }
@Override public boolean exists() throws IOException { try (HBaseAdmin admin = new HBaseAdmin(hConf)) { return tableUtil.tableExists(admin, tableId); } }
@Override public boolean exists() throws IOException { try (HBaseAdmin admin = new HBaseAdmin(hConf)) { return tableUtil.tableExists(admin, tableId); } }
@Override public boolean exists() throws IOException { try (HBaseAdmin admin = new HBaseAdmin(hConf)) { return tableUtil.tableExists(admin, tableId); } }
private void truncate(TableId tableId) throws IOException { try (HBaseAdmin admin = new HBaseAdmin(hConf)) { if (!tableUtil.tableExists(admin, tableId)) { return; } } try (HBaseDDLExecutor ddlExecutor = ddlExecutorFactory.get()) { tableUtil.truncateTable(ddlExecutor, tableId); } }
private void drop(TableId tableId) throws IOException { try (HBaseDDLExecutor ddlExecutor = ddlExecutorFactory.get(); HBaseAdmin admin = new HBaseAdmin(hConf)) { if (tableUtil.tableExists(admin, tableId)) { tableUtil.dropTable(ddlExecutor, tableId); } } }
@Override public boolean exists(QueueName queueName) throws Exception { try (HBaseAdmin admin = new HBaseAdmin(hConf)) { return tableUtil.tableExists(admin, getDataTableId(queueName)) && datasetFramework.hasInstance(getStateStoreId(queueName.getFirstComponent())); } }
@Override protected void dropTable(TableId tableId) throws IOException { try (HBaseDDLExecutor ddlExecutor = ddlExecutorFactory.get(); HBaseAdmin admin = new HBaseAdmin(hConf)) { TableId hBaseTableId = tableUtil.createHTableId(new NamespaceId(tableId.getNamespace()), tableId.getTableName()); if (tableUtil.tableExists(admin, hBaseTableId)) { tableUtil.dropTable(ddlExecutor, hBaseTableId); } } }
@Override public synchronized void dropAllInNamespace(NamespaceId namespace) throws IOException { try (HBaseDDLExecutor executor = ddlExecutorFactory.get(); HBaseAdmin admin = new HBaseAdmin(hConf)) { TableId tableId = StreamUtils.getStateStoreTableId(namespace); TableId hbaseTableId = tableUtil.createHTableId(new NamespaceId(tableId.getNamespace()), tableId.getTableName()); if (tableUtil.tableExists(admin, hbaseTableId)) { tableUtil.dropTable(executor, hbaseTableId); } } } }
private boolean exists(TableId tableId) throws IOException { HBaseTableUtil tableUtil = getTableUtil(); TableId hTableId = tableUtil.createHTableId(new NamespaceId(tableId.getNamespace()), tableId.getTableName()); return tableUtil.tableExists(hAdmin, hTableId); }
try (HBaseAdmin admin = new HBaseAdmin(hConf)) { if (!tableUtil.tableExists(admin, tableId)) { LOG.debug("TMS Table {} was not found. Skip upgrading coprocessor.", tableId); return;
try (HBaseAdmin admin = new HBaseAdmin(hConf)) { if (!tableUtil.tableExists(admin, tableId)) { LOG.debug("TMS Table {} was not found. Skip upgrading coprocessor.", tableId); return;
boolean tableExists; try (HBaseAdmin admin = new HBaseAdmin(hConf)) { tableExists = tableUtil.tableExists(admin, tableId);
boolean tableExists; try (HBaseAdmin admin = new HBaseAdmin(hConf)) { tableExists = tableUtil.tableExists(admin, tableId);
@Override public synchronized StreamConsumerStateStore create(StreamConfig streamConfig) throws IOException { NamespaceId namespace = streamConfig.getStreamId().getParent(); TableId streamStateStoreTableId = StreamUtils.getStateStoreTableId(namespace); TableId hbaseTableId = tableUtil.createHTableId(new NamespaceId(streamStateStoreTableId.getNamespace()), streamStateStoreTableId.getTableName()); boolean tableExist; try (HBaseAdmin admin = new HBaseAdmin(hConf)) { tableExist = tableUtil.tableExists(admin, hbaseTableId); } if (!tableExist) { try (HBaseDDLExecutor ddlExecutor = ddlExecutorFactory.get()) { TableDescriptorBuilder tdBuilder = HBaseTableUtil.getTableDescriptorBuilder(hbaseTableId, cConf); ColumnFamilyDescriptorBuilder cfdBuilder = HBaseTableUtil.getColumnFamilyDescriptorBuilder(Bytes.toString(QueueEntryRow.COLUMN_FAMILY), hConf); tdBuilder.addColumnFamily(cfdBuilder.build()); ddlExecutor.createTableIfNotExists(tdBuilder.build(), null); } } HTable hTable = tableUtil.createHTable(hConf, hbaseTableId); hTable.setWriteBufferSize(Constants.Stream.HBASE_WRITE_BUFFER_SIZE); hTable.setAutoFlushTo(false); return new HBaseStreamConsumerStateStore(streamConfig, hTable); }