Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions crates/core/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,26 @@ where

Ok(WalSeed::Seeded(cursor))
}

/// The durable result of importing one batch.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ReplayProgress {
/// The batch committed normally at this state-store position.
Committed { position: ChainPoint },
/// The configured stopping epoch fired after its anchoring block committed.
Boundary { position: ChainPoint },
}

impl ReplayProgress {
/// The committed state cursor reported by this import.
pub fn position(&self) -> &ChainPoint {
match self {
Self::Committed { position } | Self::Boundary { position } => position,
}
}

/// Whether the configured stopping boundary was reached.
pub fn is_boundary(&self) -> bool {
matches!(self, Self::Boundary { .. })
}
}
2 changes: 1 addition & 1 deletion crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub mod wal;
pub mod work_unit;

pub use bootstrap::BootstrapExt;
pub use import::{seed_wal_from_state, ImportExt, WalSeed, WalSeedError};
pub use import::{seed_wal_from_state, ImportExt, ReplayProgress, WalSeed, WalSeedError};
pub use submit::SubmitExt;
pub use sync::SyncExt;
pub use work_unit::{MempoolUpdate, WorkUnit};
Expand Down
Loading
Loading