FileBasedSink.FileBasedWriter (Google Cloud Dataflow SDK 1.9.1 API)

Google Cloud Dataflow SDK for Java, version 1.9.1

Class FileBasedSink.FileBasedWriter<T>

  • Type Parameters:
    T - the type of values to write.
    Direct Known Subclasses:
    Enclosing class:

    public abstract static class FileBasedSink.FileBasedWriter<T>
    extends Sink.Writer<T,FileBasedSink.FileResult>
    Abstract Sink.Writer that writes a bundle to a FileBasedSink. Subclass implementations provide a method that can write a single value to a WritableByteChannel (Sink.Writer.write(T)).

    Subclass implementations may also override methods that write headers and footers before and after the values in a bundle, respectively, as well as provide a MIME type for the output channel.

    Multiple FileBasedWriter instances may be created on the same worker, and therefore any access to static members or methods should be thread safe.

    • Field Detail

      • mimeType

        protected String mimeType
        The MIME type used in the creation of the output channel (if the file system supports it).

        GCS, for example, supports writing files with Content-Type metadata.

        May be overridden. Default is MimeTypes.TEXT. See MimeTypes for other options.