Class IndexerBasedAggregatorNode
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.rete.network.BaseNode
-
- org.eclipse.viatra.query.runtime.rete.network.StandardNode
-
- org.eclipse.viatra.query.runtime.rete.aggregation.IndexerBasedAggregatorNode
-
- All Implemented Interfaces:
IAggregatorNode,NetworkStructureChangeSensitiveNode,Node,Supplier
- Direct Known Subclasses:
CountNode
public abstract class IndexerBasedAggregatorNode extends StandardNode implements IAggregatorNode
A special node depending on a projection indexer to aggregate tuple groups with the same projection. Only propagates the aggregates of non-empty groups. Use the outer indexers to circumvent.This node cannot be used in recursive differential dataflow evaluation.
- Since:
- 1.4
-
-
Field Summary
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.network.StandardNode
childMailboxes, children
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos
-
-
Constructor Summary
Constructors Constructor Description IndexerBasedAggregatorNode(ReteContainer reteContainer)MUST call initializeWith() afterwards!
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected TupleaggregateAndPack(Tuple signature, java.util.Collection<Tuple> group)abstract java.lang.ObjectaggregateGroup(Tuple signature, java.util.Collection<Tuple> group)Aggregates (reduces) a group of tuples.java.lang.ObjectaggregateGroupAfterUpdate(Tuple signature, java.util.Collection<Tuple> currentGroup, java.lang.Object oldAggregate, Direction direction, Tuple updateElement, boolean change)Aggregates (reduces) a group of tuples, having access to the previous aggregated value (before the update) and the update definition.protected voidaggregateUpdate(Direction direction, Tuple updateElement, Tuple signature, boolean change)voidassignTraceInfo(TraceInfo traceInfo)assigns new traceability info to this nodeIndexergetAggregatorOuterIdentityIndexer(int resultPositionInSignature)IndexergetAggregatorOuterIndexer()voidinitializeWith(ProjectionIndexer projection)voidnetworkStructureChanged()At the time of the invocation, the dependency graph has already been updated.protected TuplepackResult(Tuple signature, java.lang.Object result)voidpullInto(java.util.Collection<Tuple> collector, boolean flush)Pulls the contents of this object in this particular moment into a target collection.voidpullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector, boolean flush)-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.network.StandardNode
appendChild, constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, propagateUpdate, removeChild
-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.network.BaseNode
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString, toStringCore
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.rete.network.Node
acceptPropagatedTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTag
-
Methods inherited from interface org.eclipse.viatra.query.runtime.rete.network.Supplier
getPulledContents
-
-
-
-
Constructor Detail
-
IndexerBasedAggregatorNode
public IndexerBasedAggregatorNode(ReteContainer reteContainer)
MUST call initializeWith() afterwards!
-
-
Method Detail
-
networkStructureChanged
public void networkStructureChanged()
Description copied from interface:NetworkStructureChangeSensitiveNodeAt the time of the invocation, the dependency graph has already been updated.- Specified by:
networkStructureChangedin interfaceNetworkStructureChangeSensitiveNode- Overrides:
networkStructureChangedin classStandardNode
-
initializeWith
public void initializeWith(ProjectionIndexer projection)
- Parameters:
projection- the projection indexer whose tuple groups should be aggregated
-
aggregateGroup
public abstract java.lang.Object aggregateGroup(Tuple signature, java.util.Collection<Tuple> group)
Aggregates (reduces) a group of tuples. The group can be null.
-
aggregateGroupAfterUpdate
public java.lang.Object aggregateGroupAfterUpdate(Tuple signature, java.util.Collection<Tuple> currentGroup, java.lang.Object oldAggregate, Direction direction, Tuple updateElement, boolean change)
Aggregates (reduces) a group of tuples, having access to the previous aggregated value (before the update) and the update definition. Defaults to aggregateGroup(). Override to increase performance.- Since:
- 2.4
-
aggregateAndPack
protected Tuple aggregateAndPack(Tuple signature, java.util.Collection<Tuple> group)
-
getAggregatorOuterIndexer
public Indexer getAggregatorOuterIndexer()
- Specified by:
getAggregatorOuterIndexerin interfaceIAggregatorNode
-
getAggregatorOuterIdentityIndexer
public Indexer getAggregatorOuterIdentityIndexer(int resultPositionInSignature)
- Specified by:
getAggregatorOuterIdentityIndexerin interfaceIAggregatorNode
-
pullInto
public void pullInto(java.util.Collection<Tuple> collector, boolean flush)
Description copied from interface:SupplierPulls the contents of this object in this particular moment into a target collection.
-
pullIntoWithTimeline
public void pullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector, boolean flush)
- Specified by:
pullIntoWithTimelinein interfaceSupplier
-
aggregateUpdate
protected void aggregateUpdate(Direction direction, Tuple updateElement, Tuple signature, boolean change)
- Since:
- 2.4
-
assignTraceInfo
public void assignTraceInfo(TraceInfo traceInfo)
Description copied from interface:Nodeassigns new traceability info to this node- Specified by:
assignTraceInfoin interfaceNode- Overrides:
assignTraceInfoin classBaseNode
-
-