private void setupOperations() throws Exception {
    // Create set of operations based on --ops_type command line argument.
    final ProcedureFactory[] tableOps = new ProcedureFactory[numTables];
    for (int i = 0; i < numTables; ++i) {
      tableOps[i] = new TableProcedureFactory(TableName.valueOf("testTableLock-" + i));
    }

    final ProcedureFactory[] regionOps = new ProcedureFactory[numTables * regionsPerTable];
    for (int i = 0; i < numTables; ++i) {
      for (int j = 0; j < regionsPerTable; ++j) {
        regionOps[i * regionsPerTable + j] = new RegionProcedureFactory(
          RegionInfoBuilder.newBuilder(((TableProcedureFactory) tableOps[i]).tableName)
            .setStartKey(Bytes.toBytes(j)).setEndKey(Bytes.toBytes(j + 1)).build());
      }
    }

    if (opsType.equals("table")) {
      System.out.println("Operations: table only");
      ops = tableOps;
    } else if (opsType.equals("region")) {
      System.out.println("Operations: region only");
      ops = regionOps;
    } else if (opsType.equals("both")) {
      System.out.println("Operations: both (table + region)");
      ops = (ProcedureFactory[]) ArrayUtils.addAll(tableOps, regionOps);
    } else {
      throw new Exception("-ops_type should be one of table/region/both.");
    }
  }
Tool to test performance of locks and queues in procedure scheduler independently from other
framework components. Inserts table and region operations in the scheduler, then polls them and
exercises their locks Number of tables, regions and operations can be set using cli args.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java