0

我想使用以下内容:

List<Cell> cells = sourcePut.get(CfBytes, QualBytes);

但它返回给我一个空列表,因为我没有指定正确的列族和/或正确的限定符。

对于我的源表,如何查看所有列族和限定符?

我还没有创建 HBase 表,它已经可用。

4

1 回答 1

0

我想出的解决方案如下: 1. 要获取列族,扫描表应该可以工作 2. 要获取限定符,以下是我使用的代码:

Get g = new Get(Bytes.toBytes("xxxxxxx"));
//Within quotes above, the rowkey should be entered
            try {
                Result result = table.get(g);
                System.out.println(result.getFamilyMap(Bytes.toBytes("")).firstEntry().getValue().toString());
                byte[] bytes = result.getFamilyMap(Bytes.toBytes("<Column-Family Name>")).firstEntry().getKey();
                String s = new String(bytes);
                System.out.println("Qualifier Decrypted: " + s.toString());
            } catch (IOException e) {
                e.printStackTrace();
            }
于 2015-07-14T12:23:35.980 回答