@Override
  public void perform() throws Exception {
    if (sleepTime > 0) {
      Thread.sleep(sleepTime);
    }

    Admin admin = this.context.getHBaseIntegrationTestingUtility().getAdmin();
    ServerName[] servers = getServers(admin);

    getLogger().info("Performing action: Move regions of table {}", tableName);
    List<RegionInfo> regions = admin.getRegions(tableName);
    if (regions == null || regions.isEmpty()) {
      getLogger().info("Table {} doesn't have regions to move", tableName);
      return;
    }

    Collections.shuffle(regions);

    long start = EnvironmentEdgeManager.currentTime();
    for (RegionInfo regionInfo : regions) {
      // Don't try the move if we're stopping
      if (context.isStopping()) {
        return;
      }

      moveRegion(admin, servers, regionInfo, getLogger());
      if (sleepTime > 0) {
        Thread.sleep(sleepTime);
      }

      // put a limit on max num regions. Otherwise, this won't finish
      // with a sleep time of 10sec, 100 regions will finish in 16min
      if (EnvironmentEdgeManager.currentTime() - start > maxTime) {
        break;
      }
    }
  }
Action that tries to move every region of a table.
hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java