Range in Hbase FuzzyRowFilter?

ساخت وبلاگ

Vote count: 0

I have some data in Hbase. The structure of the key is like this userID(Integer)+dateTimeInMillis(Long). I used the following code in the past to get the rows between the range:

Scan scan = new Scan(startKey.array(), endKey.array());
scan.addFamily(Bytes.toBytes(""));
ResultScanner result = table.getScanner(scan);

I need to know the userIds and TimeStamps in order to query the rows. One of my colleagues suggested I use fuzzyRowFilter to scan data for testing, I found it very helpful. I have played around a little with the fuzzyRowFilter. This is how I was able to achieve the result against all the userID for one day.

 List<Pair<byte[], byte[]>> keys = new ArrayList<Pair<byte[], byte[]>>(); keys.add(new Pair<byte[], byte[]>( startKey.array(), new byte[] { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 })); Filter filter = new FuzzyRowFilter(keys); Scan scan = new Scan(); scan.addFamily(Bytes.toBytes("d")); scan.setFilter(filter);

I can't adjust this filter to my use case. I can't find any method to specify a range. I tried searching the internet. Most developers said that the range isn't supported in this filter yet. Some had suggestions like using multiple filters. Isn't there any better way to specify range beside using multiple filters. I tried setting the last byte of my key to "1" in order to get a better result, but it didn't work out as I was expecting it to. If anybody knows a better way to apply the fuzzyRowFilter with range or has implemented a custom range filter, I would appreciate If I could get any ideas from him to get maximum performance.

Regards,

asked 35 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : range scan in hbase, نویسنده : استخدام کار backsoft بازدید : 410 تاريخ : پنجشنبه 13 آبان 1395 ساعت: 14:21