public class ColumnAggregatorNode<Domain,Accumulator,AggregateResult> extends SingleInputNode implements Clearable, IAggregatorNode, RederivableNode, PosetAwareReceiver
Direct children are nor supported, use via outer join indexers instead.
Modifier and Type | Field and Description |
---|---|
protected TupleMask |
columnMask |
protected CommunicationGroup |
currentGroup |
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, parent
children
communicationTracker, nodeId, 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() |
CommunicationGroup |
getCurrentGroup() |
protected Accumulator |
getMainAccumulator(Tuple key) |
IPosetComparator |
getPosetComparator() |
TupleMask |
getPosetMask() |
protected Accumulator |
getRederivableAccumulator(Tuple key) |
protected Mailbox |
instantiateMailbox()
Instantiates the
Mailbox of this receiver. |
boolean |
isInDRedMode()
Returns true if this node actually runs in DRed mode (not necessarily).
|
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. |
void |
setCurrentGroup(CommunicationGroup currentGroup)
Sets the current group of the mailbox
|
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, removeParent
constructIndex, getPulledContents, getReceivers, issueError, propagateUpdate, removeChild
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString, toStringCore
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
appendParent, getMailbox, getParents, removeParent
acceptPropagatedTraceInfo, assignTraceInfo, getContainer, getNodeId, getTag, getTraceInfos, setTag
constructIndex, getPulledContents, getReceivers, removeChild
protected 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
protected CommunicationGroup currentGroup
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 overpublic boolean isInDRedMode()
RederivableNode
isInDRedMode
in interface RederivableNode
protected Mailbox instantiateMailbox()
SingleInputNode
Mailbox
of this receiver.
Subclasses may override this method to provide their own mailbox implementation.instantiateMailbox
in class SingleInputNode
public TupleMask getCoreMask()
getCoreMask
in interface PosetAwareReceiver
public TupleMask getPosetMask()
getPosetMask
in interface PosetAwareReceiver
public IPosetComparator getPosetComparator()
getPosetComparator
in interface PosetAwareReceiver
public void pullInto(java.util.Collection<Tuple> collector)
Supplier
public void appendChild(Receiver receiver)
Supplier
appendChild
in interface Supplier
appendChild
in class StandardNode
public Indexer getAggregatorOuterIndexer()
getAggregatorOuterIndexer
in interface IAggregatorNode
public Indexer getAggregatorOuterIdentityIndexer(int resultPositionInSignature)
getAggregatorOuterIdentityIndexer
in interface IAggregatorNode
public void rederiveOne()
RederivableNode
ReteContainer
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 RederivableNode
public void update(Direction direction, Tuple update, boolean monotone)
PosetAwareReceiver
update
in interface PosetAwareReceiver
direction
- the direction of the updateupdate
- the update tuplemonotone
- true if the update is monotone, false otherwisepublic void update(Direction direction, Tuple update)
Receiver
protected void updateWithDeleteAndRederive(Direction direction, Tuple update, boolean monotone)
public void propagate(Tuple group, AggregateResult oldValue, AggregateResult newValue)
public void clear()
Clearable
protected 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)
public CommunicationGroup getCurrentGroup()
getCurrentGroup
in interface IGroupable
public void setCurrentGroup(CommunicationGroup currentGroup)
IGroupable
setCurrentGroup
in interface IGroupable