public class ColumnAggregatorNode<Domain,Accumulator,AggregateResult> extends SingleInputNode implements Clearable, IAggregatorNode, RederivableNode, MonotonicityAwareReceiver
Direct children are nor supported, use via outer join indexers instead.
| Modifier and Type | Field and Description |
|---|---|
protected TupleMask |
columnMask |
protected boolean |
deleteRederiveEvaluation |
protected TupleMask |
groupMask |
protected java.util.Map<Tuple,Accumulator> |
memory |
protected IMultisetAggregationOperator<Domain,Accumulator,AggregateResult> |
operator |
protected IPosetComparator |
posetComparator |
protected java.util.Map<Tuple,Accumulator> |
rederivableMemory |
protected IQueryRuntimeContext |
runtimeContext |
protected int |
sourceWidth |
mailbox, parentchildrennodeId, reteContainer, tag, traceInfos| Constructor and Description |
|---|
ColumnAggregatorNode(ReteContainer reteContainer,
IMultisetAggregationOperator<Domain,Accumulator,AggregateResult> operator,
boolean deleteRederiveEvaluation,
TupleMask groupMask,
TupleMask columnMask,
IPosetComparator posetComparator)
Creates a new column aggregator node.
|
ColumnAggregatorNode(ReteContainer reteContainer,
IMultisetAggregationOperator<Domain,Accumulator,AggregateResult> operator,
TupleMask groupMask,
int aggregatedColumn)
Creates a new column aggregator node.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendChild(Receiver receiver)
appends a receiver that will continously receive insert and revoke updates from this supplier
|
void |
clear()
Clear all partial matchings stored in memory
|
protected Accumulator |
getAccumulator(Tuple key,
java.util.Map<Tuple,Accumulator> memory) |
AggregateResult |
getAggregateResult(Tuple key) |
Tuple |
getAggregateTuple(Tuple key) |
Indexer |
getAggregatorOuterIdentityIndexer(int resultPositionInSignature) |
Indexer |
getAggregatorOuterIndexer() |
TupleMask |
getCoreMask() |
protected Accumulator |
getMainAccumulator(Tuple key) |
IPosetComparator |
getPosetComparator() |
TupleMask |
getPosetMask() |
protected Accumulator |
getRederivableAccumulator(Tuple key) |
protected Mailbox |
instantiateMailbox()
Instantiates the
Mailbox of this receiver. |
void |
propagate(Tuple group,
AggregateResult oldValue,
AggregateResult newValue) |
void |
pullInto(java.util.Collection<Tuple> collector)
pulls the contents of this object in this particular moment into a target collection
|
void |
rederiveOne()
The method is called by the
ReteContainer to re-derive tuples after the normal messages have been
delivered and consumed. |
protected boolean |
storeIfNotNeutral(Tuple key,
Accumulator accumulator,
java.util.Map<Tuple,Accumulator> memory)
Returns true if the accumulator was stored, false otherwise.
|
protected Tuple |
tupleFromAggregateResult(Tuple groupTuple,
AggregateResult aggregateResult) |
void |
update(Direction direction,
Tuple update)
updates the receiver with a newly found or lost partial matching
|
void |
update(Direction direction,
Tuple update,
boolean monotone)
Updates the receiver with a newly found or lost partial matching also providing information
whether the update is a monotone change or not.
|
protected void |
updateDefault(Direction direction,
Tuple update) |
protected void |
updateWithDeleteAndRederive(Direction direction,
Tuple update,
boolean monotone) |
appendParent, assignTraceInfo, getMailbox, getParents, propagatePullInto, removeParentconstructIndex, getPulledContents, getReceivers, issueError, propagateUpdate, removeChildacceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString, toStringCoreclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitappendParent, getMailbox, getParents, removeParentacceptPropagatedTraceInfo, assignTraceInfo, getContainer, getNodeId, getTag, getTraceInfos, setTagconstructIndex, getPulledContents, getReceivers, removeChildprotected final IMultisetAggregationOperator<Domain,Accumulator,AggregateResult> operator
protected final TupleMask groupMask
protected final TupleMask columnMask
protected final IPosetComparator posetComparator
protected final int sourceWidth
protected final IQueryRuntimeContext runtimeContext
protected final boolean deleteRederiveEvaluation
protected final java.util.Map<Tuple,Accumulator> memory
protected final java.util.Map<Tuple,Accumulator> rederivableMemory
public ColumnAggregatorNode(ReteContainer reteContainer, IMultisetAggregationOperator<Domain,Accumulator,AggregateResult> operator, boolean deleteRederiveEvaluation, TupleMask groupMask, TupleMask columnMask, IPosetComparator posetComparator)
reteContainer - the RETE container of the nodeoperator - the aggregation operatordeleteRederiveEvaluation - true if the node should run in DRED mode, false otherwisegroupMask - 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 overposetComparator - the poset comparator for the column, if known, otherwise it can be nullpublic ColumnAggregatorNode(ReteContainer reteContainer, IMultisetAggregationOperator<Domain,Accumulator,AggregateResult> operator, TupleMask groupMask, int aggregatedColumn)
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 overprotected Mailbox instantiateMailbox()
SingleInputNodeMailbox of this receiver.
Subclasses may override this method to provide their own mailbox implementation.instantiateMailbox in class SingleInputNodepublic TupleMask getCoreMask()
getCoreMask in interface MonotonicityAwareReceiverpublic TupleMask getPosetMask()
getPosetMask in interface MonotonicityAwareReceiverpublic IPosetComparator getPosetComparator()
getPosetComparator in interface MonotonicityAwareReceiverpublic void pullInto(java.util.Collection<Tuple> collector)
Supplierpublic void appendChild(Receiver receiver)
SupplierappendChild in interface SupplierappendChild in class StandardNodepublic Indexer getAggregatorOuterIndexer()
getAggregatorOuterIndexer in interface IAggregatorNodepublic Indexer getAggregatorOuterIdentityIndexer(int resultPositionInSignature)
getAggregatorOuterIdentityIndexer in interface IAggregatorNodepublic void rederiveOne()
RederivableNodeReteContainer to re-derive tuples after the normal messages have been
delivered and consumed. The re-derivation process may trigger the creation and delivery of further messages
and further re-derivation rounds.rederiveOne in interface RederivableNodepublic void update(Direction direction, Tuple update, boolean monotone)
MonotonicityAwareReceiverupdate in interface MonotonicityAwareReceiverdirection - the direction of the updateupdate - the update tuplemonotone - true if the update is monotone, false otherwisepublic void update(Direction direction, Tuple update)
Receiverprotected void updateWithDeleteAndRederive(Direction direction, Tuple update, boolean monotone)
public void propagate(Tuple group, AggregateResult oldValue, AggregateResult newValue)
public void clear()
Clearableprotected boolean storeIfNotNeutral(Tuple key, Accumulator accumulator, java.util.Map<Tuple,Accumulator> memory)
public AggregateResult getAggregateResult(Tuple key)
protected Accumulator getMainAccumulator(Tuple key)
protected Accumulator getRederivableAccumulator(Tuple key)
protected Accumulator getAccumulator(Tuple key, java.util.Map<Tuple,Accumulator> memory)
protected Tuple tupleFromAggregateResult(Tuple groupTuple, AggregateResult aggregateResult)