public String describeIndex(String tableName, String indexName)
throws IOException {
FTable table = getTableDescriptor(Bytes.toBytes(tableName));
LinkedHashMap<String, Index> indexMap = table.getIndex();
Index index = indexMap.get(indexName);
if (index == null) {
return "";
}
StringBuilder builder = new StringBuilder();
builder.append("+----------------------+----------+-------+\n");
builder.append("| INDEX_KEYS |\n");
builder.append("+----------------------+----------+-------+\n");
builder.append("| Field | Type | ORDER |\n");
builder.append("+----------------------+----------+-------+\n");
String line = "| {0} | {1} | {2} |";
LinkedHashMap<String, Field> indexKeys = index.getIndexKeys();
Map<String, Field> storings = index.getStoring();
Set<String> desc = index.getDesc();
for (Field field : indexKeys.values()) {
String fieldname = field.getName();
String s0 = fieldname
+ (fieldname.length() < 20 ? getGivenBlanks(20 - fieldname.length())