Class OutputCachingEvaluatorNode
java.lang.Object
tools.refinery.interpreter.rete.network.BaseNode
tools.refinery.interpreter.rete.network.StandardNode
tools.refinery.interpreter.rete.single.SingleInputNode
tools.refinery.interpreter.rete.eval.AbstractEvaluatorNode
tools.refinery.interpreter.rete.eval.OutputCachingEvaluatorNode
- All Implemented Interfaces:
Clearable
,IEvaluatorNode
,ResumableNode
,IGroupable
,NetworkStructureChangeSensitiveNode
,Node
,Receiver
,Supplier
,Tunnel
public class OutputCachingEvaluatorNode
extends AbstractEvaluatorNode
implements Clearable, ResumableNode
An evaluator node that caches the evaluation result. This node is also capable of caching the timestamps associated
with the result tuples if it is used in recursive differential dataflow evaluation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommunicationGroup
protected TimelyMemory
<Timestamp> Maps input tuples to timestamps.Fields inherited from class tools.refinery.interpreter.rete.eval.AbstractEvaluatorNode
core
Fields inherited from class tools.refinery.interpreter.rete.single.SingleInputNode
mailbox, parent
Fields inherited from class tools.refinery.interpreter.rete.network.StandardNode
childMailboxes, children
Fields inherited from class tools.refinery.interpreter.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Returns the smallest timestamp where lazy folding shall be resumed, or null if there is no more folding to do in this resumable.void
At the time of the invocation, the dependency graph has already been updated.void
pullInto
(Collection<Tuple> collector, boolean flush) Pulls the contents of this object in this particular moment into a target collection.void
pullIntoWithTimeline
(Map<Tuple, Timeline<Timestamp>> collector, boolean flush) void
When called, the folding of the state shall be resumed at the given timestamp.void
Sets the current group of the mailboxvoid
Updates the receiver with a newly found or lost partial matching.Methods inherited from class tools.refinery.interpreter.rete.eval.AbstractEvaluatorNode
getReteContainer, prettyPrintTraceInfoPatternList, propagateIterableUpdate
Methods inherited from class tools.refinery.interpreter.rete.single.SingleInputNode
appendParent, assignTraceInfo, getCommunicationTracker, getMailbox, getParents, instantiateMailbox, propagatePullInto, propagatePullIntoWithTimestamp, removeParent
Methods inherited from class tools.refinery.interpreter.rete.network.StandardNode
appendChild, constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, propagateUpdate, removeChild
Methods inherited from class tools.refinery.interpreter.rete.network.BaseNode
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString, toStringCore
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface tools.refinery.interpreter.rete.network.Node
acceptPropagatedTraceInfo, assignTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTag
Methods inherited from interface tools.refinery.interpreter.rete.network.Receiver
batchUpdate
Methods inherited from interface tools.refinery.interpreter.rete.network.Supplier
appendChild, constructIndex, getPulledContents, getPulledContents, getReceivers, removeChild
-
Field Details
-
logic
- Since:
- 2.3
-
outputCache
- Since:
- 2.4
-
memory
Maps input tuples to timestamps. It is wrong to map evaluation result to timestamps because the different input tuples may yield the same evaluation result. This field is null as long as this node is in a non-recursive group.- Since:
- 2.4
-
group
- Since:
- 2.4
-
-
Constructor Details
-
OutputCachingEvaluatorNode
- Since:
- 1.5
-
-
Method Details
-
getCurrentGroup
- Specified by:
getCurrentGroup
in interfaceIGroupable
- Returns:
- the current group of the mailbox
-
setCurrentGroup
Description copied from interface:IGroupable
Sets the current group of the mailbox- Specified by:
setCurrentGroup
in interfaceIGroupable
-
networkStructureChanged
public void networkStructureChanged()Description copied from interface:NetworkStructureChangeSensitiveNode
At the time of the invocation, the dependency graph has already been updated.- Specified by:
networkStructureChanged
in interfaceNetworkStructureChangeSensitiveNode
- Overrides:
networkStructureChanged
in classStandardNode
-
clear
public void clear() -
createLogic
- Since:
- 2.3
-
pullInto
Description copied from interface:Supplier
Pulls the contents of this object in this particular moment into a target collection. -
pullIntoWithTimeline
- Specified by:
pullIntoWithTimeline
in interfaceSupplier
-
update
Description copied from interface:Receiver
Updates the receiver with a newly found or lost partial matching. -
getResumableTimestamp
Description copied from interface:ResumableNode
Returns the smallest timestamp where lazy folding shall be resumed, or null if there is no more folding to do in this resumable.- Specified by:
getResumableTimestamp
in interfaceResumableNode
- Since:
- 2.4
-
resumeAt
Description copied from interface:ResumableNode
When called, the folding of the state shall be resumed at the given timestamp. The resumable is expected to do a folding step at the given timestamp only. Afterwards, folding shall be interrupted, even if there is more folding to do towards higher timestamps.- Specified by:
resumeAt
in interfaceResumableNode
- Since:
- 2.4
-