@Override
  protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException {
    super.serializeStateData(serializer);
    UpdatePeerConfigStateData.Builder builder = UpdatePeerConfigStateData.newBuilder()
      .setPeerConfig(ReplicationPeerConfigUtil.convert(peerConfig));
    if (oldPeerConfig != null) {
      builder.setOldPeerConfig(ReplicationPeerConfigUtil.convert(oldPeerConfig));
    }
    builder.setEnabled(enabled);
    serializer.serialize(builder.build());
  }
The procedure for updating the config for a replication peer.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/UpdatePeerConfigProcedure.java