java hbase obtain column families for a particular table

Developer from somewhere

Problem: want to obtain column families for a particular table.

Solution:

        Connection conn = ConnectionFactory.createConnection(config);
        Admin admin = conn.getAdmin();

        TableName transactionTableName = TableName.valueOf("some_table");
        HTableDescriptor tableDesc = admin.getTableDescriptor(transactionTableName);
        // this will contain all of them
        HColumnDescriptor colDesc[] = tableDesc.getColumnFamilies();