Skip to main content

JournalReplayReader

Trait JournalReplayReader 

Source
pub trait JournalReplayReader: Send + Sync {
    // Required methods
    fn get_next_engine_command_id_sync(&self) -> Result<i64>;
    fn get_journal_command_id_bounds_sync(
        &self,
    ) -> Result<Option<JournalCommandIdBounds>>;
    fn count_non_replayable_commands_in_range_sync(
        &self,
        start_command_id: i64,
        end_command_id: i64,
    ) -> Result<i64>;
    fn get_commands_with_l2_after_seq_sync(
        &self,
        l2_seq: i64,
    ) -> Result<Vec<ReplayCommand>>;
    fn get_replay_commands_after_command_id_sync(
        &self,
        after_command_id: i64,
        up_to_command_id: Option<i64>,
        limit: i64,
    ) -> Result<Vec<ReplayCommand>>;
    fn get_fill_events_for_command_range_sync(
        &self,
        start_command_id: i64,
        end_command_id: i64,
    ) -> Result<Vec<Vec<u8>>>;
    fn get_portfolio_events_for_command_range_sync(
        &self,
        start_command_id: i64,
        end_command_id: i64,
    ) -> Result<Vec<PortfolioReplayEvent>>;
    fn get_order_update_events_for_command_range_sync(
        &self,
        start_command_id: i64,
        end_command_id: i64,
    ) -> Result<Vec<Vec<u8>>>;
    fn get_max_l2_seq_from_events_sync(&self) -> Result<i64>;
    fn get_fill_events_after_seq_sync(
        &self,
        l2_seq: i64,
    ) -> Result<Vec<Vec<u8>>>;
    fn get_order_update_events_after_seq_sync(
        &self,
        l2_seq: i64,
    ) -> Result<Vec<Vec<u8>>>;
}
Expand description

Read-only queries for engine journal replay after snapshot recovery.

Required Methods§

Source

fn get_next_engine_command_id_sync(&self) -> Result<i64>

Next command_id for sequence initialization (MAX + 1, or 1 if empty).

Source

fn get_journal_command_id_bounds_sync( &self, ) -> Result<Option<JournalCommandIdBounds>>

Inclusive command-id bounds for replayable rows in engine_commands.

Source

fn count_non_replayable_commands_in_range_sync( &self, start_command_id: i64, end_command_id: i64, ) -> Result<i64>

Count durable non-replayable journal rows in a command-id range (exclusive start, inclusive end).

Source

fn get_commands_with_l2_after_seq_sync( &self, l2_seq: i64, ) -> Result<Vec<ReplayCommand>>

Fetch commands that produced L2 events after the snapshot’s L2 sequence. Used for the primary replay path (Pass 1).

Source

fn get_replay_commands_after_command_id_sync( &self, after_command_id: i64, up_to_command_id: Option<i64>, limit: i64, ) -> Result<Vec<ReplayCommand>>

Paginated replay cursor: fetch up to limit commands after after_command_id, optionally bounded by up_to_command_id.

Source

fn get_fill_events_for_command_range_sync( &self, start_command_id: i64, end_command_id: i64, ) -> Result<Vec<Vec<u8>>>

Raw OrderFilled event payloads in a command_id range (exclusive start, inclusive end).

Source

fn get_portfolio_events_for_command_range_sync( &self, start_command_id: i64, end_command_id: i64, ) -> Result<Vec<PortfolioReplayEvent>>

Portfolio-relevant events (OrderFilled + PositionExpired) in a command_id range. Used during portfolio cache replay.

Source

fn get_order_update_events_for_command_range_sync( &self, start_command_id: i64, end_command_id: i64, ) -> Result<Vec<Vec<u8>>>

Raw OrderUpdate event payloads in a command_id range (exclusive start, inclusive end).

Source

fn get_max_l2_seq_from_events_sync(&self) -> Result<i64>

Maximum L2 sequence from engine_events. Returns 0 if no L2 events exist.

Source

fn get_fill_events_after_seq_sync(&self, l2_seq: i64) -> Result<Vec<Vec<u8>>>

Raw OrderFilled event payloads after the snapshot boundary (by L2 sequence). Used during replay Pass 2 (fill reconciliation).

Source

fn get_order_update_events_after_seq_sync( &self, l2_seq: i64, ) -> Result<Vec<Vec<u8>>>

Raw OrderUpdate event payloads after the snapshot boundary (by L2 sequence). Used during replay Pass 3 (side-effect cancel detection).

Implementors§