@Override protected void doExecute() { TaskActivator readyActivator; while ((readyActivator = this.readyActivators.poll()) != null) { // Execute the ExecutionTask. final ExecutionTask task = readyActivator.getTask(); final Tuple<List<ChannelInstance>, PartialExecution> executionResult = this.execute(readyActivator, task); readyActivator.dispose(); // Register the outputChannelInstances (to obtain cardinality measurements and for further stages). final List<ChannelInstance> outputChannelInstances = executionResult.getField0(); outputChannelInstances.stream().filter(Objects::nonNull).forEach(this::store); // Log executions. final PartialExecution partialExecution = executionResult.getField1(); if (partialExecution != null) { this.executionState.add(partialExecution); } // Activate successor ExecutionTasks. this.activateSuccessorTasks(task, outputChannelInstances); outputChannelInstances.stream().filter(Objects::nonNull).forEach(ChannelInstance::disposeIfUnreferenced); } }
/** * Executes the {@link ExecutionStage} and contributes results to the {@link #executionState}. */ void executeStage() { this.execute(); this.updateExecutionState(); }