Class OutputCachingEvaluatorNode
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.rete.network.BaseNode
-
- org.eclipse.viatra.query.runtime.rete.network.StandardNode
-
- org.eclipse.viatra.query.runtime.rete.single.SingleInputNode
-
- org.eclipse.viatra.query.runtime.rete.eval.AbstractEvaluatorNode
-
- org.eclipse.viatra.query.runtime.rete.eval.OutputCachingEvaluatorNode
-
- All Implemented Interfaces:
Clearable,IEvaluatorNode,org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode,IGroupable,NetworkStructureChangeSensitiveNode,Node,Receiver,Supplier,Tunnel
public class OutputCachingEvaluatorNode extends AbstractEvaluatorNode implements Clearable, org.eclipse.viatra.query.runtime.rete.network.communication.timely.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 Classes Modifier and Type Class Description protected static classOutputCachingEvaluatorNode.NetworkStructureChangeSensitiveLogic
-
Field Summary
Fields Modifier and Type Field Description protected CommunicationGroupgroupprotected OutputCachingEvaluatorNode.NetworkStructureChangeSensitiveLogiclogicprotected TimelyMemory<Timestamp>memoryMaps input tuples to timestamps.protected java.util.Map<Tuple,java.lang.Iterable<Tuple>>outputCache-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.eval.AbstractEvaluatorNode
core
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.single.SingleInputNode
mailbox, parent
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.network.StandardNode
childMailboxes, children
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos
-
-
Constructor Summary
Constructors Constructor Description OutputCachingEvaluatorNode(ReteContainer reteContainer, EvaluatorCore core)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear all partial matchings stored in memoryprotected OutputCachingEvaluatorNode.NetworkStructureChangeSensitiveLogiccreateLogic()CommunicationGroupgetCurrentGroup()TimestampgetResumableTimestamp()Returns the smallest timestamp where lazy folding shall be resumed, or null if there is no more folding to do in this resumable.voidnetworkStructureChanged()At the time of the invocation, the dependency graph has already been updated.voidpullInto(java.util.Collection<Tuple> collector, boolean flush)Pulls the contents of this object in this particular moment into a target collection.voidpullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector, boolean flush)voidresumeAt(Timestamp timestamp)When called, the folding of the state shall be resumed at the given timestamp.voidsetCurrentGroup(CommunicationGroup group)Sets the current group of the mailboxvoidupdate(Direction direction, Tuple input, Timestamp timestamp)Updates the receiver with a newly found or lost partial matching.-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.eval.AbstractEvaluatorNode
getReteContainer, prettyPrintTraceInfoPatternList, propagateIterableUpdate
-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.single.SingleInputNode
appendParent, assignTraceInfo, getCommunicationTracker, getMailbox, getParents, instantiateMailbox, propagatePullInto, propagatePullIntoWithTimestamp, removeParent
-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.network.StandardNode
appendChild, constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, propagateUpdate, removeChild
-
Methods inherited from class org.eclipse.viatra.query.runtime.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 org.eclipse.viatra.query.runtime.rete.network.Node
acceptPropagatedTraceInfo, assignTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTag
-
Methods inherited from interface org.eclipse.viatra.query.runtime.rete.network.Receiver
batchUpdate
-
Methods inherited from interface org.eclipse.viatra.query.runtime.rete.network.Supplier
appendChild, constructIndex, getPulledContents, getPulledContents, getReceivers, removeChild
-
-
-
-
Field Detail
-
logic
protected OutputCachingEvaluatorNode.NetworkStructureChangeSensitiveLogic logic
- Since:
- 2.3
-
memory
protected TimelyMemory<Timestamp> 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
protected CommunicationGroup group
- Since:
- 2.4
-
-
Constructor Detail
-
OutputCachingEvaluatorNode
public OutputCachingEvaluatorNode(ReteContainer reteContainer, EvaluatorCore core)
- Since:
- 1.5
-
-
Method Detail
-
getCurrentGroup
public CommunicationGroup getCurrentGroup()
- Specified by:
getCurrentGroupin interfaceIGroupable- Returns:
- the current group of the mailbox
-
setCurrentGroup
public void setCurrentGroup(CommunicationGroup group)
Description copied from interface:IGroupableSets the current group of the mailbox- Specified by:
setCurrentGroupin interfaceIGroupable
-
networkStructureChanged
public void networkStructureChanged()
Description copied from interface:NetworkStructureChangeSensitiveNodeAt the time of the invocation, the dependency graph has already been updated.- Specified by:
networkStructureChangedin interfaceNetworkStructureChangeSensitiveNode- Overrides:
networkStructureChangedin classStandardNode
-
clear
public void clear()
Description copied from interface:ClearableClear all partial matchings stored in memory
-
createLogic
protected OutputCachingEvaluatorNode.NetworkStructureChangeSensitiveLogic createLogic()
- Since:
- 2.3
-
pullInto
public void pullInto(java.util.Collection<Tuple> collector, boolean flush)
Description copied from interface:SupplierPulls the contents of this object in this particular moment into a target collection.
-
pullIntoWithTimeline
public void pullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector, boolean flush)
- Specified by:
pullIntoWithTimelinein interfaceSupplier
-
update
public void update(Direction direction, Tuple input, Timestamp timestamp)
Description copied from interface:ReceiverUpdates the receiver with a newly found or lost partial matching.
-
getResumableTimestamp
public Timestamp getResumableTimestamp()
Description copied from interface:org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNodeReturns the smallest timestamp where lazy folding shall be resumed, or null if there is no more folding to do in this resumable.- Specified by:
getResumableTimestampin interfaceorg.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode- Since:
- 2.4
-
resumeAt
public void resumeAt(Timestamp timestamp)
Description copied from interface:org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNodeWhen 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:
resumeAtin interfaceorg.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode- Since:
- 2.4
-
-