IndexMasterObserver extends BaseMasterObserver { protected static HTableDescriptor getSecondaryIndexTableDesc(String tableName) throws IOException { HTableDescriptor indexTableDesc = new HTableDescriptor(tableName); indexTableDesc.setValue(THEMIS_SECONDARY_INDEX_TABLE_ATTRIBUTE_KEY, "true"); indexTableDesc.addFamily(getSecondaryIndexFamily()); return indexTableDesc; }  @Override void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
      HTableDescriptor desc, HRegionInfo[] regions); @Override void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
      byte[] tableName); @Override void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
      byte[] tableName); static final String THEMIS_SECONDARY_INDEX_FAMILY_ATTRIBUTE_KEY; static final String THEMIS_SECONDARY_INDEX_NAME_SPLITOR; static final String THEMIS_SECONDARY_INDEX_TABLE_NAME_PREFIX; static final String THEMIS_SECONDARY_INDEX_TABLE_ATTRIBUTE_KEY; static final String THEMIS_SECONDARY_INDEX_TABLE_FAMILY; static final byte[] THEMIS_SECONDARY_INDEX_TABLE_FAMILY_BYTES; }
@Test public void testGetSecondaryIndexTableDesc() throws IOException { String indexTableName = "__themis_index_a_b_c_d"; HTableDescriptor desc = IndexMasterObserver.getSecondaryIndexTableDesc(indexTableName); Assert.assertNotNull(desc.getValue(IndexMasterObserver.THEMIS_SECONDARY_INDEX_TABLE_ATTRIBUTE_KEY)); HColumnDescriptor family = desc.getFamily(Bytes .toBytes(IndexMasterObserver.THEMIS_SECONDARY_INDEX_TABLE_FAMILY)); Assert.assertNotNull(family); Assert.assertNotNull(family.getValue(ThemisMasterObserver.THEMIS_ENABLE_KEY)); }