Class IndexerWithMemory
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.rete.network.BaseNode
-
- org.eclipse.viatra.query.runtime.rete.index.StandardIndexer
-
- org.eclipse.viatra.query.runtime.rete.index.IndexerWithMemory
-
- All Implemented Interfaces:
Indexer
,org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode
,IGroupable
,NetworkStructureChangeSensitiveNode
,Node
,Receiver
- Direct Known Subclasses:
GenericProjectionIndexer
public abstract class IndexerWithMemory extends StandardIndexer implements Receiver, NetworkStructureChangeSensitiveNode, org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
IndexerWithMemory.NetworkStructureChangeSensitiveLogic
-
Field Summary
Fields Modifier and Type Field Description protected CommunicationGroup
group
protected IndexerWithMemory.NetworkStructureChangeSensitiveLogic
logic
protected Mailbox
mailbox
protected MaskedTupleMemory<Timestamp>
memory
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.index.StandardIndexer
mask, parent
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos
-
-
Constructor Summary
Constructors Constructor Description IndexerWithMemory(ReteContainer reteContainer, TupleMask mask)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
appendParent(Supplier supplier)
appends a parent that will continuously send insert and revoke updates to this supplierprotected IndexerWithMemory.NetworkStructureChangeSensitiveLogic
createLogic()
CommunicationGroup
getCurrentGroup()
Mailbox
getMailbox()
Returns theMailbox
of this receiver.MaskedTupleMemory<Timestamp>
getMemory()
java.util.Collection<Supplier>
getParents()
access active parentTimestamp
getResumableTimestamp()
Returns the smallest timestamp where lazy folding shall be resumed, or null if there is no more folding to do in this resumable.protected Mailbox
instantiateMailbox()
Instantiates theMailbox
of this receiver.void
networkStructureChanged()
At the time of the invocation, the dependency graph has already been updated.void
removeParent(Supplier supplier)
removes a parentvoid
resumeAt(Timestamp timestamp)
When called, the folding of the state shall be resumed at the given timestamp.void
setCurrentGroup(CommunicationGroup group)
Sets the current group of the mailboxprotected abstract void
update(Direction direction, Tuple updateElement, Tuple signature, boolean change, Timestamp timestamp)
Refined version of updatevoid
update(Direction direction, Tuple updateElement, Timestamp timestamp)
Updates the receiver with a newly found or lost partial matching.-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.index.StandardIndexer
assignTraceInfo, attachListener, detachListener, getContainer, getListeners, getMask, getParent, propagate, toStringCore
-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.network.BaseNode
acceptPropagatedTraceInfo, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString
-
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.index.Indexer
get, getActiveNode, getTimeline
-
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
-
-
-
-
Field Detail
-
memory
protected MaskedTupleMemory<Timestamp> memory
-
logic
protected IndexerWithMemory.NetworkStructureChangeSensitiveLogic logic
- Since:
- 2.3
-
mailbox
protected final Mailbox mailbox
- Since:
- 1.6
-
group
protected CommunicationGroup group
- Since:
- 2.4
-
-
Constructor Detail
-
IndexerWithMemory
public IndexerWithMemory(ReteContainer reteContainer, TupleMask mask)
-
-
Method Detail
-
getCurrentGroup
public CommunicationGroup getCurrentGroup()
- Specified by:
getCurrentGroup
in interfaceIGroupable
- Returns:
- the current group of the mailbox
-
setCurrentGroup
public void setCurrentGroup(CommunicationGroup group)
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 classStandardIndexer
-
instantiateMailbox
protected Mailbox instantiateMailbox()
Instantiates theMailbox
of this receiver. Subclasses may override this method to provide their own mailbox implementation.- Returns:
- the mailbox
- Since:
- 2.0
-
getMailbox
public Mailbox getMailbox()
Description copied from interface:Receiver
Returns theMailbox
of this receiver.- Specified by:
getMailbox
in interfaceReceiver
- Returns:
- the mailbox
-
getMemory
public MaskedTupleMemory<Timestamp> getMemory()
- Since:
- 2.0
-
update
public void update(Direction direction, Tuple updateElement, Timestamp timestamp)
Description copied from interface:Receiver
Updates the receiver with a newly found or lost partial matching.
-
update
protected abstract void update(Direction direction, Tuple updateElement, Tuple signature, boolean change, Timestamp timestamp)
Refined version of update- Since:
- 2.4
-
appendParent
public void appendParent(Supplier supplier)
Description copied from interface:Receiver
appends a parent that will continuously send insert and revoke updates to this supplier- Specified by:
appendParent
in interfaceReceiver
-
removeParent
public void removeParent(Supplier supplier)
Description copied from interface:Receiver
removes a parent- Specified by:
removeParent
in interfaceReceiver
-
getParents
public java.util.Collection<Supplier> getParents()
Description copied from interface:Receiver
access active parent- Specified by:
getParents
in interfaceReceiver
- Since:
- 2.4
-
resumeAt
public void resumeAt(Timestamp timestamp)
Description copied from interface:org.eclipse.viatra.query.runtime.rete.network.communication.timely.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 interfaceorg.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode
- Since:
- 2.4
-
getResumableTimestamp
public Timestamp getResumableTimestamp()
Description copied from interface:org.eclipse.viatra.query.runtime.rete.network.communication.timely.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 interfaceorg.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode
- Since:
- 2.4
-
createLogic
protected IndexerWithMemory.NetworkStructureChangeSensitiveLogic createLogic()
- Since:
- 2.3
-
-