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
impl Registry
Sourcepub fn open_rocksdb(
path: impl AsRef<Path>,
tuning: RocksDbTuning,
) -> Result<Self, StorageError>
pub fn open_rocksdb( path: impl AsRef<Path>, tuning: RocksDbTuning, ) -> Result<Self, StorageError>
Open a RocksDB registry at path (created if missing).
Sourcepub fn shard_count(&self) -> usize
pub fn shard_count(&self) -> usize
Number of in-process shards (always 1 for RocksDB).
Sourcepub fn entry_count(&self) -> Option<u64>
pub fn entry_count(&self) -> Option<u64>
Exact in-memory count, or RocksDB estimate-num-keys.
Sourcepub fn lsm_metrics(&self) -> Option<LsmMetrics>
pub fn lsm_metrics(&self) -> Option<LsmMetrics>
RocksDB LSM counters (None on the memory backend).
Sourcepub fn block_cache_bytes(&self) -> Option<(u64, u64)>
pub fn block_cache_bytes(&self) -> Option<(u64, u64)>
Process-wide block cache bytes (None on the memory backend).
Sourcepub fn register(
&mut self,
hash: StrHash,
raw: impl Into<String>,
) -> Result<(), StorageError>
pub fn register( &mut self, hash: StrHash, raw: impl Into<String>, ) -> Result<(), StorageError>
Register raw under hash (overwrites on duplicate).
Sourcepub fn lookup(&self, hash: StrHash) -> Result<Option<String>, StorageError>
pub fn lookup(&self, hash: StrHash) -> Result<Option<String>, StorageError>
Look up the raw string for hash.
Sourcepub fn lookup_many(
&self,
hashes: &[StrHash],
) -> Result<Vec<Option<String>>, StorageError>
pub fn lookup_many( &self, hashes: &[StrHash], ) -> Result<Vec<Option<String>>, StorageError>
Positional bulk lookup. RocksDB uses sorted MultiGet.
Sourcepub fn register_entries(
&mut self,
entries: &[(StrHash, String)],
) -> Result<u64, StorageError>
pub fn register_entries( &mut self, entries: &[(StrHash, String)], ) -> Result<u64, StorageError>
Register many entries; RocksDB uses one WriteBatch.
Sourcepub fn write_sorted_sst_run(
&self,
path: &Path,
entries: &[(StrHash, String)],
) -> Result<(), StorageError>
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.
Sourcepub fn ingest_sst_runs(&self, files: &[PathBuf]) -> Result<(), StorageError>
pub fn ingest_sst_runs(&self, files: &[PathBuf]) -> Result<(), StorageError>
Bulk-ingest sorted SST run files (see
RocksDbRegistry::ingest_sst_runs). RocksDB-only.
Sourcepub fn warm_block_cache(
&self,
fill_fraction: f64,
) -> Result<WarmBlockCacheStats, StorageError>
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.
Sourcepub fn recover_staged_sst_runs(
&self,
staging_dir: &Path,
) -> Result<(), StorageError>
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.
Sourcepub fn flush_memtables(&self) -> Result<(), StorageError>
pub fn flush_memtables(&self) -> Result<(), StorageError>
Flush MemTables (no-op for memory).
Sourcepub fn compact_range(&self)
pub fn compact_range(&self)
Compact the registry CF (no-op for memory).