Class AvroIO.Write<T>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.values.PDone>
-
- org.apache.beam.sdk.extensions.avro.io.AvroIO.Write<T>
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
- AvroIO
public static class AvroIO.Write<T> extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.values.PDone>This class is used as the default return value ofAvroIO.write(java.lang.Class<T>)All methods in this class delegate to the appropriate method of
AvroIO.TypedWrite. This class exists for backwards compatibility, and will be removed in Beam 3.0.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.apache.beam.sdk.values.PDoneexpand(org.apache.beam.sdk.values.PCollection<T> input)voidpopulateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)AvroIO.Write<T>to(java.lang.String outputPrefix)AvroIO.Write<T>to(DynamicAvroDestinations<T,?,T> dynamicDestinations)Deprecated.UseFileIO.write()orFileIO.writeDynamic()instead.AvroIO.Write<T>to(org.apache.beam.sdk.io.FileBasedSink.FilenamePolicy filenamePolicy)AvroIO.Write<T>to(org.apache.beam.sdk.io.fs.ResourceId outputPrefix)AvroIO.Write<T>to(org.apache.beam.sdk.options.ValueProvider<java.lang.String> outputPrefix)AvroIO.Write<T>toResource(org.apache.beam.sdk.options.ValueProvider<org.apache.beam.sdk.io.fs.ResourceId> outputPrefix)AvroIO.Write<T>withCodec(org.apache.avro.file.CodecFactory codec)AvroIO.Write<T>withDatumWriterFactory(AvroSink.DatumWriterFactory<T> datumWriterFactory)AvroIO.Write<T>withMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)AvroIO.Write<T>withNumShards(int numShards)<DestinationT>
AvroIO.TypedWrite<T,DestinationT,T>withOutputFilenames()Specify that output filenames are wanted.AvroIO.Write<T>withoutSharding()AvroIO.Write<T>withSchema(org.apache.avro.Schema schema)AvroIO.Write<T>withShardNameTemplate(java.lang.String shardTemplate)AvroIO.Write<T>withSuffix(java.lang.String filenameSuffix)AvroIO.Write<T>withSyncInterval(int syncInterval)AvroIO.Write<T>withTempDirectory(org.apache.beam.sdk.io.fs.ResourceId tempDirectory)AvroIO.Write<T>withTempDirectory(org.apache.beam.sdk.options.ValueProvider<org.apache.beam.sdk.io.fs.ResourceId> tempDirectory)AvroIO.Write<T>withWindowedWrites()-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, setDisplayData, setResourceHints, toString, validate, validate
-
-
-
-
Method Detail
-
to
public AvroIO.Write<T> to(java.lang.String outputPrefix)
-
to
public AvroIO.Write<T> to(org.apache.beam.sdk.io.fs.ResourceId outputPrefix)
-
to
public AvroIO.Write<T> to(org.apache.beam.sdk.options.ValueProvider<java.lang.String> outputPrefix)
-
toResource
public AvroIO.Write<T> toResource(org.apache.beam.sdk.options.ValueProvider<org.apache.beam.sdk.io.fs.ResourceId> outputPrefix)
-
to
public AvroIO.Write<T> to(org.apache.beam.sdk.io.FileBasedSink.FilenamePolicy filenamePolicy)
-
to
@Deprecated public AvroIO.Write<T> to(DynamicAvroDestinations<T,?,T> dynamicDestinations)
Deprecated.UseFileIO.write()orFileIO.writeDynamic()instead.
-
withSyncInterval
public AvroIO.Write<T> withSyncInterval(int syncInterval)
-
withSchema
public AvroIO.Write<T> withSchema(org.apache.avro.Schema schema)
-
withTempDirectory
public AvroIO.Write<T> withTempDirectory(org.apache.beam.sdk.options.ValueProvider<org.apache.beam.sdk.io.fs.ResourceId> tempDirectory)
-
withTempDirectory
public AvroIO.Write<T> withTempDirectory(org.apache.beam.sdk.io.fs.ResourceId tempDirectory)
-
withShardNameTemplate
public AvroIO.Write<T> withShardNameTemplate(java.lang.String shardTemplate)
-
withSuffix
public AvroIO.Write<T> withSuffix(java.lang.String filenameSuffix)
-
withNumShards
public AvroIO.Write<T> withNumShards(int numShards)
-
withoutSharding
public AvroIO.Write<T> withoutSharding()
-
withWindowedWrites
public AvroIO.Write<T> withWindowedWrites()
-
withCodec
public AvroIO.Write<T> withCodec(org.apache.avro.file.CodecFactory codec)
-
withDatumWriterFactory
public AvroIO.Write<T> withDatumWriterFactory(AvroSink.DatumWriterFactory<T> datumWriterFactory)
-
withOutputFilenames
public <DestinationT> AvroIO.TypedWrite<T,DestinationT,T> withOutputFilenames()
Specify that output filenames are wanted.The nested
AvroIO.TypedWritetransform always has access to output filenames, however due to backwards-compatibility concerns,AvroIO.Writecannot return them. This method simply returns the innerAvroIO.TypedWritetransform which hasWriteFilesResultas its output type, allowing access to output files.The supplied
DestinationTtype must be: the same as that supplied into(DynamicAvroDestinations)if that method was used, orVoidotherwise.
-
withMetadata
public AvroIO.Write<T> withMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)
-
expand
public org.apache.beam.sdk.values.PDone expand(org.apache.beam.sdk.values.PCollection<T> input)
- Specified by:
expandin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.values.PDone>
-
populateDisplayData
public void populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)
- Specified by:
populateDisplayDatain interfaceorg.apache.beam.sdk.transforms.display.HasDisplayData- Overrides:
populateDisplayDatain classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.values.PDone>
-
-