Google Cloud Dataflow SDK for Java, version 1.9.1
Class Write.Bound<T>
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.transforms.PTransform<PCollection<T>,PDone>
-
- com.google.cloud.dataflow.sdk.io.Write.Bound<T>
-
- All Implemented Interfaces:
- HasDisplayData, Serializable
- Enclosing class:
- Write
public static class Write.Bound<T> extends PTransform<PCollection<T>,PDone>
APTransform
that writes to aSink
. See the class-level Javadoc for more information.- See Also:
Write
,Sink
, Serialized Form
-
-
Field Summary
-
Fields inherited from class com.google.cloud.dataflow.sdk.transforms.PTransform
name
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description PDone
apply(PCollection<T> input)
Applies thisPTransform
on the givenInputT
, and returns itsOutput
.int
getNumShards()
Returns the number of shards that will be produced in the output.Sink<T>
getSink()
Returns theSink
associated with this PTransform.void
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.Write.Bound<T>
withNumShards(int numShards)
Returns a newWrite.Bound
that will write to the currentSink
using the specified number of shards.-
Methods inherited from class com.google.cloud.dataflow.sdk.transforms.PTransform
getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString, validate
-
-
-
-
Method Detail
-
apply
public PDone apply(PCollection<T> input)
Description copied from class:PTransform
Applies thisPTransform
on the givenInputT
, and returns itsOutput
.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).
The default implementation throws an exception. A derived class must either implement apply, or else each runner must supply a custom implementation via
PipelineRunner.apply(com.google.cloud.dataflow.sdk.transforms.PTransform<InputT, OutputT>, InputT)
.- Overrides:
apply
in classPTransform<PCollection<T>,PDone>
-
populateDisplayData
public void populateDisplayData(DisplayData.Builder builder)
Description copied from class:PTransform
Register display data for the given transform or component.populateDisplayData(DisplayData.Builder)
is invoked by Pipeline runners to collect display data viaDisplayData.from(HasDisplayData)
. Implementations may callsuper.populateDisplayData(builder)
in order to register display data in the current namespace, but should otherwise usesubcomponent.populateDisplayData(builder)
to use the namespace of the subcomponent.By default, does not register any display data. Implementors may override this method to provide their own display data.
- Specified by:
populateDisplayData
in interfaceHasDisplayData
- Overrides:
populateDisplayData
in classPTransform<PCollection<T>,PDone>
- Parameters:
builder
- The builder to populate with display data.- See Also:
HasDisplayData
-
getNumShards
public int getNumShards()
Returns the number of shards that will be produced in the output.- See Also:
for more information
-
withNumShards
public Write.Bound<T> withNumShards(int numShards)
Returns a newWrite.Bound
that will write to the currentSink
using the specified number of shards.This option should be used sparingly as it can hurt performance. See
Write
for more information.A value less than or equal to 0 will be equivalent to the default behavior of runner-controlled sharding.
-
-