Google Cloud Dataflow SDK for Java, version 1.9.1
Class PValueBase
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.values.POutputValueBase
-
- com.google.cloud.dataflow.sdk.values.PValueBase
-
- Direct Known Subclasses:
- TypedPValue
public abstract class PValueBase extends POutputValueBase implements PValue
APValueBase
is an abstract base class that provides sensible default implementations for methods ofPValue
. In particular, this includes functionality for getting/setting:- The
Pipeline
that thePValue
is part of. - Whether the
PValue
has bee finalized (as an input or an output), after which its properties can no longer be changed.
For internal use.
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
PValueBase()
No-arg constructor for Java serialization only.protected
PValueBase(Pipeline pipeline)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Collection<? extends PValue>
expand()
void
finishSpecifying()
After building, finalizes thisPInput
to make it ready for being used as an input to aPTransform
.protected String
getKindString()
Returns aString
capturing the kind of thisPValueBase
.String
getName()
Returns the name of thisPValueBase
.boolean
isFinishedSpecifyingInternal()
Returns whether thisPValueBase
has been finalized, and its core properties, e.g., name, can no longer be changed.void
recordAsOutput(AppliedPTransform<?,?,?> transform)
Records that thisPOutputValueBase
is an output with the given name of the givenAppliedPTransform
.protected void
recordAsOutput(AppliedPTransform<?,?,?> transform, String outName)
Records that thisPOutputValueBase
is an output with the given name of the givenAppliedPTransform
in the givenPipeline
.PValueBase
setName(String name)
Sets the name of thisPValueBase
.String
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
getProducingTransformInternal
-
Methods inherited from interface com.google.cloud.dataflow.sdk.values.POutput
finishSpecifyingOutput, getPipeline
-
Methods inherited from interface com.google.cloud.dataflow.sdk.values.PInput
getPipeline
-
-
-
-
Constructor Detail
-
PValueBase
protected PValueBase(Pipeline pipeline)
-
PValueBase
protected PValueBase()
No-arg constructor for Java serialization only. The resultingPValueBase
is unlikely to be valid.
-
-
Method Detail
-
getName
public String getName()
Returns the name of thisPValueBase
.By default, the name of a
PValueBase
is based on the name of thePTransform
that produces it. It can be specified explicitly by callingsetName(java.lang.String)
.- Specified by:
getName
in interfacePValue
- Throws:
IllegalStateException
- if the name hasn't been set yet
-
setName
public PValueBase setName(String name)
Sets the name of thisPValueBase
. Returnsthis
.- Throws:
IllegalStateException
- if thisPValueBase
has already been finalized and may no longer be set.
-
recordAsOutput
public void recordAsOutput(AppliedPTransform<?,?,?> transform)
Description copied from class:POutputValueBase
Records that thisPOutputValueBase
is an output with the given name of the givenAppliedPTransform
.To be invoked only by
POutput.recordAsOutput(com.google.cloud.dataflow.sdk.transforms.AppliedPTransform<?, ?, ?>)
implementations. Not to be invoked directly by user code.- Specified by:
recordAsOutput
in interfacePOutput
- Overrides:
recordAsOutput
in classPOutputValueBase
-
recordAsOutput
protected void recordAsOutput(AppliedPTransform<?,?,?> transform, String outName)
Records that thisPOutputValueBase
is an output with the given name of the givenAppliedPTransform
in the givenPipeline
.To be invoked only by
POutput.recordAsOutput(com.google.cloud.dataflow.sdk.transforms.AppliedPTransform<?, ?, ?>)
implementations. Not to be invoked directly by user code.
-
isFinishedSpecifyingInternal
public boolean isFinishedSpecifyingInternal()
Returns whether thisPValueBase
has been finalized, and its core properties, e.g., name, can no longer be changed.For internal use only.
-
expand
public Collection<? extends PValue> expand()
Description copied from interface:POutput
Expands thisPOutput
into a list of its component outputPValues
.- A
PValue
expands to itself. - A tuple or list of
PValues
(such asPCollectionTuple
orPCollectionList
) expands to its componentPValue PValues
.
Not intended to be invoked directly by user code.
- A
-
finishSpecifying
public void finishSpecifying()
Description copied from interface:PInput
After building, finalizes thisPInput
to make it ready for being used as an input to aPTransform
.Automatically invoked whenever
apply()
is invoked on thisPInput
, so users do not normally call this explicitly.- Specified by:
finishSpecifying
in interfacePInput
-
getKindString
protected String getKindString()
Returns aString
capturing the kind of thisPValueBase
.By default, uses the base name of the current class as its kind string.
-
-