protected InternalAccumulator() { super(SharedExecutors.getTimer(), MAX_ITEMS, MAX_BATCH_MILLIS, MAX_IDLE_MILLIS); }
@Modified protected void modified(ComponentContext context) { Dictionary<?, ?> properties = context.getProperties(); Integer poolSize = Tools.getIntegerProperty(properties, SHARED_THREAD_POOL_SIZE); if (poolSize != null && poolSize > 1) { sharedThreadPoolSize = poolSize; SharedExecutors.setPoolSize(sharedThreadPoolSize); } else if (poolSize != null) { log.warn("sharedThreadPoolSize must be greater than 1"); } Integer timeLimit = Tools.getIntegerProperty(properties, MAX_EVENT_TIME_LIMIT); if (timeLimit != null && timeLimit >= 0) { maxEventTimeLimit = timeLimit; eventDeliveryService.setDispatchTimeLimit(maxEventTimeLimit); } else if (timeLimit != null) { log.warn("maxEventTimeLimit must be greater than or equal to 0"); } Boolean performanceCheck = Tools.isPropertyEnabled(properties, CALCULATE_PERFORMANCE_CHECK); if (performanceCheck != null) { calculatePoolPerformance = performanceCheck; SharedExecutors.setMetricsService(calculatePoolPerformance ? metricsService : null); } log.info("Settings: sharedThreadPoolSize={}, maxEventTimeLimit={}, calculatePoolPerformance={}", sharedThreadPoolSize, maxEventTimeLimit, calculatePoolPerformance); } }
@Deactivate protected void deactivate() { cfgService.unregisterProperties(getClass(), false); SharedExecutors.shutdown(); SharedScheduledExecutors.shutdown(); }
@Activate public void activate() { cfgService.registerConfigFactory(configFactory); driverAdminService.addListener(driverListener); checkMissingMergedDrivers(); if (!missingMergedDrivers.isEmpty()) { // Missing drivers should be created upon detecting registration // events of a new pipeconf or a base driver. If, for any reason, we // miss such event, here's a watchdog task. SharedExecutors.getPoolThreadExecutor() .execute(this::missingDriversWatchdogTask); } log.info("Started"); }
private void startWatchdog() { log.info("Starting watchdog task for dispatcher {}", name); watchdog = new Watchdog(); SharedExecutors.getTimer().schedule(watchdog, WATCHDOG_MS, WATCHDOG_MS); }
public synchronized void start() { // Initially start polling quickly. Then drop down to configured value log.debug("Starting Stats collection thread for {}", sw.getStringId()); task = new InternalTimerTask(); SharedExecutors.getTimer().scheduleAtFixedRate(task, 1 * SECONDS, pollInterval * SECONDS); }
public synchronized void start() { // Initially start polling quickly. Then drop down to configured value log.debug("Starting Table Stats collection thread for {}", sw.getStringId()); task = new InternalTimerTask(); SharedExecutors.getTimer().scheduleAtFixedRate(task, 1 * SECONDS, pollInterval * SECONDS); }