Class IndexerBasedAggregatorNode
java.lang.Object
tools.refinery.interpreter.rete.network.BaseNode
tools.refinery.interpreter.rete.network.StandardNode
tools.refinery.interpreter.rete.aggregation.IndexerBasedAggregatorNode
- All Implemented Interfaces:
IAggregatorNode
,NetworkStructureChangeSensitiveNode
,Node
,Supplier
- Direct Known Subclasses:
CountNode
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 tools.refinery.interpreter.rete.network.StandardNode
childMailboxes, children
Fields inherited from class tools.refinery.interpreter.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos
-
Constructor Summary
ConstructorsConstructorDescriptionIndexerBasedAggregatorNode
(ReteContainer reteContainer) MUST call initializeWith() afterwards! -
Method Summary
Modifier and TypeMethodDescriptionprotected Tuple
aggregateAndPack
(Tuple signature, Collection<Tuple> group) abstract Object
aggregateGroup
(Tuple signature, Collection<Tuple> group) Aggregates (reduces) a group of tuples.aggregateGroupAfterUpdate
(Tuple signature, Collection<Tuple> currentGroup, 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 void
aggregateUpdate
(Direction direction, Tuple updateElement, Tuple signature, boolean change) void
assignTraceInfo
(TraceInfo traceInfo) assigns new traceability info to this nodegetAggregatorOuterIdentityIndexer
(int resultPositionInSignature) void
initializeWith
(ProjectionIndexer projection) void
At the time of the invocation, the dependency graph has already been updated.protected Tuple
packResult
(Tuple signature, Object result) void
pullInto
(Collection<Tuple> collector, boolean flush) Pulls the contents of this object in this particular moment into a target collection.void
pullIntoWithTimeline
(Map<Tuple, Timeline<Timestamp>> collector, boolean flush) Methods inherited from class tools.refinery.interpreter.rete.network.StandardNode
appendChild, constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, propagateUpdate, removeChild
Methods inherited from class tools.refinery.interpreter.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 tools.refinery.interpreter.rete.network.Node
acceptPropagatedTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTag
Methods inherited from interface tools.refinery.interpreter.rete.network.Supplier
getPulledContents
-
Constructor Details
-
IndexerBasedAggregatorNode
MUST call initializeWith() afterwards!
-
-
Method Details
-
networkStructureChanged
public void networkStructureChanged()Description copied from interface:NetworkStructureChangeSensitiveNode
At the time of the invocation, the dependency graph has already been updated.- Specified by:
networkStructureChanged
in interfaceNetworkStructureChangeSensitiveNode
- Overrides:
networkStructureChanged
in classStandardNode
-
initializeWith
- Parameters:
projection
- the projection indexer whose tuple groups should be aggregated
-
aggregateGroup
Aggregates (reduces) a group of tuples. The group can be null. -
aggregateGroupAfterUpdate
public Object aggregateGroupAfterUpdate(Tuple signature, Collection<Tuple> currentGroup, 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
-
getAggregatorOuterIndexer
- Specified by:
getAggregatorOuterIndexer
in interfaceIAggregatorNode
-
getAggregatorOuterIdentityIndexer
- Specified by:
getAggregatorOuterIdentityIndexer
in interfaceIAggregatorNode
-
pullInto
Description copied from interface:Supplier
Pulls the contents of this object in this particular moment into a target collection. -
pullIntoWithTimeline
- Specified by:
pullIntoWithTimeline
in interfaceSupplier
-
packResult
-
aggregateUpdate
protected void aggregateUpdate(Direction direction, Tuple updateElement, Tuple signature, boolean change) - Since:
- 2.4
-
assignTraceInfo
Description copied from interface:Node
assigns new traceability info to this node- Specified by:
assignTraceInfo
in interfaceNode
- Overrides:
assignTraceInfo
in classBaseNode
-