pub struct HashChunkDict { /* private fields */ }Implementations§
Source§impl HashChunkDict
impl HashChunkDict
Sourcepub fn new(digester: Algorithm) -> Self
pub fn new(digester: Algorithm) -> Self
Create a new instance of HashChunkDict.
Sourcepub fn hashmap(&self) -> &HashMap<RafsDigest, (Arc<ChunkWrapper>, AtomicU32)>
pub fn hashmap(&self) -> &HashMap<RafsDigest, (Arc<ChunkWrapper>, AtomicU32)>
Get an immutable reference to the internal HashMap.
Sourcepub fn from_commandline_arg(
arg: &str,
config: Arc<ConfigV2>,
rafs_config: &RafsSuperConfig,
) -> Result<Arc<dyn ChunkDict>>
pub fn from_commandline_arg( arg: &str, config: Arc<ConfigV2>, rafs_config: &RafsSuperConfig, ) -> Result<Arc<dyn ChunkDict>>
Parse commandline argument for chunk dictionary and load chunks into the dictionary.
Sourcepub fn from_bootstrap_file(
path: &Path,
config: Arc<ConfigV2>,
rafs_config: &RafsSuperConfig,
) -> Result<Self>
pub fn from_bootstrap_file( path: &Path, config: Arc<ConfigV2>, rafs_config: &RafsSuperConfig, ) -> Result<Self>
Load chunks from the RAFS filesystem into the chunk dictionary.
Trait Implementations§
Source§impl ChunkDict for HashChunkDict
impl ChunkDict for HashChunkDict
Source§fn add_chunk(&mut self, chunk: Arc<ChunkWrapper>, digester: Algorithm)
fn add_chunk(&mut self, chunk: Arc<ChunkWrapper>, digester: Algorithm)
Add a chunk into the cache.
Source§fn get_chunk(
&self,
digest: &RafsDigest,
uncompressed_size: u32,
) -> Option<&Arc<ChunkWrapper>>
fn get_chunk( &self, digest: &RafsDigest, uncompressed_size: u32, ) -> Option<&Arc<ChunkWrapper>>
Get a cached chunk from the cache.
Source§fn get_blobs(&self) -> Vec<Arc<BlobInfo>>
fn get_blobs(&self) -> Vec<Arc<BlobInfo>>
Get all
BlobInfo objects referenced by cached chunks.Source§fn get_blob_by_inner_idx(&self, idx: u32) -> Option<&Arc<BlobInfo>>
fn get_blob_by_inner_idx(&self, idx: u32) -> Option<&Arc<BlobInfo>>
Get the
BlobInfo object with inner index idx.Source§fn set_real_blob_idx(&self, inner_idx: u32, out_idx: u32)
fn set_real_blob_idx(&self, inner_idx: u32, out_idx: u32)
Associate an external index with the inner index.
Auto Trait Implementations§
impl !Freeze for HashChunkDict
impl !RefUnwindSafe for HashChunkDict
impl Send for HashChunkDict
impl Sync for HashChunkDict
impl Unpin for HashChunkDict
impl !UnwindSafe for HashChunkDict
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