private DataNodeId getDataNodeId(RestRequest restRequest) throws RestServiceException {
    String name = (String) restRequest.getArgs().get(NAME_QUERY_PARAM);
    String portStr = (String) restRequest.getArgs().get(PORT_QUERY_PARAM);
    if (name == null || portStr == null) {
      throw new RestServiceException("Missing name and/or port of data node", RestServiceErrorCode.MissingArgs);
    }
    int port;
    try {
      port = Integer.parseInt(portStr);
    } catch (NumberFormatException e) {
      throw new RestServiceException("Port " + "[" + portStr + "] could not parsed into a number",
          RestServiceErrorCode.InvalidArgs);
    }
    DataNodeId dataNodeId = clusterMap.getDataNodeId(name, port);
    if (dataNodeId == null) {
      metrics.unknownDatanodeError.inc();
      throw new RestServiceException("No datanode found for parameters " + name + ":" + port,
          RestServiceErrorCode.NotFound);
    }
    return dataNodeId;
  }
Gets the {@link DataNodeId} based on query parameters in the {@code restRequest}. Return is always non-null.
@param restRequest the {@link RestRequest} containing the parameters of the request.
@return the {@link DataNodeId} based on query parameters in the {@code restRequest}. Return is always non-null.
@throws RestServiceException if either {@link #NAME_QUERY_PARAM} or {@link #PORT_QUERY_PARAM} is missing, if
{@link #PORT_QUERY_PARAM} is not an {@link Integer} or if there is no datanode that corresponds to the given
parameters.
ambry-frontend/src/main/java/com/github/ambry/frontend/GetPeersHandler.java