You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Jonathan Gray (Commented) (JIRA)" <ji...@apache.org> on 2011/10/18 21:11:10 UTC

[jira] [Commented] (HBASE-4612) Allow ColumnPrefixFilter to support multiple prefixes

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

Jonathan Gray commented on HBASE-4612:
--------------------------------------

Hey Eran.  Thanks for the contribution!  A few comments..

- There's no explanation of the behavior anywhere.  In the constructors and addPrefix() methods, you should document that this creates an OR condition across all of the prefixes, correct?
- No need to instantiate a new comparator all the time (use Bytes.BYTES_COMPARATOR)
- Something seems odd when you keep adding to the end of a List and then sort.  How about a TreeSet?  You can easily ignore dupes that way.
- There's no input verification so, for example, you could pass a null to the constructor or an empty byte[][] and have some strange behavior.  Like it will instantiate okay but then you'll get server-side NPEs or IOOB.
- this.prefixes.size() == 0 -> this.prefixes.isEmpty()
- your comment at the top of filterColumn, i wouldn't exactly call it a workaround, but it's a good comment.  looking at the logic, it seems like correct behavior would be that it can be called with current == size() but it would be a bug if current > size(), right?  should you add an assert or throw an exception?
                
> Allow ColumnPrefixFilter to support multiple prefixes
> -----------------------------------------------------
>
>                 Key: HBASE-4612
>                 URL: https://issues.apache.org/jira/browse/HBASE-4612
>             Project: HBase
>          Issue Type: Improvement
>          Components: filters
>    Affects Versions: 0.90.4
>            Reporter: Eran Kutner
>            Priority: Minor
>         Attachments: HBASE-4612-0.90.patch
>
>
> When having a lot of columns grouped by name I've found that it would be very useful to be able to scan them using multiple prefixes, allowing to fetch specific groups in one scan, without fetching the entire row. This is impossible to achieve using a FilterList, so I've added such support to the existing ColmnPrefixFilter while keeping backward compatibility.
> The attached patch is based on 0.90.4, I noticed that the 0.92 branch has a new method to support instantiating filters using Thrift. I'm not sure how the serialization works there so I didn't implement that, but the rest of my code should work in 0.92 as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira