pub trait TransformConfig:
DynClone
+ NamedComponent
+ Debug
+ Send
+ Sync
+ Serialize
+ Deserialize {
// Required methods
fn build<'life0, 'life1, 'async_trait>(
&'life0 self,
globals: &'life1 TransformContext,
) -> Pin<Box<dyn Future<Output = Result<Transform>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn input(&self) -> Input;
fn outputs(
&self,
globals: &TransformContext,
input_definitions: &[(OutputId, Definition)],
) -> Vec<TransformOutput>;
// Provided methods
fn validate(&self, _context: &TransformContext) -> Result<(), Vec<String>> { ... }
fn validate_env(
&self,
_context: &TransformContext,
) -> Result<(), Vec<String>> { ... }
fn enable_concurrency(&self) -> bool { ... }
fn nestable(&self, _parents: &HashSet<&'static str>) -> bool { ... }
fn files_to_watch(&self) -> Vec<&PathBuf> { ... }
}Expand description
Generalized interface for describing and building transform components.
Required Methods§
Sourcefn build<'life0, 'life1, 'async_trait>(
&'life0 self,
globals: &'life1 TransformContext,
) -> Pin<Box<dyn Future<Output = Result<Transform>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn build<'life0, 'life1, 'async_trait>(
&'life0 self,
globals: &'life1 TransformContext,
) -> Pin<Box<dyn Future<Output = Result<Transform>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Builds the transform with the given context.
If the transform is built successfully, Ok(...) is returned containing the transform.
§Errors
If an error occurs while building the transform, an error variant explaining the issue is returned.
Sourcefn outputs(
&self,
globals: &TransformContext,
input_definitions: &[(OutputId, Definition)],
) -> Vec<TransformOutput>
fn outputs( &self, globals: &TransformContext, input_definitions: &[(OutputId, Definition)], ) -> Vec<TransformOutput>
Gets the list of outputs exposed by this transform.
The provided merged_definition can be used by transforms to understand the expected shape
of events flowing through the transform.
Provided Methods§
Sourcefn validate(&self, _context: &TransformContext) -> Result<(), Vec<String>>
fn validate(&self, _context: &TransformContext) -> Result<(), Vec<String>>
Validates that the configuration of the transform is valid.
Validates structural constraints on the transform configuration that do not require
environment resources: reserved output names, duplicate route names, invalid sample
rates, and similar config-level checks. Called during config compilation so errors
are reported on both vector validate and normal startup/reload.
§Errors
If validation does not succeed, an error variant containing a list of all validation errors is returned.
Sourcefn validate_env(&self, _context: &TransformContext) -> Result<(), Vec<String>>
fn validate_env(&self, _context: &TransformContext) -> Result<(), Vec<String>>
Validates the transform configuration against environment resources: compiles VRL
programs, builds conditions, and resolves enrichment table references. Only called
from vector validate (via validate_transforms), not during normal startup because
build() performs equivalent checks with real resources.
§Errors
If validation does not succeed, an error variant containing a list of all validation errors is returned.
Sourcefn enable_concurrency(&self) -> bool
fn enable_concurrency(&self) -> bool
Whether or not concurrency should be enabled for this transform.
When enabled, this transform may be run in parallel in order to attempt to maximize throughput for this node in the topology. Transforms should generally not run concurrently unless they are compute-heavy, as there is a cost/overhead associated with fanning out events to the parallel transform tasks.
Sourcefn nestable(&self, _parents: &HashSet<&'static str>) -> bool
fn nestable(&self, _parents: &HashSet<&'static str>) -> bool
Whether or not this transform can be nested, given the types of transforms it would be nested within.
For some transforms, they can expand themselves into a subtopology of nested transforms. However, in order to prevent an infinite recursion of nested transforms, we may want to only allow one layer of “expansion”. Additionally, there may be known issues with a transform that is nested under another specific transform interacting poorly, or incorrectly.
This method allows a transform to report if it can or cannot function correctly if it is nested under transforms of a specific type, or if such nesting is fundamentally disallowed.
Sourcefn files_to_watch(&self) -> Vec<&PathBuf>
fn files_to_watch(&self) -> Vec<&PathBuf>
Gets the files to watch to trigger reload