public void addIndex(String tableName, Index index) throws MetaException {
byte[] rowKey = Bytes.toBytes(FConstants.TABLEROW_PREFIX_STR + tableName);
Get get = new Get(rowKey);
// check if the table exists
if (!exists(get)) {
throw new MetaException(tableName + " is not exists.");
}
Put put = new Put(rowKey);
byte[] cq = Bytes.toBytes(FConstants.INDEXQUALIFIER_PREFIX_STR
+ index.getIndexName());
put.add(FConstants.CATALOG_FAMILY, cq, index.toByte());