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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LinearizabilityChecker.Event
static class
LinearizabilityChecker.EventType
static class
LinearizabilityChecker.History
Sequence of invocations and responses, recording the run of a concurrent system.static interface
LinearizabilityChecker.KeyedSpec
Sequential specification of a datatype that allows for keyed access, providing compositional checking (seeLinearizabilityChecker.SequentialSpec.partition(List)
).static interface
LinearizabilityChecker.SequentialSpec
Sequential specification of a datatype. -
Constructor Summary
Constructors Constructor Description LinearizabilityChecker()
-
Method Summary
Modifier and Type Method Description boolean
isLinearizable(LinearizabilityChecker.SequentialSpec spec, LinearizabilityChecker.History history)
Convenience method forisLinearizable(SequentialSpec, History, Function)
that requires the history to be completeboolean
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 specificationboolean
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 specificationstatic 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
-
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 datatypehistory
- the history of events to check for linearizabilitymissingResponseGenerator
- 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 datatypehistory
- the history of events to check for linearizabilitymissingResponseGenerator
- used to complete the history with missing responsesterminateEarly
- 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 forisLinearizable(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
-