@Override public Tuple<Collection<ExecutionLineageNode>, Collection<ChannelInstance>> aggregate( Tuple<Collection<ExecutionLineageNode>, Collection<ChannelInstance>> accumulator, ChannelLineageNode node) { accumulator.getField1().add(node.getChannelInstance()); return accumulator; }
/** * Adds a predecessor. * * @param predecessor the predecessor */ public void addPredecessor(LazyExecutionLineageNode predecessor) { assert !this.predecessors.contains(predecessor) : String.format("Lineage predecessor %s is already present.", predecessor); this.predecessors.add(predecessor); // TODO: Pinning the input ChannelInstances down like this is not very elegant. // A better solution would be to incorporate all LazyExecutionLineageNodes into the // reference counting scheme. However, this would imply considerable effort to get it right. if (!this.isExecuted && predecessor instanceof ChannelLineageNode) { ChannelInstance channelInstance = ((ChannelLineageNode) predecessor).getChannelInstance(); this.pinnedDownChannelInstances.add(channelInstance); channelInstance.noteObtainedReference(); } }