Search in sources :

Example 1 with PinotBrokerServletContextChangeListener

use of com.linkedin.pinot.broker.servlet.PinotBrokerServletContextChangeListener in project pinot by linkedin.

the class BrokerServerBuilder method buildHTTP.

public void buildHTTP() {
    // build server which has servlet
    Configuration c = _config.subset(CLIENT_CONFIG_PREFIX);
    BrokerClientConf clientConfig = new BrokerClientConf(c);
    _server = new Server(clientConfig.getQueryPort());
    WebAppContext context = new WebAppContext();
    context.addServlet(PinotClientRequestServlet.class, "/query");
    context.addServlet(PinotBrokerHealthCheckServlet.class, "/health");
    context.addServlet(PinotBrokerRoutingTableDebugServlet.class, "/debug/routingTable/*");
    context.addServlet(PinotBrokerTimeBoundaryDebugServlet.class, "/debug/timeBoundary/*");
    if (clientConfig.enableConsole()) {
        context.setResourceBase(clientConfig.getConsoleWebappPath());
    } else {
        context.setResourceBase("");
    }
    context.addEventListener(new PinotBrokerServletContextChangeListener(_requestHandler, _brokerMetrics, _timeBoundaryService));
    context.setAttribute(BrokerServerBuilder.class.toString(), this);
    _server.setHandler(context);
}
Also used : WebAppContext(org.eclipse.jetty.webapp.WebAppContext) Configuration(org.apache.commons.configuration.Configuration) Server(org.eclipse.jetty.server.Server) PinotBrokerServletContextChangeListener(com.linkedin.pinot.broker.servlet.PinotBrokerServletContextChangeListener)

Aggregations

PinotBrokerServletContextChangeListener (com.linkedin.pinot.broker.servlet.PinotBrokerServletContextChangeListener)1 Configuration (org.apache.commons.configuration.Configuration)1 Server (org.eclipse.jetty.server.Server)1 WebAppContext (org.eclipse.jetty.webapp.WebAppContext)1