@Override
    public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
      // Determine the connector (port) the request came through
      int port = request.getServerPort();

      // Find the handler for the corresponding port
      Handler handler = connectorToHandlerMap.entrySet().stream()
          .filter(entry -> entry.getKey().getPort() == port)
          .map(Map.Entry::getValue)
          .findFirst()
          .orElseThrow(() -> new IllegalStateException("No handler found for port " + port));

      // Delegate the request to the handler
      handler.handle(target, baseRequest, request, response);
    }
Handles the HTTP request by determining which port the request came through and routing it to the appropriate handler.

@param target the target of the request
@param baseRequest the base request object
@param request the {@link HttpServletRequest} object containing the request details
@param response the {@link HttpServletResponse} object to send the response
@throws IOException if an input or output exception occurs during the handling of the request
@throws ServletException if a servlet-specific exception occurs during the handling of the request
common/src/java/org/apache/hive/http/HttpServer.java