HBaseMetadata { public void deleteTableIndex(final long tableId, final String indexName) { Verify.isValidId(tableId); Verify.isNotNullOrEmpty(indexName, "The index name is invalid"); final List<Put> puts = Lists.newArrayList(); final List<Delete> deletes = Lists.newArrayList(); final TableSchema existingSchema = getSchema(tableId); final TableSchema updatedSchema = existingSchema.schemaCopy(); updatedSchema.removeIndex(indexName); deletes.add(generateIndexDelete(tableId, indexName)); puts.add(putTableSchema(tableId, updatedSchema)); 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 testDeleteIndexInvalidTableId() { final long invalidTableId = -1; hbaseMetadata.deleteTableIndex(invalidTableId, INDEX_NAME); }
@Test(expected = NullPointerException.class) public void testDeleteIndexNullIndexName() { hbaseMetadata.deleteTableIndex(1, null); }
@Test(expected = IllegalArgumentException.class) public void testDeleteIndexEmptyIndexName() { hbaseMetadata.deleteTableIndex(1, ""); }