pub struct Rocksdb { /* private fields */ }
Expand description
Rocksdb service support.
Capabilities
This service can be used to:
- read
- write
-
list - scan
-
presign - blocking
Note
OpenDAL will build rocksdb from source by default.
To link with existing rocksdb lib, please set one of the following:
ROCKSDB_LIB_DIR
to the dir that containslibrocksdb.so
ROCKSDB_STATIC
to the dir that containslibrocksdb.a
If the version of RocksDB is below 6.0, you may encounter compatibility
issues. It is advisable to follow the steps provided in the INSTALL
file to build rocksdb, rather than relying on system libraries that
may be outdated and incompatible.
Configuration
root
: Set the working directory ofOpenDAL
datadir
: Set the path to the rocksdb data directory
You can refer to RocksdbBuilder
’s docs for more information
Example
Via Builder
use anyhow::Result;
use opendal::services::Rocksdb;
use opendal::Object;
use opendal::Operator;
#[tokio::main]
async fn main() -> Result<()> {
let mut builder = Rocksdb::default();
builder.datadir("/tmp/opendal/rocksdb");
let op: Operator = Operator::new(builder)?.finish();
let _: Object = op.object("test_file");
Ok(())
}
Implementations§
Trait Implementations§
source§impl Builder for RocksdbBuilder
impl Builder for RocksdbBuilder
source§impl Clone for RocksdbBuilder
impl Clone for RocksdbBuilder
source§fn clone(&self) -> RocksdbBuilder
fn clone(&self) -> RocksdbBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RocksdbBuilder
impl Debug for RocksdbBuilder
source§impl Default for RocksdbBuilder
impl Default for RocksdbBuilder
source§fn default() -> RocksdbBuilder
fn default() -> RocksdbBuilder
Returns the “default value” for a type. Read more