Skip to main content

PoolStore

Struct PoolStore 

Source
pub struct PoolStore { /* private fields */ }

Implementations§

Source§

impl PoolStore

Source

pub fn delete_protection_status( &self, ) -> Result<Option<PoolDeleteProtectionStatus>, StoreError>

Source

pub fn acquire_delete_protection( &self, lease_id: Hash, reason: &str, ) -> Result<PoolDeleteProtectionChange, StoreError>

Source

pub fn hold_delete_protection( &self, lease_id: Hash, expected_record_sha256: Hash, ) -> Result<PoolDeleteProtectionGuard, StoreError>

Hold the exact durable delete-protection record against release while a long-running online retirement audit uses it as an append-only Pool authority. Ordinary writes and physical member moves remain available.

Source

pub fn release_delete_protection( &self, lease_id: Hash, expected_record_sha256: Hash, ) -> Result<PoolDeleteProtectionChange, StoreError>

Source§

impl PoolStore

Source

pub fn maintain( &self, max_items: usize, ) -> Result<PoolMaintenanceReport, StoreError>

Source

pub fn maintain_with_batch_items( &self, max_items: usize, batch_items: usize, ) -> Result<PoolMaintenanceReport, StoreError>

Source§

impl PoolStore

Source§

impl PoolStore

Source

pub fn open<P: AsRef<Path>>( path: P, config: PoolStoreConfig, ) -> Result<Self, StoreError>

Source

pub fn stop_temperature_worker(&self) -> Result<(), StoreError>

Stop this process’s background temperature balancer.

Exact maintenance and recovery commands use this before taking catalog snapshots so the same Pool handle cannot relocate blobs behind their authority checks.

Source

pub fn add_member( &self, config: PoolMemberConfig, ) -> Result<PoolMemberId, StoreError>

Source

pub fn begin_drain(&self, id: PoolMemberId) -> Result<(), StoreError>

Source

pub fn update_member_limits( &self, id: PoolMemberId, capacity_bytes: u64, max_read_concurrency: u32, max_write_concurrency: u32, ) -> Result<(), StoreError>

Source

pub fn update_member_temperature_watermarks( &self, id: PoolMemberId, low_percent: u8, high_percent: u8, ) -> Result<(), StoreError>

Source

pub fn remove_member(&self, id: PoolMemberId) -> Result<(), StoreError>

Source

pub fn member(&self, id: PoolMemberId) -> Result<PoolMemberStatus, StoreError>

Source

pub fn members(&self) -> Result<Vec<PoolMemberStatus>, StoreError>

Source

pub fn blob_location( &self, hash: &Hash, ) -> Result<Option<PoolMemberId>, StoreError>

Source

pub fn put_sync(&self, hash: Hash, data: &[u8]) -> Result<bool, StoreError>

Source

pub fn put_many_report_sync( &self, items: &[(Hash, Vec<u8>)], ) -> Result<PutManyReport, StoreError>

Source

pub fn put_many_optimistic_report_sync( &self, items: &[(Hash, Vec<u8>)], ) -> Result<PutManyReport, StoreError>

Insert a locally generated content-addressed batch while trusting catalogued committed locations. Pending locations still take the ordinary repair path; stored and moving locations need no payload read.

Source

pub fn put_many_sync( &self, items: &[(Hash, Vec<u8>)], ) -> Result<usize, StoreError>

Source

pub fn put_many_optimistic_sync( &self, items: &[(Hash, Vec<u8>)], ) -> Result<usize, StoreError>

Source

pub fn get_sync(&self, hash: &Hash) -> Result<Option<Vec<u8>>, StoreError>

Source

pub fn get_range_sync( &self, hash: &Hash, start: u64, end_inclusive: u64, ) -> Result<Option<Vec<u8>>, StoreError>

Source

pub fn blob_size_sync(&self, hash: &Hash) -> Result<Option<u64>, StoreError>

Source

