pub trait SourcePlugin:
SupportsGracefulShutdown
+ Send
+ Sync {
// Required methods
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn output_schema(&self) -> Result<SchemaRef, PluginError>;
fn generate_batch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn process_checkpoint_marker<'life0, 'async_trait>(
&'life0 self,
epoch: CheckpointEpoch,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn process_checkpoint_finalizer<'life0, 'async_trait>(
&'life0 self,
epoch: CheckpointEpoch,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn labels(&self) -> Vec<PluginLabel> { ... }
}Expand description
Optional, non-FFI trait for the plugins to implement source support.
Required Methods§
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn output_schema(&self) -> Result<SchemaRef, PluginError>
Sourcefn generate_batch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_batch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return an empty batch to indicate missing data if needed.
Sourcefn process_checkpoint_marker<'life0, 'async_trait>(
&'life0 self,
epoch: CheckpointEpoch,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn process_checkpoint_marker<'life0, 'async_trait>(
&'life0 self,
epoch: CheckpointEpoch,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returning a successful result indicates that the checkpoint marker was processed successfully, and the mark should be propagated downstream.
fn process_checkpoint_finalizer<'life0, 'async_trait>(
&'life0 self,
epoch: CheckpointEpoch,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Provided Methods§
Sourcefn labels(&self) -> Vec<PluginLabel>
fn labels(&self) -> Vec<PluginLabel>
Identity labels for this plugin instance. Typically derived from options at
construction time (e.g. chain_slug, network, topic). Returned labels flow
through PluginResult::labels into the metrics subsystem as Prometheus labels.
Default: no labels.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".