Class LinearizabilityChecker

java.lang.Object
org.elasticsearch.cluster.coordination.LinearizabilityChecker

public class LinearizabilityChecker
extends java.lang.Object
Basic implementation of the Wing and Gong Graph Search Algorithm, following the descriptions in Gavin Lowe: Testing for linearizability Concurrency and Computation: Practice and Experience 29, 4 (2017). http://dx.doi.org/10.1002/cpe.3928 Alex Horn and Daniel Kroening: Faster linearizability checking via P-compositionality FORTE (2015). http://dx.doi.org/10.1007/978-3-319-19195-9_4
  • Constructor Details

    • LinearizabilityChecker

      public LinearizabilityChecker()
  • Method Details

    • isLinearizable

      public boolean isLinearizable​(LinearizabilityChecker.SequentialSpec spec, LinearizabilityChecker.History history, java.util.function.Function<java.lang.Object,​java.lang.Object> missingResponseGenerator)
      Checks whether the provided history is linearizable with respect to the given sequential specification
      Parameters:
      spec - the sequential specification of the datatype
      history - the history of events to check for linearizability
      missingResponseGenerator - used to complete the history with missing responses
      Returns:
      true iff the history is linearizable w.r.t. the given spec
    • isLinearizable

      public boolean isLinearizable​(LinearizabilityChecker.SequentialSpec spec, LinearizabilityChecker.History history, java.util.function.Function<java.lang.Object,​java.lang.Object> missingResponseGenerator, java.util.function.BooleanSupplier terminateEarly)
      Checks whether the provided history is linearizable with respect to the given sequential specification
      Parameters:
      spec - the sequential specification of the datatype
      history - the history of events to check for linearizability
      missingResponseGenerator - used to complete the history with missing responses
      terminateEarly - a condition upon which to terminate early
      Returns:
      true iff the history is linearizable w.r.t. the given spec
    • isLinearizable

      public boolean isLinearizable​(LinearizabilityChecker.SequentialSpec spec, LinearizabilityChecker.History history)
      Convenience method for isLinearizable(SequentialSpec, History, Function) that requires the history to be complete
    • visualize

      public static java.lang.String visualize​(LinearizabilityChecker.SequentialSpec spec, LinearizabilityChecker.History history, java.util.function.Function<java.lang.Object,​java.lang.Object> missingResponseGenerator)
      Return a visual representation of the history