@Override
  protected LockState acquireLock(final MasterProcedureEnv env) {
    // It now takes an exclusive lock on the merged child region to make sure
    // that no two parallel running of two GCMultipleMergedRegionsProcedures on the
    // region.
    if (env.getProcedureScheduler().waitRegion(this, mergedChild)) {
      return LockState.LOCK_EVENT_WAIT;
    }
    return LockState.LOCK_ACQUIRED;
  }
GC regions that have been Merged. Caller determines if it is GC time. This Procedure does not
check. This is a Table Procedure. We take a read lock on the Table. We do NOT keep a lock for the
life of this procedure. The sub-procedures take locks on the Regions they are purging. Replaces a
Procedure that did two regions only at a time instead doing multiple merges in the one go; only
difference from the old {@link GCMergedRegionsState} is the serialization; this class has a
different serialization profile writing out more than just two regions.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCMultipleMergedRegionsProcedure.java