Class LinearizabilityChecker.History
java.lang.Object
org.elasticsearch.cluster.coordination.LinearizabilityChecker.History
- Enclosing class:
- LinearizabilityChecker
public static class LinearizabilityChecker.History
extends java.lang.Object
Sequence of invocations and responses, recording the run of a concurrent system.
-
Constructor Summary
Constructors Constructor Description History()
History(java.util.Collection<LinearizabilityChecker.Event> events)
-
Method Summary
Modifier and Type Method Description LinearizabilityChecker.History
clone()
void
complete(java.util.function.Function<java.lang.Object,java.lang.Object> missingResponseGenerator)
Completes the history with response events for invocations that are missing corresponding responsesjava.util.List<LinearizabilityChecker.Event>
copyEvents()
Copy the list of events for external use.int
invoke(java.lang.Object input)
Appends a new invocation event to the historyvoid
remove(int id)
Removes the events with the corresponding id from the historyvoid
respond(int id, java.lang.Object output)
Appends a new response event to the historyint
size()
Returns the number of recorded eventsjava.lang.String
toString()
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
History
public History() -
History
-
-
Method Details
-
invoke
public int invoke(java.lang.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, java.lang.Object output)Appends a new response event to the history- Parameters:
id
- the id of the corresponding invocation eventoutput
- 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
Copy the list of events for external use.- Returns:
- list of events in the order recorded.
-
complete
public void complete(java.util.function.Function<java.lang.Object,java.lang.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 classjava.lang.Object
-
size
public int size()Returns the number of recorded events -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-