public class PubsubUnboundedSink extends PTransform<PCollection<PubsubMessage>,PDone>
GroupByKey
followed by a ParDo
which publishes as a side effect. (In the future we want to design and switch to a custom
UnboundedSink
implementation so as to gain access to system watermark and
end-of-pipeline cleanup.)
DoFn
instances to execute concurrently and hide latency.
annotations, displayData, name, resourceHints
Constructor and Description |
---|
PubsubUnboundedSink(PubsubClient.PubsubClientFactory pubsubFactory,
ValueProvider<PubsubClient.TopicPath> topic,
java.lang.String timestampAttribute,
java.lang.String idAttribute,
int numShards) |
PubsubUnboundedSink(PubsubClient.PubsubClientFactory pubsubFactory,
ValueProvider<PubsubClient.TopicPath> topic,
java.lang.String timestampAttribute,
java.lang.String idAttribute,
int numShards,
int publishBatchSize,
int publishBatchBytes) |
PubsubUnboundedSink(PubsubClient.PubsubClientFactory pubsubFactory,
ValueProvider<PubsubClient.TopicPath> topic,
java.lang.String timestampAttribute,
java.lang.String idAttribute,
int numShards,
int publishBatchSize,
int publishBatchBytes,
java.lang.String pubsubRootUrl) |
PubsubUnboundedSink(PubsubClient.PubsubClientFactory pubsubFactory,
ValueProvider<PubsubClient.TopicPath> topic,
java.lang.String timestampAttribute,
java.lang.String idAttribute,
int numShards,
java.lang.String pubsubRootUrl) |
Modifier and Type | Method and Description |
---|---|
PDone |
expand(PCollection<PubsubMessage> input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
@Nullable java.lang.String |
getIdAttribute()
Get the id attribute.
|
@Nullable java.lang.String |
getTimestampAttribute()
Get the timestamp attribute.
|
@Nullable PubsubClient.TopicPath |
getTopic()
Get the topic being written to.
|
@Nullable ValueProvider<PubsubClient.TopicPath> |
getTopicProvider()
Get the
ValueProvider for the topic being written to. |
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
public PubsubUnboundedSink(PubsubClient.PubsubClientFactory pubsubFactory, ValueProvider<PubsubClient.TopicPath> topic, java.lang.String timestampAttribute, java.lang.String idAttribute, int numShards)
public PubsubUnboundedSink(PubsubClient.PubsubClientFactory pubsubFactory, ValueProvider<PubsubClient.TopicPath> topic, java.lang.String timestampAttribute, java.lang.String idAttribute, int numShards, java.lang.String pubsubRootUrl)
public PubsubUnboundedSink(PubsubClient.PubsubClientFactory pubsubFactory, ValueProvider<PubsubClient.TopicPath> topic, java.lang.String timestampAttribute, java.lang.String idAttribute, int numShards, int publishBatchSize, int publishBatchBytes)
public PubsubUnboundedSink(PubsubClient.PubsubClientFactory pubsubFactory, ValueProvider<PubsubClient.TopicPath> topic, java.lang.String timestampAttribute, java.lang.String idAttribute, int numShards, int publishBatchSize, int publishBatchBytes, java.lang.String pubsubRootUrl)
public @Nullable PubsubClient.TopicPath getTopic()
public @Nullable ValueProvider<PubsubClient.TopicPath> getTopicProvider()
ValueProvider
for the topic being written to.public @Nullable java.lang.String getTimestampAttribute()
public @Nullable java.lang.String getIdAttribute()
public PDone expand(PCollection<PubsubMessage> input)
PTransform
PTransform
should be expanded on the given
InputT
.
NOTE: This method should not be called directly. Instead apply the PTransform
should
be applied to the InputT
using the apply
method.
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<PubsubMessage>,PDone>