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

Simplify the logic of getRegionInfo in TestFlushFromClient to reduce redundancy code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 2.3.1, 2.4.0, 2.2.6
    • test
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: