Trait vector::config::SourceConfig
source · pub trait SourceConfig: DynClone + NamedComponent + Debug + Send + Sync + Serialize + Deserialize {
// Required methods
fn build<'life0, 'async_trait>(
&'life0 self,
cx: SourceContext,
) -> Pin<Box<dyn Future<Output = Result<Source>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn outputs(&self, global_log_namespace: LogNamespace) -> Vec<SourceOutput>;
fn can_acknowledge(&self) -> bool;
// Provided method
fn resources(&self) -> Vec<Resource> { ... }
}
Expand description
Generalized interface for describing and building source components.
Required Methods§
sourcefn build<'life0, 'async_trait>(
&'life0 self,
cx: SourceContext,
) -> Pin<Box<dyn Future<Output = Result<Source>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn build<'life0, 'async_trait>(
&'life0 self,
cx: SourceContext,
) -> Pin<Box<dyn Future<Output = Result<Source>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Builds the source with the given context.
If the source is built successfully, Ok(...)
is returned containing the source.
§Errors
If an error occurs while building the source, an error variant explaining the issue is returned.
sourcefn outputs(&self, global_log_namespace: LogNamespace) -> Vec<SourceOutput>
fn outputs(&self, global_log_namespace: LogNamespace) -> Vec<SourceOutput>
Gets the list of outputs exposed by this source.
sourcefn can_acknowledge(&self) -> bool
fn can_acknowledge(&self) -> bool
Whether or not this source can acknowledge the events it emits.
Generally, Vector uses acknowledgements to track when an event has finally been processed, either successfully or unsuccessfully. While it is used internally in some areas, such as within disk buffers for knowing when a message can be deleted from the buffer, it is primarily used to signal back to a source that a message has been successfully (durably) processed or not.
By exposing whether or not a source supports acknowledgements, we can avoid situations where using acknowledgements would only add processing overhead for no benefit to the source, as well as emit contextual warnings when end-to-end acknowledgements are enabled, but the topology as configured does not actually support the use of end-to-end acknowledgements.
Provided Methods§
sourcefn resources(&self) -> Vec<Resource>
fn resources(&self) -> Vec<Resource>
Gets the list of resources, if any, used by this source.
Resources represent dependencies – network ports, file descriptors, and so on – that cannot be shared between components at runtime. This ensures that components can not be configured in a way that would deadlock the spawning of a topology, and as well, allows Vector to determine the correct order for rebuilding a topology during configuration reload when resources must first be reclaimed before being reassigned, and so on.