Skip to main content

Registry

Enum Registry 

Source
pub enum Registry {
    Memory(ShardedRegistry),
    RocksDb(RocksDbRegistry),
}
Expand description

In-memory or RocksDB string registry used by compute and the registry process.

Variants§

§

Memory(ShardedRegistry)

Partition-hashed in-memory shards.

§

RocksDb(RocksDbRegistry)

Disk-backed dictionary at {data_dir}/{repository}/registry.

Implementations§

Source§

impl Registry

Source

pub fn memory(shard_count: usize) -> Self

In-memory registry with shard_count shards.

Source

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

Open a RocksDB registry at path (created if missing).

Source

pub fn shard_count(&self) -> usize

Number of in-process shards (always 1 for RocksDB).

Source

pub fn entry_count(&self) -> Option<u64>

Exact in-memory count, or RocksDB estimate-num-keys.

Source

pub fn lsm_metrics(&self) -> Option<LsmMetrics>

RocksDB LSM counters (None on the memory backend).

Source

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

Process-wide block cache bytes (None on the memory backend).

Source

pub fn register( &mut self, hash: StrHash, raw: impl Into<String>, ) -> Result<(), StorageError>

Register raw under hash (overwrites on duplicate).

Source

pub fn lookup(&self, hash: StrHash) -> Result<Option<String>, StorageError>

Look up the raw string for hash.

Source

pub fn lookup_many( &self, hashes: &[StrHash], ) -> Result<Vec<Option<String>>, StorageError>

Positional bulk lookup. RocksDB uses sorted MultiGet.

Source

pub fn register_entries( &mut self, entries: &[(StrHash, String)], ) -> Result<u64, StorageError>

Register many entries; RocksDB uses one WriteBatch.

Source

pub fn write_sorted_sst_run( &self, path: &Path, entries: &[(StrHash, String)], ) -> Result<(), StorageError>

Write hash-sorted entries as one SST run file at path (see RocksDbRegistry::write_sorted_sst_run). RocksDB-only: the in-memory registry has no SST layout to write.

Source

pub fn ingest_sst_runs(&self, files: &[PathBuf]) -> Result<(), StorageError>

Bulk-ingest sorted SST run files (see RocksDbRegistry::ingest_sst_runs). RocksDB-only.

Source

pub fn warm_block_cache( &self, fill_fraction: f64, ) -> Result<WarmBlockCacheStats, StorageError>

Warm this registry’s block cache (see RocksDbRegistry::warm_block_cache). No-op on the in-memory backend: there is no block cache to warm, so the stats come back zeroed rather than erroring.

Source

pub fn recover_staged_sst_runs( &self, staging_dir: &Path, ) -> Result<(), StorageError>

Ingest finished offline-import SST runs in staging_dir (see RocksDbRegistry::recover_staged_sst_runs). RocksDB-only.

Source

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

Flush MemTables (no-op for memory).

Source

pub fn compact_range(&self)

Compact the registry CF (no-op for memory).

Trait Implementations§

Source§

impl Debug for Registry

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,