private JSONObject getReplicas(String blobId) throws RestServiceException {
    try {
      PartitionId partitionId = new BlobId(blobId, clusterMap).getPartition();
      if (partitionId == null) {
        metrics.invalidBlobIdError.inc();
        logger.warn("Partition for blob id {} is null. The blob id might be invalid", blobId);
        throw new RestServiceException("Partition for blob id " + blobId + " is null. The id might be invalid",
            RestServiceErrorCode.NotFound);
      }
      return packageResult(partitionId.getReplicaIds());
    } catch (IllegalArgumentException e) {
      metrics.invalidBlobIdError.inc();
      throw new RestServiceException("Invalid blob id received for getReplicasForBlob request - " + blobId, e,
          RestServiceErrorCode.NotFound);
    } catch (IOException | JSONException e) {
      metrics.responseConstructionError.inc();
      throw new RestServiceException("Could not create response for GET of replicas for " + blobId, e,
          RestServiceErrorCode.InternalServerError);
    }
  }
Extracts the blob ID provided by the client and figures out the partition that the blob ID would belong to
based on the cluster map. Using the partition information, returns the list of replicas as a part of a JSONObject.
@param blobId the blob ID whose replicas are required.
@return A {@link JSONObject} that wraps the replica list.
@throws RestServiceException if there were missing or invalid arguments or if there was a {@link JSONException}
                               or any other while building the response
ambry-frontend/src/main/java/com/github/ambry/frontend/GetReplicasHandler.java