hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chia-Ping Tsai (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-20484) Remove the unnecessary autoboxing in FilterListBase
Date Wed, 25 Apr 2018 03:37:00 GMT

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

Chia-Ping Tsai commented on HBASE-20484:
----------------------------------------

{quote}can you take a look if i get your idea?Thanks
{quote}
It is even better than I expected. :)

> Remove the unnecessary autoboxing in FilterListBase
> ---------------------------------------------------
>
>                 Key: HBASE-20484
>                 URL: https://issues.apache.org/jira/browse/HBASE-20484
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Chia-Ping Tsai
>            Assignee: Guangxu Cheng
>            Priority: Trivial
>              Labels: beginner, beginners
>         Attachments: HBASE-20484.master.001.patch
>
>
> {code:java}
> protected static boolean checkAndGetReversed(List<Filter> rowFilters, boolean defaultValue)
{
>   if (rowFilters.isEmpty()) {
>     return defaultValue;
>   }
>   Boolean retValue = rowFilters.get(0).isReversed();   // this one
>   boolean allEqual = rowFilters.stream().map(Filter::isReversed).allMatch(retValue::equals);
>   if (!allEqual) {
>     throw new IllegalArgumentException("Filters in the list must have the same reversed
flag");
>   }
>   return retValue;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message