标签:res key 技术 mil tab get throws ble exception
最近在公司做hbase就打算复习下它的过滤器以便不时之需,RowFilter根据行键(rowkey)筛选数据
public void filter() throws IOException
{
Filter rf = new RowFilter(CompareFilter.CompareOp.LESS, new BinaryComparator(Bytes.toBytes("35643b94-b396-4cdc-abd9-029ca495769d")));
Scan s = new Scan();
s.setFilter(rf);
ResultScanner rs = table.getScanner(s);
for (Result r : rs) {
System.out.println("rowkey:" + new String(r.getRow()));
for (KeyValue keyValue : r.raw()) {
System.out.println("列族:" + new String(keyValue.getFamily())
+ " 列:" + new String(keyValue.getQualifier()) + ":"
+ new String(keyValue.getValue()));
}
}
}
标签:res key 技术 mil tab get throws ble exception
原文地址:http://www.cnblogs.com/yaohaitao/p/6777626.html