You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Joep Rottinghuis (JIRA)" <ji...@apache.org> on 2012/05/31 21:17:23 UTC

[jira] [Created] (HBASE-6142) Javadoc in some Filters ambiguous

Joep Rottinghuis created HBASE-6142:
---------------------------------------

             Summary: Javadoc in some Filters ambiguous
                 Key: HBASE-6142
                 URL: https://issues.apache.org/jira/browse/HBASE-6142
             Project: HBase
          Issue Type: Bug
          Components: documentation
    Affects Versions: 0.92.2, 0.96.0, 0.94.1
            Reporter: Joep Rottinghuis
            Priority: Minor


The javadoc on some of the filter is somewhat confusing.
The main Filter interface has methods that behave like a sieve; when filterRowKey returns true, that means that the row is filtered _out_ (not included).

Many of the Filter implementations work the other way around. When the condition is met the value passes (ie, the row is returned).

Most Filters make it clear when a values passes (passing through the filter meaning the values are returned from the scan).
Some are less clear in light of how the Filter interface works: WhileMatchFilter and SingleColumnValueFilter are examples.

--
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

        

[jira] [Commented] (HBASE-6142) Javadoc in some Filters ambiguous

Posted by "Joep Rottinghuis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286858#comment-13286858 ] 

Joep Rottinghuis commented on HBASE-6142:
-----------------------------------------

Another example that requires a double-take after initial first reading:
WhileMatchFilter:
{code}
/**
 * A wrapper filter that returns true from {@link #filterAllRemaining()} as soon
 * as the wrapped filters {@link Filter#filterRowKey(byte[], int, int)},
 * {@link Filter#filterKeyValue(org.apache.hadoop.hbase.KeyValue)},
 * {@link org.apache.hadoop.hbase.filter.Filter#filterRow()} or
 * {@link org.apache.hadoop.hbase.filter.Filter#filterAllRemaining()} methods
 * returns true.
 */
{code}
Huh? A Filter that returns true... meaning that values will be filtered out not pass the filter.
Seems like the point is to stop the scan after a certain condition is met for efficiency, but it is not immediately obvious how multiple filters interact when wrapped by WhileMatchFilter.
                
> Javadoc in some Filters ambiguous
> ---------------------------------
>
>                 Key: HBASE-6142
>                 URL: https://issues.apache.org/jira/browse/HBASE-6142
>             Project: HBase
>          Issue Type: Bug
>          Components: documentation
>    Affects Versions: 0.92.2, 0.96.0, 0.94.1
>            Reporter: Joep Rottinghuis
>            Priority: Minor
>
> The javadoc on some of the filter is somewhat confusing.
> The main Filter interface has methods that behave like a sieve; when filterRowKey returns true, that means that the row is filtered _out_ (not included).
> Many of the Filter implementations work the other way around. When the condition is met the value passes (ie, the row is returned).
> Most Filters make it clear when a values passes (passing through the filter meaning the values are returned from the scan).
> Some are less clear in light of how the Filter interface works: WhileMatchFilter and SingleColumnValueFilter are examples.

--
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

        

[jira] [Commented] (HBASE-6142) Javadoc in some Filters ambiguous

Posted by "Joep Rottinghuis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286852#comment-13286852 ] 

Joep Rottinghuis commented on HBASE-6142:
-----------------------------------------

