### Question:
IndexMapReduceUtil { public static boolean isIndexedTable(String tableName, Configuration conf) throws IOException { IndexedHTableDescriptor tableDescriptor = getTableDescriptor(tableName, conf); return tableDescriptor != null; }  static IndexedHTableDescriptor getTableDescriptor(String tableName, Configuration conf); static boolean isIndexedTable(String tableName, Configuration conf); static boolean isIndexedTable(Configuration conf); static List<Put> getIndexPut(Put userPut, Configuration conf); static List<Delete> getIndexDelete(Delete userDelete, Configuration conf); static byte[] getStartKey(Configuration conf, String tableName, byte[] row); static final String INDEX_DATA_DIR; static final String INDEX_IS_INDEXED_TABLE; }### Answer:
@Test(timeout = 180000) public void testShouldAbleReturnTrueForIndexedTable() throws Exception { tableName = "testShouldAbleReturnTrueForIndexedTable"; IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(tableName); HColumnDescriptor hcd = new HColumnDescriptor("col"); IndexSpecification iSpec = new IndexSpecification("ScanIndexf"); iSpec.addIndexColumn(hcd, "ql", ValueType.String, 10); ihtd.addFamily(hcd); ihtd.addIndex(iSpec); admin.createTable(ihtd); Assert.assertTrue(IndexMapReduceUtil.isIndexedTable(tableName, conf)); }
@Test(timeout = 180000) public void testShouldAbleReturnFalseForNonIndexedTable() throws Exception { tableName = "testShouldAbleReturnFalseForNonIndexedTable"; HTableDescriptor ihtd = new HTableDescriptor(tableName); HColumnDescriptor hcd = new HColumnDescriptor("col"); ihtd.addFamily(hcd); admin.createTable(ihtd); Assert.assertFalse(IndexMapReduceUtil.isIndexedTable(tableName, conf)); }