Interface CoordinationState.PersistedState
-
- All Known Implementing Classes:
InMemoryPersistedState
- Enclosing class:
- CoordinationState
public static interface CoordinationState.PersistedState
Pluggable persistence layer forCoordinationState
.
-
-
Method Summary
Modifier and Type Method Description default void
close()
long
getCurrentTerm()
Returns the current termClusterState
getLastAcceptedState()
Returns the last accepted cluster statedefault void
markLastAcceptedStateAsCommitted()
Marks the last accepted cluster state as committed.void
setCurrentTerm(long currentTerm)
Sets a new current term.void
setLastAcceptedState(ClusterState clusterState)
Sets a new last accepted cluster state.
-
-
-
Method Detail
-
getCurrentTerm
long getCurrentTerm()
Returns the current term
-
getLastAcceptedState
ClusterState getLastAcceptedState()
Returns the last accepted cluster state
-
setCurrentTerm
void setCurrentTerm(long currentTerm)
Sets a new current term. After a successful call to this method,getCurrentTerm()
should return the last term that was set. The value returned bygetLastAcceptedState()
should not be influenced by calls to this method.
-
setLastAcceptedState
void setLastAcceptedState(ClusterState clusterState)
Sets a new last accepted cluster state. After a successful call to this method,getLastAcceptedState()
should return the last cluster state that was set. The value returned bygetCurrentTerm()
should not be influenced by calls to this method.
-
markLastAcceptedStateAsCommitted
default void markLastAcceptedStateAsCommitted()
Marks the last accepted cluster state as committed. After a successful call to this method,getLastAcceptedState()
should return the last cluster state that was set, with the last committed configuration now corresponding to the last accepted configuration, and the cluster uuid, if set, marked as committed.
-
close
default void close()
-
-