if (constraints.isAllowedCachedRight(bm.getContext(),
leftTuple)) {
if (leftTuple.getStagedType() == LeftTuple.NONE) {
trgLeftTuples.addUpdate(leftTuple);
}
final AccumulateContext accctx = (AccumulateContext) leftTuple.getObject();
// add a new match
addMatch(accNode,
accumulate,
leftTuple,
rightTuple,
null,
null,
wm,
am,
accctx,
true);
}
}
} else {
// in the same bucket, so iterate and compare
for (; leftTuple != null; leftTuple = (LeftTuple) leftIt.next(leftTuple)) {
if (constraints.isAllowedCachedRight(bm.getContext(),
leftTuple)) {
if (leftTuple.getStagedType() == LeftTuple.NONE) {
trgLeftTuples.addUpdate(leftTuple);
}
final AccumulateContext accctx = (AccumulateContext) leftTuple.getObject();
LeftTuple temp = null;
if (childLeftTuple != null && childLeftTuple.getLeftParent() == leftTuple) {
temp = childLeftTuple.getRightParentNext();
// we must re-add this to ensure deterministic iteration
childLeftTuple.reAddLeft();
removeMatch(accNode,
accumulate,
rightTuple,
childLeftTuple,
wm,
am,
accctx,
true);
childLeftTuple = temp;
}
// add a new match
addMatch(accNode,
accumulate,
leftTuple,
rightTuple,
null,
childLeftTuple,
wm,
am,
accctx,
true);
if (temp != null) {
childLeftTuple = temp;
}
} else if (childLeftTuple != null && childLeftTuple.getLeftParent() == leftTuple) {
if (leftTuple.getStagedType() == LeftTuple.NONE) {
trgLeftTuples.addUpdate(leftTuple);
}
LeftTuple temp = childLeftTuple.getRightParentNext();
final AccumulateContext accctx = (AccumulateContext) leftTuple.getObject();
// remove the match
removeMatch(accNode,
accumulate,
rightTuple,
childLeftTuple,