pub trait ArchiverReader: Send + Sync {
// Required methods
fn find_safe_boundary(&self, min_age_hours: i64) -> Result<ArchivalBoundary>;
fn fetch_events_batch(
&self,
max_command_id: i64,
age_cutoff: &DateTime<Utc>,
batch_size: i64,
after_event_id: Option<i64>,
) -> Result<Vec<ArchivedEvent>>;
fn fetch_orphan_commands_batch(
&self,
max_command_id: i64,
age_cutoff: &DateTime<Utc>,
batch_size: i64,
after_command_id: Option<i64>,
) -> Result<Vec<ArchivedCommand>>;
fn fetch_order_actions_batch(
&self,
age_cutoff: &DateTime<Utc>,
batch_size: i64,
after_id: Option<i32>,
) -> Result<Vec<ArchivedOrderAction>>;
fn fetch_order_updates_batch(
&self,
age_cutoff: &DateTime<Utc>,
batch_size: i64,
after_id: Option<i32>,
) -> Result<Vec<ArchivedOrderUpdate>>;
}Expand description
Read operations for the archiver: boundary discovery and batch fetching.
Required Methods§
Sourcefn find_safe_boundary(&self, min_age_hours: i64) -> Result<ArchivalBoundary>
fn find_safe_boundary(&self, min_age_hours: i64) -> Result<ArchivalBoundary>
Find the safe archival boundary based on the engine snapshot’s
last_command_id and the configured minimum age.
Sourcefn fetch_events_batch(
&self,
max_command_id: i64,
age_cutoff: &DateTime<Utc>,
batch_size: i64,
after_event_id: Option<i64>,
) -> Result<Vec<ArchivedEvent>>
fn fetch_events_batch( &self, max_command_id: i64, age_cutoff: &DateTime<Utc>, batch_size: i64, after_event_id: Option<i64>, ) -> Result<Vec<ArchivedEvent>>
Fetch a batch of engine events eligible for archival.
Sourcefn fetch_orphan_commands_batch(
&self,
max_command_id: i64,
age_cutoff: &DateTime<Utc>,
batch_size: i64,
after_command_id: Option<i64>,
) -> Result<Vec<ArchivedCommand>>
fn fetch_orphan_commands_batch( &self, max_command_id: i64, age_cutoff: &DateTime<Utc>, batch_size: i64, after_command_id: Option<i64>, ) -> Result<Vec<ArchivedCommand>>
Fetch engine commands that have no remaining engine events (orphans).
Sourcefn fetch_order_actions_batch(
&self,
age_cutoff: &DateTime<Utc>,
batch_size: i64,
after_id: Option<i32>,
) -> Result<Vec<ArchivedOrderAction>>
fn fetch_order_actions_batch( &self, age_cutoff: &DateTime<Utc>, batch_size: i64, after_id: Option<i32>, ) -> Result<Vec<ArchivedOrderAction>>
Fetch a batch of order actions eligible for archival.
Sourcefn fetch_order_updates_batch(
&self,
age_cutoff: &DateTime<Utc>,
batch_size: i64,
after_id: Option<i32>,
) -> Result<Vec<ArchivedOrderUpdate>>
fn fetch_order_updates_batch( &self, age_cutoff: &DateTime<Utc>, batch_size: i64, after_id: Option<i32>, ) -> Result<Vec<ArchivedOrderUpdate>>
Fetch a batch of order updates eligible for archival.