@Inject public ExecutorManager(final Props azkProps, final ExecutorLoader loader, final AlerterHolder alerterHolder, final CommonMetrics commonMetrics, final ExecutorApiGateway apiGateway) throws ExecutorManagerException { this.alerterHolder = alerterHolder; this.azkProps = azkProps; this.commonMetrics = commonMetrics; this.executorLoader = loader; this.apiGateway = apiGateway; this.setupExecutors(); this.loadRunningFlows(); this.queuedFlows = new QueuedExecutions( azkProps.getLong(Constants.ConfigurationKeys.WEBSERVER_QUEUE_SIZE, 100000)); // The default threshold is set to 30 for now, in case some users are affected. We may // decrease this number in future, to better prevent DDos attacks. this.maxConcurrentRunsOneFlow = azkProps .getInt(Constants.ConfigurationKeys.MAX_CONCURRENT_RUNS_ONEFLOW, DEFAULT_MAX_ONCURRENT_RUNS_ONEFLOW); this.loadQueuedFlows(); this.cacheDir = new File(azkProps.getString("cache.directory", "cache")); this.executingManager = new ExecutingManagerUpdaterThread(); if (isMultiExecutorMode()) { setupMultiExecutorMode(); } final long executionLogsRetentionMs = azkProps.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); this.cleanerThread = new CleanerThread(executionLogsRetentionMs); }
public ExecutorManager(Props props, ExecutorLoader loader, Map<String, Alerter> alters) throws ExecutorManagerException { this.executorLoader = loader; this.loadRunningFlows(); executorHost = props.getString("executor.host", "localhost"); executorPort = props.getInt("executor.port"); alerters = alters; cacheDir = new File(props.getString("cache.directory", "cache")); executingManager = new ExecutingManagerUpdaterThread(); executingManager.start(); long executionLogsRetentionMs = props.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); cleanerThread = new CleanerThread(executionLogsRetentionMs); cleanerThread.start(); }
private CleanerThread createCleanerThread() { final long executionLogsRetentionMs = this.azkProps.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); return new CleanerThread(executionLogsRetentionMs); }