public class PubsubUnboundedSource extends PTransform<PBegin,PCollection<PubsubMessage>>
PubsubIO.read() instead.
A PTransform which streams messages from Pubsub.
UnboundedSource which receives messages
in batches and hands them out one at a time.
UnboundedSource.UnboundedReader instances to execute concurrently and thus hide latency.
name| Constructor and Description |
|---|
PubsubUnboundedSource(PubsubClient.PubsubClientFactory pubsubFactory,
ValueProvider<org.apache.beam.sdk.io.gcp.pubsub.PubsubClient.ProjectPath> project,
ValueProvider<PubsubClient.TopicPath> topic,
ValueProvider<PubsubClient.SubscriptionPath> subscription,
String timestampAttribute,
String idAttribute,
boolean needsAttributes)
Construct an unbounded source to consume from the Pubsub
subscription. |
| Modifier and Type | Method and Description |
|---|---|
PCollection<PubsubMessage> |
expand(PBegin input) |
String |
getIdAttribute()
Get the id attribute.
|
boolean |
getNeedsAttributes() |
org.apache.beam.sdk.io.gcp.pubsub.PubsubClient.ProjectPath |
getProject()
Get the project path.
|
PubsubClient.SubscriptionPath |
getSubscription()
Get the subscription being read from.
|
ValueProvider<PubsubClient.SubscriptionPath> |
getSubscriptionProvider()
Get the
ValueProvider for the subscription being read from. |
String |
getTimestampAttribute()
Get the timestamp attribute.
|
PubsubClient.TopicPath |
getTopic()
Get the topic being read from.
|
ValueProvider<PubsubClient.TopicPath> |
getTopicProvider()
Get the
ValueProvider for the topic being read from. |
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validatepublic PubsubUnboundedSource(PubsubClient.PubsubClientFactory pubsubFactory, @Nullable ValueProvider<org.apache.beam.sdk.io.gcp.pubsub.PubsubClient.ProjectPath> project, @Nullable ValueProvider<PubsubClient.TopicPath> topic, @Nullable ValueProvider<PubsubClient.SubscriptionPath> subscription, @Nullable String timestampAttribute, @Nullable String idAttribute, boolean needsAttributes)
subscription.@Nullable public org.apache.beam.sdk.io.gcp.pubsub.PubsubClient.ProjectPath getProject()
@Nullable public PubsubClient.TopicPath getTopic()
@Nullable public ValueProvider<PubsubClient.TopicPath> getTopicProvider()
ValueProvider for the topic being read from.@Nullable public PubsubClient.SubscriptionPath getSubscription()
@Nullable public ValueProvider<PubsubClient.SubscriptionPath> getSubscriptionProvider()
ValueProvider for the subscription being read from.public boolean getNeedsAttributes()
public PCollection<PubsubMessage> expand(PBegin input)
expand in class PTransform<PBegin,PCollection<PubsubMessage>>Copyright © 2016–2017 The Apache Software Foundation. All rights reserved.