add interface to query rocksdb properties w/ admin cmd

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-08-02 01:40:41 +00:00
parent f261d44edb
commit ac941a801a
4 changed files with 51 additions and 2 deletions

View file

@ -1,4 +1,4 @@
use std::{future::Future, mem::size_of, pin::Pin, sync::Arc};
use std::{ffi::CStr, future::Future, mem::size_of, pin::Pin, sync::Arc};
use conduit::{utils, Result};
use rocksdb::{
@ -189,6 +189,10 @@ impl Map {
self.watchers.watch(prefix)
}
pub fn property_integer(&self, name: &CStr) -> Result<u64> { self.db.property_integer(&self.cf(), name) }
pub fn property(&self, name: &str) -> Result<String> { self.db.property(&self.cf(), name) }
#[inline]
pub fn name(&self) -> &str { &self.name }