Class InMemoryPersistedState
- java.lang.Object
-
- org.elasticsearch.cluster.coordination.InMemoryPersistedState
-
- All Implemented Interfaces:
CoordinationState.PersistedState
public class InMemoryPersistedState extends java.lang.Object implements CoordinationState.PersistedState
-
-
Constructor Summary
Constructors Constructor Description InMemoryPersistedState(long term, ClusterState acceptedState)
-
Method Summary
Modifier and Type Method Description long
getCurrentTerm()
Returns the current termClusterState
getLastAcceptedState()
Returns 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
markLastAcceptedStateAsCommitted
-
-
-
-
Constructor Detail
-
InMemoryPersistedState
public InMemoryPersistedState(long term, ClusterState acceptedState)
-
-
Method Detail
-
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
public void setLastAcceptedState(ClusterState clusterState)
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
public ClusterState getLastAcceptedState()
Description copied from interface:CoordinationState.PersistedState
Returns the last accepted cluster state- Specified by:
getLastAcceptedState
in interfaceCoordinationState.PersistedState
-
-