pub struct ShardedBlockStore { /* private fields */ }Expand description
Sharded block store for parallel I/O
Implementations§
Source§impl ShardedBlockStore
impl ShardedBlockStore
Sourcepub fn with_shards(shard_count: usize) -> Self
pub fn with_shards(shard_count: usize) -> Self
Create with specific number of shards
Sourcepub fn write_block(&self, file_id: u64, data: &[u8]) -> Result<ShardedBlockRef>
pub fn write_block(&self, file_id: u64, data: &[u8]) -> Result<ShardedBlockRef>
Write a block for a specific file
Sourcepub fn write_block_with_compression(
&self,
file_id: u64,
data: &[u8],
compression: BlockCompression,
) -> Result<ShardedBlockRef>
pub fn write_block_with_compression( &self, file_id: u64, data: &[u8], compression: BlockCompression, ) -> Result<ShardedBlockRef>
Write a block with specific compression
Sourcepub fn read_block(&self, shard_ref: &ShardedBlockRef) -> Result<Vec<u8>>
pub fn read_block(&self, shard_ref: &ShardedBlockRef) -> Result<Vec<u8>>
Read a block
Sourcepub fn add_ref(&self, shard_ref: &ShardedBlockRef)
pub fn add_ref(&self, shard_ref: &ShardedBlockRef)
Increment reference count
Sourcepub fn release_ref(&self, shard_ref: &ShardedBlockRef) -> bool
pub fn release_ref(&self, shard_ref: &ShardedBlockRef) -> bool
Decrement reference count
Sourcepub fn stats(&self) -> ShardedBlockStoreStats
pub fn stats(&self) -> ShardedBlockStoreStats
Get aggregate statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ShardedBlockStore
impl !RefUnwindSafe for ShardedBlockStore
impl Send for ShardedBlockStore
impl Sync for ShardedBlockStore
impl Unpin for ShardedBlockStore
impl UnwindSafe for ShardedBlockStore
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
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>
Converts
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>
Converts
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