private void waitUntilNoPeerProcedure(MasterProcedureEnv env) throws ProcedureSuspendedException {
    long peerProcCount;
    try {
      peerProcCount = env.getMasterServices().getProcedures().stream()
        .filter(p -> p instanceof PeerProcedureInterface).filter(p -> !p.isFinished()).count();
    } catch (IOException e) {
      throw suspend(env.getMasterConfiguration(),
        backoff -> LOG.warn("failed to check peer procedure status, sleep {} secs and retry later",
          backoff / 1000, e));
    }
    if (peerProcCount > 0) {
      throw suspend(env.getMasterConfiguration(),
        backoff -> LOG.info(
          "There are still {} pending peer procedures, sleep {} secs and retry later",
          peerProcCount, backoff / 1000));
    }
    resetRetry();
    LOG.info("No pending peer procedures found, continue...");
  }
A procedure for migrating replication queue data from zookeeper to hbase:replication table.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/MigrateReplicationQueueFromZkToTableProcedure.java