Class PairsHistory

All Implemented Interfaces:
Serializable, Cloneable, Iterable<ArrayList<akka.japi.Pair<Integer,Utils.Decision>>>, Collection<ArrayList<akka.japi.Pair<Integer,Utils.Decision>>>, List<ArrayList<akka.japi.Pair<Integer,Utils.Decision>>>, RandomAccess, SequencedCollection<ArrayList<akka.japi.Pair<Integer,Utils.Decision>>>

public class PairsHistory extends ArrayList<ArrayList<akka.japi.Pair<Integer,Utils.Decision>>>
PairsHistory class to store the history of the pairs and the final decision associated to it
See Also:
  • Constructor Details

    • PairsHistory

      public PairsHistory()
      Default constructor.
    • PairsHistory

      public PairsHistory(@NotNull @NotNull PairsHistory sourceObject)
      Copy constructor.
      Parameters:
      sourceObject - source object to copy
  • Method Details

    • setState

      public void setState(int e, int i, Utils.Decision finalState)
      Get the state of the given epoch and iteration.
      Parameters:
      e - epoch
      i - iteration
      finalState - final state to set
    • readValidVariable

      public int readValidVariable()
      Read the last valid, i.e., committed, variable.
      Returns:
      the last valid variable, -1 in case none is set
    • insert

      public void insert(int e, int i, int element)
      Insert a new element in the history.
      Parameters:
      e - epoch
      i - iteration
      element - element to insert
    • getLatest

      public Utils.EpochPair getLatest()
      Get the latest epoch and iteration.
      Returns:
      the latest epoch and iteration
    • getLatestCommitted

      public Utils.EpochPair getLatestCommitted()
      Get the epoch and iteration of the last commited transaction, by commited transaction we consider a transaction that has non-pending state.
      Returns:
      the latest epoch and iteration committed
    • toString

      public String toString()
      Overrides:
      toString in class AbstractCollection<ArrayList<akka.japi.Pair<Integer,Utils.Decision>>>