Hi,

I'm a bit confused by the behavior of Filter.filterRowKey().

The javadoc of Filter mentions this:

[...]
 * <li>{@link #filterRowKey(byte[],int,int)} -> true to drop this row,
 * if false, we will also call</li>
 * <li>{@link #filterKeyValue(KeyValue)} -> true to drop this key/value</li>
[...]

So I would expect that when I return true from filterRowKey, then
filterKeyValue() won't be called. But this is not what I see.

I created a small test case with a filter that returns true in
filterRowKey, and prints out when filterKeyValue is called. It does both a
Get and a Scan with a filter. The output it prints is:

doing a Get
filterRowKey called
filterKeyValue called for kv row1/myfam:c1/1380552443995/Put/vlen=1/ts=2
filterKeyValue called for kv row1/myfam:c2/1380552443995/Put/vlen=1/ts=2
get result size = 0
doing a Scan
filterRowKey called
filterKeyValue called for kv row1/myfam:c1/1380552443995/Put/vlen=1/ts=2
filterKeyValue called for kv row1/myfam:c2/1380552443995/Put/vlen=1/ts=2
filterRowKey called
filterKeyValue called for kv row2/myfam:c1/1380552443998/Put/vlen=1/ts=3
filterKeyValue called for kv row2/myfam:c2/1380552443998/Put/vlen=1/ts=3

The end result is correct though: the row will be skipped regardless of
what filterKeyValue returns. But filterKeyValue might do something
expensive. It's easy to work around though.

This is with HBase 0.94.12.

Is this expected behavior or a know issue (didn't find any), or should I
log it?

Bruno.

-- 
Bruno Dumon
NGDATA - Making Sense of Data
http://www.ngdata.com/

Reply via email to