void setRequest(NettyRequest request) {
    if (request != null) {
      if (this.request == null) {
        this.request = request;
        HttpUtil.setKeepAlive(responseMetadata, request.isKeepAlive());
      } else {
        throw new IllegalStateException(
            "Request has already been set inside NettyResponseChannel for channel {} " + ctx.channel());
      }
    } else {
      throw new IllegalArgumentException("RestRequest provided is null");
    }
  }
Sets the request whose response is being served through this instance of NettyResponseChannel.
@param request the {@link NettyRequest} whose response is being served through this instance of
               NettyResponseChannel.
ambry-rest/src/main/java/com/github/ambry/rest/NettyResponseChannel.java