public Channel initializeOutputChannel(int index, Configuration configuration) { final ChannelDescriptor channelDescriptor = this.operator.getOutputChannelDescriptor(index); final OutputSlot<?> output = this.operator.getNumOutputs() == 0 ? null : this.operator.getOutput(index); final Channel channel = channelDescriptor.createChannel(output, configuration); this.setOutputChannel(index, channel); return channel; }
private void connectToSuccessorTasks(int outputIndex, Platform platform, Collection<Activation> collector) { final OutputSlot<?> output = this.operator.getOutput(outputIndex); // TODO: Make generic: There might be multiple OutputSlots for final loop outputs (one for each iteration). final Junction junction = this.getJunction(output); LoggerFactory.getLogger(this.getClass()).debug("Connecting {} -> {}.", output, junction); assert junction != null : String.format("No junction found for %s.", output); this.executionTask.setOutputChannel(outputIndex, junction.getSourceChannel()); for (int targetIndex = 0; targetIndex < junction.getNumTargets(); targetIndex++) { final Channel targetChannel = junction.getTargetChannel(targetIndex); final InputSlot<?> targetInput = junction.getTargetInput(targetIndex); final ExecutionTask successorTask = ExecutionTaskFlowCompiler.this.getOrCreateExecutionTask((ExecutionOperator) targetInput.getOwner()); targetChannel.addConsumer(successorTask, targetInput.getIndex()); this.createActivation(targetInput.unchecked(), collector); } }