@Override
  public void initiateDeactivation(ReplicaId replicaId) {
    partitionToDeactivationLatch.put(replicaId.getPartitionId().toPathString(), new CountDownLatch(1));
    partitionToDeactivationSuccess.put(replicaId.getPartitionId().toPathString(), false);
    // once deactivation is initiated, local replica won't receive new PUTs. All remote replicas should be able to
    // eventually catch with last PUT in local store. Hence, we set acceptable lag threshold to 0.
    replicaToLagInfos.put(replicaId, new LocalReplicaLagInfos(replicaId, 0, ReplicaState.INACTIVE));
  }
An implementation of {@link ReplicaSyncUpManager} that helps track replica catchup state.

To track state of replica that is catching up or being commissioned, this class leverages a {@link java.util.concurrent.CountDownLatch}.
Every time {@link ReplicaSyncUpManager#initiateBootstrap(ReplicaId)} is called, a new latch (with initial value = 1)
is created associated with given replica. Any caller that invokes {@link ReplicaSyncUpManager#waitBootstrapCompleted(String)}
is blocked and wait until corresponding latch counts to zero. External component (i.e. replication manager) is able to
call {@link ReplicaSyncUpManager#onBootstrapComplete(ReplicaId)} or {@link ReplicaSyncUpManager#onBootstrapError(ReplicaId)}
to mark sync-up success or failure by counting down the latch. This will unblock caller waiting fot this latch and
proceed with subsequent actions.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/AmbryReplicaSyncUpManager.java