public abstract static class PubsubIO.Write<T> extends PTransform<PCollection<T>,PDone>
PubsubIO.write()
.Modifier and Type | Class and Description |
---|---|
class |
PubsubIO.Write.PubsubBoundedWriter
Writer to Pubsub which batches messages from bounded collections.
|
name
Constructor and Description |
---|
Write() |
Modifier and Type | Method and Description |
---|---|
PDone |
expand(PCollection<T> input)
Applies this
PTransform on the given InputT , and returns its
Output . |
protected Coder<java.lang.Void> |
getDefaultOutputCoder()
Returns the default
Coder to use for the output of this
single-output PTransform . |
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
PubsubIO.Write<T> |
to(java.lang.String topic)
Publishes to the specified topic.
|
PubsubIO.Write<T> |
to(ValueProvider<java.lang.String> topic)
Like
topic() but with a ValueProvider . |
PubsubIO.Write<T> |
withIdAttribute(java.lang.String idAttribute)
Writes to Pub/Sub, adding each record's unique identifier to the published messages in an
attribute with the specified name.
|
PubsubIO.Write<T> |
withTimestampAttribute(java.lang.String timestampAttribute)
Writes to Pub/Sub and adds each record's timestamp to the published messages in an attribute
with the specified name.
|
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString, validate
public PubsubIO.Write<T> to(java.lang.String topic)
See PubsubIO.PubsubTopic.fromPath(String)
for more details on the format of the
topic
string.
public PubsubIO.Write<T> to(ValueProvider<java.lang.String> topic)
topic()
but with a ValueProvider
.public PubsubIO.Write<T> withTimestampAttribute(java.lang.String timestampAttribute)
Instant.Instant(long)
can be used to parse this value.
If the output from this sink is being read by another Beam pipeline, then
PubsubIO.Read.withTimestampAttribute(String)
can be used to ensure the other source
reads these timestamps from the appropriate attribute.
public PubsubIO.Write<T> withIdAttribute(java.lang.String idAttribute)
If the the output from this sink is being read by another Beam pipeline, then PubsubIO.Read.withIdAttribute(String)
can be used to ensure that* the other source reads
these unique identifiers from the appropriate attribute.
public PDone expand(PCollection<T> 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<PCollection<T>,PDone>
public void populateDisplayData(DisplayData.Builder builder)
PTransform
populateDisplayData(DisplayData.Builder)
is invoked by Pipeline runners to collect
display data via DisplayData.from(HasDisplayData)
. Implementations may call
super.populateDisplayData(builder)
in order to register display data in the current
namespace, but should otherwise use subcomponent.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.
populateDisplayData
in interface HasDisplayData
populateDisplayData
in class PTransform<PCollection<T>,PDone>
builder
- The builder to populate with display data.HasDisplayData
protected Coder<java.lang.Void> getDefaultOutputCoder()
PTransform
Coder
to use for the output of this
single-output PTransform
.
By default, always throws
getDefaultOutputCoder
in class PTransform<PCollection<T>,PDone>