hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stack <st...@duboce.net>
Subject Re: HBase: scanner with custom filter - filterRowKey: rowKey == null
Date Wed, 04 Mar 2009 07:15:52 GMT
Its called on the server in the StoreScanner#next method.  It can be null if
we did not find a row in a particular region.  For sure your table has stuff
in it and your scanner returns rows when no filter in place?  Perhaps just
log nulls rather then kill the scanner.  See if we move past the null?

Here is how it is called at line #164:

      filtered = dataFilter != null? dataFilter.filterRowKey(chosenRow) :
false;

See above this line for where we chose the next row from the backing
memcache and store files.

St.Ack


On Tue, Mar 3, 2009 at 5:04 AM, Michael Seibold <seibold@in.tum.de> wrote:

> Hi,
>
> I'm not sure how the method filterRowKey(byte[] rowKey) of the
> RowFilterInterface works.
>
> I have the feeling that this method may be called with null as parameter
> by HBase. When is the rowKey Parameter null and why?
>
> I have used the following custom filter to verify this:
>
> public class HFilter implements RowFilterInterface {
>
>        public HFilter() {
>
>        }
>
>        public boolean filterRowKey(byte[] rowKey) {
>                if (rowKey == null) {
>                        throw new RuntimeException("rowKey == null");
>                }
>                return false;
>        }
> }
>
> After a while I get the following exception:
>
> 192.168.0.11:32806: error: java.io.IOException:
> java.lang.RuntimeException: rowKey == null
> java.io.IOException: java.lang.RuntimeException: rowKey == null
>        at
>
> org.apache.hadoop.hbase.regionserver.HRegionServer.convertThrowableToIOE(HRegionServer.java:687)
>        at
>
> org.apache.hadoop.hbase.regionserver.HRegionServer.convertThrowableToIOE(HRegionServer.java:677)
>        at
>
> org.apache.hadoop.hbase.regionserver.HRegionServer.next(HRegionServer.java:1586)
>        at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
>        at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> I tried this with HBase 0.19.0 and HDFS (Hadoop 0.19.0) running together
> on 1 server.
>
> That's why I got the feeling that the method filterRowKey may be called
> with null as parameter by HBase. I don't understand why this should
> happen. Is null a special case that I have to handle in this method?
>
> Kind regards,
> Michael
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message