@Override public boolean isTableDisabled(String tableName) throws IOException { return adm.isTableDisabled(tableName); }
@Override public boolean isTableDisabled(String tableName) throws IOException { return adm.isTableDisabled(tableName); }
@Override public boolean isTableDisabled(String tableName) throws IOException { return adm.isTableDisabled(tableName); }
@Override public boolean checkState(int tries) throws IOException { return getAdmin().isTableDisabled(tableName); } });
@Override public HTableDescriptor[] enableTables(Pattern pattern) throws IOException { List<HTableDescriptor> failed = new LinkedList<>(); for (HTableDescriptor table : listTables(pattern)) { if (isTableDisabled(table.getTableName())) { try { enableTable(table.getTableName()); } catch (IOException ex) { LOG.info("Failed to enable table " + table.getTableName(), ex); failed.add(table); } } } return failed.toArray(new HTableDescriptor[failed.size()]); }
@Override public void flush(final TableName tableName) throws IOException { checkTableExists(tableName); if (isTableDisabled(tableName)) { LOG.info("Table is disabled: " + tableName.getNameAsString()); return; } execProcedure("flush-table-proc", tableName.getNameAsString(), new HashMap<>()); }
@Override public Future<Void> restoreSnapshotAsync(final String snapshotName) throws IOException, RestoreSnapshotException { TableName tableName = getTableNameBeforeRestoreSnapshot(snapshotName); // The table does not exists, switch to clone. if (!tableExists(tableName)) { return cloneSnapshotAsync(snapshotName, tableName); } // Check if the table is disabled if (!isTableDisabled(tableName)) { throw new TableNotDisabledException(tableName); } return internalRestoreSnapshotAsync(snapshotName, tableName, false); }
if (!isTableDisabled(tableName)) { throw new TableNotDisabledException(tableName);
@Override public boolean checkState(int tries) throws IOException { return getAdmin().isTableDisabled(tableName); } });
@Override public HTableDescriptor[] enableTables(Pattern pattern) throws IOException { List<HTableDescriptor> failed = new LinkedList<>(); for (HTableDescriptor table : listTables(pattern)) { if (isTableDisabled(table.getTableName())) { try { enableTable(table.getTableName()); } catch (IOException ex) { LOG.info("Failed to enable table " + table.getTableName(), ex); failed.add(table); } } } return failed.toArray(new HTableDescriptor[failed.size()]); }
@Override public void flush(final TableName tableName) throws IOException { checkTableExists(tableName); if (isTableDisabled(tableName)) { LOG.info("Table is disabled: " + tableName.getNameAsString()); return; } execProcedure("flush-table-proc", tableName.getNameAsString(), new HashMap<>()); }
if (admin.isTableDisabled(databaseName))
@Override public Future<Void> restoreSnapshotAsync(final String snapshotName) throws IOException, RestoreSnapshotException { TableName tableName = getTableNameBeforeRestoreSnapshot(snapshotName); // The table does not exists, switch to clone. if (!tableExists(tableName)) { return cloneSnapshotAsync(snapshotName, tableName); } // Check if the table is disabled if (!isTableDisabled(tableName)) { throw new TableNotDisabledException(tableName); } return internalRestoreSnapshotAsync(snapshotName, tableName, false); }
if (!isTableDisabled(tableName)) { throw new TableNotDisabledException(tableName);
/** * Creates the table. * * @param tableName * the table name */ public void createTable(String tableName, String columnFamily) { try { if (!utility.getHBaseAdmin().tableExists(tableName)) { utility.createTable(tableName.getBytes(), columnFamily.getBytes()); if (utility.getHBaseAdmin().isTableDisabled(tableName)) { utility.getHBaseAdmin().enableTable(tableName); } } else { logger.info("Table:" + tableName + " already exist:"); } } catch (IOException e) { logger.error(e.getMessage()); } }
private void addColumnFamilies(List<TableInfo> tableInfos, HTableDescriptor hTableDescriptor, boolean isUpdate) throws IOException { if (admin.isTableEnabled(databaseName)) { admin.disableTable(databaseName); } for (TableInfo tableInfo : tableInfos) { HColumnDescriptor columnDescriptor = hTableDescriptor.getFamily(tableInfo.getTableName().getBytes()); if (columnDescriptor != null && !isUpdate) { admin.deleteColumn(databaseName, tableInfo.getTableName()); addColumn(tableInfo); } else if (columnDescriptor == null) { addColumn(tableInfo); } } if (admin.isTableDisabled(databaseName)) { admin.enableTable(databaseName); } }
@Override public boolean isTableDisabled(String tableName) throws IOException { return adm.isTableDisabled(tableName); }
if (!admin.isTableDisabled(TABLE))
if (!admin.isTableDisabled(TABLE))
protected void waitForDisabled(String tableName) throws Exception { for (int i = 0; i < MAX_WAIT_ITERATION; i++) { if (admin.isTableDisabled(tableName)) { return; } Thread.sleep(WAIT_INTERVAL); } Assert.fail(Util.getMethodName() + " failed"); }