public class PubsubUnboundedSource<T> extends PTransform<PBegin,PCollection<T>>
UnboundedSource which receives messages
in batches and hands them out one at a time.
UnboundedSource.UnboundedReader instances to execute concurrently and thus hide latency.
NOTE: This is not the implementation used when running on the Google Cloud Dataflow service.
name| Constructor and Description |
|---|
PubsubUnboundedSource(org.apache.beam.sdk.util.PubsubClient.PubsubClientFactory pubsubFactory,
org.apache.beam.sdk.util.PubsubClient.ProjectPath project,
org.apache.beam.sdk.util.PubsubClient.TopicPath topic,
org.apache.beam.sdk.util.PubsubClient.SubscriptionPath subscription,
Coder<T> elementCoder,
String timestampLabel,
String idLabel)
Construct an unbounded source to consume from the Pubsub
subscription. |
| Modifier and Type | Method and Description |
|---|---|
PCollection<T> |
apply(PBegin input)
Applies this
PTransform on the given InputT, and returns its
Output. |
Coder<T> |
getElementCoder() |
String |
getIdLabel() |
org.apache.beam.sdk.util.PubsubClient.ProjectPath |
getProject() |
org.apache.beam.sdk.util.PubsubClient.SubscriptionPath |
getSubscription() |
String |
getTimestampLabel() |
org.apache.beam.sdk.util.PubsubClient.TopicPath |
getTopic() |
getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validatepublic PubsubUnboundedSource(org.apache.beam.sdk.util.PubsubClient.PubsubClientFactory pubsubFactory,
@Nullable
org.apache.beam.sdk.util.PubsubClient.ProjectPath project,
@Nullable
org.apache.beam.sdk.util.PubsubClient.TopicPath topic,
@Nullable
org.apache.beam.sdk.util.PubsubClient.SubscriptionPath subscription,
Coder<T> elementCoder,
@Nullable
String timestampLabel,
@Nullable
String idLabel)
subscription.@Nullable public org.apache.beam.sdk.util.PubsubClient.ProjectPath getProject()
@Nullable public org.apache.beam.sdk.util.PubsubClient.TopicPath getTopic()
@Nullable public org.apache.beam.sdk.util.PubsubClient.SubscriptionPath getSubscription()
public PCollection<T> apply(PBegin input)
PTransformPTransform 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).
apply in class PTransform<PBegin,PCollection<T>>