public static class PubsubIO.Read
extends java.lang.Object
PCollection<String> containing the items from
the stream.| Modifier and Type | Class and Description |
|---|---|
static class |
PubsubIO.Read.Bound
A PTransform that reads from a PubSub source and returns
a unbounded PCollection containing the items from the stream.
|
| Constructor and Description |
|---|
PubsubIO.Read() |
| Modifier and Type | Method and Description |
|---|---|
static PubsubIO.Read.Bound |
dropLateData(boolean dropLateData)
If true, then late-arriving data from this source will be dropped.
|
static PubsubIO.Read.Bound |
idLabel(java.lang.String idLabel)
Creates and returns a PubSubIO.Read PTransform where unique record identifiers are
expected to be provided using the PubSub labeling API.
|
static PubsubIO.Read.Bound |
named(java.lang.String name) |
static PubsubIO.Read.Bound |
subscription(java.lang.String subscription)
Creates and returns a PubsubIO.Read PTransform for reading from
a specific Pubsub subscription.
|
static PubsubIO.Read.Bound |
timestampLabel(java.lang.String timestampLabel)
Creates and returns a PubsubIO.Read PTransform where record timestamps are expected
to be provided using the PubSub labeling API.
|
static PubsubIO.Read.Bound |
topic(java.lang.String topic)
Creates and returns a PubsubIO.Read PTransform for reading from
a Pubsub topic with the specified publisher topic.
|
public static PubsubIO.Read.Bound named(java.lang.String name)
public static PubsubIO.Read.Bound topic(java.lang.String topic)
/topics/<project>/<topic>, where <project> is the name of
the publishing project. The <topic> component must comply with
the below requirements.
public static PubsubIO.Read.Bound subscription(java.lang.String subscription)
/subscriptions/<project>/<<subscription>,
where <project> is the name of the project the subscription belongs to.
The <subscription> component must comply with the below requirements.
public static PubsubIO.Read.Bound timestampLabel(java.lang.String timestampLabel)
<timestampLabel> parameter
specifies the label name. The label value sent to PubsSub is a numerical value representing
the number of milliseconds since the Unix epoch. For example, if using the joda time classes,
org.joda.time.Instant.getMillis() returns the correct value for this label.
If <timestampLabel> is not provided, the system will generate record timestamps
the first time it sees each record. All windowing will be done relative to these timestamps.
Windows are closed based on an estimate of when this source has finished producing data for
a timestamp range, which means that late data can arrive after a window has been closed. The
{#dropLateData} field allows you to control what to do with late data. The relaxes the
semantics of GroupByKey; see
GroupByKey for additional information on
late data and windowing.
public static PubsubIO.Read.Bound dropLateData(boolean dropLateData)
If late data is not dropped, data for a window can arrive after that window has already
been closed. The relaxes the semantics of GroupByKey; see
GroupByKey
for additional information on late data and windowing.
public static PubsubIO.Read.Bound idLabel(java.lang.String idLabel)
<idLabel> parameter
specifies the label name. The label value sent to PubSub can be any string value that
uniquely identifies this record.
If idLabel is not provided, Dataflow cannot guarantee that no duplicate data will be delivered on the PubSub stream. In this case, deduplication of the stream will be stricly best effort.