Class JsonIO.Write<T>

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.beam.sdk.transforms.display.HasDisplayData
    Enclosing class:
    JsonIO

    public abstract static class JsonIO.Write<T>
    extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,​org.apache.beam.sdk.io.WriteFilesResult<java.lang.String>>
    PTransform for writing JSON files.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.apache.beam.sdk.transforms.PTransform

        annotations, displayData, name, resourceHints
    • Constructor Summary

      Constructors 
      Constructor Description
      Write()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.beam.sdk.io.WriteFilesResult<java.lang.String> expand​(org.apache.beam.sdk.values.PCollection<T> input)  
      JsonIO.Write<T> withCompression​(org.apache.beam.sdk.io.Compression compression)
      Specifies the Compression of all generated shard files.
      JsonIO.Write<T> withMaxNumWritersPerBundle​(@Nullable java.lang.Integer maxNumWritersPerBundle)
      Set the maximum number of writers created in a bundle before spilling to shuffle.
      JsonIO.Write<T> withNoSpilling()
      Whether to skip the spilling of data.
      JsonIO.Write<T> withNumShards​(java.lang.Integer numShards)
      Specifies to use a given fixed number of shards per window.
      JsonIO.Write<T> withoutSharding()
      Forces a single file as output and empty shard name template.
      JsonIO.Write<T> withShardTemplate​(java.lang.String shardTemplate)
      Uses the given ShardNameTemplate for naming output files.
      JsonIO.Write<T> withSuffix​(java.lang.String suffix)
      Configures the filename suffix for written files.
      JsonIO.Write<T> withTempDirectory​(org.apache.beam.sdk.io.fs.ResourceId tempDirectory)
      Set the base directory used to generate temporary files.
      JsonIO.Write<T> withWindowedWrites()
      Preserves windowing of input elements and writes them to files based on the element's window.
      JsonIO.Write<T> withWritableByteChannelFactory​(org.apache.beam.sdk.io.FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)
      Returns a transform for writing to text files like this one but that has the given FileBasedSink.WritableByteChannelFactory to be used by the FileBasedSink during output.
      • Methods inherited from class org.apache.beam.sdk.transforms.PTransform

        addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Write

        public Write()
    • Method Detail

      • withCompression

        public JsonIO.Write<T> withCompression​(org.apache.beam.sdk.io.Compression compression)
        Specifies the Compression of all generated shard files.
      • withNoSpilling

        public JsonIO.Write<T> withNoSpilling()
        Whether to skip the spilling of data. See WriteFiles.withNoSpilling().
      • withMaxNumWritersPerBundle

        public JsonIO.Write<T> withMaxNumWritersPerBundle​(@Nullable java.lang.Integer maxNumWritersPerBundle)
        Set the maximum number of writers created in a bundle before spilling to shuffle. See WriteFiles#withMaxNumWritersPerBundle().
      • withNumShards

        public JsonIO.Write<T> withNumShards​(java.lang.Integer numShards)
        Specifies to use a given fixed number of shards per window. See TextIO.Write.withNumShards(int).
      • withoutSharding

        public JsonIO.Write<T> withoutSharding()
        Forces a single file as output and empty shard name template. See TextIO.Write.withoutSharding().
      • withShardTemplate

        public JsonIO.Write<T> withShardTemplate​(java.lang.String shardTemplate)
        Uses the given ShardNameTemplate for naming output files. See TextIO.Write.withShardNameTemplate(java.lang.String).
      • withSuffix

        public JsonIO.Write<T> withSuffix​(java.lang.String suffix)
        Configures the filename suffix for written files. See TextIO.Write.withSuffix(java.lang.String).
      • withTempDirectory

        public JsonIO.Write<T> withTempDirectory​(org.apache.beam.sdk.io.fs.ResourceId tempDirectory)
        Set the base directory used to generate temporary files. See TextIO.Write.withTempDirectory(org.apache.beam.sdk.options.ValueProvider<org.apache.beam.sdk.io.fs.ResourceId>).
      • withWindowedWrites

        public JsonIO.Write<T> withWindowedWrites()
        Preserves windowing of input elements and writes them to files based on the element's window. See TextIO.Write.withWindowedWrites().
      • withWritableByteChannelFactory

        public JsonIO.Write<T> withWritableByteChannelFactory​(org.apache.beam.sdk.io.FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)
        Returns a transform for writing to text files like this one but that has the given FileBasedSink.WritableByteChannelFactory to be used by the FileBasedSink during output. See TextIO.Write.withWritableByteChannelFactory(org.apache.beam.sdk.io.FileBasedSink.WritableByteChannelFactory).
      • expand

        public org.apache.beam.sdk.io.WriteFilesResult<java.lang.String> expand​(org.apache.beam.sdk.values.PCollection<T> input)
        Specified by:
        expand in class org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,​org.apache.beam.sdk.io.WriteFilesResult<java.lang.String>>