public static class Create.Values<T> extends PTransform<PBegin,PCollection<T>>
PTransform
that creates a PCollection
from a set of in-memory objects.name
Modifier and Type | Method and Description |
---|---|
PCollection<T> |
expand(PBegin input)
Applies this
PTransform on the given InputT , and returns its
Output . |
Coder<T> |
getDefaultOutputCoder(PBegin input)
Returns the default
Coder to use for the output of this
single-output PTransform when applied to the given input. |
java.lang.Iterable<T> |
getElements() |
Create.Values<T> |
withCoder(Coder<T> coder)
Returns a
Create.Values PTransform like this one that uses the given
Coder<T> to decode each of the objects into a
value of type T . |
Create.Values<T> |
withType(TypeDescriptor<T> type)
Returns a
Create.Values PTransform like this one that uses the given
TypeDescriptor<T> to determine the Coder to use to decode each of the
objects into a value of type T . |
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validate
public Create.Values<T> withCoder(Coder<T> coder)
Create.Values
PTransform like this one that uses the given
Coder<T>
to decode each of the objects into a
value of type T
.
By default, Create.Values
can automatically determine the Coder
to use
if all elements have the same non-parameterized run-time class, and a default coder is
registered for that class. See CoderRegistry
for details on how defaults are
determined.
Note that for Create.Values
with no elements, the VoidCoder
is used.
public Create.Values<T> withType(TypeDescriptor<T> type)
Create.Values
PTransform like this one that uses the given
TypeDescriptor<T>
to determine the Coder
to use to decode each of the
objects into a value of type T
. Note that a default coder must be registered for the
class described in the TypeDescriptor<T>
.
By default, Create.Values
can automatically determine the Coder
to use
if all elements have the same non-parameterized run-time class, and a default coder is
registered for that class. See CoderRegistry
for details on how defaults are
determined.
Note that for Create.Values
with no elements, the VoidCoder
is used.
public java.lang.Iterable<T> getElements()
public PCollection<T> expand(PBegin input)
PTransform
PTransform
on the given InputT
, and returns its
Output
.
Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
expand
in class PTransform<PBegin,PCollection<T>>
public Coder<T> getDefaultOutputCoder(PBegin input) throws CannotProvideCoderException
PTransform
Coder
to use for the output of this
single-output PTransform
when applied to the given input.
By default, always throws.
getDefaultOutputCoder
in class PTransform<PBegin,PCollection<T>>
CannotProvideCoderException
- if none can be inferred.