ReplicationPeerConfig preRemovePeer(String peerId) throws DoNotRetryIOException {
    ReplicationPeerDescription pd = checkPeerExists(peerId);
    checkPeerInDAStateIfSyncReplication(peerId);
    return pd.getPeerConfig();
  }
Manages and performs all replication admin operations.
<p>
Used to add/remove a replication peer.
<p>
Implement {@link ConfigurationObserver} mainly for recreating {@link ReplicationPeerStorage}, for
supporting migrating across different replication peer storages without restarting master.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java