/** * Register new resource watcher that will be checked in default {@link Frequency#MEDIUM MEDIUM} frequency */ public <W extends ResourceWatcher> WatcherHandle<W> add(W watcher) throws IOException { return add(watcher, Frequency.MEDIUM); }
public void notifyNow() { notifyNow(Frequency.MEDIUM); }
injector.getInstance(ResourceWatcherService.class).stop(); if (NetworkModule.HTTP_ENABLED.get(settings)) { injector.getInstance(HttpServerTransport.class).stop();
clusterService.setNodeConnectionsService(nodeConnectionsService); injector.getInstance(ResourceWatcherService.class).start(); injector.getInstance(GatewayService.class).start(); Discovery discovery = injector.getInstance(Discovery.class);
final ResourceWatcherService resourceWatcherService = new ResourceWatcherService(settings, threadPool); final ScriptModule scriptModule = new ScriptModule(settings, pluginsService.filterPlugins(ScriptPlugin.class)); AnalysisModule analysisModule = new AnalysisModule(this.environment, pluginsService.filterPlugins(AnalysisPlugin.class));
@Inject public ResourceWatcherService(Settings settings, ThreadPool threadPool) { super(settings); this.enabled = ENABLED.get(settings); this.threadPool = threadPool; TimeValue interval = RELOAD_INTERVAL_LOW.get(settings); lowMonitor = new ResourceMonitor(interval, Frequency.LOW); interval = RELOAD_INTERVAL_MEDIUM.get(settings); mediumMonitor = new ResourceMonitor(interval, Frequency.MEDIUM); interval = RELOAD_INTERVAL_HIGH.get(settings); highMonitor = new ResourceMonitor(interval, Frequency.HIGH); logRemovedSetting("watcher.enabled", "resource.reload.enabled"); logRemovedSetting("watcher.interval", "resource.reload.interval"); logRemovedSetting("watcher.interval.low", "resource.reload.interval.low"); logRemovedSetting("watcher.interval.medium", "resource.reload.interval.medium"); logRemovedSetting("watcher.interval.high", "resource.reload.interval.high"); }
StopWatch stopWatch = new StopWatch("node_close"); toClose.add(() -> stopWatch.start("tribe")); toClose.add(() -> stopWatch.stop().start("node_service")); toClose.add(nodeService); toClose.add(() -> stopWatch.stop().start("http")); if (NetworkModule.HTTP_ENABLED.get(settings)) { toClose.add(injector.getInstance(HttpServerTransport.class));
injector.getInstance(ResourceWatcherService.class).start();
final ResourceWatcherService resourceWatcherService = new ResourceWatcherService(settings, threadPool); final ScriptModule scriptModule = new ScriptModule(settings, pluginsService.filterPlugins(ScriptPlugin.class)); AnalysisModule analysisModule = new AnalysisModule(this.environment, pluginsService.filterPlugins(AnalysisPlugin.class));
@Inject public ResourceWatcherService(Settings settings, ThreadPool threadPool) { super(settings); this.enabled = settings.getAsBoolean("resource.reload.enabled", true); this.threadPool = threadPool; TimeValue interval = settings.getAsTime("resource.reload.interval.low", Frequency.LOW.interval); lowMonitor = new ResourceMonitor(interval, Frequency.LOW); interval = settings.getAsTime("resource.reload.interval.medium", settings.getAsTime("resource.reload.interval", Frequency.MEDIUM.interval)); mediumMonitor = new ResourceMonitor(interval, Frequency.MEDIUM); interval = settings.getAsTime("resource.reload.interval.high", Frequency.HIGH.interval); highMonitor = new ResourceMonitor(interval, Frequency.HIGH); logRemovedSetting("watcher.enabled", "resource.reload.enabled"); logRemovedSetting("watcher.interval", "resource.reload.interval"); logRemovedSetting("watcher.interval.low", "resource.reload.interval.low"); logRemovedSetting("watcher.interval.medium", "resource.reload.interval.medium"); logRemovedSetting("watcher.interval.high", "resource.reload.interval.high"); }
/** * Register new resource watcher that will be checked in the given frequency */ public <W extends ResourceWatcher> WatcherHandle<W> add(W watcher, Frequency frequency) throws IOException { watcher.init(); switch (frequency) { case LOW: return lowMonitor.add(watcher); case MEDIUM: return mediumMonitor.add(watcher); case HIGH: return highMonitor.add(watcher); default: throw new IllegalArgumentException("Unknown frequency [" + frequency + "]"); } }
injector.getInstance(ResourceWatcherService.class).stop(); if (NetworkModule.HTTP_ENABLED.get(settings)) { injector.getInstance(HttpServerTransport.class).stop();
clusterService.setNodeConnectionsService(nodeConnectionsService); injector.getInstance(ResourceWatcherService.class).start(); injector.getInstance(GatewayService.class).start(); Discovery discovery = injector.getInstance(Discovery.class);
public void notifyNow() { notifyNow(Frequency.MEDIUM); }
final ResourceWatcherService resourceWatcherService = new ResourceWatcherService(settings, threadPool); final ScriptModule scriptModule = ScriptModule.create(settings, this.environment, resourceWatcherService, pluginsService.filterPlugins(ScriptPlugin.class));
/** * Register new resource watcher that will be checked in default {@link Frequency#MEDIUM MEDIUM} frequency */ public <W extends ResourceWatcher> WatcherHandle<W> add(W watcher) throws IOException { return add(watcher, Frequency.MEDIUM); }
injector.getInstance(ResourceWatcherService.class).stop(); if (NetworkModule.HTTP_ENABLED.get(settings)) { injector.getInstance(HttpServerTransport.class).stop();
injector.getInstance(ResourceWatcherService.class).start(); injector.getInstance(TribeService.class).start();
public void notifyNow() { notifyNow(Frequency.MEDIUM); }
final ResourceWatcherService resourceWatcherService = new ResourceWatcherService(settings, threadPool); final ScriptModule scriptModule = new ScriptModule(settings, pluginsService.filterPlugins(ScriptPlugin.class)); AnalysisModule analysisModule = new AnalysisModule(this.environment, pluginsService.filterPlugins(AnalysisPlugin.class));