class IndexMasterObserver extends BaseMasterObserver {

  protected static void checkIndexNames(HColumnDescriptor familyDesc) throws IOException {
    String indexAttribute = familyDesc.getValue(THEMIS_SECONDARY_INDEX_FAMILY_ATTRIBUTE_KEY);
    String[] indexColumns = indexAttribute.split(THEMIS_SECONDARY_INDEX_NAME_SPLITOR);
    Set<String> indexColumnSet = new HashSet<String>();
    // check duplicate
    for (String indexColumn : indexColumns) {
      if (indexColumnSet.contains(indexColumn)) {
        throw new IOException("duplicate secondary index definition, indexAttribute="
            + indexAttribute + ", familyDesc:" + familyDesc);
      }
      byte[][] indexNameAndColumn = KeyValue.parseColumn(Bytes.toBytes(indexColumn));
      if (indexNameAndColumn.length == 1 || indexNameAndColumn[0] == null
          || indexNameAndColumn[0].length == 0 || indexNameAndColumn[1] == null
          || indexNameAndColumn[1].length == 0) {
        throw new IOException(
            "illegal secondary index definition, please set index as 'indexName:qualifier', but is:"
                + indexColumn);
      }
      indexColumnSet.add(indexColumn);
    }
  }

}