| Version 1 (modified by liaojiaohe, 13 years ago) (diff) |
|---|
开发的时候发现HBASE使用的一个问题
byte[][] qualifiers = new byte[][]{Bytes.toBytes("apns"), Bytes.toBytes("receive_type"), Bytes.toBytes("receiv
e_time")};
Scan scan = new Scan();
scan.setCaching(100);
scan.setMaxVersions(1);
FilterList filters = new FilterList();
RowFilter rowfilter = new RowFilter(CompareOp.EQUAL, new BinaryPrefixComparator(new String(3 + "_").getBytes()
));
filters.addFilter(rowfilter);
SingleColumnValueFilter filter = new SingleColumnValueFilter(
Bytes.toBytes("base"),
"app_ver_int".getBytes(),
CompareOp.EQUAL,
Bytes.toBytes(3020000));
filters.addFilter(filter);
for (int i = 0; i < qualifiers.length; i++) {
scan.addColumn(Bytes.toBytes("base"), qualifiers[i]);
}
// filters.addFilter(new FirstKeyOnlyFilter());
scan.setFilter(filters);
ResultScanner scanner = hTable.getScanner(scan);
出现问题,由于filter里面的字段在addColumn的时候是没用的,filter就失效了
Attachments
-
map.jpg
(13.7 KB) -
added by liaojiaohe 13 years ago.
-
reduce.jpg
(7.8 KB) -
added by liaojiaohe 13 years ago.
-
adAnalytics3.0.zip
(135.9 KB) -
added by liaojiaohe 13 years ago.
![(please configure the [header_logo] section in trac.ini)](http://www1.pconline.com.cn/hr/2009/global/images/logo.gif)