public static <T> T waitFor(MasterProcedureEnv env, String purpose, Predicate<T> predicate)
    throws IOException {
    Configuration conf = env.getMasterConfiguration();
    long waitTime = conf.getLong("hbase.master.wait.on.region", 5 * 60 * 1000);
    return waitFor(env, waitTime, purpose, predicate);
  }
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