public ContextHandlerCollection createAndAddWebApp(Builder builder) throws IOException {
    WebAppContext webAppContext = createWebAppContext(builder);
    initWebAppContext(builder, webAppContext);
    RewriteHandler rwHandler = createRewriteHandler(builder, webAppContext);

    ContextHandlerCollection portHandler = new ContextHandlerCollection();
    portHandler.addHandler(rwHandler);

    for (Pair<String, Class<? extends HttpServlet>> p : builder.servlets) {
      addServlet(p.getKey(), "/" + p.getKey(), p.getValue(), webAppContext);
    }

    builder.globalFilters.forEach((k, v) -> 
        addFilter(k, v.getKey(), v.getValue(), webAppContext.getServletHandler()));

    // Associate the port handler with the a new connector and add it to the server
    ServerConnector connector = createAndAddChannelConnector(threadPool.getQueueSize(), builder);
    portHandlerWrapper.addHandler(connector, portHandler);

    if (builder.contextPath.equals("/")) {
      rootWebAppContext = webAppContext;
    }

    return portHandler;
  }
Creates a port connector and initializes a web application that processes requests through the newly 
created port connector.

@param builder - The builder object used to configure and create the port connector and web application.
@return ContextHandlerCollection - A collection of request handlers associated with the new port connector,
        which includes the newly initialized web application.
common/src/java/org/apache/hive/http/HttpServer.java