@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public static @interface DoFn.Setup
This is a good place to initialize transient in-memory resources, such as network
connections. The resources can then be disposed in DoFn.Teardown
.
This is not a good place to perform external side-effects that later need cleanup,
e.g. creating temporary files on distributed filesystems, starting VMs, or initiating data
export jobs. Such logic must be instead implemented purely via DoFn.StartBundle
, DoFn.ProcessElement
and DoFn.FinishBundle
methods, references to the objects requiring cleanup
must be passed as PCollection
elements, and they must be cleaned up via regular Beam
transforms, e.g. see the Wait
transform.
The method annotated with this must satisfy the following constraints: