Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.values
Class TypedPValue<T>
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.values.POutputValueBase
-
- com.google.cloud.dataflow.sdk.values.PValueBase
-
- com.google.cloud.dataflow.sdk.values.TypedPValue<T>
-
- Type Parameters:
T
- the type of the values stored in thisTypedPValue
- Direct Known Subclasses:
- PCollection
public abstract class TypedPValue<T> extends PValueBase implements PValue
ATypedPValue<T>
is the abstract base class of things that store some number of values of typeT
.Because we know the type
T
, this is the layer of the inheritance hierarchy where we store a coder for objects of typeT
.
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
TypedPValue(Pipeline p)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
finishSpecifying()
After building, finalizes thisPValue
to make it ready for running.Coder<T>
getCoder()
Returns theCoder
used by thisTypedPValue
to encode and decode the values stored in it.TypeDescriptor<T>
getTypeDescriptor()
Returns aTypeDescriptor<T>
with some reflective information aboutT
, if possible.TypedPValue<T>
setCoder(Coder<T> coder)
Sets theCoder
used by thisTypedPValue
to encode and decode the values stored in it.TypedPValue<T>
setTypeDescriptorInternal(TypeDescriptor<T> typeDescriptor)
Sets theTypeDescriptor<T>
associated with this class.-
Methods inherited from class com.google.cloud.dataflow.sdk.values.PValueBase
expand, getKindString, getName, isFinishedSpecifyingInternal, recordAsOutput, recordAsOutput, setName, toString
-
Methods inherited from class com.google.cloud.dataflow.sdk.values.POutputValueBase
finishSpecifyingOutput, getPipeline, getProducingTransformInternal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.cloud.dataflow.sdk.values.PValue
getName, getProducingTransformInternal
-
Methods inherited from interface com.google.cloud.dataflow.sdk.values.POutput
expand, finishSpecifyingOutput, getPipeline, recordAsOutput
-
Methods inherited from interface com.google.cloud.dataflow.sdk.values.PInput
expand, getPipeline
-
-
-
-
Constructor Detail
-
TypedPValue
protected TypedPValue(Pipeline p)
-
-
Method Detail
-
getCoder
public Coder<T> getCoder()
Returns theCoder
used by thisTypedPValue
to encode and decode the values stored in it.- Throws:
IllegalStateException
- if theCoder
hasn't been set, and couldn't be inferred.
-
setCoder
public TypedPValue<T> setCoder(Coder<T> coder)
- Throws:
IllegalStateException
- if thisTypedPValue
has already been finalized and is no longer settable, e.g., by havingapply()
called on it
-
finishSpecifying
public void finishSpecifying()
After building, finalizes thisPValue
to make it ready for running. Automatically invoked whenever thePValue
is "used" (e.g., when apply() is called on it) and when the Pipeline is run (useful if this is aPValue
with no consumers).- Specified by:
finishSpecifying
in interfacePInput
- Overrides:
finishSpecifying
in classPValueBase
-
getTypeDescriptor
public TypeDescriptor<T> getTypeDescriptor()
Returns aTypeDescriptor<T>
with some reflective information aboutT
, if possible. May returnnull
if no information is available. Subclasses may override this to enable betterCoder
inference.
-
setTypeDescriptorInternal
public TypedPValue<T> setTypeDescriptorInternal(TypeDescriptor<T> typeDescriptor)
Sets theTypeDescriptor<T>
associated with this class. Better reflective type information will lead to betterCoder
inference.
-
-