@Override
      public void serverAdded(ServerName serverName) {
        MasterProcedureScheduler scheduler =
          services.getMasterProcedureExecutor().getEnvironment().getProcedureScheduler();
        for (UsedReplayWorkersForPeer usedWorkers : usedWorkersByPeer.values()) {
          synchronized (usedWorkers) {
            usedWorkers.wake(scheduler);
          }
        }
      }
This class is used to record the used workers(region servers) for a replication peer. For
balancing the replaying remote wal job, we will only schedule one remote replay procedure each
time. So when acquiring a worker, we will first get all the region servers for this cluster,
and then filter out the used ones.
<p/>
The {@link ProcedureEvent} is used for notifying procedures that there are available workers
now. We used to use sleeping and retrying before, but if the interval is too large, for
example, exponential backoff, then it is not effective, but if the interval is too small, then
we will flood the procedure wal.
<p/>
The states are only kept in memory, so when restarting, we need to reconstruct these
information, using the information stored in related procedures. See the {@code afterReplay}
method in {@link RecoverStandbyProcedure} and {@link SyncReplicationReplayWALProcedure} for
more details.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/SyncReplicationReplayWALManager.java