public abstract static class JsonIO.Write<T> extends PTransform<PCollection<T>,WriteFilesResult<java.lang.String>>
PTransform
for writing JSON files.name, resourceHints
Constructor and Description |
---|
Write() |
Modifier and Type | Method and Description |
---|---|
WriteFilesResult<java.lang.String> |
expand(PCollection<T> input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
JsonIO.Write<T> |
withCompression(Compression compression)
Specifies the
Compression of all generated shard files. |
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(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(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. |
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setResourceHints, toString, validate, validate
public JsonIO.Write<T> withCompression(Compression compression)
Compression
of all generated shard files.public JsonIO.Write<T> withNoSpilling()
WriteFiles.withNoSpilling()
.public JsonIO.Write<T> withNumShards(java.lang.Integer numShards)
TextIO.Write#withNumShards
.public JsonIO.Write<T> withoutSharding()
TextIO.Write#withoutSharding
.public JsonIO.Write<T> withShardTemplate(java.lang.String shardTemplate)
ShardNameTemplate
for naming output files. See TextIO.Write#withShardNameTemplate
.public JsonIO.Write<T> withSuffix(java.lang.String suffix)
TextIO.Write#withSuffix
.public JsonIO.Write<T> withTempDirectory(ResourceId tempDirectory)
TextIO.Write#withTempDirectory
.public JsonIO.Write<T> withWindowedWrites()
TextIO.Write#withWindowedWrites
.public JsonIO.Write<T> withWritableByteChannelFactory(FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)
FileBasedSink.WritableByteChannelFactory
to be used by the FileBasedSink
during
output. See TextIO.Write#withWritableByteChannelFactory
.public WriteFilesResult<java.lang.String> expand(PCollection<T> input)
PTransform
PTransform
should be expanded on the given
InputT
.
NOTE: This method should not be called directly. Instead apply the PTransform
should
be applied to the InputT
using the apply
method.
Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
expand
in class PTransform<PCollection<T>,WriteFilesResult<java.lang.String>>