public static byte[] submitAndWaitProcedure(ProcedureExecutor<MasterProcedureEnv> procExec,
    final Procedure<MasterProcedureEnv> proc) throws IOException {
    if (proc.isInitializing()) {
      procExec.submitProcedure(proc);
    }
    return waitForProcedureToCompleteIOE(procExec, proc, Long.MAX_VALUE);
  }
Helper to synchronously wait on conditions. This will be removed in the future (mainly when the
AssignmentManager will be replaced with a Procedure version) by using ProcedureYieldException,
and the queue will handle waiting and scheduling based on events.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ProcedureSyncWait.java