@Override public Collection<Executor> getAllActiveExecutors() { return Collections.unmodifiableCollection(this.activeExecutors.getAll()); }
private void updateRemainingExecutorsAndSleep(final Set<Executor> remainingExecutors, final Executor selectedExecutor) { remainingExecutors.remove(selectedExecutor); if (remainingExecutors.isEmpty()) { remainingExecutors.addAll(ExecutorManager.this.activeExecutors.getAll()); sleepAfterDispatchFailure(); } }
@Override public Set<String> getPrimaryServerHosts() { // Only one for now. More probably later. final HashSet<String> ports = new HashSet<>(); for (final Executor executor : this.activeExecutors.getAll()) { ports.add(executor.getHost() + ":" + executor.getPort()); } return ports; }
/** * {@inheritDoc} * * @see azkaban.executor.ExecutorManagerAdapter#fetchExecutor(int) */ @Override public Executor fetchExecutor(final int executorId) throws ExecutorManagerException { for (final Executor executor : this.activeExecutors.getAll()) { if (executor.getId() == executorId) { return executor; } } return this.executorLoader.fetchExecutor(executorId); }
@Override public Set<String> getAllActiveExecutorServerHosts() { // Includes non primary server/hosts final HashSet<String> ports = new HashSet<>(); for (final Executor executor : this.activeExecutors.getAll()) { ports.add(executor.getHost() + ":" + executor.getPort()); } // include executor which were initially active and still has flows running for (final Pair<ExecutionReference, ExecutableFlow> running : this.runningExecutions.get() .values()) { final ExecutionReference ref = running.getFirst(); if (ref.getExecutor().isPresent()) { final Executor executor = ref.getExecutor().get(); ports.add(executor.getHost() + ":" + executor.getPort()); } } return ports; }
private QueueProcessorThread setupQueueProcessor() { return new QueueProcessorThread( this.azkProps.getBoolean(Constants.ConfigurationKeys.QUEUEPROCESSING_ENABLED, true), this.azkProps.getLong(Constants.ConfigurationKeys.ACTIVE_EXECUTOR_REFRESH_IN_MS, 50000), this.azkProps.getInt( Constants.ConfigurationKeys.ACTIVE_EXECUTOR_REFRESH_IN_NUM_FLOW, 5), this.azkProps.getInt( Constants.ConfigurationKeys.MAX_DISPATCHING_ERRORS_PERMITTED, this.activeExecutors.getAll().size()), this.sleepAfterDispatchFailure); }
for (final Executor executor : this.activeExecutors.getAll()) {
throws ExecutorManagerException { final Set<Executor> remainingExecutors = new HashSet<>( ExecutorManager.this.activeExecutors.getAll()); Throwable lastError; synchronized (exflow) {