You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Viraj Jasani (Jira)" <ji...@apache.org> on 2020/08/05 14:42:00 UTC

[jira] [Commented] (HBASE-24821) Simplify the logic of getRegionInfo in TestFlushFromClient to reduce redundancy code

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

Viraj Jasani commented on HBASE-24821:
--------------------------------------

Merged changes to master, branch-2, 2.3, 2.2. Thanks for the contribution [~filtertip].

> Simplify the logic of getRegionInfo in TestFlushFromClient to reduce redundancy code
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-24821
>                 URL: https://issues.apache.org/jira/browse/HBASE-24821
>             Project: HBase
>          Issue Type: Improvement
>          Components: test
>            Reporter: Zheng Wang
>            Assignee: Zheng Wang
>            Priority: Minor
>
> Current logic:
> {code:java}
>   private List<HRegion> getRegionInfo() {
>     return TEST_UTIL.getHBaseCluster().getLiveRegionServerThreads().stream()
>       .map(JVMClusterUtil.RegionServerThread::getRegionServer)
>       .flatMap(r -> r.getRegions().stream())
>       .filter(r -> r.getTableDescriptor().getTableName().equals(tableName))
>       .collect(Collectors.toList());
>   }
> {code}
> The MiniHBaseCluster has similar method to do same thing.
>  So it could just directly call:
> {code:java}
>   private List<HRegion> getRegionInfo() {
>     return TEST_UTIL.getHBaseCluster().getRegions(tableName);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)