Google Cloud Dataflow SDK for Java, version 1.9.1
Class PubsubIO.Write.Bound<T>
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.transforms.PTransform<PCollection<T>,PDone>
-
- com.google.cloud.dataflow.sdk.io.PubsubIO.Write.Bound<T>
-
- All Implemented Interfaces:
- HasDisplayData, Serializable
- Enclosing class:
- PubsubIO.Write
public static class PubsubIO.Write.Bound<T> extends PTransform<PCollection<T>,PDone>
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description class
PubsubIO.Write.Bound.PubsubWriter
Writer to Pubsub which batches messages from bounded collections.
-
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
.Coder<T>
getCoder()
protected Coder<Void>
getDefaultOutputCoder()
Returns the defaultCoder
to use for the output of this single-outputPTransform
.String
getIdLabel()
String
getTimestampLabel()
PubsubIO.PubsubTopic
getTopic()
ValueProvider<PubsubIO.PubsubTopic>
getTopicProvider()
PubsubIO.Write.Bound<T>
idLabel(String idLabel)
Returns a new transform that's like this one but that publishes unique record IDs to a message attribute with the specified name.PubsubIO.Write.Bound<T>
named(String name)
Returns a new transform that's like this one but with the specified step name.void
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.PubsubIO.Write.Bound<T>
timestampLabel(String timestampLabel)
Returns a new transform that's like this one but that publishes record timestamps to a message attribute with the specified name.PubsubIO.Write.Bound<T>
topic(String topic)
Returns a new transform that's like this one but that writes to the specified topic.PubsubIO.Write.Bound<T>
topic(ValueProvider<String> topic)
Liketopic()
but with aValueProvider
.<X> PubsubIO.Write.Bound<X>
withCoder(Coder<X> coder)
Returns a new transform that's like this one but that uses the givenCoder
to encode each of the elements of the inputPCollection
into an output record.-
Methods inherited from class com.google.cloud.dataflow.sdk.transforms.PTransform
getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString, validate
-
-
-
-
Method Detail
-
named
public PubsubIO.Write.Bound<T> named(String name)
Returns a new transform that's like this one but with the specified step name.Does not modify this object.
-
topic
public PubsubIO.Write.Bound<T> topic(String topic)
Returns a new transform that's like this one but that writes to the specified topic.See
PubsubIO.PubsubTopic.fromPath(String)
for more details on the format of thetopic
string.Does not modify this object.
-
topic
public PubsubIO.Write.Bound<T> topic(ValueProvider<String> topic)
Liketopic()
but with aValueProvider
.
-
timestampLabel
public PubsubIO.Write.Bound<T> timestampLabel(String timestampLabel)
Returns a new transform that's like this one but that publishes record timestamps to a message attribute with the specified name. SeePubsubIO.Write.timestampLabel(String)
for more details.Does not modify this object.
-
idLabel
public PubsubIO.Write.Bound<T> idLabel(String idLabel)
Returns a new transform that's like this one but that publishes unique record IDs to a message attribute with the specified name. SeePubsubIO.Write.idLabel(String)
for more details.Does not modify this object.
-
withCoder
public <X> PubsubIO.Write.Bound<X> withCoder(Coder<X> coder)
Returns a new transform that's like this one but that uses the givenCoder
to encode each of the elements of the inputPCollection
into an output record.Does not modify this object.
- Type Parameters:
X
- the type of the elements of the inputPCollection
-
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
-
getDefaultOutputCoder
protected Coder<Void> getDefaultOutputCoder()
Description copied from class:PTransform
Returns the defaultCoder
to use for the output of this single-outputPTransform
.By default, always throws
- Overrides:
getDefaultOutputCoder
in classPTransform<PCollection<T>,PDone>
-
getTopic
public PubsubIO.PubsubTopic getTopic()
-
getTopicProvider
public ValueProvider<PubsubIO.PubsubTopic> getTopicProvider()
-
getTimestampLabel
public String getTimestampLabel()
-
getIdLabel
public String getIdLabel()
-
-