public static class TextIO.Write extends PTransform<PCollection<java.lang.String>,PDone>
TextIO.write()
.
All methods in this class delegate to the appropriate method of TextIO.TypedWrite
.
This class exists for backwards compatibility, and will be removed in Beam 3.0.
name
Modifier and Type | Method and Description |
---|---|
PDone |
expand(PCollection<java.lang.String> input)
Override this method to specify how this
PTransform should be expanded
on the given InputT . |
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
TextIO.Write |
to(FileBasedSink.DynamicDestinations<java.lang.String,?,java.lang.String> dynamicDestinations)
See
TypedWrite#to(DynamicDestinations) . |
TextIO.Write |
to(FileBasedSink.FilenamePolicy filenamePolicy)
See
TypedWrite#to(FilenamePolicy) . |
TextIO.Write |
to(ResourceId filenamePrefix)
|
TextIO.Write |
to(SerializableFunction<java.lang.String,DefaultFilenamePolicy.Params> destinationFunction,
DefaultFilenamePolicy.Params emptyDestination)
See
TypedWrite#to(SerializableFunction, Params) . |
TextIO.Write |
to(java.lang.String filenamePrefix)
|
TextIO.Write |
to(ValueProvider<java.lang.String> outputPrefix)
|
TextIO.Write |
toResource(ValueProvider<ResourceId> filenamePrefix)
|
TextIO.Write |
withFooter(java.lang.String footer)
|
TextIO.Write |
withHeader(java.lang.String header)
|
TextIO.Write |
withNumShards(int numShards)
|
<DestinationT> |
withOutputFilenames()
Specify that output filenames are wanted.
|
TextIO.Write |
withoutSharding()
|
TextIO.Write |
withShardNameTemplate(java.lang.String shardTemplate)
|
TextIO.Write |
withSuffix(java.lang.String filenameSuffix)
|
TextIO.Write |
withTempDirectory(ResourceId tempDirectory)
|
TextIO.Write |
withTempDirectory(ValueProvider<ResourceId> tempDirectory)
|
TextIO.Write |
withWindowedWrites()
|
TextIO.Write |
withWritableByteChannelFactory(FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)
See
TypedWrite#withWritableByteChannelFactory(WritableByteChannelFactory) . |
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString, validate
public TextIO.Write to(java.lang.String filenamePrefix)
@Experimental(value=FILESYSTEM) public TextIO.Write to(ResourceId filenamePrefix)
public TextIO.Write to(ValueProvider<java.lang.String> outputPrefix)
@Experimental(value=FILESYSTEM) public TextIO.Write toResource(ValueProvider<ResourceId> filenamePrefix)
@Experimental(value=FILESYSTEM) public TextIO.Write to(FileBasedSink.FilenamePolicy filenamePolicy)
TypedWrite#to(FilenamePolicy)
.@Experimental(value=FILESYSTEM) public TextIO.Write to(FileBasedSink.DynamicDestinations<java.lang.String,?,java.lang.String> dynamicDestinations)
TypedWrite#to(DynamicDestinations)
.@Experimental(value=FILESYSTEM) public TextIO.Write to(SerializableFunction<java.lang.String,DefaultFilenamePolicy.Params> destinationFunction, DefaultFilenamePolicy.Params emptyDestination)
TypedWrite#to(SerializableFunction, Params)
.@Experimental(value=FILESYSTEM) public TextIO.Write withTempDirectory(ValueProvider<ResourceId> tempDirectory)
@Experimental(value=FILESYSTEM) public TextIO.Write withTempDirectory(ResourceId tempDirectory)
public TextIO.Write withShardNameTemplate(java.lang.String shardTemplate)
public TextIO.Write withSuffix(java.lang.String filenameSuffix)
public TextIO.Write withNumShards(int numShards)
public TextIO.Write withoutSharding()
public TextIO.Write withHeader(@Nullable java.lang.String header)
public TextIO.Write withFooter(@Nullable java.lang.String footer)
public TextIO.Write withWritableByteChannelFactory(FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)
TypedWrite#withWritableByteChannelFactory(WritableByteChannelFactory)
.public TextIO.Write withWindowedWrites()
public <DestinationT> TextIO.TypedWrite<java.lang.String,DestinationT> withOutputFilenames()
The nested TextIO.TypedWrite
transform always has access to output filenames, however due
to backwards-compatibility concerns, TextIO.Write
cannot return them. This method simply
returns the inner TextIO.TypedWrite
transform which has WriteFilesResult
as its
output type, allowing access to output files.
The supplied DestinationT
type must be: the same as that supplied in #to(DynamicDestinations)
if that method was used; DefaultFilenamePolicy.Params
if #to(SerializableFunction, Params)
was used, or Void
otherwise.
public void populateDisplayData(DisplayData.Builder builder)
PTransform
populateDisplayData(DisplayData.Builder)
is invoked by Pipeline runners to collect
display data via DisplayData.from(HasDisplayData)
. Implementations may call
super.populateDisplayData(builder)
in order to register display data in the current
namespace, but should otherwise use subcomponent.populateDisplayData(builder)
to use
the namespace of the subcomponent.
By default, does not register any display data. Implementors may override this method to provide their own display data.
populateDisplayData
in interface HasDisplayData
populateDisplayData
in class PTransform<PCollection<java.lang.String>,PDone>
builder
- The builder to populate with display data.HasDisplayData
public PDone expand(PCollection<java.lang.String> 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<java.lang.String>,PDone>