全表扫描数据,范围扫描数据
public static void main(String[] args) throws Exception {
Configuration conf = HBaseConfiguration.create();
conf.set("hbase.zookeeper.quorum", "hadoop01:2181,hadoop02:2181,hadoop03:2181");
HTable tab = new HTable(conf, "tabx1");
Scan scan = new Scan();
scan.setStartRow("rk3".getBytes());
scan.setStopRow("rk6".getBytes());
ResultScanner rs = tab.getScanner(scan);
for(Result r : rs){
String rk = new String(r.getRow());
NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> map = r.getMap();
for(Map.Entry<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> entry : map