Package org.apache.beam.sdk.options
Interface ValueProvider<T>
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
ValueProvider.NestedValueProvider
,ValueProvider.RuntimeValueProvider
,ValueProvider.StaticValueProvider
public interface ValueProvider<T> extends java.io.Serializable
AValueProvider
abstracts the notion of fetching a value that may or may not be currently available.This can be used to parameterize transforms that only read values in at runtime, for example.
A common task is to create a
PCollection
containing the value of thisValueProvider
regardless of whether it's accessible at construction time or not. For that, useCreate.ofProvider(org.apache.beam.sdk.options.ValueProvider<T>, org.apache.beam.sdk.coders.Coder<T>)
.For unit-testing a transform against a
ValueProvider
that only becomes available at runtime, useTestPipeline.newProvider(T)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ValueProvider.Deserializer
For internal use only; no backwards compatibility guarantees.static class
ValueProvider.NestedValueProvider<T,X>
ValueProvider.NestedValueProvider
is an implementation ofValueProvider
that allows for wrapping anotherValueProvider
object.static class
ValueProvider.RuntimeValueProvider<T>
ValueProvider.RuntimeValueProvider
is an implementation ofValueProvider
that allows for a value to be provided at execution time rather than at graph construction time.static class
ValueProvider.Serializer
For internal use only; no backwards compatibility guarantees.static class
ValueProvider.StaticValueProvider<T>
ValueProvider.StaticValueProvider
is an implementation ofValueProvider
that allows for a static value to be provided.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
get()
Returns the runtime value wrapped by thisValueProvider
in case it isisAccessible()
, otherwise fails.boolean
isAccessible()
Whether the contents of thisValueProvider
is currently available viaget()
.
-
-
-
Method Detail
-
get
T get()
Returns the runtime value wrapped by thisValueProvider
in case it isisAccessible()
, otherwise fails.
-
isAccessible
boolean isAccessible()
Whether the contents of thisValueProvider
is currently available viaget()
.
-
-