public interface JvmInitializer
During pipeline execution,
beforeProcessing will be invoked at
the appropriate stage of execution after the JVM is launched. Currently this is only supported in
portable pipelines or when using Google Cloud Dataflow.
ServiceLoader is used to discover implementations of
note that you will need to register your implementation with the appropriate resources to ensure
your code is executed. You can use a tool like
|Modifier and Type||Method and Description|
Implement beforeProcessing to run some custom initialization after basic services such as logging, but before data processing begins.
Implement onStartup to run some custom initialization immediately after the JVM is launched for pipeline execution.
default void onStartup()
In general users should prefer to implement
beforeProcessing to perform custom
initialization so that basic services such as logging can be initialized first, but
onStartup is also provided if initialization absolutely needs to be run immediately after
default void beforeProcessing(PipelineOptions options)
options- The pipeline options passed to the worker.