扫描Hbase中的特定行键';s
我想从Hbase表中获取特定行键内的所有列扫描Hbase中的特定行键';s,hbase,Hbase,我想从Hbase表中获取特定行键内的所有列 eg: Rowkey starts from 123456 Rowkey ends with 123466 so i want to fetch programatically (In java) all columns within this rowkeym only. 这很直截了当。你试过什么吗?不管怎样 Configuration conf = HbaseConfiguration.create(); HTable table = ne
eg:
Rowkey starts from 123456
Rowkey ends with 123466
so i want to fetch programatically (In java) all columns within this rowkeym only.
这很直截了当。你试过什么吗?不管怎样
Configuration conf = HbaseConfiguration.create();
HTable table = new HTable(conf, "tablename");
Scan scan = new Scan();
scan.setStartRow(Bytes.toBytes("123456"));
scan.setStopRow(Bytes.toBytes("123456"));
ResultScanner rs = table.getScanner();
for (Result result : scanner) {
for (KeyValue kv : result.raw()) {
System.out.println("KV: " + kv + ", Value: " +
Bytes.toString(kv.getValue()));
}
}
scanner.close();