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


이 페이지가 도움이 되었나요? 평가를 부탁드립니다.

다음에 대한 의견 보내기...

도움이 필요하시나요? 지원 페이지를 방문하세요.