Class LinearizabilityChecker.History

java.lang.Object
org.elasticsearch.cluster.coordination.LinearizabilityChecker.History
Enclosing class:
LinearizabilityChecker

public static class LinearizabilityChecker.History extends Object
Sequence of invocations and responses, recording the run of a concurrent system.
  • Constructor Details

  • Method Details

    • invoke

      public int invoke(Object input)
      Appends a new invocation event to the history
      Parameters:
      input - the input value associated with the invocation event
      Returns:
      an id that can be used to record the corresponding response event
    • respond

      public void respond(int id, Object output)
      Appends a new response event to the history
      Parameters:
      id - the id of the corresponding invocation event
      output - the output value associated with the response event
    • remove

      public void remove(int id)
      Removes the events with the corresponding id from the history
      Parameters:
      id - the value of the id to remove
    • copyEvents

      public List<LinearizabilityChecker.Event> copyEvents()
      Copy the list of events for external use.
      Returns:
      list of events in the order recorded.
    • complete

      public void complete(Function<Object,Object> missingResponseGenerator)
      Completes the history with response events for invocations that are missing corresponding responses
      Parameters:
      missingResponseGenerator - a function from invocation input to response output, used to generate the corresponding response
    • clone

      Overrides:
      clone in class Object
    • size

      public int size()
      Returns the number of recorded events
    • toString

      public String toString()
      Overrides:
      toString in class Object