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:
Externalizable
,Serializable
,MemoryFactory
,NetworkNode
,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, 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
addAssociation, addAssociation, attach, doRemove, getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, 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.core.common.NetworkNode
getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getPartitionId, getType, isAssociatedWith
-
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, RuleBasePartitionId partitionId)
Description copied from class:BaseNode
Sets the partition this node belongs to- Overrides:
setPartitionId
in classBaseNode
-
setLeftListenedProperties
protected void setLeftListenedProperties(Collection<String> leftListenedProperties)
- Overrides:
setLeftListenedProperties
in classLeftTupleSource
-
initInferredMask
public void initInferredMask()
-
initInferredMask
protected void initInferredMask(LeftTupleSource leftInput)
- Overrides:
initInferredMask
in classLeftTupleSource
-
unwrapRightInput
public ObjectSource unwrapRightInput()
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classLeftTupleSource
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classLeftTupleSource
- Throws:
IOException
-
assertObject
public void assertObject(InternalFactHandle factHandle, PropagationContext pctx, InternalWorkingMemory wm)
- Specified by:
assertObject
in interfaceObjectSink
-
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory wm)
- Specified by:
modifyObject
in interfaceObjectSink
-
reorderRightTuple
protected void reorderRightTuple(InternalWorkingMemory wm, RightTuple rightTuple)
-
doDeleteRightTuple
public void doDeleteRightTuple(RightTuple rightTuple, InternalWorkingMemory wm, BetaMemory memory)
-
doUpdateRightTuple
public void doUpdateRightTuple(RightTuple rightTuple, InternalWorkingMemory wm, BetaMemory memory)
-
isRightInputIsRiaNode
public boolean isRightInputIsRiaNode()
-
isRightInputPassive
public boolean isRightInputPassive()
-
getRightInput
public ObjectSource getRightInput()
-
setRightInput
public void setRightInput(ObjectSource rightInput)
-
getRightIterator
public FastIterator getRightIterator(TupleMemory memory)
-
getRightIterator
public FastIterator getRightIterator(TupleMemory memory, RightTuple rightTuple)
-
getLeftIterator1
public FastIterator getLeftIterator1(TupleMemory memory)
-
getFirstRightTuple
public RightTuple getFirstRightTuple(Tuple leftTuple, TupleMemory memory, InternalFactHandle factHandle, FastIterator it)
-
getFirstLeftTuple1
public LeftTuple getFirstLeftTuple1(RightTuple rightTuple, TupleMemory memory, FastIterator it)
-
getLeftIterator
public FastIterator getLeftIterator(TupleMemory memory)
-
getFirstLeftTuple
public LeftTuple getFirstLeftTuple(RightTuple rightTuple, TupleMemory memory, FastIterator it)
-
getFirstTuple
public static Tuple getFirstTuple(TupleMemory memory, FastIterator it)
-
isIndexedUnificationJoin
public boolean isIndexedUnificationJoin()
-
getConstraints
public 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
-
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, InternalWorkingMemory workingMemory)
- Specified by:
byPassModifyToBetaNode
in interfaceObjectSink
-
getBetaMemory
public static BetaMemory getBetaMemory(BetaNode node, InternalWorkingMemory wm)
-
isObjectMemoryEnabled
public boolean isObjectMemoryEnabled()
-
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()
- Specified by:
isLeftTupleMemoryEnabled
in interfaceLeftTupleSink
- Specified by:
isLeftTupleMemoryEnabled
in classLeftTupleSource
-
setLeftTupleMemoryEnabled
public void setLeftTupleMemoryEnabled(boolean tupleMemoryEnabled)
- Specified by:
setLeftTupleMemoryEnabled
in interfaceLeftTupleSink
-
createMemory
public Memory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm)
- Specified by:
createMemory
in interfaceMemoryFactory
-
dumpMemory
public void dumpMemory(InternalWorkingMemory workingMemory)
-
calculateHashCode
protected int calculateHashCode()
-
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, InternalWorkingMemory workingMemory)
-
getRightDeclaredMask
public BitMask getRightDeclaredMask()
-
setRightDeclaredMask
public void setRightDeclaredMask(BitMask rightDeclaredMask)
-
getRightInferredMask
public BitMask getRightInferredMask()
-
getRightNegativeMask
public BitMask getRightNegativeMask()
-
getRightInputOtnId
public ObjectTypeNode.Id getRightInputOtnId()
- Specified by:
getRightInputOtnId
in interfaceRightTupleSink
-
setRightInputOtnId
public void setRightInputOtnId(ObjectTypeNode.Id rightInputOtnId)
-
-