Packages

class RocksDB extends Logging

Class representing a RocksDB instance that checkpoints version of data to DFS. After a set of updates, a new version can be committed by calling commit(). Any past version can be loaded by calling load(version).

Note

This class is not thread-safe, so use it only from one thread.

See also

RocksDBFileManager to see how the files are laid out in local disk and DFS.

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

Instance Constructors

  1. new RocksDB(dfsRootDir: String, conf: RocksDBConf, localRootDir: File = Utils.createTempDir(), hadoopConf: Configuration = new Configuration, loggingId: String = "", useColumnFamilies: Boolean = false, enableStateStoreCheckpointIds: Boolean = false, partitionId: Int = 0)

    conf

    Configuration for RocksDB

    localRootDir

    Root directory in local disk that is used to working and checkpointing dirs

    hadoopConf

    Hadoop configuration for talking to the remote file system

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def checkColFamilyExists(colFamilyName: String): Boolean

    Function to check if the column family exists in the state store instance.

    Function to check if the column family exists in the state store instance.

    colFamilyName

    - name of the column family

    returns

    - true if the column family exists, false otherwise

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  7. def close(): Unit

    Release all resources

  8. def commit(): (Long, StateStoreCheckpointInfo)

    Commit all the updates made as a version to DFS.

    Commit all the updates made as a version to DFS. The steps it needs to do to commits are: - Flush all changes to disk - Create a RocksDB checkpoint in a new local dir - Sync the checkpoint dir files to DFS

  9. val conf: RocksDBConf
  10. def createColFamilyIfAbsent(colFamilyName: String, isInternal: Boolean): Short

    Check if the column family exists with given name and create one if it doesn't.

    Check if the column family exists with given name and create one if it doesn't. Users can create external column families storing user facing data as well as internal column families such as secondary indexes. Metrics for both of these types are tracked separately.

    colFamilyName

    - column family name

    isInternal

    - whether the column family is for internal use or not

    returns

    - virtual column family id

  11. def doMaintenance(): Unit
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def get(key: Array[Byte], cfName: String = StateStore.DEFAULT_COL_FAMILY_NAME): Array[Byte]

    Get the value for the given key if present, or null.

    Get the value for the given key if present, or null.

    Note

    This will return the last written value even if it was uncommitted.

  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  16. def getColFamilyCount(isInternal: Boolean): Long
  17. def getLatestVersion(): Long

    Get the latest version available in the DFS

  18. def getWriteBufferManagerAndCache(): (WriteBufferManager, Cache)

    Get the write buffer manager and cache

  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  20. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  21. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  24. def iterator(cfName: String): NextIterator[ByteArrayPair]

    Get an iterator of all committed and uncommitted key-value pairs for the given column family.

  25. def iterator(): NextIterator[ByteArrayPair]

    Get an iterator of all committed and uncommitted key-value pairs.

  26. var lastCommitBasedStateStoreCkptId: Option[String]
    Attributes
    protected
  27. var lastCommittedStateStoreCkptId: Option[String]
    Attributes
    protected
  28. val lineageManager: RocksDBLineageManager
    Attributes
    protected[sql]
  29. def load(version: Long, stateStoreCkptId: Option[String] = None, readOnly: Boolean = false): RocksDB
  30. def loadFromSnapshot(snapshotVersion: Long, endVersion: Long): RocksDB

    Load from the start snapshot version and apply all the changelog records to reach the end version.

    Load from the start snapshot version and apply all the changelog records to reach the end version. Note that this will copy all the necessary files from DFS to local disk as needed, and possibly restart the native RocksDB instance.

    snapshotVersion

    version of the snapshot to start with

    endVersion

    end version

    returns

    A RocksDB instance loaded with the state endVersion replayed from snapshotVersion. Note that the instance will be read-only since this method is only used in State Data Source.

  31. var loadedStateStoreCkptId: Option[String]
    Attributes
    protected
  32. var loadedVersion: Long
    Attributes
    protected
  33. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  34. def logDebug(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  35. def logDebug(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  36. def logDebug(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  37. def logDebug(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  38. def logError(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  39. def logError(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  40. def logError(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  41. def logError(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  42. def logInfo(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  43. def logInfo(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  44. def logInfo(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  45. def logInfo(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  46. def logName: String
    Attributes
    protected
    Definition Classes
    RocksDB → Logging
  47. def logTrace(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  48. def logTrace(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  49. def logTrace(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  50. def logTrace(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  51. def logWarning(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  52. def logWarning(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  53. def logWarning(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  54. def logWarning(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  55. def merge(key: Array[Byte], value: Array[Byte], cfName: String = StateStore.DEFAULT_COL_FAMILY_NAME, includesPrefix: Boolean = false): Unit

    Merge the given value for the given key.

    Merge the given value for the given key. This is equivalent to the Atomic Read-Modify-Write operation in RocksDB, known as the "Merge" operation. The modification is appending the provided value to current list of values for the given key.

    Note

    This operation requires that the encoder used can decode multiple values for a key from the values byte array.

    ,

    This update is not committed to disk until commit() is called.

  56. def metricsOpt: Option[RocksDBMetrics]

    Function to return RocksDB metrics if the recorded metrics are available and the operator has reached the commit stage for this state store instance and version.

    Function to return RocksDB metrics if the recorded metrics are available and the operator has reached the commit stage for this state store instance and version. If not, we return None

    returns

    - Return RocksDBMetrics if available and None otherwise

  57. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  58. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  59. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  60. def prefixScan(prefix: Array[Byte], cfName: String = StateStore.DEFAULT_COL_FAMILY_NAME): NextIterator[ByteArrayPair]
  61. def put(key: Array[Byte], value: Array[Byte], cfName: String = StateStore.DEFAULT_COL_FAMILY_NAME, includesPrefix: Boolean = false): Unit

    Put the given value for the given key.

    Put the given value for the given key.

    Note

    This update is not committed to disk until commit() is called.

  62. def remove(key: Array[Byte], cfName: String = StateStore.DEFAULT_COL_FAMILY_NAME, includesPrefix: Boolean = false): Unit

    Remove the key if present.

    Remove the key if present.

    Note

    This update is not committed to disk until commit() is called.

  63. def removeColFamilyIfExists(colFamilyName: String): Boolean

    Remove RocksDB column family, if exists

    Remove RocksDB column family, if exists

    returns

    columnFamilyId if it exists, else None

  64. def rollback(): Unit

    Drop uncommitted changes, and roll back to previous version.

  65. var sessionStateStoreCkptId: Option[String]
    Attributes
    protected
  66. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  67. def toString(): String
    Definition Classes
    AnyRef → Any
  68. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  69. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  70. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  71. 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