org.eclipse.viatra.query.runtime.rete.single

## Class TimelyUniquenessEnforcerNode

- 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.AbstractUniquenessEnforcerNode
      - - org.eclipse.viatra.query.runtime.rete.single.TimelyUniquenessEnforcerNode

- All Implemented Interfaces:
    org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode, IGroupable, NetworkStructureChangeSensitiveNode, Node, Receiver, Supplier, Tunnel
  Direct Known Subclasses:
    TimelyProductionNode

      public class TimelyUniquenessEnforcerNode
      extends AbstractUniquenessEnforcerNode
      implements org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode

  Timely uniqueness enforcer node implementation.
  Since:
    2.4
  No Extend:
    This class is not intended to be subclassed by clients.
  No Instantiate:
    This class is not intended to be instantiated by clients.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CommunicationGroup` | `group`
    `protected TimelyMemory<Timestamp>` | `memory`

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.rete.single.AbstractUniquenessEnforcerNode

      `identityMask, mailbox, memoryIdentityIndexer, memoryNullIndexer, nullMask, parents, specializedListeners, tupleWidth`

    - ### 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 and Description
    `TimelyUniquenessEnforcerNode(ReteContainer container, int tupleWidth)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CommunicationGroup` | `getCurrentGroup()`
    `ProjectionIndexer` | `getIdentityIndexer()`
    `ProjectionIndexer` | `getNullIndexer()`
    `Timestamp` | `getResumableTimestamp()` Returns the smallest timestamp where lazy folding shall be resumed, or null if there is no more folding to do in this resumable.
    `java.util.Collection<Tuple>` | `getTuples()`
    `protected Mailbox` | `instantiateMailbox()`
    `void` | `networkStructureChanged()` At the time of the invocation, the dependency graph has already been updated.
    `void` | `pullInto(java.util.Collection<Tuple> collector, boolean flush)` Pulls the contents of this object in this particular moment into a target collection.
    `void` | `pullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector, boolean flush)`
    `void` | `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 mailbox
    `void` | `update(Direction direction, Tuple update, Timestamp timestamp)` updates the receiver with a newly found or lost partial matching

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.rete.single.AbstractUniquenessEnforcerNode

      `appendParent, assignTraceInfo, constructIndex, getMailbox, getParents, propagate, removeParent`

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.rete.network.StandardNode

      `appendChild, 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.Supplier

      `appendChild, getPulledContents, getPulledContents, getReceivers, removeChild`

- - ### Field Detail

    - #### memory

          protected final TimelyMemory<Timestamp> memory

    - #### group

          protected CommunicationGroup group

      Since:
        2.4

  - ### Constructor Detail

    - #### TimelyUniquenessEnforcerNode

          public TimelyUniquenessEnforcerNode(ReteContainer container,
                                              int tupleWidth)

  - ### Method Detail

    - #### instantiateMailbox

          protected Mailbox instantiateMailbox()

      Specified by:
        `instantiateMailbox` in class `AbstractUniquenessEnforcerNode`

    - #### pullInto

          public void pullInto(java.util.Collection<Tuple> collector,
                               boolean flush)

      Description copied from interface: `Supplier`
      Pulls the contents of this object in this particular moment into a target collection.
      Specified by:
        `pullInto` in interface `Supplier`
        `flush` - if true, flushing of messages is allowed during the pull, otherwise flushing is not allowed

    - #### getCurrentGroup

          public CommunicationGroup getCurrentGroup()

      Specified by:
        `getCurrentGroup` in interface `IGroupable`
      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 interface `IGroupable`

    - #### getTuples

          public java.util.Collection<Tuple> getTuples()

      Specified by:
        `getTuples` in class `AbstractUniquenessEnforcerNode`

    - #### 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 interface `org.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.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 interface `org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode`
      Since:
        2.4

    - #### update

          public void update(Direction direction,
                             Tuple update,
                             Timestamp timestamp)

      Description copied from interface: `Receiver`
      updates the receiver with a newly found or lost partial matching
      Specified by:
        `update` in interface `Receiver`

    - #### pullIntoWithTimeline

          public void pullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector,
                                           boolean flush)

      Specified by:
        `pullIntoWithTimeline` in interface `Supplier`

    - #### getNullIndexer

          public ProjectionIndexer getNullIndexer()

      Specified by:
        `getNullIndexer` in class `AbstractUniquenessEnforcerNode`

    - #### getIdentityIndexer

          public ProjectionIndexer getIdentityIndexer()

      Specified by:
        `getIdentityIndexer` in class `AbstractUniquenessEnforcerNode`

    - #### 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 interface `NetworkStructureChangeSensitiveNode`
      Overrides:
        `networkStructureChanged` in class `StandardNode`