Skip to main content

ReferenceTableSource

Trait ReferenceTableSource 

Source
pub trait ReferenceTableSource: Send {
    // Required methods
    fn poll_snapshot<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<RecordBatch>, ConnectorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_snapshot_complete(&self) -> bool;
    fn poll_changes<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<RecordBatch>, ConnectorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn checkpoint(&self) -> SourceCheckpoint;
    fn restore<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        checkpoint: &'life1 SourceCheckpoint,
    ) -> Pin<Box<dyn Future<Output = Result<(), ConnectorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), ConnectorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A source that populates a reference/dimension table.

The lifecycle is:

  1. Call poll_snapshot repeatedly until it returns Ok(None) (snapshot complete).
  2. Optionally call poll_changes in a loop to receive incremental updates (CDC mode).
  3. Call close when the table is no longer needed.

Checkpoint/restore support allows resuming from a saved position across restarts.

Required Methods§

Source

fn poll_snapshot<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<RecordBatch>, ConnectorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Polls for the next batch of snapshot data.

Returns Ok(Some(batch)) while snapshot data is available. Returns Ok(None) when the snapshot is complete.

§Errors

Returns ConnectorError on read failure.

Source

fn is_snapshot_complete(&self) -> bool

Returns true once all snapshot batches have been delivered.

Source

fn poll_changes<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<RecordBatch>, ConnectorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Polls for the next batch of incremental changes (CDC).

Returns Ok(Some(batch)) when change data is available, Ok(None) when no changes are pending.

§Errors

Returns ConnectorError on read failure.

Source

fn checkpoint(&self) -> SourceCheckpoint

Creates a checkpoint of the current source position.

Source

fn restore<'life0, 'life1, 'async_trait>( &'life0 mut self, checkpoint: &'life1 SourceCheckpoint, ) -> Pin<Box<dyn Future<Output = Result<(), ConnectorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Restores the source position from a checkpoint.

§Errors

Returns ConnectorError if the checkpoint is invalid or restore fails.

Source

fn close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), ConnectorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Closes the source and releases resources.

§Errors

Returns ConnectorError if shutdown fails.

Implementors§