PubsubIO.Write (Google Cloud Dataflow SDK 1.9.1 API)

Google Cloud Dataflow SDK for Java, version 1.9.1

com.google.cloud.dataflow.sdk.io

Class PubsubIO.Write

    • Method Detail

      • timestampLabel

        public static PubsubIO.Write.Bound<String> timestampLabel(String timestampLabel)
        Creates a transform that writes to Pub/Sub, adds each record's timestamp to the published messages in an attribute with the specified name. The value of the attribute will be a number representing the number of milliseconds since the Unix epoch. For example, if using the Joda time classes, Instant.Instant(long) can be used to parse this value.

        If the output from this sink is being read by another Dataflow source, then PubsubIO.Read.timestampLabel(String) can be used to ensure the other source reads these timestamps from the appropriate attribute.

      • idLabel

        public static PubsubIO.Write.Bound<String> idLabel(String idLabel)
        Creates a transform that writes to Pub/Sub, adding each record's unique identifier to the published messages in an attribute with the specified name. The value of the attribute is an opaque string.

        If the the output from this sink is being read by another Dataflow source, then PubsubIO.Read.idLabel(String) can be used to ensure that* the other source reads these unique identifiers from the appropriate attribute.

      • withCoder

        public static <T> PubsubIO.Write.Bound<T> withCoder(Coder<T> coder)
        Creates a transform that uses the given Coder to encode each of the elements of the input collection into an output message.

        By default, uses StringUtf8Coder, which writes input Java strings directly as records.

        Type Parameters:
        T - the type of the elements of the input PCollection


Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Cloud Dataflow