在hbase中默认的Get()构造函数的重要性是什么

时间:2015-07-09 12:28:39

标签: hbase

hbase中默认的Get()构造函数的重要性是什么?它是否返回表中的所有行?我正在尝试使用它但它需要永远。

Configuration conf = HBaseConfiguration.create();   
HTable table0 = new HTable(conf, "test");
Get get0 = new Get();
Result result0 = table0.get(get0);
byte[] val0 = result0.getValue(Bytes.toBytes("cf1"), Bytes.toBytes("e1"));

System.out.println("Value: " + Bytes.toString(val0));

1 个答案:

答案 0 :(得分:1)

这不重要,你不应该使用它。如果您阅读文档,您将看到您不应该使用。它说。

Constructor for Writable. DO NOT USE

我相信您使用的是旧客户端,因为此构造函数不再存在。您应该始终在构造函数中指定要获取的行,或者提供另一个要复制的行。

你想要达到什么目的?全表扫描?那么你就是这样做的。

Scan scan = new Scan();
ResultScanner results = table.getScaner(scan);
...