Skip to main content

BlobIndex

Struct BlobIndex 

Source
pub struct BlobIndex { /* private fields */ }
Expand description

Point-lookup RocksDB index over content-addressed blob entries.

Blob entries (16-byte hash keys) live in the index column family. A small set of maintenance keys (the per-segment durable lengths) live in the implicit default column family instead, so a meta key can never collide with a hash key and a full index scan yields exactly the blob entries.

Implementations§

Source§

impl BlobIndex

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self, StorageError>

Open (creating if missing) the blob index at path with RocksDbTuning::blob_index.

Source

pub fn open_with_tuning( path: impl AsRef<Path>, tuning: RocksDbTuning, ) -> Result<Self, StorageError>

Open the blob index with explicit tuning (tests and benchmarks).

Source

pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, StorageError>

Get one key, or None if absent.

Source

pub fn multi_get( &self, keys: &[&[u8]], ) -> Result<Vec<Option<Vec<u8>>>, StorageError>

Positional batched point lookup; None marks a missing key.

Values are copied once out of RocksDB’s pinned MultiGet batch; the pins are released before this returns. keys need not be sorted: RocksDB sorts the batch internally.

Source

pub fn get_meta(&self, key: &[u8]) -> Result<Option<Vec<u8>>, StorageError>

Get one maintenance key from the default column family.

Source

pub fn iter_entries(&self) -> Iter<'_>

Iterate every blob entry (hash key → tagged value) in index order.

Meta keys are excluded — they live in the default column family — so a full walk of this iterator is exactly the blob entry set (waratah blob verify).

Source

pub fn write_batch(&self) -> BlobIndexBatch

Start an atomic write batch against the index.

Source

pub fn flush(&self) -> Result<(), StorageError>

Flush the MemTables to SST files and wait for completion. Covers both column families: the blob entries and the default maintenance keys (per-segment durable lengths) — leaving the maintenance keys unflushed would make them WAL-replay-only forever.

Source

pub fn compact(&self)

Full-range compaction of both column families (blob entries and the default maintenance keys).

Source

pub fn block_cache_bytes(&self) -> Option<(u64, u64)>

This DB’s block-cache (capacity, used) bytes, for metrics.

Trait Implementations§

Source§

impl Debug for BlobIndex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,