LeftTupleSets srcLeftTuples,
LeftTupleSets trgLeftTuples) {
boolean tupleMemory = true;
BetaMemory bm = am.getBetaMemory();
RightTupleMemory rtm = bm.getRightTupleMemory();
Accumulate accumulate = accNode.getAccumulate();
ContextEntry[] contextEntry = bm.getContext();
BetaConstraints constraints = accNode.getRawConstraints();
FastIterator rightIt = accNode.getRightIterator( rtm );
for ( LeftTuple leftTuple = srcLeftTuples.getUpdateFirst(); leftTuple != null; ) {
LeftTuple next = leftTuple.getStagedNext();
final AccumulateContext accctx = (AccumulateContext) leftTuple.getObject();
PropagationContext context = leftTuple.getPropagationContext();
constraints.updateFromTuple( contextEntry,
wm,
leftTuple );
RightTuple rightTuple = accNode.getFirstRightTuple( leftTuple,
rtm,
context,
rightIt );
LeftTuple childLeftTuple = leftTuple.getFirstChild();
// first check our index (for indexed nodes only) hasn't changed and we are returning the same bucket
// if rightTuple is null, we assume there was a bucket change and that bucket is empty
if ( childLeftTuple != null && rtm.isIndexed() && !rightIt.isFullIterator() && (rightTuple == null || (rightTuple.getMemory() != childLeftTuple.getRightParent().getMemory())) ) {
// our index has changed, so delete all the previous matchings
removePreviousMatchesForLeftTuple( accNode,
accumulate,
leftTuple,
wm,