See the JavaDoc in SingleColumnValueFilter:
{code}
/**
 * This filter is used to filter cells based on value. It takes a {@link CompareFilter.CompareOp}
 * operator (equal, greater, not equal, etc), and either a byte [] value or
 * a WritableByteArrayComparable.
{code}
"to filter" is not clear. Filter in (pass), or filter out (like Filter#filterRowKey)?
Then the following snippet seems to match how Filter is defined, but is not actually how it does work:
{code}
 * If we have a byte [] value then we just do a lexicographic compare. For
 * example, if passed value is 'b' and cell has 'a' and the compare operator
 * is LESS, then we will filter out this cell (return true).  If this is not
 * sufficient (eg you want to deserialize a long and then compare it to a fixed
 * long value), then you can pass in your own comparator instead.
{code}
I think that is incorrect. In this example since 'a' _is_ LESS than 'b' the value would actually pass the filter (row returned by scan).

                
> Javadoc in some Filters ambiguous
> ---------------------------------
>
>                 Key: HBASE-6142
>                 URL: https://issues.apache.org/jira/browse/HBASE-6142
>             Project: HBase
>          Issue Type: Bug
>          Components: documentation
>    Affects Versions: 0.92.2, 0.96.0, 0.94.1
>            Reporter: Joep Rottinghuis
>            Priority: Minor
>
> The javadoc on some of the filter is somewhat confusing.
> The main Filter interface has methods that behave like a sieve; when filterRowKey returns true, that means that the row is filtered _out_ (not included).
> Many of the Filter implementations work the other way around. When the condition is met the value passes (ie, the row is returned).
> Most Filters make it clear when a values passes (passing through the filter meaning the values are returned from the scan).
> Some are less clear in light of how the Filter interface works: WhileMatchFilter and SingleColumnValueFilter are examples.

--
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

        

[jira] [Updated] (HBASE-6142) Javadoc in some Filters ambiguous

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-6142:
-------------------------

    Tags: noo
    
> Javadoc in some Filters ambiguous
> ---------------------------------
>
>                 Key: HBASE-6142
>                 URL: https://issues.apache.org/jira/browse/HBASE-6142
>             Project: HBase
>          Issue Type: Bug
>          Components: documentation
>    Affects Versions: 0.92.2, 0.96.0, 0.94.1
>            Reporter: Joep Rottinghuis
>            Priority: Minor
>
> The javadoc on some of the filter is somewhat confusing.
> The main Filter interface has methods that behave like a sieve; when filterRowKey returns true, that means that the row is filtered _out_ (not included).
> Many of the Filter implementations work the other way around. When the condition is met the value passes (ie, the row is returned).
> Most Filters make it clear when a values passes (passing through the filter meaning the values are returned from the scan).
> Some are less clear in light of how the Filter interface works: WhileMatchFilter and SingleColumnValueFilter are examples.

--
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

        

[jira] [Commented] (HBASE-6142) Javadoc in some Filters ambiguous

Posted by "Joep Rottinghuis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13287862#comment-13287862 ] 

Joep Rottinghuis commented on HBASE-6142:
-----------------------------------------

Ah, I will look up my (signed) copy of said book, write test and take a shot at the javadoc.
Cannot promise any angel qualities though...
                
> Javadoc in some Filters ambiguous
> ---------------------------------
>
>                 Key: HBASE-6142
>                 URL: https://issues.apache.org/jira/browse/HBASE-6142
>             Project: HBase
>          Issue Type: Bug
>          Components: documentation
>    Affects Versions: 0.92.2, 0.96.0, 0.94.1
>            Reporter: Joep Rottinghuis
>            Priority: Minor
>              Labels: noob
>
> The javadoc on some of the filter is somewhat confusing.
> The main Filter interface has methods that behave like a sieve; when filterRowKey returns true, that means that the row is filtered _out_ (not included).
> Many of the Filter implementations work the other way around. When the condition is met the value passes (ie, the row is returned).
> Most Filters make it clear when a values passes (passing through the filter meaning the values are returned from the scan).
> Some are less clear in light of how the Filter interface works: WhileMatchFilter and SingleColumnValueFilter are examples.

--
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

        

[jira] [Updated] (HBASE-6142) Javadoc in some Filters ambiguous

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-6142:
-------------------------

      Tags: noob  (was: noo)
    Labels: noob  (was: )

Tagging as noob.  Would be grand if an angel from heaven would write little unit tests to verify which way the filter blows and fix the javadoc accordingly (Lars George, if we read that book of yours, would it answer the questions Joep raises?  IIRC, its good on filters?)
                
> Javadoc in some Filters ambiguous
> ---------------------------------
>
>                 Key: HBASE-6142
>                 URL: https://issues.apache.org/jira/browse/HBASE-6142
>             Project: HBase
>          Issue Type: Bug
>          Components: documentation
>    Affects Versions: 0.92.2, 0.96.0, 0.94.1
>            Reporter: Joep Rottinghuis
>            Priority: Minor
>              Labels: noob
>
> The javadoc on some of the filter is somewhat confusing.
> The main Filter interface has methods that behave like a sieve; when filterRowKey returns true, that means that the row is filtered _out_ (not included).
> Many of the Filter implementations work the other way around. When the condition is met the value passes (ie, the row is returned).
> Most Filters make it clear when a values passes (passing through the filter meaning the values are returned from the scan).
> Some are less clear in light of how the Filter interface works: WhileMatchFilter and SingleColumnValueFilter are examples.

--
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