@Override
  public boolean controlReplicationForPartitions(Collection<PartitionId> ids, List<String> origins, boolean enable) {
    if (origins.isEmpty()) {
      origins = new ArrayList<>(replicaThreadPoolByDc.keySet());
    }
    if (!replicaThreadPoolByDc.keySet().containsAll(origins)) {
      return false;
    }

    if (origins.size() == replicaThreadPoolByDc.size()) {
      if (!enable) {
        replicationDisabledPartitions.addAll(ids);
      } else {
        replicationDisabledPartitions.removeAll(ids);
      }
    }

    for (String origin : origins) {
      for (ReplicaThread replicaThread : replicaThreadPoolByDc.get(origin)) {
        replicaThread.controlReplicationForPartitions(ids, enable);
      }
    }
    return true;
  }
Enable/Disable replication for given partitions if all origins are involved,
we can disable replication for all partitions and pass this to future ReplicaThreads as well
otherwise control replication for current replica threads only
@param ids the {@link PartitionId}s to enable/disable it on.
@param origins the list of datacenters from which replication should be enabled/disabled. Having an empty list
               disables replication from all datacenters.
@param enable whether to enable ({@code true}) or disable.
@return true/false
ambry-replication/src/main/java/com/github/ambry/replication/ReplicationEngine.java