pub struct DocView {
pub pointer: Pointer,
pub etag: String,
pub last_modified_unix: Option<u64>,
pub refs: Vec<ChunkRef>,
pub tombstones: BTreeMap<String, Tombstone>,
pub chunks_read: usize,
/* private fields */
}Fields§
§pointer: Pointer§etag: String§last_modified_unix: Option<u64>§refs: Vec<ChunkRef>§tombstones: BTreeMap<String, Tombstone>§chunks_read: usizeChunks parsed by this view, for the bench and the tests.
Implementations§
Source§impl DocView
impl DocView
Sourcepub async fn open(
store: Arc<dyn ObjectStore>,
cfg: &LeanConfig,
first: Option<Option<LoadedPointer>>,
) -> LeanResult<Opened>
pub async fn open( store: Arc<dyn ObjectStore>, cfg: &LeanConfig, first: Option<Option<LoadedPointer>>, ) -> LeanResult<Opened>
Open the document at the pointer, first being a pointer read the
caller already made (as manifest::load_from). A chunk the pointer
names that the bucket lacks restarts onto a moved pointer and is
refused under an unchanged one, as a full load does.
pub fn seq(&self) -> u64
Sourcepub fn handle(&self) -> ManifestHandle
pub fn handle(&self) -> ManifestHandle
The handle a writer presents to CAS over this read.
Sourcepub fn home(&self, p: &str) -> usize
pub fn home(&self, p: &str) -> usize
The chunk a path falls in: the last whose first key is not after it.
Sourcepub async fn chunk(
&mut self,
i: usize,
) -> LeanResult<Arc<BTreeMap<String, LeanEntry>>>
pub async fn chunk( &mut self, i: usize, ) -> LeanResult<Arc<BTreeMap<String, LeanEntry>>>
Chunk i’s entries, parsed once per view.
Sourcepub async fn prefetch<'a>(
&mut self,
paths: impl IntoIterator<Item = &'a str>,
) -> LeanResult<()>
pub async fn prefetch<'a>( &mut self, paths: impl IntoIterator<Item = &'a str>, ) -> LeanResult<()>
Parse the chunks the given paths fall in, the misses fetched
chunk_fetch_parallelism at a time.
pub async fn get(&mut self, p: &str) -> LeanResult<Option<LeanEntry>>
Sourcepub async fn first_under(
&mut self,
prefix: &str,
skip: &dyn Fn(&str) -> bool,
) -> LeanResult<Option<String>>
pub async fn first_under( &mut self, prefix: &str, skip: &dyn Fn(&str) -> bool, ) -> LeanResult<Option<String>>
The first key of the document under prefix that skip does not
exclude, in key order.
Sourcepub async fn rechunk(
&mut self,
changes: &BTreeMap<String, Option<LeanEntry>>,
) -> LeanResult<Vec<(ChunkRef, Option<Vec<u8>>)>>
pub async fn rechunk( &mut self, changes: &BTreeMap<String, Option<LeanEntry>>, ) -> LeanResult<Vec<(ChunkRef, Option<Vec<u8>>)>>
chunk::rechunk_with over this view: a chunk the re-chunk needs and
this view has not read is fetched, and the re-chunk run again.
Sourcepub async fn retired(
&mut self,
overlay: &BTreeMap<String, Option<LeanEntry>>,
) -> LeanResult<Vec<String>>
pub async fn retired( &mut self, overlay: &BTreeMap<String, Option<LeanEntry>>, ) -> LeanResult<Vec<String>>
The retire set (§12, claim 2): each key theirs cites at a path of
overlay that the overlay drops, and that the merged document (the
overlay over this view) cites nowhere. In path order, a key twice
where two changed paths dropped it, as the whole-document loop gives
it. Every chunk’s aliases are read only when something was dropped.
Sourcepub async fn aliases(&mut self) -> LeanResult<Vec<(String, String)>>
pub async fn aliases(&mut self) -> LeanResult<Vec<(String, String)>>
Every alias of the document: each chunk’s, from the cache by address, the chunks the cache lacks parsed. What the cache lacks is read from this view’s own parse, never from the cache a second time: a prune between the two reads would drop aliases silently, and a missing alias reads as a handle nothing cites.
Sourcepub fn retain_aliases(&self, live: &HashSet<&str>)
pub fn retain_aliases(&self, live: &HashSet<&str>)
Forget the aliases of the chunks live does not name: the cache then
holds what the next commit can ask about.
Sourcepub async fn assemble(&mut self) -> LeanResult<LoadedManifest>
pub async fn assemble(&mut self) -> LeanResult<LoadedManifest>
The whole document, as a full load would give it: for the collection pass, the event trace and the shadow check.