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 classA special non-iterable index that checks a suspected aggregate value for a given signature.protected classA 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 TupleMaskprotected final TupleMaskprotected final AggregateResultprotected final IMultisetAggregationOperator<Domain, Accumulator, AggregateResult> protected final IQueryRuntimeContextprotected final intFields inherited from class tools.refinery.interpreter.rete.single.SingleInputNode
mailbox, parentFields inherited from class tools.refinery.interpreter.rete.network.StandardNode
childMailboxes, childrenFields 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 TypeMethodDescriptionvoidappendChild(Receiver receiver) appends a receiver that will continously receive insert and revoke updates from this supplierabstract AggregateResultgetAggregateResult(Tuple key) abstract Map<AggregateResult, Timeline<Timestamp>> abstract TuplegetAggregateTuple(Tuple key) getAggregatorOuterIdentityIndexer(int resultPositionInSignature) voidpropagate(Direction direction, Tuple group, AggregateResult value, Timestamp timestamp) voidpropagateAggregateResultUpdate(Tuple group, AggregateResult oldValue, AggregateResult newValue, Timestamp timestamp) voidpullInto(Collection<Tuple> collector, boolean flush) Pulls the contents of this object in this particular moment into a target collection.voidpullIntoWithTimeline(Map<Tuple, Timeline<Timestamp>> collector, boolean flush) protected TupletupleFromAggregateResult(Tuple groupTuple, AggregateResult aggregateResult) Methods inherited from class tools.refinery.interpreter.rete.single.SingleInputNode
appendParent, assignTraceInfo, getMailbox, getParents, instantiateMailbox, propagatePullInto, propagatePullIntoWithTimestamp, removeParentMethods inherited from class tools.refinery.interpreter.rete.network.StandardNode
constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, networkStructureChanged, propagateUpdate, removeChildMethods inherited from class tools.refinery.interpreter.rete.network.BaseNode
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString, toStringCoreMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface tools.refinery.interpreter.rete.network.Node
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfos, setTagMethods inherited from interface tools.refinery.interpreter.rete.network.Receiver
batchUpdate, updateMethods 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:
getCommunicationTrackerin interfaceNode- Overrides:
getCommunicationTrackerin classSingleInputNode
-
pullInto
Description copied from interface:SupplierPulls the contents of this object in this particular moment into a target collection. -
pullIntoWithTimeline
- Specified by:
pullIntoWithTimelinein interfaceSupplier
-
appendChild
Description copied from interface:Supplierappends a receiver that will continously receive insert and revoke updates from this supplier- Specified by:
appendChildin interfaceSupplier- Overrides:
appendChildin classStandardNode
-
getAggregatorOuterIndexer
- Specified by:
getAggregatorOuterIndexerin interfaceIAggregatorNode
-
getAggregatorOuterIdentityIndexer
- Specified by:
getAggregatorOuterIdentityIndexerin 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
-