List<PartitionId> getWritablePartitions(String partitionClass) {
      return getPartitionsWithState(partitionClass, (partitionState -> partitionState != PartitionState.READ_ONLY),
          WRITABLE_LOG_STR);
    }
Returns all the partitions that are not in state {@link PartitionState#READ_ONLY} AND have the highest number of
replicas in the local datacenter for the given {@code partitionClass}.
<p/>
Also attempts to return only partitions with healthy replicas but if no such partitions are found, returns all
the eligible partitions irrespective of replica health.
<p/>
If {@code partitionClass} is {@code null}, gets writable partitions from all partition classes.
@param partitionClass the class of the partitions desired. Can be {@code null}.
@return all the writable partitions in {@code partitionClass} with the highest replica count in the local
datacenter (all writable partitions if it is {@code null}).
ambry-clustermap/src/main/java/com/github/ambry/clustermap/ClusterMapUtils.java