pub enum LocalStore {
Fs(FsBlobStore),
Lmdb(LmdbBlobStore),
TieredLmdb {
primary: Box<LmdbBlobStore>,
legacy: Box<LmdbBlobStore>,
},
}Expand description
Local blob store - wraps either FsBlobStore or LmdbBlobStore
Variants§
Implementations§
Source§impl LocalStore
impl LocalStore
Sourcepub fn new<P: AsRef<Path>>(
path: P,
backend: &StorageBackend,
) -> Result<Self, StoreError>
pub fn new<P: AsRef<Path>>( path: P, backend: &StorageBackend, ) -> Result<Self, StoreError>
Create a new unbounded local store.
Higher-level stores that need quota enforcement should manage eviction above this layer so tree metadata, pins, and archival policies stay coherent.
Sourcepub fn new_with_lmdb_map_size<P: AsRef<Path>>(
path: P,
backend: &StorageBackend,
_map_size_bytes: Option<u64>,
) -> Result<Self, StoreError>
pub fn new_with_lmdb_map_size<P: AsRef<Path>>( path: P, backend: &StorageBackend, _map_size_bytes: Option<u64>, ) -> Result<Self, StoreError>
Create a new local store with an explicit LMDB logical size cap when using the LMDB backend.
The requested size is used for both the LMDB map and the store’s built-in byte quota, so standalone blob envs can evict instead of growing forever.
Sourcepub fn new_unbounded<P: AsRef<Path>>(
path: P,
backend: &StorageBackend,
) -> Result<Self, StoreError>
pub fn new_unbounded<P: AsRef<Path>>( path: P, backend: &StorageBackend, ) -> Result<Self, StoreError>
Create a new unbounded local store for a specific backend.
Sourcepub fn new_unbounded_with_lmdb_map_size<P: AsRef<Path>>(
path: P,
backend: &StorageBackend,
_map_size_bytes: Option<u64>,
) -> Result<Self, StoreError>
pub fn new_unbounded_with_lmdb_map_size<P: AsRef<Path>>( path: P, backend: &StorageBackend, _map_size_bytes: Option<u64>, ) -> Result<Self, StoreError>
Create a local store with an explicit LMDB map size but without adapter-level eviction.
Higher layers use this when they need a large mmap while enforcing quota with richer retention policy. In tiered LMDB mode, both the hot primary and cold legacy envs are opened without adapter-level eviction so merely enabling the hot tier can never reclaim legacy data on startup.
pub fn backend(&self) -> StorageBackend
pub fn force_sync(&self) -> Result<(), StoreError>
Sourcepub fn put_many_report_sync(
&self,
items: &[(Hash, Vec<u8>)],
) -> Result<PutManyReport, StoreError>
pub fn put_many_report_sync( &self, items: &[(Hash, Vec<u8>)], ) -> Result<PutManyReport, StoreError>
Sync batch put operation.
Sourcepub fn put_many_sync(
&self,
items: &[(Hash, Vec<u8>)],
) -> Result<usize, StoreError>
pub fn put_many_sync( &self, items: &[(Hash, Vec<u8>)], ) -> Result<usize, StoreError>
Sync batch put operation.
pub fn get_range_sync( &self, hash: &Hash, start: u64, end_inclusive: u64, ) -> Result<Option<Vec<u8>>, StoreError>
pub fn blob_size_sync(&self, hash: &Hash) -> Result<Option<u64>, StoreError>
pub fn touch_accessed_sync( &self, hash: &Hash, now: u64, ) -> Result<bool, StoreError>
pub fn touch_many_accessed_sync( &self, hashes: &[Hash], now: u64, ) -> Result<usize, StoreError>
pub fn last_accessed_at_sync( &self, hash: &Hash, ) -> Result<Option<u64>, StoreError>
pub fn many_last_accessed_at_sync( &self, hashes: &[Hash], ) -> Result<Vec<(Hash, u64)>, StoreError>
Sourcepub fn existing_hashes_in_sorted_candidates(
&self,
sorted_hashes: &[Hash],
) -> Result<Vec<bool>, StoreError>
pub fn existing_hashes_in_sorted_candidates( &self, sorted_hashes: &[Hash], ) -> Result<Vec<bool>, StoreError>
Mark which sorted hashes already exist in local storage.
Sourcepub fn delete_sync(&self, hash: &Hash) -> Result<bool, StoreError>
pub fn delete_sync(&self, hash: &Hash) -> Result<bool, StoreError>
Sync delete operation
pub fn delete_writable_sync(&self, hash: &Hash) -> Result<bool, StoreError>
Sourcepub fn stats(&self) -> Result<LocalStoreStats, StoreError>
pub fn stats(&self) -> Result<LocalStoreStats, StoreError>
Get storage statistics
Sourcepub fn writable_stats(&self) -> Result<LocalStoreStats, StoreError>
pub fn writable_stats(&self) -> Result<LocalStoreStats, StoreError>
Get storage statistics for the tier that receives new writes.
Sourcepub fn list_writable(&self) -> Result<Vec<Hash>, StoreError>
pub fn list_writable(&self) -> Result<Vec<Hash>, StoreError>
List hashes in the tier that receives new writes.
Trait Implementations§
Source§impl Store for LocalStore
impl Store for LocalStore
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
Source§fn set_max_bytes(&self, _max: u64)
fn set_max_bytes(&self, _max: u64)
Source§fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StoreStats> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StoreStats> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
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,
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,
Source§fn pin<'life0, 'life1, 'async_trait>(
&'life0 self,
_hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn pin<'life0, 'life1, 'async_trait>(
&'life0 self,
_hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn unpin<'life0, 'life1, 'async_trait>(
&'life0 self,
_hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn unpin<'life0, 'life1, 'async_trait>(
&'life0 self,
_hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl !Freeze for LocalStore
impl RefUnwindSafe for LocalStore
impl Send for LocalStore
impl Sync for LocalStore
impl Unpin for LocalStore
impl UnsafeUnpin for LocalStore
impl UnwindSafe for LocalStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more