Class AbstractColumnAggregatorNode<Domain,Accumulator,AggregateResult>
java.lang.Object
tools.refinery.interpreter.rete.network.BaseNode
tools.refinery.interpreter.rete.network.StandardNode
tools.refinery.interpreter.rete.single.SingleInputNode
tools.refinery.interpreter.rete.aggregation.AbstractColumnAggregatorNode<Domain,Accumulator,AggregateResult>
- All Implemented Interfaces:
Clearable
,IAggregatorNode
,NetworkStructureChangeSensitiveNode
,Node
,Receiver
,Supplier
,Tunnel
- Direct Known Subclasses:
ColumnAggregatorNode
,FaithfulTimelyColumnAggregatorNode
,FirstOnlyTimelyColumnAggregatorNode
public abstract class AbstractColumnAggregatorNode<Domain,Accumulator,AggregateResult>
extends SingleInputNode
implements Clearable, IAggregatorNode
Groups incoming tuples by the given mask, and aggregates values at a specific index in each group.
Direct children are not supported, use via outer join indexers instead.
There are both timeless and timely implementations.
- Since:
- 2.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
A special non-iterable index that checks a suspected aggregate value for a given signature.protected class
A special non-iterable index that retrieves the aggregated, packed result (signature+aggregate) for the original signature.protected static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TupleMask
protected final TupleMask
protected final AggregateResult
protected final IMultisetAggregationOperator
<Domain, Accumulator, AggregateResult> protected final IQueryRuntimeContext
protected final int
Fields inherited from class tools.refinery.interpreter.rete.single.SingleInputNode
mailbox, parent
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
ConstructorsConstructorDescriptionAbstractColumnAggregatorNode
(ReteContainer reteContainer, IMultisetAggregationOperator<Domain, Accumulator, AggregateResult> operator, TupleMask groupMask, int aggregatedColumn) Creates a new column aggregator node.AbstractColumnAggregatorNode
(ReteContainer reteContainer, IMultisetAggregationOperator<Domain, Accumulator, AggregateResult> operator, TupleMask groupMask, TupleMask columnMask) Creates a new column aggregator node. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendChild
(Receiver receiver) appends a receiver that will continously receive insert and revoke updates from this supplierabstract AggregateResult
getAggregateResult
(Tuple key) abstract Map
<AggregateResult, Timeline<Timestamp>> abstract Tuple
getAggregateTuple
(Tuple key) getAggregatorOuterIdentityIndexer
(int resultPositionInSignature) void
propagate
(Direction direction, Tuple group, AggregateResult value, Timestamp timestamp) void
propagateAggregateResultUpdate
(Tuple group, AggregateResult oldValue, AggregateResult newValue, Timestamp timestamp) 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) protected Tuple
tupleFromAggregateResult
(Tuple groupTuple, AggregateResult aggregateResult) Methods inherited from class tools.refinery.interpreter.rete.single.SingleInputNode
appendParent, assignTraceInfo, getMailbox, getParents, instantiateMailbox, propagatePullInto, propagatePullIntoWithTimestamp, removeParent
Methods inherited from class tools.refinery.interpreter.rete.network.StandardNode
constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, networkStructureChanged, 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, getContainer, getNodeId, getTag, getTraceInfos, setTag
Methods inherited from interface tools.refinery.interpreter.rete.network.Receiver
batchUpdate, update
Methods inherited from interface tools.refinery.interpreter.rete.network.Supplier
constructIndex, getPulledContents, getPulledContents, getReceivers, removeChild
-
Field Details
-
operator
- Since:
- 1.6
-
groupMask
- Since:
- 1.6
-
columnMask
- Since:
- 1.6
-
sourceWidth
protected final int sourceWidth- Since:
- 1.6
-
runtimeContext
- Since:
- 1.6
-
NEUTRAL
-
aggregatorOuterIndexer
protected AbstractColumnAggregatorNode<Domain,Accumulator, aggregatorOuterIndexerAggregateResult>.AggregatorOuterIndexer -
aggregatorOuterIdentityIndexers
protected AbstractColumnAggregatorNode.AggregatorOuterIdentityIndexer[] aggregatorOuterIdentityIndexers
-
-
Constructor Details
-
AbstractColumnAggregatorNode
public AbstractColumnAggregatorNode(ReteContainer reteContainer, IMultisetAggregationOperator<Domain, Accumulator, AggregateResult> operator, TupleMask groupMask, TupleMask columnMask) Creates a new column aggregator node.- Parameters:
reteContainer
- the RETE container of the nodeoperator
- the aggregation operatorgroupMask
- the mask that masks a tuple to obtain the key that we are grouping-bycolumnMask
- the mask that masks a tuple to obtain the tuple element(s) that we are aggregating overdeleteRederiveEvaluation
- true if the node should run in DRED mode, false otherwiseposetComparator
- the poset comparator for the column, if known, otherwise it can be null- Since:
- 1.6
-
AbstractColumnAggregatorNode
public AbstractColumnAggregatorNode(ReteContainer reteContainer, IMultisetAggregationOperator<Domain, Accumulator, AggregateResult> operator, TupleMask groupMask, int aggregatedColumn) Creates a new column aggregator node.- Parameters:
reteContainer
- the RETE container of the nodeoperator
- the aggregation operatorgroupMask
- the mask that masks a tuple to obtain the key that we are grouping-byaggregatedColumn
- the index of the column that the aggregator node is aggregating over
-
-
Method Details
-
getCommunicationTracker
- Specified by:
getCommunicationTracker
in interfaceNode
- Overrides:
getCommunicationTracker
in classSingleInputNode
-
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
-
appendChild
Description copied from interface:Supplier
appends a receiver that will continously receive insert and revoke updates from this supplier- Specified by:
appendChild
in interfaceSupplier
- Overrides:
appendChild
in classStandardNode
-
getAggregatorOuterIndexer
- Specified by:
getAggregatorOuterIndexer
in interfaceIAggregatorNode
-
getAggregatorOuterIdentityIndexer
- Specified by:
getAggregatorOuterIdentityIndexer
in interfaceIAggregatorNode
-
propagateAggregateResultUpdate
public void propagateAggregateResultUpdate(Tuple group, AggregateResult oldValue, AggregateResult newValue, Timestamp timestamp) - Since:
- 2.4
-
propagate
- Since:
- 2.4
-
getAggregateTuple
-
getAggregateTupleTimeline
- Since:
- 2.4
-
getAggregateResult
-
getAggregateResultTimeline
- Since:
- 2.4
-
tupleFromAggregateResult
-