Package org.drools.core.reteoo
Class BetaNode
java.lang.Object
org.drools.core.common.BaseNode
org.drools.core.reteoo.LeftTupleSource
org.drools.core.reteoo.BetaNode
- All Implemented Interfaces:
Serializable,NetworkNode,MemoryFactory,LeftTupleNode,LeftTupleSink,LeftTupleSinkNode,ObjectSink,ObjectSinkNode,RightTupleSink,Sink
- Direct Known Subclasses:
AccumulateNode,ExistsNode,JoinNode,NotNode
public abstract class BetaNode
extends LeftTupleSource
implements LeftTupleSinkNode, ObjectSinkNode, RightTupleSink, MemoryFactory
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUsed with the updateSink method, so that the parent ObjectSource can update the TupleSink -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BetaConstraintsprotected booleanprotected static final booleanprotected static final org.slf4j.Loggerprotected booleanprotected ObjectSourceprotected booleanprotected booleanFields inherited from class org.drools.core.reteoo.LeftTupleSource
leftDeclaredMask, leftInferredMask, leftInput, leftNegativeMask, sinkFields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId -
Constructor Summary
ConstructorsModifierConstructorDescriptionBetaNode()protectedBetaNode(int id, LeftTupleSource leftInput, ObjectSource rightInput, BetaConstraints constraints, BuildContext context) Constructs aBetaNodeusing the specifiedBetaNodeBinder. -
Method Summary
Modifier and TypeMethodDescriptionvoidassertObject(InternalFactHandle factHandle, PropagationContext pctx, ReteEvaluator reteEvaluator) voidbyPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) protected intcreateMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator) createRightTuple(InternalFactHandle handle, RightTupleSink sink, PropagationContext context) voiddoAttach(BuildContext context) voiddoDeleteRightTuple(TupleImpl rightTuple, ReteEvaluator reteEvaluator, BetaMemory memory) voiddoUpdateRightTuple(TupleImpl rightTuple, ReteEvaluator reteEvaluator, BetaMemory memory) booleanstatic BetaMemorygetBetaMemory(NetworkNode node, ReteEvaluator reteEvaluator) static BetaMemorygetBetaMemoryFromRightInput(BetaNode betaNode, ReteEvaluator reteEvaluator) getFirstLeftTuple(TupleImpl rightTuple, TupleMemory memory, FastIterator<TupleImpl> it) getFirstRightTuple(TupleImpl leftTuple, TupleMemory memory, FastIterator<TupleImpl> it) static TupleImplgetFirstTuple(TupleMemory memory, FastIterator<TupleImpl> it) getLeftIterator(TupleMemory memory) Returns the next nodeReturns the next nodeReturns the previous nodeReturns the previous nodeorg.drools.util.bitmask.BitMaskorg.drools.util.bitmask.BitMaskgetRightIterator(TupleMemory memory) org.drools.util.bitmask.BitMaskgetRules()protected voidinitDeclaredMask(BuildContext context, LeftTupleSource leftInput) voidprotected voidinitInferredMask(LeftTupleSource leftInput) booleanbooleanbooleanbooleanbooleanvoidmodifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) voidnetworkUpdated(UpdateContext updateContext) A method that is called for all nodes whose network below them changed, after the change is complete, providing them with an opportunity for state updateprotected voidreorderRightTuple(ReteEvaluator reteEvaluator, TupleImpl rightTuple) protected voidsetLeftListenedProperties(Collection<String> leftListenedProperties) voidSets the next nodevoidSets the next nodevoidsetPartitionId(BuildContext context, RuleBasePartitionId partitionId) Sets the partition this node belongs tovoidSets the previous nodevoidsetPreviousObjectSinkNode(ObjectSinkNode previous) Sets the previous nodevoidsetRightInput(ObjectSource rightInput) voidsetRightInputOtnId(ObjectTypeNodeId rightInputOtnId) toString()Methods inherited from class org.drools.core.reteoo.LeftTupleSource
addTupleSink, addTupleSink, addTupleSink, getFirstLeftTupleSinkIgnoreRemoving, getLeftDeclaredMask, getLeftInferredMask, getLeftInputOtnId, getLeftInputPattern, getLeftNegativeMask, getLeftTupleSource, getObjectCount, getObjectType, getObjectTypeForPropertyReactivity, getPathIndex, getSinkPropagator, getType, initMasks, isInUse, removeTupleSink, setLeftInferredMask, setLeftInputOtnId, setLeftTupleSource, setNodeConstraintsPropertyReactiveMask, setObjectCount, setPartitionIdWithSinks, setSourcePartitionId, setSourcePartitionIdMethods inherited from class org.drools.core.common.BaseNode
addAssociatedTerminal, addAssociation, addAssociation, attach, doRemove, getAssociatedRules, getAssociatedTerminalsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hasAssociatedTerminal, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociatedTerminal, removeAssociation, setId, setStreamModeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.drools.core.reteoo.LeftTupleNode
getLeftTupleSource, getObjectCount, getPathIndex, getSinkPropagator, setObjectCountMethods inherited from interface org.drools.core.reteoo.LeftTupleSink
getLeftInferredMask, getLeftInputOtnId, setLeftInputOtnId, setPartitionIdWithSinksMethods inherited from interface org.drools.core.common.MemoryFactory
getMemoryIdMethods inherited from interface org.drools.base.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, getType, hasAssociatedTerminal, isAssociatedWith, removeAssociatedTerminalMethods inherited from interface org.drools.core.reteoo.ObjectSinkNode
setPartitionIdWithSinksMethods inherited from interface org.drools.core.reteoo.RightTupleSink
modifyRightTuple, retractRightTuple
-
Field Details
-
log
protected static final org.slf4j.Logger log -
isLogTraceEnabled
protected static final boolean isLogTraceEnabled -
rightInput
-
constraints
-
objectMemory
protected boolean objectMemory -
tupleMemoryEnabled
protected boolean tupleMemoryEnabled -
indexedUnificationJoin
protected boolean indexedUnificationJoin -
rightInputIsRiaNode
protected boolean rightInputIsRiaNode
-
-
Constructor Details
-
BetaNode
public BetaNode() -
BetaNode
protected BetaNode(int id, LeftTupleSource leftInput, ObjectSource rightInput, BetaConstraints constraints, BuildContext context) Constructs aBetaNodeusing the specifiedBetaNodeBinder.- Parameters:
leftInput- The left inputTupleSource.rightInput- The right inputObjectSource.
-
-
Method Details
-
initDeclaredMask
- Overrides:
initDeclaredMaskin classLeftTupleSource
-
setPartitionId
Description copied from class:BaseNodeSets the partition this node belongs to- Overrides:
setPartitionIdin classBaseNode
-
setLeftListenedProperties
- Overrides:
setLeftListenedPropertiesin classLeftTupleSource
-
initInferredMask
public void initInferredMask() -
initInferredMask
- Overrides:
initInferredMaskin classLeftTupleSource
-
unwrapRightInput
-
assertObject
public void assertObject(InternalFactHandle factHandle, PropagationContext pctx, ReteEvaluator reteEvaluator) - Specified by:
assertObjectin interfaceObjectSink
-
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
modifyObjectin interfaceObjectSink
-
reorderRightTuple
-
doDeleteRightTuple
public void doDeleteRightTuple(TupleImpl rightTuple, ReteEvaluator reteEvaluator, BetaMemory memory) -
doUpdateRightTuple
public void doUpdateRightTuple(TupleImpl rightTuple, ReteEvaluator reteEvaluator, BetaMemory memory) -
isRightInputIsRiaNode
public boolean isRightInputIsRiaNode()- Specified by:
isRightInputIsRiaNodein interfaceNetworkNode
-
isRightInputPassive
public boolean isRightInputPassive() -
getRightInput
-
setRightInput
-
getRightIterator
-
getFirstRightTuple
public RightTuple getFirstRightTuple(TupleImpl leftTuple, TupleMemory memory, FastIterator<TupleImpl> it) -
getLeftIterator
-
getFirstLeftTuple
public TupleImpl getFirstLeftTuple(TupleImpl rightTuple, TupleMemory memory, FastIterator<TupleImpl> it) -
getStartTuple
-
getFirstTuple
-
isIndexedUnificationJoin
public boolean isIndexedUnificationJoin() -
getConstraints
-
getRawConstraints
-
networkUpdated
Description copied from class:BaseNodeA method that is called for all nodes whose network below them changed, after the change is complete, providing them with an opportunity for state update- Specified by:
networkUpdatedin classBaseNode
-
getRules
-
getObjectTypeNode
- Specified by:
getObjectTypeNodein classBaseNode
-
doAttach
-
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
byPassModifyToBetaNodein interfaceObjectSink
-
getBetaMemory
-
isObjectMemoryEnabled
public boolean isObjectMemoryEnabled() -
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()- Specified by:
isLeftTupleMemoryEnabledin interfaceLeftTupleSink- Specified by:
isLeftTupleMemoryEnabledin classLeftTupleSource
-
createMemory
- Specified by:
createMemoryin interfaceMemoryFactory
-
toString
-
calculateHashCode
protected int calculateHashCode() -
equals
-
getNextLeftTupleSinkNode
Returns the next node- Specified by:
getNextLeftTupleSinkNodein interfaceLeftTupleSinkNode- Returns:
- The next TupleSinkNode
-
setNextLeftTupleSinkNode
Sets the next node- Specified by:
setNextLeftTupleSinkNodein interfaceLeftTupleSinkNode- Parameters:
next- The next TupleSinkNode
-
getPreviousLeftTupleSinkNode
Returns the previous node- Specified by:
getPreviousLeftTupleSinkNodein interfaceLeftTupleSinkNode- Returns:
- The previous TupleSinkNode
-
setPreviousLeftTupleSinkNode
Sets the previous node- Specified by:
setPreviousLeftTupleSinkNodein interfaceLeftTupleSinkNode- Parameters:
previous- The previous TupleSinkNode
-
getNextObjectSinkNode
Returns the next node- Specified by:
getNextObjectSinkNodein interfaceObjectSinkNode- Returns:
- The next ObjectSinkNode
-
setNextObjectSinkNode
Sets the next node- Specified by:
setNextObjectSinkNodein interfaceObjectSinkNode- Parameters:
next- The next ObjectSinkNode
-
getPreviousObjectSinkNode
Returns the previous node- Specified by:
getPreviousObjectSinkNodein interfaceObjectSinkNode- Returns:
- The previous ObjectSinkNode
-
setPreviousObjectSinkNode
Sets the previous node- Specified by:
setPreviousObjectSinkNodein interfaceObjectSinkNode- Parameters:
previous- The previous ObjectSinkNode
-
createRightTuple
public RightTuple createRightTuple(InternalFactHandle handle, RightTupleSink sink, PropagationContext context) -
getBetaMemoryFromRightInput
public static BetaMemory getBetaMemoryFromRightInput(BetaNode betaNode, ReteEvaluator reteEvaluator) -
getRightDeclaredMask
public org.drools.util.bitmask.BitMask getRightDeclaredMask() -
getRightInferredMask
public org.drools.util.bitmask.BitMask getRightInferredMask() -
getRightNegativeMask
public org.drools.util.bitmask.BitMask getRightNegativeMask() -
getRightInputOtnId
- Specified by:
getRightInputOtnIdin interfaceRightTupleSink
-
setRightInputOtnId
-