88 sdata->
options = rocksdb_options_create();
91 rocksdb_options_set_create_if_missing(sdata->
options, 1);
93 rocksdb_options_set_keep_log_file_num(sdata->
options, 1);
97 rocksdb_readoptions_set_verify_checksums(sdata->
read_options, 1);
104 rocksdb_options_set_compression(sdata->
options, rocksdb_no_compression);
107 sdata->
db = rocksdb_open(sdata->
options, path, &sdata->
err);
110 rocksdb_options_destroy(sdata->
options);
132 void *rv = rocksdb_get(sdata->
db, sdata->
read_options, key, klen, vlen, &sdata->
err);
135 rocksdb_free(sdata->
err);
155 void *value,
size_t vlen)
166 rocksdb_free(sdata->
err);
188 rocksdb_free(sdata->
err);
208 rocksdb_close(sdata->
db);
209 rocksdb_options_destroy(sdata->
options);
222#define RDBVER(major, minor, patch) #major "." #minor "." #patch
223 return "RocksDB " RDBVER(ROCKSDB_MAJOR, ROCKSDB_MINOR, ROCKSDB_PATCH);
static void store_rocksdb_close(StoreHandle **ptr)
Close a Store connection - Implements StoreOps::close() -.
static int store_rocksdb_delete_record(StoreHandle *store, const char *key, size_t klen)
Delete a record from the Store - Implements StoreOps::delete_record() -.
static void * store_rocksdb_fetch(StoreHandle *store, const char *key, size_t klen, size_t *vlen)
Fetch a Value from the Store - Implements StoreOps::fetch() -.
static void store_rocksdb_free(StoreHandle *store, void **ptr)
Free a Value returned by fetch() - Implements StoreOps::free() -.
static StoreHandle * store_rocksdb_open(const char *path, bool create)
Open a connection to a Store - Implements StoreOps::open() -.
static int store_rocksdb_store(StoreHandle *store, const char *key, size_t klen, void *value, size_t vlen)
Write a Value to the Store - Implements StoreOps::store() -.
static const char * store_rocksdb_version(void)
Get a Store version string - Implements StoreOps::version() -.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Convenience wrapper for the library headers.
static struct RocksDbStoreData * rocksdb_sdata_new(void)
Create new RocksDb Store Data.
#define RDBVER(major, minor, patch)
static void rocksdb_sdata_free(struct RocksDbStoreData **ptr)
Free RocksDb Store Data.
void StoreHandle
Opaque type for store backend.
#define STORE_BACKEND_OPS(_name)
rocksdb_options_t * options
rocksdb_readoptions_t * read_options
rocksdb_writeoptions_t * write_options