hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mathias Herberts (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-9717) Allow filterRowKey to return a next key hint
Date Sun, 06 Oct 2013 08:53:44 GMT

    [ https://issues.apache.org/jira/browse/HBASE-9717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13787531#comment-13787531
] 

Mathias Herberts commented on HBASE-9717:
-----------------------------------------

I think the best way to be backward compatible would be to add two methods Filter, namely:

abstract boolean hasRowKeyHint()
abstract byte[] getRowKeyHint(byte[] buffer, int offset, int length)

if hasRowKeyHint returns true for the filter, then when filterRowKey returns true (filter
the row), getRowKeyHint would be called and return a hint onto which key we should seek to,
or null if no hint is available.

Default implementation of hasRowKeyHint would return false.
Default implementation of getRowKeyHint would return null.

This would allow for minimal changes, basically if I'm not mistaken, Filter, FilterBase, HRegion,
FilterList, and WhileMatchFilter would be the only classes needing changes, with a semantic
to determine for FilterList in case MUST_PASS_ONE is used.

> Allow filterRowKey to return a next key hint
> --------------------------------------------
>
>                 Key: HBASE-9717
>                 URL: https://issues.apache.org/jira/browse/HBASE-9717
>             Project: HBase
>          Issue Type: New Feature
>          Components: Filters
>            Reporter: Mathias Herberts
>
> The Filter interface has a filterRowKey method which returns a boolean set to true if
the given row key should be filtered out.
> When a row key is filtered, it could be interesting to be able to provide the scanner
a hint about the next row key which should be examined. This could tremendously speed up scanning
in some cases.
> The logic could be similar to that of filterKeyValue with a helper method getNextRowKeyHint,
or even simpler, filterRowKey could return a byte[] which would be set to null to mean keep
the row, to the empty array to mean filter the row and there is not hint, and to a non empty
byte array to mean filter the row and here is a hint about the next key that should be scanned.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message