@Override public void run() throws Exception { remoteAdmin.createTable(new HTableDescriptor(TableName.valueOf("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; }
private void createTable(HTableDescriptor hTableDescriptor) { try { synchronized (mutex) { remoteAdmin.createTable(hTableDescriptor); } } catch (IOException e) { throw new CreateTableException(e); } }
@Override public void run() throws Exception { remoteAdmin.createTable(new HTableDescriptor(TableName.valueOf("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; }