public static PartitionId getPartitionIdFromStr(String partitionIdStr, ClusterMap clusterMap) {
    if (partitionIdStr == null) {
      return null;
    }
    PartitionId targetPartitionId = null;
    List<? extends PartitionId> partitionIds = clusterMap.getAllPartitionIds(null);
    for (PartitionId partitionId : partitionIds) {
      if (partitionId.isEqual(partitionIdStr)) {
        targetPartitionId = partitionId;
        break;
      }
    }
    if (targetPartitionId == null) {
      throw new IllegalArgumentException("Partition Id is not valid: [" + partitionIdStr + "]");
    }
    return targetPartitionId;
  }
Gets the {@link PartitionId} in the {@code clusterMap} whose string representation matches {@code partitionIdStr}.
@param partitionIdStr the string representation of the partition required.
@param clusterMap the {@link ClusterMap} to use to list and process {@link PartitionId}s.
@return the {@link PartitionId} in the {@code clusterMap} whose string repr matches {@code partitionIdStr}.
{@code null} if {@code partitionIdStr} is {@code null}.
@throws IllegalArgumentException if there is no @link PartitionId} in the {@code clusterMap} whose string repr
matches {@code partitionIdStr}.
ambry-tools/src/main/java/com/github/ambry/tools/admin/ServerAdminTool.java