Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-24821

Simplify the logic of getRegionInfo in TestFlushFromClient to reduce redundancy code

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-alpha-1, 2.3.1, 2.4.0, 2.2.6
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Current logic:

        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());
        }
      

      The MiniHBaseCluster has similar method to do same thing.
      So it could just directly call:

        private List<HRegion> getRegionInfo() {
          return TEST_UTIL.getHBaseCluster().getRegions(tableName);
        }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                filtertip Zheng Wang
                Reporter:
                filtertip Zheng Wang
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: