protected void unbalanceRegions(ClusterMetrics clusterStatus, List<ServerName> fromServers,
    List<ServerName> toServers, double fractionOfRegions) throws Exception {
    List<byte[]> victimRegions = new ArrayList<>();
    for (Map.Entry<ServerName, ServerMetrics> entry : clusterStatus.getLiveServerMetrics()
      .entrySet()) {
      ServerName sn = entry.getKey();
      ServerMetrics serverLoad = entry.getValue();
      // Ugh.
      List<byte[]> regions = new ArrayList<>(serverLoad.getRegionMetrics().keySet());
      int victimRegionCount = (int) Math.ceil(fractionOfRegions * regions.size());
      getLogger().debug("Removing {} regions from {}", victimRegionCount, sn);
      Random rand = ThreadLocalRandom.current();
      for (int i = 0; i < victimRegionCount; ++i) {
        int victimIx = rand.nextInt(regions.size());
        String regionId = RegionInfo.encodeRegionName(regions.remove(victimIx));
        victimRegions.add(Bytes.toBytes(regionId));
      }
    }

    getLogger().info("Moving {} regions from {} servers to {} different servers",
      victimRegions.size(), fromServers.size(), toServers.size());
    Admin admin = this.context.getHBaseIntegrationTestingUtility().getAdmin();
    Random rand = ThreadLocalRandom.current();
    for (byte[] victimRegion : victimRegions) {
      // Don't keep moving regions if we're
      // trying to stop the monkey.
      if (context.isStopping()) {
        break;
      }
      int targetIx = rand.nextInt(toServers.size());
      admin.move(victimRegion, toServers.get(targetIx));
    }
  }
Returns current region servers - active master
hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java