Skip to main content

DocView

Struct DocView 

Source
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: usize

Chunks parsed by this view, for the bench and the tests.

Implementations§

Source§

impl DocView

Source

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.

Source

pub fn seq(&self) -> u64

Source

pub fn handle(&self) -> ManifestHandle

The handle a writer presents to CAS over this read.

Source

pub fn home(&self, p: &str) -> usize

The chunk a path falls in: the last whose first key is not after it.

Source

pub async fn chunk( &mut self, i: usize, ) -> LeanResult<Arc<BTreeMap<String, LeanEntry>>>

Chunk i’s entries, parsed once per view.

Source

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.

Source

pub async fn get(&mut self, p: &str) -> LeanResult<Option<LeanEntry>>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.