Package org.infinispan.statetransfer
Class CommitManager
java.lang.Object
org.infinispan.statetransfer.CommitManager
Keeps track of the keys updated by normal operation and state transfer. Since the command processing happens
concurrently with the state transfer, it needs to keep track of the keys updated by normal command in order to reject
the updates from the state transfer. It assumes that the keys from normal operations are most recent thant the ones
received by state transfer.
- Since:
- 7.0
- Author:
- Pedro Ruivo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal CompletionStage<Void> commit(CacheEntry entry, Flag operation, int segment, boolean l1Only, InvocationContext ctx) It tries to commit the cache entry.final booleanisEmpty()final booleanisTracking(Flag trackFlag) final voidstartTrack(Flag track) It starts tracking keys committed.final voidIt stops tracking keys committed.final voidstopTrackFor(Flag flag, int segmentId) Stop tracking the entries for the given segment if state transfer tracking is enabled.toString()
-
Constructor Details
-
CommitManager
public CommitManager()
-
-
Method Details
-
startTrack
It starts tracking keys committed. All the keys committed will be flagged with this flag. State transfer received after the key is tracked will be discarded.- Parameters:
track- Flag to start tracking keys for local site state transfer or for remote site state transfer.
-
stopTrack
It stops tracking keys committed.- Parameters:
track- Flag to stop tracking keys for local site state transfer or for remote site state transfer.
-
stopTrackFor
Stop tracking the entries for the given segment if state transfer tracking is enabled.- Parameters:
flag- : flag to verify if tracking is enabled.segmentId- : segment to stop tracking.
-
commit
public final CompletionStage<Void> commit(CacheEntry entry, Flag operation, int segment, boolean l1Only, InvocationContext ctx) It tries to commit the cache entry. The entry is not committed if it is originated from state transfer and other operation already has updated it.- Parameters:
entry- the entry to commitoperation- ifnull, it identifies this commit as originated from a normal operation. Otherwise, itctx-
-
isTracking
- Returns:
trueif the flag is being tracked,falseotherwise.
-
isEmpty
public final boolean isEmpty()- Returns:
trueif no keys are tracked,falseotherwise.
-
toString
-