public NodeMaster(CoreConfiguration conf, CachingDocumentNIO<T> documentNIO, Pipeline pipeline, ShutdownHandler shutdownHandler) { this.conf = conf; this.shutdownHandler = shutdownHandler; sm = StageManager.getStageManager(); this.pipeline = pipeline; this.pollingInterval = conf.getPollingInterval(); this.port = conf.getRestPort(); this.namespace = conf.getNamespace(); this.documentNIO = documentNIO; this.dbc = documentNIO.getDatabaseConnector(); } /**
public void startup() { ShuttingDownOnUncaughtException uncaughtExceptionHandler = new ShuttingDownOnUncaughtException(this); Thread.setDefaultUncaughtExceptionHandler(uncaughtExceptionHandler); simpleSocketServer = new SimpleSocketServer((LoggerContext) LoggerFactory.getILoggerFactory(), coreConfiguration.getLoggingPort()); simpleSocketServer.start(); DatabaseConfiguration.DATABASE_URL_PARAM, coreConfiguration.getDatabaseUrl(), DatabaseConfiguration.DATABASE_NAMESPACE, coreConfiguration.getNamespace()); if (coreConfiguration.isCacheEnabled()) { cache = new MemoryCache<MongoType>(); } else { backing, cache, coreConfiguration.isCacheEnabled(), coreConfiguration.getCacheTimeout()); backing.getPipelineReader(), null, coreConfiguration.isPerformanceLogging()));
private void addMissingGroups(Pipeline newPipeline) { for(StageGroup group : newPipeline.getStageGroups()) { if(!pipeline.hasGroup(group.getName())) { pipeline.addGroup(group); if(attachFiles(group)) { sm.addRunner(new StageRunner(group, new File(namespace), port, conf.isPerformanceLogging(), conf.getLoggingPort(), shutdownHandler)); } else { logger.error("Was unable to start the stage group '"+group.getName()+"' due to missing libraries."); } } } }
@SuppressWarnings("rawtypes") public RESTServer(CoreConfiguration conf, HttpRESTHandler requestHandler) { this(conf.getRestPort(), requestHandler); }