/** * @param tableName name of table to check * @return true if all regions of the table are available * @throws IOException if a remote or network exception occurs */ public boolean isTableAvailable(String tableName) throws IOException { return isTableAvailable(Bytes.toBytes(tableName)); }
@Override public void run() throws Exception { remoteAdmin.isTableAvailable(Bytes.toBytes("TestTable")); } });
private boolean checkTable(RemoteAdmin admin) throws IOException { HTableDescriptor tableDescriptor = getTableDescriptor(); if (this.presplitRegions > 0) { // presplit requested if (admin.isTableAvailable(tableDescriptor.getTableName().getName())) { admin.deleteTable(tableDescriptor.getTableName().getName()); } byte[][] splits = getSplits(); for (int i=0; i < splits.length; i++) { LOG.debug(" split " + i + ": " + Bytes.toStringBinary(splits[i])); } admin.createTable(tableDescriptor); LOG.info ("Table created with " + this.presplitRegions + " splits"); } else { boolean tableExists = admin.isTableAvailable(tableDescriptor.getTableName().getName()); if (!tableExists) { admin.createTable(tableDescriptor); LOG.info("Table " + tableDescriptor + " created"); } } boolean tableExists = admin.isTableAvailable(tableDescriptor.getTableName().getName()); return tableExists; }
/** * @param tableName name of table to check * @return true if all regions of the table are available * @throws IOException if a remote or network exception occurs */ public boolean isTableAvailable(String tableName) throws IOException { return isTableAvailable(Bytes.toBytes(tableName)); }
/** * @param tableName name of table to check * @return true if all regions of the table are available * @throws IOException if a remote or network exception occurs */ public boolean isTableAvailable(String tableName) throws IOException { return isTableAvailable(Bytes.toBytes(tableName)); }
/** * @param tableName name of table to check * @return true if all regions of the table are available * @throws IOException if a remote or network exception occurs */ public boolean isTableAvailable(String tableName) throws IOException { return isTableAvailable(Bytes.toBytes(tableName)); }
@Override public boolean isTableExists(String tableName) { boolean result = false; try { synchronized (mutex) { result = remoteAdmin.isTableAvailable(tableName); } } catch (IOException e) { throw new ReadTableException(e); } return result; }
@Override public void run() throws Exception { remoteAdmin.isTableAvailable(Bytes.toBytes("TestTable")); } });
private boolean checkTable(RemoteAdmin admin) throws IOException { HTableDescriptor tableDescriptor = getTableDescriptor(); if (this.presplitRegions > 0) { // presplit requested if (admin.isTableAvailable(tableDescriptor.getTableName().getName())) { admin.deleteTable(tableDescriptor.getTableName().getName()); } byte[][] splits = getSplits(); for (int i=0; i < splits.length; i++) { LOG.debug(" split " + i + ": " + Bytes.toStringBinary(splits[i])); } admin.createTable(tableDescriptor); LOG.info ("Table created with " + this.presplitRegions + " splits"); } else { boolean tableExists = admin.isTableAvailable(tableDescriptor.getTableName().getName()); if (!tableExists) { admin.createTable(tableDescriptor); LOG.info("Table " + tableDescriptor + " created"); } } boolean tableExists = admin.isTableAvailable(tableDescriptor.getTableName().getName()); return tableExists; }