void controlReplicationForPartitions(Collection<PartitionId> ids, boolean enable) {
    lock.lock();
    try {
      for (PartitionId id : ids) {
        if (allReplicatedPartitions.contains(id)) {
          if (enable) {
            if (replicationDisabledPartitions.remove(id)) {
              allDisabled = false;
              pauseCondition.signal();
            }
          } else {
            replicationDisabledPartitions.add(id);
            allDisabled = allReplicatedPartitions.size() == replicationDisabledPartitions.size();
          }
          logger.info("Disable status of replication of {} from {} is {}. allDisabled for {} is {}", id, datacenterName,
              replicationDisabledPartitions.contains(id), getName(), allDisabled);
        }
      }
    } finally {
      terminateCurrentContinuousReplicationCycle = true;
      lock.unlock();
    }
  }
Enables/disables replication on the given {@code ids}.
@param ids the {@link PartitionId}s to enable/disable it on.
@param enable whether to enable ({@code true}) or disable.
ambry-replication/src/main/java/com/github/ambry/replication/ReplicaThread.java