Interface ServiceContext


public interface ServiceContext
State machine context.

The context is reflective of the current position and state of the Raft state machine. In particular, it exposes the current approximate time and all open Sessions.

  • Method Details

    • serviceId

      PrimitiveId serviceId()
      Returns the state machine identifier.
      Returns:
      The unique state machine identifier.
    • serviceName

      String serviceName()
      Returns the state machine name.
      Returns:
      The state machine name.
    • serviceType

      PrimitiveType serviceType()
      Returns the state machine type.
      Returns:
      The state machine type.
    • localMemberId

      io.atomix.cluster.MemberId localMemberId()
      Returns the local member ID
      Returns:
      The local member ID
    • serviceConfig

      <C extends ServiceConfig> C serviceConfig()
      Returns the service configuration.
      Type Parameters:
      C - the configuration type
      Returns:
      the service configuration
    • currentIndex

      long currentIndex()
      Returns the current state machine index.

      The state index is indicative of the index of the current operation being applied to the server state machine. If a query is being applied, the index of the last command applied will be used.

      Returns:
      The current state machine index.
    • currentSession

      Session currentSession()
      Returns the current session.
      Returns:
      the current session
    • currentOperation

      OperationType currentOperation()
      Returns the current operation type.
      Returns:
      the current operation type
    • logicalClock

      io.atomix.utils.time.LogicalClock logicalClock()
      Returns the state machine's logical clock.
      Returns:
      The state machine's logical clock.
    • wallClock

      io.atomix.utils.time.WallClock wallClock()
      Returns the state machine's wall clock.
      Returns:
      The state machine's wall clock.