Packages

class RocksDBStateMachine extends Logging

A state machine that manages the lifecycle of a RocksDB instance

This class enforces proper state transitions and ensures thread-safety for accessing RocksDB instances. It prevents concurrent modifications to the same native RocksDB instance by using a stamp-based locking mechanism.

State Lifecycle: - RELEASED: The RocksDB instance is not being accessed by any thread - ACQUIRED: The RocksDB instance is currently being accessed by a thread - CLOSED: The RocksDB instance has been closed and can no longer be used

Valid Transitions: - RELEASED -> ACQUIRED: When a thread acquires the RocksDB instance - ACQUIRED -> RELEASED: When a thread releases the RocksDB instance - RELEASED -> CLOSED: When the RocksDB instance is shut down - ACQUIRED -> MAINTENANCE: Maintenance can be performed on an acquired RocksDB instance - RELEASED -> MAINTENANCE: Maintenance can be performed on a released RocksDB instance

Stamps: Each time a RocksDB instance is acquired, a unique stamp is generated. This stamp must be presented when performing operations on the RocksDB instance and when releasing it. This ensures that only the stamp owner that acquired the RocksDB instance can release it or perform operations.

Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RocksDBStateMachine
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new RocksDBStateMachine(stateStoreId: StateStoreId, rocksDBConf: RocksDBConf)

Type Members

  1. implicit class LogStringContext extends AnyRef
    Definition Classes
    Logging

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def MDC(key: LogKey, value: Any): MDC
    Attributes
    protected
    Definition Classes
    Logging
  5. def acquireStamp(): Long

    Acquires the RocksDB instance for exclusive use by the calling task.

    Acquires the RocksDB instance for exclusive use by the calling task. Transitions the state from RELEASED to ACQUIRED.

    This method will block if another task currently has a stamp for the RocksDB instance, waiting up to the configured timeout before throwing an exception.

    returns

    A unique stamp that must be used for subsequent operations and release

    Exceptions thrown

    QueryExecutionErrors.unreleasedThreadError if timeout occurs waiting for another thread

    StateStoreInvalidStateMachineTransition if the RocksDB instance is in CLOSED state

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  8. def close(): Boolean

    Closes the RocksDB instance permanently, transitioning it to CLOSED state.

    Closes the RocksDB instance permanently, transitioning it to CLOSED state. Once closed, the RocksDB instance cannot be used again and all future operations will fail.

    This method will block if another task currently has a stamp for the RocksDB instance, waiting up to the configured timeout before throwing an exception.

    Exceptions thrown

    QueryExecutionErrors.unreleasedThreadError if timeout occurs waiting for another thread

    StateStoreInvalidStateMachineTransition if called multiple times (idempotent)

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  13. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  14. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  17. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  18. def logBasedOnLevel(level: Level)(f: => MessageWithContext): Unit
    Attributes
    protected
    Definition Classes
    Logging
  19. def logDebug(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  20. def logDebug(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  21. def logDebug(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  22. def logDebug(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  23. def logError(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  24. def logError(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  25. def logError(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  26. def logError(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  27. def logInfo(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  28. def logInfo(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  29. def logInfo(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  30. def logInfo(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  31. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  32. def logTrace(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  33. def logTrace(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  34. def logTrace(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  35. def logTrace(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  36. def logWarning(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  37. def logWarning(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  38. def logWarning(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  39. def logWarning(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  40. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  41. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  42. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  43. def releaseStamp(stamp: Long, throwEx: Boolean = true): Boolean

    Releases the RocksDB instance, transitioning it from ACQUIRED to RELEASED state.

    Releases the RocksDB instance, transitioning it from ACQUIRED to RELEASED state. This can only be called by the stamp owner that acquired the RocksDB instance.

    stamp

    The stamp that was returned when the RocksDB instance was acquired

    throwEx

    Whether to throw an exception if the stamp is invalid (default: true)

    returns

    true if the RocksDB instance was successfully released, false if stamp was invalid and throwEx=false

    Exceptions thrown

    StateStoreInvalidStamp if stamp is invalid and throwEx=true

    StateStoreInvalidStateMachineTransition if the current state doesn't allow release

  44. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  45. def toString(): String
    Definition Classes
    AnyRef → Any
  46. def verifyForMaintenance(): Unit

    This verifies that it is in a state that allows maintenance to be performed.

    This verifies that it is in a state that allows maintenance to be performed. This operation is allowed in both RELEASED and ACQUIRED states.

    Exceptions thrown

    StateStoreInvalidStateMachineTransition if the RocksDB instance is in CLOSED state

  47. def verifyStamp(stamp: Long): Unit

    Verifies that the provided stamp matches the current valid stamp.

    Verifies that the provided stamp matches the current valid stamp. This ensures that operations are performed by the task that acquired the RocksDB instance.

    stamp

    The stamp to verify against the current valid stamp

    Exceptions thrown

    StateStoreInvalidStamp if the stamp does not match the current valid stamp

  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  50. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  51. def withLogContext(context: Map[String, String])(body: => Unit): Unit
    Attributes
    protected
    Definition Classes
    Logging

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped