pub struct MultilevelDataCache<DiskCache, ExpressCache> { /* private fields */ }Expand description
A data cache which uses both the local disk and S3 Express One Zone bucket as a storage.
Implementations§
Trait Implementations§
Source§impl<DiskCache, ExpressCache> DataCache for MultilevelDataCache<DiskCache, ExpressCache>
impl<DiskCache, ExpressCache> DataCache for MultilevelDataCache<DiskCache, ExpressCache>
Source§fn get_block<'life0, 'life1, 'async_trait>(
&'life0 self,
cache_key: &'life1 ObjectId,
block_idx: BlockIndex,
block_offset: u64,
object_size: usize,
) -> Pin<Box<dyn Future<Output = DataCacheResult<Option<ChecksummedBytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_block<'life0, 'life1, 'async_trait>(
&'life0 self,
cache_key: &'life1 ObjectId,
block_idx: BlockIndex,
block_offset: u64,
object_size: usize,
) -> Pin<Box<dyn Future<Output = DataCacheResult<Option<ChecksummedBytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets a block from one of the underlying caches. Populates the disk cache with data fetched from the S3 Express cache.
Source§fn put_block<'life0, 'async_trait>(
&'life0 self,
cache_key: ObjectId,
block_idx: BlockIndex,
block_offset: u64,
bytes: ChecksummedBytes,
object_size: usize,
) -> Pin<Box<dyn Future<Output = DataCacheResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_block<'life0, 'async_trait>(
&'life0 self,
cache_key: ObjectId,
block_idx: BlockIndex,
block_offset: u64,
bytes: ChecksummedBytes,
object_size: usize,
) -> Pin<Box<dyn Future<Output = DataCacheResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Puts a block to both caches.
Source§fn block_size(&self) -> u64
fn block_size(&self) -> u64
Returns the block size for the data cache.
Auto Trait Implementations§
impl<DiskCache, ExpressCache> Freeze for MultilevelDataCache<DiskCache, ExpressCache>where
ExpressCache: Freeze,
impl<DiskCache, ExpressCache> !RefUnwindSafe for MultilevelDataCache<DiskCache, ExpressCache>
impl<DiskCache, ExpressCache> Send for MultilevelDataCache<DiskCache, ExpressCache>
impl<DiskCache, ExpressCache> Sync for MultilevelDataCache<DiskCache, ExpressCache>
impl<DiskCache, ExpressCache> Unpin for MultilevelDataCache<DiskCache, ExpressCache>where
ExpressCache: Unpin,
impl<DiskCache, ExpressCache> !UnwindSafe for MultilevelDataCache<DiskCache, ExpressCache>
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
Mutably borrows from an owned value. Read more