Class InMemoryPersistedState
java.lang.Object
org.elasticsearch.cluster.coordination.InMemoryPersistedState
- All Implemented Interfaces:
Closeable
,AutoCloseable
,CoordinationState.PersistedState
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the current termReturns the last accepted cluster statevoid
setCurrentTerm(long currentTerm)
Sets a new current term.void
setLastAcceptedState(ClusterState clusterState)
Sets a new last accepted cluster state.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.coordination.CoordinationState.PersistedState
close, markLastAcceptedStateAsCommitted
-
Constructor Details
-
InMemoryPersistedState
-
-
Method Details
-
setCurrentTerm
public void setCurrentTerm(long currentTerm)Description copied from interface:CoordinationState.PersistedState
Sets a new current term. After a successful call to this method,CoordinationState.PersistedState.getCurrentTerm()
should return the last term that was set. The value returned byCoordinationState.PersistedState.getLastAcceptedState()
should not be influenced by calls to this method.- Specified by:
setCurrentTerm
in interfaceCoordinationState.PersistedState
-
setLastAcceptedState
Description copied from interface:CoordinationState.PersistedState
Sets a new last accepted cluster state. After a successful call to this method,CoordinationState.PersistedState.getLastAcceptedState()
should return the last cluster state that was set. The value returned byCoordinationState.PersistedState.getCurrentTerm()
should not be influenced by calls to this method.- Specified by:
setLastAcceptedState
in interfaceCoordinationState.PersistedState
-
getCurrentTerm
public long getCurrentTerm()Description copied from interface:CoordinationState.PersistedState
Returns the current term- Specified by:
getCurrentTerm
in interfaceCoordinationState.PersistedState
-
getLastAcceptedState
Description copied from interface:CoordinationState.PersistedState
Returns the last accepted cluster state- Specified by:
getLastAcceptedState
in interfaceCoordinationState.PersistedState
-