You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by T Vinod Gupta <tv...@readypulse.com> on 2012/01/17 01:08:22 UTC

scan doesn't work with row key filter but works with start/stop key

Hi,
I am seeing a very strange behavior that i am finding hard to explain.
method 1 works below but method 2 hangs till the scan times out and exits.

1)
        Scan scan = new Scan();
        List<Filter> filters = new ArrayList<Filter>();
        Filter familyFilter = new
FamilyFilter(CompareFilter.CompareOp.EQUAL,  new
BinaryComparator(Bytes.toBytes("family")));
        filters.add(familyFilter);
        Filter columnFilter = new
QualifierFilter(CompareFilter.CompareOp.NOT_EQUAL,
                new RegexStringComparator("data"));
        filters.add(columnFilter);
        FilterList filterList = new FilterList(filters);
        scan.setFilter(filterList);
        scan.setCaching(500);
        scan.setStartRow(Bytes.toBytes("RowPrefix:1326153600"));
        scan.setStopRow(Bytes.toBytes("RowPrefix:1326672001"));
        HTable table = new HTable(config, "MyTable");
        ResultScanner scanner = null;
        try {
            scanner = table.getScanner(scan);
...

2)
        Scan scan = new Scan();
        List<Filter> filters = new ArrayList<Filter>();
        Filter familyFilter = new
FamilyFilter(CompareFilter.CompareOp.EQUAL,  new
BinaryComparator(Bytes.toBytes("family")));
        filters.add(familyFilter);
        Filter columnFilter = new
QualifierFilter(CompareFilter.CompareOp.NOT_EQUAL,
                new RegexStringComparator("data"));
        filters.add(columnFilter);
        Filter rowKeyLowerFilter = new
RowFilter(CompareFilter.CompareOp.GREATER_OR_EQUAL, new
BinaryComparator(Bytes.toBytes( "RowPrefix:1326153600" )));
        Filter rowKeyUpperFilter = new
RowFilter(CompareFilter.CompareOp.LESS_OR_EQUAL, new
BinaryComparator(Bytes.toBytes( "RowPrefix:1326672001" )));
        filters.add(rowKeyLowerFilter);
        filters.add(rowKeyUpperFilter);
        FilterList filterList = new FilterList(filters);
        scan.setFilter(filterList);
        scan.setCaching(500);
        HTable table = new HTable(config, "MyTable");
        ResultScanner scanner = null;
        try {
            scanner = table.getScanner(scan);
...


im wondering whats the reason.. i didn't see anything suspicious in the RS
logs. what i saw was that there were lots of statements such as these
coinciding with the 2nd method -
2012-01-17 00:06:06,331 DEBUG
org.apache.hadoop.hbase.io.hfile.LruBlockCache: Block cache LRU eviction
started; Attempting to free 60.43 MB of total=513.55 MB
2012-01-17 00:06:06,724 DEBUG
org.apache.hadoop.hbase.io.hfile.LruBlockCache: Block cache LRU eviction
completed; freed=61.02 MB, total=453.92 MB, single=127.35 MB, multi=379 MB,
memory=3.53 MB

thanks