public static class PubsubIO.Read.Bound<T> extends PTransform<PInput,PCollection<T>>
PTransform that reads from a Cloud Pub/Sub source and returns
a unbounded PCollection containing the items from the stream.| Modifier and Type | Class and Description |
|---|---|
class |
PubsubIO.Read.Bound.PubsubBoundedReader
Default reader when Pubsub subscription has some form of upper bound.
|
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() |
Duration |
getMaxReadTime() |
PubsubIO.PubsubSubscription |
getSubscription() |
String |
getTimestampLabel() |
PubsubIO.PubsubTopic |
getTopic() |
PubsubIO.Read.Bound<T> |
idLabel(String idLabel)
Returns a transform that's like this one but that reads unique message IDs
from the given message attribute.
|
PubsubIO.Read.Bound<T> |
maxNumRecords(int maxNumRecords)
Returns a transform that's like this one but will only read up to the specified
maximum number of records from Cloud Pub/Sub.
|
PubsubIO.Read.Bound<T> |
maxReadTime(Duration maxReadTime)
Returns a transform that's like this one but will only read during the specified
duration from Cloud Pub/Sub.
|
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
PubsubIO.Read.Bound<T> |
subscription(String subscription)
Returns a transform that's like this one but reading from the
given subscription.
|
PubsubIO.Read.Bound<T> |
timestampLabel(String timestampLabel)
Returns a transform that's like this one but that reads message timestamps
from the given message attribute.
|
PubsubIO.Read.Bound<T> |
topic(String topic)
Returns a transform that's like this one but that reads from the specified topic.
|
<X> PubsubIO.Read.Bound<X> |
withCoder(Coder<X> coder)
Returns a transform that's like this one but that uses the given
Coder to decode each record into a value of type X. |
getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString, validatepublic PubsubIO.Read.Bound<T> subscription(String subscription)
See PubsubIO.PubsubSubscription.fromPath(String) for more details on the format
of the subscription string.
Multiple readers reading from the same subscription will each receive some arbitrary portion of the data. Most likely, separate readers should use their own subscriptions.
Does not modify this object.
public PubsubIO.Read.Bound<T> topic(String topic)
See PubsubIO.PubsubTopic.fromPath(String) for more details on the
format of the topic string.
Does not modify this object.
public PubsubIO.Read.Bound<T> timestampLabel(String timestampLabel)
PubsubIO.Read.timestampLabel(String) for
more details on the format of the timestamp attribute.
Does not modify this object.
public PubsubIO.Read.Bound<T> idLabel(String idLabel)
PubsubIO.Read.idLabel(String) for more
details on the format of the ID attribute.
Does not modify this object.
public <X> PubsubIO.Read.Bound<X> withCoder(Coder<X> coder)
Coder 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)
PCollection. See PubsubIO.Read.maxNumRecords(int) for more details.public PubsubIO.Read.Bound<T> maxReadTime(Duration maxReadTime)
PCollection.
See PubsubIO.Read.maxReadTime(Duration) for more details.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).
apply in class PTransform<PInput,PCollection<T>>public void populateDisplayData(DisplayData.Builder builder)
PTransformpopulateDisplayData(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 HasDisplayDatapopulateDisplayData in class PTransform<PInput,PCollection<T>>builder - The builder to populate with display data.HasDisplayDataprotected 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 Duration getMaxReadTime()