Class InMemoryPersistedState
java.lang.Object
org.elasticsearch.cluster.coordination.InMemoryPersistedState
- All Implemented Interfaces:
Closeable,AutoCloseable,CoordinationState.PersistedState
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the current termReturns the last accepted cluster statevoidsetCurrentTerm(long currentTerm)Sets a new current term.voidsetLastAcceptedState(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, waitMethods 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.PersistedStateSets 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:
setCurrentTermin interfaceCoordinationState.PersistedState
-
setLastAcceptedState
Description copied from interface:CoordinationState.PersistedStateSets 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:
setLastAcceptedStatein interfaceCoordinationState.PersistedState
-
getCurrentTerm
public long getCurrentTerm()Description copied from interface:CoordinationState.PersistedStateReturns the current term- Specified by:
getCurrentTermin interfaceCoordinationState.PersistedState
-
getLastAcceptedState
Description copied from interface:CoordinationState.PersistedStateReturns the last accepted cluster state- Specified by:
getLastAcceptedStatein interfaceCoordinationState.PersistedState
-