@Override
  public void handleRequests(NetworkRequest networkRequest) throws InterruptedException {
    try {
      RequestOrResponseType type;
      if (networkRequest instanceof LocalChannelRequest) {
        RequestOrResponse request =
            (RequestOrResponse) ((LocalChannelRequest) networkRequest).getRequestInfo().getRequest();
        type = request.getRequestType();
      } else {
        DataInputStream stream = new DataInputStream(networkRequest.getInputStream());
        type = RequestOrResponseType.values()[stream.readShort()];
      }
      switch (type) {
        case PutRequest:
          handlePutRequest(networkRequest);
          break;
        case GetRequest:
          handleGetRequest(networkRequest);
          break;
        case DeleteRequest:
          handleDeleteRequest(networkRequest);
          break;
        case BatchDeleteRequest:
          handleBatchDeleteRequest(networkRequest);
          break;
        case TtlUpdateRequest:
          handleTtlUpdateRequest(networkRequest);
          break;
        case ReplicaMetadataRequest:
          handleReplicaMetadataRequest(networkRequest);
          break;
        case AdminRequest:
          handleAdminRequest(networkRequest);
          break;
        case UndeleteRequest:
          handleUndeleteRequest(networkRequest);
          break;
        case ReplicateBlobRequest:
          handleReplicateBlobRequest(networkRequest);
          break;
        case FileCopyGetMetaDataRequest:
          handleFileCopyGetMetaDataRequest(networkRequest);
          break;
        case FileCopyGetChunkRequest:
          handleFileCopyGetChunkRequest(networkRequest);
          break;
        default:
          throw new UnsupportedOperationException("Request type not supported");
      }
    } catch (Exception e) {
      logger.error("Error while handling request {} closing connection", networkRequest, e);
      requestResponseChannel.closeConnection(networkRequest);
    }
  }
The main request implementation class. All requests to the server are
handled by this class
ambry-server/src/main/java/com/github/ambry/server/AmbryRequests.java