pub struct ForkScope { /* private fields */ }Expand description
Read-only scope identifying a forked session.
Constructed by Session::fork(name).build() (Day 7) via
ForkScope::new. Once built, both fork_info and overlay are
immutable for the scope’s lifetime — Phase 1 forks are read-only.
Implementations§
Source§impl ForkScope
impl ForkScope
Sourcepub fn new(
fork_info: Arc<ForkInfo>,
overlay: SchemaDelta,
registry: Arc<ForkRegistryHandle>,
) -> Self
pub fn new( fork_info: Arc<ForkInfo>, overlay: SchemaDelta, registry: Arc<ForkRegistryHandle>, ) -> Self
Build a new fork scope, registering a holder on registry.
fork_info must already be in Active status; callers should
have walked the registry’s open-or-create flow before invoking.
overlay is the schema delta loaded from
catalog/fork_schemas/{fork_id}.json.
Sourcepub fn record_fork_fragment(&self, table_name: &str, rows_added: u64)
pub fn record_fork_fragment(&self, table_name: &str, rows_added: u64)
Phase 5a: record rows_added rows newly written through this
fork to table_name. Idempotent under repeated calls — the
counter is monotonically increasing within a process lifetime.
Sourcepub fn fragment_count(&self, table_name: &str) -> u64
pub fn fragment_count(&self, table_name: &str) -> u64
Phase 5a: current accumulated row count for table_name on
this fork. Returns 0 if the fork has never written to it.
Sourcepub fn all_fragment_counts(&self) -> Vec<(String, u64)>
pub fn all_fragment_counts(&self) -> Vec<(String, u64)>
Phase 5a: snapshot of every (table, count) pair recorded on
this fork. Used by IndexRebuildManager to enumerate build
candidates each polling tick.
Sourcepub fn register_fork_local_index(
&self,
label: &str,
column: &str,
kind: ForkLocalIndexKind,
)
pub fn register_fork_local_index( &self, label: &str, column: &str, kind: ForkLocalIndexKind, )
Phase 5a: register a completed fork-local index build.
Called by IndexRebuildManager after the build lands on
the fork’s branch.
Sourcepub fn fork_local_index(
&self,
label: &str,
column: &str,
) -> Option<ForkLocalIndexKind>
pub fn fork_local_index( &self, label: &str, column: &str, ) -> Option<ForkLocalIndexKind>
Phase 5a: lookup the fork-local index kind for a (label, column) pair, if one has been built. Returns None when
the planner should fall back to the inherited primary index
(or to a plain scan).
Sourcepub fn all_fork_local_indexes(
&self,
) -> Vec<((String, String), ForkLocalIndexKind)>
pub fn all_fork_local_indexes( &self, ) -> Vec<((String, String), ForkLocalIndexKind)>
Phase 5a: snapshot of every registered fork-local index.
Sourcepub fn parent_fork_id(&self) -> Option<ForkId>
pub fn parent_fork_id(&self) -> Option<ForkId>
Parent fork id (Phase 3). None ⇒ parent is primary.
Used by UniInner::at_fork to walk the ancestor chain for
overlay composition, and by BranchedBackend to route
on-the-fly dataset creation through the parent’s branch.
Sourcepub fn overlay(&self) -> Arc<SchemaDelta> ⓘ
pub fn overlay(&self) -> Arc<SchemaDelta> ⓘ
Schema delta to merge on top of primary’s schema. Returns a
snapshot of the current overlay; subsequent
Self::add_label_to_overlay calls will not affect the
returned Arc.
Sourcepub fn branch_for(&self, dataset_name: &str) -> Option<String>
pub fn branch_for(&self, dataset_name: &str) -> Option<String>
Branch name for a given Lance dataset, if this fork has one.
Used by StorageManager dataset factories to route reads.
Consults both the immutable fork-point datasets map (set by
finish_create) and the dynamic-branches map (populated by
Self::register_dynamic_branch when a flush hits a dataset
that wasn’t branched at fork-point). Returns None only if no
branch exists on either side — the BranchedBackend then either
creates one on the fly or surfaces an error.
Sourcepub fn register_dynamic_branch(&self, dataset: String, branch: String)
pub fn register_dynamic_branch(&self, dataset: String, branch: String)
Record a branch created after fork-point (e.g. for a dataset that didn’t exist on primary at fork creation, or for compaction-only adjacency tables).
In-memory only; the caller is responsible for persisting via
ForkRegistryHandle::register_dataset_branch so a restart
recovers the same mapping. Idempotent — re-registering an
existing entry is a no-op.
Sourcepub async fn add_label_to_overlay(
&self,
name: String,
meta: LabelMeta,
) -> Result<()>
pub async fn add_label_to_overlay( &self, name: String, meta: LabelMeta, ) -> Result<()>
Append a label to the fork-local schema overlay and persist the new overlay to disk.
Idempotent: if a label with the same name is already in the
overlay (or in primary’s schema, accessible to the caller via
the merged SchemaManager not consulted here), the append
still records this entry — callers should check for duplicates
before invoking. The persistence-then-swap order means a
failed PUT leaves the in-memory ArcSwap untouched and the
returned error surfaces to the caller.
Concurrency: serialized within a single fork by overlay_lock
so two concurrent appends don’t clobber each other’s
persisted state.
Sourcepub async fn add_edge_type_to_overlay(
&self,
name: String,
meta: EdgeTypeMeta,
) -> Result<()>
pub async fn add_edge_type_to_overlay( &self, name: String, meta: EdgeTypeMeta, ) -> Result<()>
Append an edge type to the fork-local schema overlay and
persist. Same semantics as Self::add_label_to_overlay.
Sourcepub fn registry(&self) -> Arc<ForkRegistryHandle> ⓘ
pub fn registry(&self) -> Arc<ForkRegistryHandle> ⓘ
Registry handle (used by admin paths to e.g. compute holder counts).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ForkScope
impl !UnwindSafe for ForkScope
impl Freeze for ForkScope
impl Send for ForkScope
impl Sync for ForkScope
impl Unpin for ForkScope
impl UnsafeUnpin for ForkScope
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> PluginState for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.