private void addToList(List<String> encodedRegionNames, String encodedRegionName,
    ReplicationQueueStorage queueStorage) throws ReplicationException {
    encodedRegionNames.add(encodedRegionName);
    if (encodedRegionNames.size() >= UPDATE_LAST_SEQ_ID_BATCH_SIZE) {
      queueStorage.removeLastSequenceIds(peerId, encodedRegionNames);
      encodedRegionNames.clear();
    }
  }
The procedure for updating the config for a replication peer.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/UpdatePeerConfigProcedure.java