pub fn exists(&self, hash: &Hash) -> Result<bool, StoreError>

Source

pub fn existing_hashes_in_sorted_candidates( &self, sorted_hashes: &[Hash], ) -> Result<Vec<bool>, StoreError>

Source

pub fn committed_hashes_in_sorted_candidates( &self, sorted_hashes: &[Hash], ) -> Result<Vec<bool>, StoreError>

Mark hashes whose pool catalog entries represent committed data.

Pending records deliberately return false so an interrupted migration supplies the source bytes again and lets the ordinary repair/finalize path complete them. Stored and moving records are already durable and can be skipped by an incremental migration without rereading payloads.

Source

pub fn catalog_locations_in_sorted_candidates( &self, sorted_hashes: &[Hash], ) -> Result<Vec<PoolCatalogLocation>, StoreError>

Return the exact catalog state for one sorted source page using a single read transaction.

Migration reconciliation uses this to distinguish a terminal size-matched Stored record from Missing, crash-left Pending, and non-terminal Moving without loading target payload bytes.

Source

pub fn scan_catalog_locations_after( &self, after: Option<Hash>, limit: usize, ) -> Result<Vec<(Hash, PoolCatalogLocation)>, StoreError>

Scan one bounded raw catalog page in hash order.

Online migration content audits use the raw catalog key as their resumable cursor. Pending and moving rows are returned explicitly: they are not terminal content authorities, but their keys must still advance the scan so a page containing only transient rows makes progress.

Source

pub fn largest_member_map_size_bytes(&self) -> Result<Option<usize>, StoreError>

Largest map size among members that are available in this process.

The pool catalog is a separate LMDB environment and is intentionally not reported as blob capacity.

Source

pub fn delete_sync(&self, hash: &Hash) -> Result<bool, StoreError>

Source

pub fn delete_many_sync(&self, hashes: &[Hash]) -> Result<usize, StoreError>

Delete a batch with one transaction per affected member and one pool catalog transaction.

Source

pub fn cleanup_stale_pending_exact_offline_sync( &self, expected: &[PoolStalePending], ) -> Result<PoolStalePendingCleanupReport, StoreError>

Clear one exact, bounded set of crash-abandoned Pending records.

This is deliberately narrower than Self::delete_many_sync: every live location must still equal the authorized (hash, member, size), no hash may be pinned or owned by a move, and no member may contain a physical record for the hash. The catalog and all secondary indexes change in one transaction and are force-synced before success.

A caller must stop and fence every Pool writer before its strict read-only audit and keep that fence through this call. This includes clones and handles in this process: a writer can commit Pending, pause before entering its member gate, and otherwise resume after cleanup. Catalog and member LMDB environments do not provide one atomic cross-environment transaction, so this method intentionally makes no online-safety claim.

Source

pub fn pin_sync(&self, hash: &Hash) -> Result<(), StoreError>

Source

pub fn unpin_sync(&self, hash: &Hash) -> Result<(), StoreError>

Source

pub fn pin_count_sync(&self, hash: &Hash) -> Result<u32, StoreError>

Source

pub fn touch_accessed_sync( &self, hash: &Hash, now: u64, ) -> Result<bool, StoreError>

Source

pub fn touch_many_accessed_sync( &self, hashes: &[Hash], now: u64, ) -> Result<usize, StoreError>

Source

pub fn last_accessed_at_sync( &self, hash: &Hash, ) -> Result<Option<u64>, StoreError>

Source

pub fn many_last_accessed_at_sync( &self, hashes: &[Hash], ) -> Result<Vec<(Hash, u64)>, StoreError>

Source

pub fn list(&self) -> Result<Vec<Hash>, StoreError>

Source

pub fn stats(&self) -> Result<StoreStats, StoreError>

Source

pub fn writable_physical_stats(&self) -> Result<StoreStats, StoreError>

Return conservative physical usage for quota admission without scanning the logical Pool catalog.

Every member LMDB maintains its own totals transactionally, so summing those counters is constant in the member count and remains accurate across processes and mixed binary versions. Blobs temporarily duplicated during a move are counted in both members, which is intentionally conservative for writable-space admission. Missing member statistics fail closed rather than undercounting storage.

Source

pub fn force_sync(&self) -> Result<(), StoreError>

Source

pub fn catalog_map_size_bytes(&self) -> u64

Current LMDB virtual map size for the Pool catalog.

Source

pub fn validate_controlled_member_state_exact(&self) -> Result<(), StoreError>

Exhaustively prove every controlled member’s physical indexes and persisted aggregate counters before the first migration mutation.

Controlled reopen performs only constant-time structural checks so bounded mapping epochs do not rescan the complete target. The caller must hold the external writer fence while this one full proof runs and must keep that fence held until migration completion.

Source

pub fn validate_controlled_authority(&self) -> Result<(), StoreError>

Revalidate every controlled catalog/member authority without forcing unrelated writer commits to storage.

This is sufficient before advancing a migration cursor when the migration observed exact Stored rows and performed no target writes. Any batch that attempted target writes must use Self::validate_controlled_authority_and_sync instead.

Source

pub fn validate_controlled_authority_and_sync(&self) -> Result<(), StoreError>

Revalidate every controlled authority and force the catalog/member commits durable before an external migration cursor may advance.

Trait Implementations§

Source§

impl Clone for PoolStore

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Deref for PoolStore

Source§

type Target = PoolStoreInner

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Store for PoolStore

Source§

fn put<'life0, 'async_trait>( &'life0 self, hash: Hash, data: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Store data by its hash Returns true if newly stored, false if already existed
Source§

fn put_many<'life0, 'async_trait>( &'life0 self, items: Vec<(Hash, Vec<u8>)>, ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Store multiple blobs. Returns the number of newly stored items.
Source§

fn put_many_optimistic<'life0, 'async_trait>( &'life0 self, items: Vec<(Hash, Vec<u8>)>, ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Store a locally generated content-addressed batch without requiring an implementation to reread bytes for hashes it already tracks. Read more
Source§

fn get<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 Hash, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve data by hash Returns data or None if not found
Source§

fn get_range<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 Hash, start: u64, end_inclusive: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve a byte range from a blob by hash. Read more
Source§

fn blob_size<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 Hash, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return the stored blob size in bytes. Read more
Source§

fn has<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 Hash, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if hash exists
Source§

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 Hash, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete by hash Returns true if deleted, false if didn’t exist
Source§

fn delete_many<'life0, 'async_trait>( &'life0 self, hashes: Vec<Hash>, ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete multiple hashes and return the number that existed. Read more
Source§

fn stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StoreStats> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get storage statistics
Source§

fn pin<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 Hash, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Pin a hash (increment ref count). Pinned items are not evicted.
Source§

fn unpin<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 Hash, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unpin a hash (decrement ref count). Item can be evicted when count reaches 0.
Source§

fn pin_count(&self, hash: &Hash) -> u32

Get pin count for a hash. 0 = not pinned.
Source§

fn flush_pending<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Flush writes retained by an overlay store. Read more
Source§

fn flush_pending_if_needed<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Flush at an intermediate memory boundary. Buffered stores may retain a bounded amount between boundaries; callers must still explicitly flush all pending writes before returning a committed root.
Source§

fn set_max_bytes(&self, _max: u64)

Set maximum storage size in bytes. 0 = unlimited.
Source§

fn max_bytes(&self) -> Option<u64>

Get maximum storage size. None = unlimited.
Source§

fn evict_if_needed<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Evict unpinned items if over storage limit. Returns number of bytes freed.
Source§

fn is_pinned(&self, hash: &[u8; 32]) -> bool

Check if hash is pinned (pin count > 0)

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

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

Source§

fn vzip(self) -> V