Interface CoordinationState.PersistedState

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
InMemoryPersistedState
Enclosing class:
CoordinationState

public static interface CoordinationState.PersistedState extends Closeable
Pluggable persistence layer for CoordinationState.
  • 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 by getLastAcceptedState() 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 by getCurrentTerm() 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() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException