@Override
  protected void afterReplay(MasterProcedureEnv env) {
    // If the procedure is not finished and the worker is not null, we should add it to the used
    // worker set, to prevent the worker being used by others.
    if (worker != null && !isFinished()) {
      env.getMasterServices().getSyncReplicationReplayWALManager().addUsedPeerWorker(peerId,
        worker);
    }
  }
The procedure for replaying a set of remote wals. It will get an available region server and
schedule a {@link SyncReplicationReplayWALRemoteProcedure} to actually send the request to region
server.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/SyncReplicationReplayWALProcedure.java