HBaseMetadata { public void renameExistingTable(final String oldTableName, final String newTableName) { Verify.isNotNullOrEmpty(oldTableName, "Old table name must have value"); Verify.isNotNullOrEmpty(newTableName, "New table name must have value"); final long tableId = getTableId(oldTableName); List<Delete> deletes = Lists.newArrayList(deleteTableId(oldTableName)); List<Put> puts = Lists.newArrayList(putTableId(newTableName, tableId)); performMutations(deletes, puts); } @Inject  HBaseMetadata(final Provider<HTableInterface> provider); @Inject void setColumnFamily(final @Named(ConfigConstants.COLUMN_FAMILY) String columnFamily); long getTableId(final String tableName); Map<String, Long> getIndexIds(final long tableId); BiMap<String, Long> getColumnIds(final long tableId); TableSchema getSchema(final long tableId); void createTable(final String tableName, final TableSchema schema); void createTableIndex(final long tableId,
                                 final IndexSchema indexSchema); void deleteTableIndex(final long tableId, final String indexName); void deleteTable(String tableName); void renameExistingTable(final String oldTableName, final String newTableName); long getAutoInc(long tableId); long incrementAutoInc(long tableId, long amount); void setAutoInc(long tableId, long value); long getRowCount(long tableId); long incrementRowCount(long tableId, long amount); void truncateRowCount(long tableId);  }
@Test(expected = IllegalArgumentException.class) public void testRenameExistingTableEmptyNewTableName() throws TableNotFoundException { hbaseMetadata.renameExistingTable(TABLE_NAME, ""); }
@Test(expected = NullPointerException.class) public void testRenameExistingTableNullCurrentTableName() throws TableNotFoundException { hbaseMetadata.renameExistingTable(null, TABLE_NAME); }
@Test(expected = IllegalArgumentException.class) public void testRenameExistingTableEmptyCurrentTableName() throws TableNotFoundException { hbaseMetadata.renameExistingTable("", TABLE_NAME); }
@Test(expected = NullPointerException.class) public void testRenameExistingTableNullNewTableName() throws TableNotFoundException { hbaseMetadata.renameExistingTable(TABLE_NAME, null); }