谁能告诉我,如何列出hbase表中的所有行键?
发布于 2014-11-11 01:32:13
HBase外壳可用于列出所有行键:
count 'table_name', { INTERVAL => 1 }
发布于 2011-09-05 17:16:04
这应该会快得多( FirstKeyOnlyFilter在服务器上运行,并在将结果发送到客户端之前剥离所有列数据):
Configuration conf = HBaseConfiguration.create();
HTable table = new HTable(conf, tableName.getBytes());
System.out.println("scanning full table:");
Scan scan = new Scan();
scan.setFilter(new FirstKeyOnlyFilter());
ResultScanner scanner = table.getScanner(scan);
for (Result rr : scanner) {
byte[] key == rr.getRow();
...
}
发布于 2011-03-09 00:10:34
Configuration conf = HBaseConfiguration.create();
HTable table = new HTable(conf, tableName.getBytes());
System.out.println("scanning full table:");
ResultScanner scanner = table.getScanner(new Scan());
for (Result rr = scanner.next(); rr != null; rr = scanner.next()) {
byte[] key == rr.getRow();
...
}
https://stackoverflow.com/questions/5218085
复制相似问题