protected HttpServer setupQueryWebServer(ExternalProperties externalProperties) throws Exception { final HttpServerConfig config = HttpServerConfigBuilder.custom().setMaxRequestSize(externalProperties.getMaxWebRequestSize()).build(); HttpServer queryWebServer = new HttpServer(webManager.getBosses(), webManager.getWorkers(), externalProperties.getQueryWebInterfacePort(), config); queryWebServer.setAttribute(HYRACKS_CONNECTION_ATTR, hcc); ServiceLoader.load(IQueryWebServerRegistrant.class).iterator() .forEachRemaining(c -> c.register(appCtx, queryWebServer)); return queryWebServer; }
protected HttpServer setupWebServer(ExternalProperties externalProperties) throws Exception { final HttpServerConfig config = HttpServerConfigBuilder.custom().setMaxRequestSize(externalProperties.getMaxWebRequestSize()).build(); HttpServer webServer = new HttpServer(webManager.getBosses(), webManager.getWorkers(), externalProperties.getWebInterfacePort(), config); webServer.setAttribute(HYRACKS_CONNECTION_ATTR, hcc); webServer.addServlet(new ApiServlet(webServer.ctx(), new String[] { "/*" }, appCtx, ccExtensionManager.getCompilationProvider(AQL), ccExtensionManager.getCompilationProvider(SQLPP), getStatementExecutorFactory(), componentProvider)); return webServer; }
protected void configureServers() throws Exception { final ExternalProperties externalProperties = getApplicationContext().getExternalProperties(); final HttpServerConfig config = HttpServerConfigBuilder.custom().setMaxRequestSize(externalProperties.getMaxWebRequestSize()).build(); HttpServer apiServer = new HttpServer(webManager.getBosses(), webManager.getWorkers(), externalProperties.getNcApiPort(), config); apiServer.setAttribute(ServletConstants.SERVICE_CONTEXT_ATTR, ncServiceCtx); apiServer.addServlet(new StorageApiServlet(apiServer.ctx(), getApplicationContext(), Servlets.STORAGE)); apiServer.addServlet( new NetDiagnosticsApiServlet(apiServer.ctx(), getApplicationContext(), Servlets.NET_DIAGNOSTICS)); webManager.add(apiServer); }
protected HttpServer setupJSONAPIServer(ExternalProperties externalProperties) throws Exception { final HttpServerConfig config = HttpServerConfigBuilder.custom().setMaxRequestSize(externalProperties.getMaxWebRequestSize()).build(); HttpServer jsonAPIServer = new HttpServer(webManager.getBosses(), webManager.getWorkers(), externalProperties.getAPIServerPort(), config); jsonAPIServer.setAttribute(HYRACKS_CONNECTION_ATTR, hcc); jsonAPIServer.setAttribute(ASTERIX_APP_CONTEXT_INFO_ATTR, appCtx); jsonAPIServer.setAttribute(ServletConstants.EXECUTOR_SERVICE_ATTR, ccServiceCtx.getControllerService().getExecutor()); jsonAPIServer.setAttribute(ServletConstants.RUNNING_QUERIES_ATTR, statementExecutorCtx); jsonAPIServer.setAttribute(ServletConstants.SERVICE_CONTEXT_ATTR, ccServiceCtx); // Other APIs. addServlet(jsonAPIServer, Servlets.QUERY_STATUS); addServlet(jsonAPIServer, Servlets.QUERY_RESULT); addServlet(jsonAPIServer, Servlets.QUERY_SERVICE); addServlet(jsonAPIServer, Servlets.QUERY_AQL); addServlet(jsonAPIServer, Servlets.RUNNING_REQUESTS); addServlet(jsonAPIServer, Servlets.CONNECTOR); addServlet(jsonAPIServer, Servlets.SHUTDOWN); addServlet(jsonAPIServer, Servlets.VERSION); addServlet(jsonAPIServer, Servlets.CLUSTER_STATE); addServlet(jsonAPIServer, Servlets.REBALANCE); addServlet(jsonAPIServer, Servlets.CLUSTER_STATE_NODE_DETAIL); // must not precede add of CLUSTER_STATE addServlet(jsonAPIServer, Servlets.CLUSTER_STATE_CC_DETAIL); // must not precede add of CLUSTER_STATE addServlet(jsonAPIServer, Servlets.DIAGNOSTICS); addServlet(jsonAPIServer, Servlets.ACTIVE_STATS); return jsonAPIServer; }