use of com.datatorrent.stram.webapp.StramWebApp in project apex-core by apache.
the class StreamingAppMasterService method serviceStart.
@Override
protected void serviceStart() throws Exception {
super.serviceStart();
if (UserGroupInformation.isSecurityEnabled()) {
delegationTokenManager.startThreads();
}
// write the connect address for containers to DFS
InetSocketAddress connectAddress = NetUtils.getConnectAddress(this.heartbeatListener.getAddress());
URI connectUri = RecoverableRpcProxy.toConnectURI(connectAddress);
FSRecoveryHandler recoveryHandler = new FSRecoveryHandler(dag.assertAppPath(), getConfig());
recoveryHandler.writeConnectUri(connectUri.toString());
// start web service
try {
org.mortbay.log.Log.setLog(null);
} catch (Throwable throwable) {
// SPOI-2687. As part of Pivotal Certification, we need to catch ClassNotFoundException as Pivotal was using
// Jetty 7 where as other distros are using Jetty 6.
// LOG.error("can't set the log to null: ", throwable);
}
try {
Configuration config = getConfig();
if (SecurityUtils.isStramWebSecurityEnabled()) {
config = new Configuration(config);
config.set("hadoop.http.filter.initializers", StramWSFilterInitializer.class.getCanonicalName());
}
String customSSLConfig = dag.getValue(LogicalPlan.STRAM_HTTP_CUSTOM_CONFIG);
if (StringUtils.isNotEmpty(customSSLConfig)) {
config.addResource(new Path(customSSLConfig));
}
WebApp webApp = WebApps.$for("stram", StramAppContext.class, appContext, "ws").with(config).start(new StramWebApp(this.dnmgr));
LOG.info("Started web service at port: " + webApp.port());
appMasterTrackingUrl = NetUtils.getConnectAddress(webApp.getListenerAddress()).getHostName() + ":" + webApp.port();
if (ConfigUtils.isSSLEnabled(config)) {
appMasterTrackingUrl = "https://" + appMasterTrackingUrl;
}
LOG.info("Setting tracking URL to: " + appMasterTrackingUrl);
} catch (Exception e) {
LOG.error("Webapps failed to start. Ignoring for now:", e);
}
}
Aggregations