pub struct CoreProvider { /* private fields */ }Expand description
Shared provider implementation for live snapshots and recovery replay.
Live instances hold the exact ArcSwap used by crate::SharedGraph.
Recovery instances accumulate snapshot sections and WAL changes until
CoreProvider::finish_recovery materializes a SeleneGraph.
Implementations§
Source§impl CoreProvider
impl CoreProvider
Sourcepub fn new_for_live(snapshot: Arc<ArcSwap<SeleneGraph>>) -> Arc<Self>
pub fn new_for_live(snapshot: Arc<ArcSwap<SeleneGraph>>) -> Arc<Self>
Construct a live provider bound to a shared graph snapshot pointer.
Sourcepub fn new_for_live_with_wal(
snapshot: Arc<ArcSwap<SeleneGraph>>,
durable: Option<DurableState>,
) -> Arc<Self>
pub fn new_for_live_with_wal( snapshot: Arc<ArcSwap<SeleneGraph>>, durable: Option<DurableState>, ) -> Arc<Self>
Construct a live provider with optional commit-critical WAL state.
Sourcepub fn new_for_recovery() -> Arc<Self>
pub fn new_for_recovery() -> Arc<Self>
Construct a recovery-mode provider with an empty accumulator.
Sourcepub fn finish_recovery(
self: Arc<Self>,
expected_graph_id: GraphId,
expected_bound_type: Option<Arc<GraphTypeDef>>,
) -> GraphResult<SeleneGraph>
pub fn finish_recovery( self: Arc<Self>, expected_graph_id: GraphId, expected_bound_type: Option<Arc<GraphTypeDef>>, ) -> GraphResult<SeleneGraph>
Drain the recovery accumulator into a graph snapshot.
expected_graph_id is the caller-asserted graph identity. If a
snapshot’s CORE/META was applied and disagrees with this id,
recovery fails. If no CORE/META was applied (WAL-only or empty
recovery), expected_graph_id is used directly with default scalar
metadata fields.
§Errors
Returns crate::GraphError::Provider if this provider was
constructed for live mode, if META disagrees with
expected_graph_id, or if the accumulated section/changelog state
cannot be materialized into graph columns.
Trait Implementations§
Source§impl DurableProvider for CoreProvider
impl DurableProvider for CoreProvider
Source§fn provider_tag(&self) -> ProviderTag
fn provider_tag(&self) -> ProviderTag
Source§fn next_timestamp(&self) -> HlcTimestamp
fn next_timestamp(&self) -> HlcTimestamp
Source§fn write_commit(
&self,
principal: Option<&Arc<[u8]>>,
changes: &[Change],
timestamp: HlcTimestamp,
) -> Result<u64, ProviderError>
fn write_commit( &self, principal: Option<&Arc<[u8]>>, changes: &[Change], timestamp: HlcTimestamp, ) -> Result<u64, ProviderError>
Source§impl IndexProvider for CoreProvider
impl IndexProvider for CoreProvider
Source§fn provider_tag(&self) -> ProviderTag
fn provider_tag(&self) -> ProviderTag
Source§fn read_section(
&self,
sub_tag: SubTag,
bytes: &[u8],
) -> Result<(), ProviderError>
fn read_section( &self, sub_tag: SubTag, bytes: &[u8], ) -> Result<(), ProviderError>
Source§fn write_section(&self, sub_tag: SubTag) -> Result<Vec<u8>, ProviderError>
fn write_section(&self, sub_tag: SubTag) -> Result<Vec<u8>, ProviderError>
Source§fn on_change(&self, change: &Change) -> Result<(), ProviderError>
fn on_change(&self, change: &Change) -> Result<(), ProviderError>
Source§fn handles_change_batches(&self) -> bool
fn handles_change_batches(&self) -> bool
Source§fn on_changes(&self, changes: &[Change]) -> Result<(), ProviderError>
fn on_changes(&self, changes: &[Change]) -> Result<(), ProviderError>
Source§fn rebuild_from_graph(&self, _graph: &SeleneGraph) -> Result<(), ProviderError>
fn rebuild_from_graph(&self, _graph: &SeleneGraph) -> Result<(), ProviderError>
Source§fn on_commit_applied(&self, _generation: u64) -> Result<(), ProviderError>
fn on_commit_applied(&self, _generation: u64) -> Result<(), ProviderError>
Source§fn vector_candidate_set(
&self,
_name: &DbString,
_generation: u64,
) -> Result<Option<VectorCandidateSet>, ProviderError>
fn vector_candidate_set( &self, _name: &DbString, _generation: u64, ) -> Result<Option<VectorCandidateSet>, ProviderError>
Source§fn vector_candidate_state_infos(
&self,
_generation: u64,
) -> Result<Vec<VectorCandidateStateInfo>, ProviderError>
fn vector_candidate_state_infos( &self, _generation: u64, ) -> Result<Vec<VectorCandidateStateInfo>, ProviderError>
generation. Read moreSource§impl RecoveryProvider for CoreProvider
impl RecoveryProvider for CoreProvider
Source§fn provider_tag(&self) -> [u8; 4]
fn provider_tag(&self) -> [u8; 4]
Source§fn read_section(&self, sub: [u8; 4], bytes: &[u8]) -> RecoveryResult<()>
fn read_section(&self, sub: [u8; 4], bytes: &[u8]) -> RecoveryResult<()>
Source§fn on_changes(&self, changes: &[Change]) -> RecoveryResult<()>
fn on_changes(&self, changes: &[Change]) -> RecoveryResult<()>
Auto Trait Implementations§
impl !Freeze for CoreProvider
impl !RefUnwindSafe for CoreProvider
impl Send for CoreProvider
impl Sync for CoreProvider
impl Unpin for CoreProvider
impl UnsafeUnpin for CoreProvider
impl UnwindSafe for CoreProvider
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
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>
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.