Interface CoordinationState.PersistedState
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
InMemoryPersistedState
- Enclosing class:
- CoordinationState
Pluggable persistence layer for
CoordinationState
.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
long
Returns the current termReturns the last accepted cluster statedefault void
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 Details
-
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
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
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-