public static class PubsubIO.Read.Bound<T> extends PTransform<PInput,PCollection<T>>
PTransform that reads from a PubSub source and returns
a unbounded PCollection containing the items from the stream.name| Modifier and Type | Method and Description |
|---|---|
PCollection<T> |
apply(PInput input)
Applies this
PTransform on the given InputT, and returns its
Output. |
Coder<T> |
getCoder() |
protected Coder<T> |
getDefaultOutputCoder()
Returns the default
Coder to use for the output of this
single-output PTransform. |
String |
getIdLabel() |
int |
getMaxNumRecords() |
org.joda.time.Duration |
getMaxReadTime() |
PubsubIO.PubsubSubscription |
getSubscription() |
String |
getTimestampLabel() |
PubsubIO.PubsubTopic |
getTopic() |
PubsubIO.Read.Bound<T> |
idLabel(String idLabel)
Returns a new PubsubIO.Read PTransform that's like this one but reading unique ids
from the given PubSub label.
|
PubsubIO.Read.Bound<T> |
maxNumRecords(int maxNumRecords)
Sets the maximum number of records that will be read from Pubsub.
|
PubsubIO.Read.Bound<T> |
maxReadTime(org.joda.time.Duration maxReadTime)
Sets the maximum duration during which records will be read from Pubsub.
|
PubsubIO.Read.Bound<T> |
named(String name)
Returns a new PubsubIO.Read PTransform that's like this one but with the given
step name.
|
PubsubIO.Read.Bound<T> |
subscription(String subscription)
Returns a new PubsubIO.Read PTransform that's like this one but reading from the
given subscription.
|
PubsubIO.Read.Bound<T> |
timestampLabel(String timestampLabel)
Returns a new PubsubIO.Read PTransform that's like this one but reading timestamps
from the given PubSub label.
|
PubsubIO.Read.Bound<T> |
topic(String topic)
Returns a new PubsubIO.Read PTransform that's like this one but reading from the
give topic.
|
<X> PubsubIO.Read.Bound<X> |
withCoder(Coder<X> coder)
Returns a new PubsubIO.Read PTransform that's like this one but that uses the given
Coder<X> to decode each record into a value of type X. |
getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString, validatepublic PubsubIO.Read.Bound<T> named(String name)
public PubsubIO.Read.Bound<T> subscription(String subscription)
Multiple readers reading from the same subscription will each receive some arbirary portion of the data. Most likely, separate readers should use their own subscriptions.
public PubsubIO.Read.Bound<T> topic(String topic)
public PubsubIO.Read.Bound<T> timestampLabel(String timestampLabel)
public PubsubIO.Read.Bound<T> idLabel(String idLabel)
public <X> PubsubIO.Read.Bound<X> withCoder(Coder<X> coder)
Coder<X> to decode each record into a value of type X. Does not modify
this object.X - the type of the decoded elements, and the
elements of the resulting PCollection.public PubsubIO.Read.Bound<T> maxNumRecords(int maxNumRecords)
Setting either this or maxNumRecords will cause the output PCollection
to be bounded.
public PubsubIO.Read.Bound<T> maxReadTime(org.joda.time.Duration maxReadTime)
Setting either this or maxNumRecords will cause the output PCollection
to be bounded.
public PCollection<T> apply(PInput 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).
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).
apply in class PTransform<PInput,PCollection<T>>protected Coder<T> getDefaultOutputCoder()
PTransformCoder to use for the output of this
single-output PTransform.
By default, always throws
getDefaultOutputCoder in class PTransform<PInput,PCollection<T>>public PubsubIO.PubsubTopic getTopic()
public PubsubIO.PubsubSubscription getSubscription()
public String getTimestampLabel()
public String getIdLabel()
public int getMaxNumRecords()
public org.joda.time.Duration getMaxReadTime()