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:
java.io.Serializable
,org.drools.base.common.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BetaConstraints
constraints
protected boolean
indexedUnificationJoin
protected static boolean
isLogTraceEnabled
protected static org.slf4j.Logger
log
protected boolean
objectMemory
protected ObjectSource
rightInput
protected boolean
rightInputIsRiaNode
protected boolean
tupleMemoryEnabled
-
Fields inherited from class org.drools.core.reteoo.LeftTupleSource
leftDeclaredMask, leftInferredMask, leftInput, leftNegativeMask, sink
-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
Constructor Summary
Constructors Modifier Constructor Description BetaNode()
protected
BetaNode(int id, LeftTupleSource leftInput, ObjectSource rightInput, BetaConstraints constraints, BuildContext context)
Constructs aBetaNode
using the specifiedBetaNodeBinder
.
-
Method Summary
-
Methods inherited from class org.drools.core.reteoo.LeftTupleSource
addTupleSink, addTupleSink, addTupleSink, createPeer, getFirstLeftTupleSinkIgnoreRemoving, getLeftDeclaredMask, getLeftInferredMask, getLeftInputOtnId, getLeftInputPattern, getLeftNegativeMask, getLeftTupleSource, getObjectCount, getObjectType, getObjectTypeForPropertyReactivity, getPathIndex, getSinkPropagator, getType, initMasks, isInUse, removeTupleSink, setLeftInferredMask, setLeftInputOtnId, setLeftTupleSource, setNodeConstraintsPropertyReactiveMask, setObjectCount, setPartitionIdWithSinks, setSourcePartitionId, setSourcePartitionId
-
Methods 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, setPartitionsEnabled, setStreamMode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.reteoo.LeftTupleNode
getLeftTupleSource, getObjectCount, getPathIndex, getSinkPropagator, setObjectCount
-
Methods inherited from interface org.drools.core.reteoo.LeftTupleSink
createLeftTuple, createLeftTuple, createLeftTuple, createLeftTuple, createLeftTuple, createPeer, getLeftInferredMask, getLeftInputOtnId, setLeftInputOtnId, setPartitionIdWithSinks
-
Methods inherited from interface org.drools.core.common.MemoryFactory
getMemoryId
-
Methods inherited from interface org.drools.base.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, getType, hasAssociatedTerminal, isAssociatedWith, removeAssociatedTerminal
-
Methods inherited from interface org.drools.core.reteoo.ObjectSinkNode
setPartitionIdWithSinks
-
Methods inherited from interface org.drools.core.reteoo.RightTupleSink
modifyRightTuple, retractRightTuple
-
-
-
-
Field Detail
-
log
protected static final org.slf4j.Logger log
-
isLogTraceEnabled
protected static final boolean isLogTraceEnabled
-
rightInput
protected ObjectSource rightInput
-
constraints
protected BetaConstraints constraints
-
objectMemory
protected boolean objectMemory
-
tupleMemoryEnabled
protected boolean tupleMemoryEnabled
-
indexedUnificationJoin
protected boolean indexedUnificationJoin
-
rightInputIsRiaNode
protected boolean rightInputIsRiaNode
-
-
Constructor Detail
-
BetaNode
public BetaNode()
-
BetaNode
protected BetaNode(int id, LeftTupleSource leftInput, ObjectSource rightInput, BetaConstraints constraints, BuildContext context)
Constructs aBetaNode
using the specifiedBetaNodeBinder
.- Parameters:
leftInput
- The left inputTupleSource
.rightInput
- The right inputObjectSource
.
-
-
Method Detail
-
initDeclaredMask
protected void initDeclaredMask(BuildContext context, LeftTupleSource leftInput)
- Overrides:
initDeclaredMask
in classLeftTupleSource
-
setPartitionId
public void setPartitionId(BuildContext context, org.drools.base.common.RuleBasePartitionId partitionId)
Description copied from class:BaseNode
Sets the partition this node belongs to- Overrides:
setPartitionId
in classBaseNode
-
setLeftListenedProperties
protected void setLeftListenedProperties(java.util.Collection<java.lang.String> leftListenedProperties)
- Overrides:
setLeftListenedProperties
in classLeftTupleSource
-
initInferredMask
public void initInferredMask()
-
initInferredMask
protected void initInferredMask(LeftTupleSource leftInput)
- Overrides:
initInferredMask
in classLeftTupleSource
-
unwrapRightInput
public ObjectSource unwrapRightInput()
-
assertObject
public void assertObject(InternalFactHandle factHandle, PropagationContext pctx, ReteEvaluator reteEvaluator)
- Specified by:
assertObject
in interfaceObjectSink
-
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
- Specified by:
modifyObject
in interfaceObjectSink
-
reorderRightTuple
protected void reorderRightTuple(ReteEvaluator reteEvaluator, RightTuple rightTuple)
-
doDeleteRightTuple
public void doDeleteRightTuple(RightTuple rightTuple, ReteEvaluator reteEvaluator, BetaMemory memory)
-
doUpdateRightTuple
public void doUpdateRightTuple(RightTuple rightTuple, ReteEvaluator reteEvaluator, BetaMemory memory)
-
isRightInputIsRiaNode
public boolean isRightInputIsRiaNode()
- Specified by:
isRightInputIsRiaNode
in interfaceorg.drools.base.common.NetworkNode
-
isRightInputPassive
public boolean isRightInputPassive()
-
getRightInput
public ObjectSource getRightInput()
-
setRightInput
public void setRightInput(ObjectSource rightInput)
-
getRightIterator
public FastIterator<Tuple> getRightIterator(TupleMemory memory)
-
getFirstRightTuple
public RightTuple getFirstRightTuple(Tuple leftTuple, TupleMemory memory, FastIterator<Tuple> it)
-
getLeftIterator
public FastIterator<Tuple> getLeftIterator(TupleMemory memory)
-
getFirstLeftTuple
public LeftTuple getFirstLeftTuple(RightTuple rightTuple, TupleMemory memory, FastIterator<Tuple> it)
-
getFirstTuple
public static Tuple getFirstTuple(TupleMemory memory, FastIterator<Tuple> it)
-
isIndexedUnificationJoin
public boolean isIndexedUnificationJoin()
-
getConstraints
public org.drools.base.rule.constraint.BetaNodeFieldConstraint[] getConstraints()
-
getRawConstraints
public BetaConstraints getRawConstraints()
-
networkUpdated
public void networkUpdated(UpdateContext updateContext)
Description copied from class:BaseNode
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 update- Specified by:
networkUpdated
in classBaseNode
-
getRules
public java.util.List<java.lang.String> getRules()
-
getObjectTypeNode
public ObjectTypeNode getObjectTypeNode()
- Specified by:
getObjectTypeNode
in classBaseNode
-
doAttach
public void doAttach(BuildContext context)
-
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
- Specified by:
byPassModifyToBetaNode
in interfaceObjectSink
-
getBetaMemory
public static BetaMemory getBetaMemory(BetaNode node, ReteEvaluator reteEvaluator)
-
isObjectMemoryEnabled
public boolean isObjectMemoryEnabled()
-
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()
- Specified by:
isLeftTupleMemoryEnabled
in interfaceLeftTupleSink
- Specified by:
isLeftTupleMemoryEnabled
in classLeftTupleSource
-
createMemory
public Memory createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator)
- Specified by:
createMemory
in interfaceMemoryFactory
-
calculateHashCode
protected int calculateHashCode()
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
getNextLeftTupleSinkNode
public LeftTupleSinkNode getNextLeftTupleSinkNode()
Returns the next node- Specified by:
getNextLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Returns:
- The next TupleSinkNode
-
setNextLeftTupleSinkNode
public void setNextLeftTupleSinkNode(LeftTupleSinkNode next)
Sets the next node- Specified by:
setNextLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Parameters:
next
- The next TupleSinkNode
-
getPreviousLeftTupleSinkNode
public LeftTupleSinkNode getPreviousLeftTupleSinkNode()
Returns the previous node- Specified by:
getPreviousLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Returns:
- The previous TupleSinkNode
-
setPreviousLeftTupleSinkNode
public void setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
Sets the previous node- Specified by:
setPreviousLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Parameters:
previous
- The previous TupleSinkNode
-
getNextObjectSinkNode
public ObjectSinkNode getNextObjectSinkNode()
Returns the next node- Specified by:
getNextObjectSinkNode
in interfaceObjectSinkNode
- Returns:
- The next ObjectSinkNode
-
setNextObjectSinkNode
public void setNextObjectSinkNode(ObjectSinkNode next)
Sets the next node- Specified by:
setNextObjectSinkNode
in interfaceObjectSinkNode
- Parameters:
next
- The next ObjectSinkNode
-
getPreviousObjectSinkNode
public ObjectSinkNode getPreviousObjectSinkNode()
Returns the previous node- Specified by:
getPreviousObjectSinkNode
in interfaceObjectSinkNode
- Returns:
- The previous ObjectSinkNode
-
setPreviousObjectSinkNode
public void setPreviousObjectSinkNode(ObjectSinkNode previous)
Sets the previous node- Specified by:
setPreviousObjectSinkNode
in 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.core.util.bitmask.BitMask getRightDeclaredMask()
-
getRightInferredMask
public org.drools.core.util.bitmask.BitMask getRightInferredMask()
-
getRightNegativeMask
public org.drools.core.util.bitmask.BitMask getRightNegativeMask()
-
getRightInputOtnId
public ObjectTypeNode.Id getRightInputOtnId()
- Specified by:
getRightInputOtnId
in interfaceRightTupleSink
-
setRightInputOtnId
public void setRightInputOtnId(ObjectTypeNode.Id rightInputOtnId)
-
-