private boolean areAllLocalReplicasForPartitionUp(PartitionId partitionId) {
      for (ReplicaId replica : partitionIdToLocalReplicas.get(partitionId)) {
        if (replica.isDown()) {
          return false;
        }
      }

      // Generate a metric to track how often we choose a replica that is not globally available for writes.
      if (!isPartitionEligibleForParanoidDurability(partitionId)) {
        if (clusterManagerMetrics != null)
          clusterManagerMetrics.paranoidDurabilityIneligibleReplicaCount.inc();
      }
      return true;
    }
Check whether all local replicas of the given {@link PartitionId} are up.
@param partitionId the {@link PartitionId} to check.
@return true if all local replicas are up; false otherwise.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/ClusterMapUtils.java