Hai*_*mei 23
HBase shell可用于列出所有行键:
count 'table_name', { INTERVAL => 1 }
Run Code Online (Sandbox Code Playgroud)
Gel*_*eli 13
这应该快得多(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();
...
}
Run Code Online (Sandbox Code Playgroud)
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();
...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
28400 次 |
| 最近记录: |