@Override
  protected void addRemoteReplicaInfoToReplicaThread(List<RemoteReplicaInfo> remoteReplicaInfos, boolean unused) {
    /**
     * This fn must be called with rwlock.writeLock() held.
     * It is called by helix when a new replica (not a new partition) is assigned to VCR node.
     * onReplicaAddedOrRemoved -> addPartitionToReplicaThread
     */
    try {
      for (RemoteReplicaInfo rinfo : remoteReplicaInfos) {
        try {
          // Replicas here may belong to different partitions, but they must already be assigned to this node
          PartitionId partitionId = rinfo.getReplicaId().getPartitionId();
          ReplicaThread rthread = partitionToPartitionInfo.get(partitionId).getReplicaThread();
          String datacenter = rinfo.getReplicaId().getDataNodeId().getDatacenterName();
          if (!localDatacenterName.equalsIgnoreCase(datacenter)) {
            throw new UnsupportedOperationException(
                String.format("Cross-colo replication from %s to %s is unsupported in VCR for replica {}",
                    localDatacenterName, datacenter, rinfo));
          }
          rthread.addRemoteReplicaInfo(rinfo);
          rinfo.setReplicaThread(rthread);
          logger.info("[REPLICA] Added replica {} to thread {}", rinfo, rthread.getName());
        } catch (Throwable e) {
          vcrMetrics.addPartitionErrorCount.inc();
          logger.error("[REPLICA] Failed to add replica {} to thread due to {}", rinfo, e);
        }
      }
    } catch (Throwable e) {
      vcrMetrics.addPartitionErrorCount.inc();
      logger.error("Failed to add replica(s) due to {}", e);
    }
  }
Assign all replicas of a partition to the same thread to avoid concurrent updates to Azure
@param remoteReplicaInfos List of {@link RemoteReplicaInfo} These replicas belong to different partitions
@param unused unused variable
ambry-cloud/src/main/java/com/github/ambry/cloud/VcrReplicationManager.java