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.
- Alphabetic
- By Inheritance
- RocksDB
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new RocksDB(dfsRootDir: String, conf: RocksDBConf, localRootDir: File = Utils.createTempDir(), hadoopConf: Configuration = new Configuration, loggingId: String = "")
- dfsRootDir
Remote directory where checkpoints are going to be written
- 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
- loggingId
Id that will be prepended in logs for isolating concurrent RocksDBs
Type Members
- case class RocksDBSnapshot(checkpointDir: File, version: Long, numKeys: Long) extends Product with Serializable
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(): Unit
Release all resources
- def commit(): Long
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
- val conf: RocksDBConf
- def doMaintenance(): Unit
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def get(key: Array[Byte]): 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.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getLatestVersion(): Long
Get the latest version available in the DFS
- def getWriteBufferManagerAndCache(): (WriteBufferManager, Cache)
Get the write buffer manager and cache
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def iterator(): Iterator[ByteArrayPair]
Get an iterator of all committed and uncommitted key-value pairs.
- def load(version: Long, readOnly: Boolean = false): RocksDB
Load the given version of data in a native RocksDB instance.
Load the given version of data in a native RocksDB instance. Note that this will copy all the necessary file from DFS to local disk as needed, and possibly restart the native RocksDB instance.
- def log: Logger
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logName: String
- Attributes
- protected
- Definition Classes
- RocksDB → Logging
- def logTrace(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def metrics: RocksDBMetrics
Get current instantaneous statistics
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def prefixScan(prefix: Array[Byte]): Iterator[ByteArrayPair]
- def put(key: Array[Byte], value: Array[Byte]): 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.
- def remove(key: Array[Byte]): Unit
Remove the key if present.
Remove the key if present.
- Note
This update is not committed to disk until commit() is called.
- def rollback(): Unit
Drop uncommitted changes, and roll back to previous version.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def timeTakenMs(body: => Unit): Long
Records the duration of running
bodyfor the next query progress update.Records the duration of running
bodyfor the next query progress update.- Attributes
- protected
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()