HBaseAdmin admin = new HBaseAdmin(UTIL.getConfiguration());
Configuration conf = admin.getConfiguration();
conf.setBoolean("hbase.use.secondary.index", true);
ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
String userTableName = "testBlockEncoding";
IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
HColumnDescriptor hcd = new HColumnDescriptor("col1");
IndexSpecification iSpec = new IndexSpecification("Index1");
iSpec.addIndexColumn(hcd, "ql", ValueType.String, 10);
ihtd.addFamily(hcd);
ihtd.addIndex(iSpec);
admin.createTable(ihtd);
ZKAssign.blockUntilNoRIT(zkw);
HTable table = new HTable(conf, userTableName + "_idx");
HTableDescriptor tableDescriptor =
admin.getTableDescriptor(Bytes.toBytes(userTableName + "_idx"));