This service can be used to:
- create_dir
- stat
- read
- write
- delete
- copy
- rename
- list
-
presign
OpenDAL will build rocksdb from source by default.
To link with existing rocksdb lib, please set one of the following:
ROCKSDB_LIB_DIRto the dir that containslibrocksdb.soROCKSDB_STATICto 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.
root: Set the working directory ofOpenDALdatadir: Set the path to the rocksdb data directory
You can refer to [RocksdbBuilder]'s docs for more information.
use anyhow::Result;
use opendal::services::Rocksdb;
use opendal::Operator;
#[tokio::main]
async fn main() -> Result<()> {
let mut builder = Rocksdb::default()
.datadir("/tmp/opendal/rocksdb");
let op: Operator = Operator::new(builder)?.finish();
Ok(())
}