@Override
    public byte[] get(long timeout, TimeUnit unit)
      throws InterruptedException, ExecutionException, TimeoutException {
      if (hasResult) {
        return result;
      }
      try {
        result = waitForProcedureToComplete(procExec, proc, unit.toMillis(timeout));
        hasResult = true;
        return result;
      } catch (TimeoutIOException e) {
        throw new TimeoutException(e.getMessage());
      } catch (Exception e) {
        throw new ExecutionException(e);
      }
    }
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