T - the type of each of the elements of the input PCollectionpublic static class AvroIO.Write.Bound<T> extends PTransform<PCollection<T>,PDone>
name| Modifier and Type | Method and Description |
|---|---|
PDone |
apply(PCollection<T> input)
Applies this
PTransform on the given Input, and returns its
Output. |
protected Coder<java.lang.Void> |
getDefaultOutputCoder()
Returns the default
Coder to use for the output of this
single-output PTransform, or null if
none can be inferred. |
java.lang.String |
getFilenamePrefix() |
java.lang.String |
getFilenameSuffix() |
protected java.lang.String |
getKindString()
Returns a string describing what kind of
PTransform this is. |
int |
getNumShards() |
org.apache.avro.Schema |
getSchema() |
java.lang.String |
getShardNameTemplate()
Returns the current shard name template string.
|
java.lang.String |
getShardTemplate() |
java.lang.Class<T> |
getType() |
AvroIO.Write.Bound<T> |
named(java.lang.String name)
Returns a new AvroIO.Write PTransform that's like this one but
with the given step name.
|
boolean |
needsValidation() |
AvroIO.Write.Bound<T> |
to(java.lang.String filenamePrefix)
Returns a new AvroIO.Write PTransform that's like this one but
that writes to the file(s) with the given filename prefix.
|
AvroIO.Write.Bound<T> |
withNumShards(int numShards)
Returns a new AvroIO.Write PTransform that's like this one but
that uses the provided shard count.
|
AvroIO.Write.Bound<T> |
withoutSharding()
Returns a new AvroIO.Write PTransform that's like this one but
that forces a single file as output.
|
AvroIO.Write.Bound<T> |
withoutValidation()
Returns a new TextIO.Write PTransform that's like this one but
that has GCS output path validation on pipeline creation disabled.
|
<T1> AvroIO.Write.Bound<T1> |
withSchema(java.lang.Class<T1> type)
Returns a new AvroIO.Write PTransform that's like this one but
that writes to Avro file(s) containing records whose type is the
specified Avro-generated class.
|
AvroIO.Write.Bound<org.apache.avro.generic.GenericRecord> |
withSchema(org.apache.avro.Schema schema)
Returns a new AvroIO.Write PTransform that's like this one but
that writes to Avro file(s) containing records of the specified
schema.
|
AvroIO.Write.Bound<org.apache.avro.generic.GenericRecord> |
withSchema(java.lang.String schema)
Returns a new AvroIO.Write PTransform that's like this one but
that writes to Avro file(s) containing records of the specified
schema in a JSON-encoded string form.
|
AvroIO.Write.Bound<T> |
withShardNameTemplate(java.lang.String shardTemplate)
Returns a new AvroIO.Write PTransform that's like this one but
that uses the given shard name template.
|
AvroIO.Write.Bound<T> |
withSuffix(java.lang.String filenameSuffix)
Returns a new AvroIO.Write PTransform that's like this one but
that writes to the file(s) with the given filename suffix.
|
finishSpecifying, getCoderRegistry, getDefaultName, getDefaultOutputCoder, getInput, getName, getOutput, getPipeline, setName, setPipeline, toString, withNamepublic AvroIO.Write.Bound<T> named(java.lang.String name)
public AvroIO.Write.Bound<T> to(java.lang.String filenamePrefix)
See Write.to(String) for more information.
Does not modify this object.
public AvroIO.Write.Bound<T> withSuffix(java.lang.String filenameSuffix)
Does not modify this object.
ShardNameTemplatepublic AvroIO.Write.Bound<T> withNumShards(int numShards)
Constraining the number of shards is likely to reduce the performance of a pipeline. Setting this value is not recommended unless you require a specific number of output files.
Does not modify this object.
numShards - the number of shards to use, or 0 to let the system
decide.ShardNameTemplatepublic AvroIO.Write.Bound<T> withShardNameTemplate(java.lang.String shardTemplate)
Does not modify this object.
ShardNameTemplatepublic AvroIO.Write.Bound<T> withoutSharding()
This is a shortcut for
.withNumShards(1).withShardNameTemplate("")
Does not modify this object.
public <T1> AvroIO.Write.Bound<T1> withSchema(java.lang.Class<T1> type)
T1 - the type of the elements of the input PCollectionpublic AvroIO.Write.Bound<org.apache.avro.generic.GenericRecord> withSchema(org.apache.avro.Schema schema)
public AvroIO.Write.Bound<org.apache.avro.generic.GenericRecord> withSchema(java.lang.String schema)
public AvroIO.Write.Bound<T> withoutValidation()
This can be useful in the case where the GCS output location does not exist at the pipeline creation time, but is expected to be available at execution time.
public PDone apply(PCollection<T> input)
PTransformPTransform on the given Input, and returns its
Output.
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).
The default implementation throws an exception. A derived class must
either implement apply, or else each runner must supply a custom
implementation via
PipelineRunner.apply(com.google.cloud.dataflow.sdk.transforms.PTransform<Input, Output>, Input).
apply in class PTransform<PCollection<T>,PDone>public java.lang.String getShardNameTemplate()
protected Coder<java.lang.Void> getDefaultOutputCoder()
PTransformCoder to use for the output of this
single-output PTransform, or null if
none can be inferred.
By default, returns null.
getDefaultOutputCoder in class PTransform<PCollection<T>,PDone>protected java.lang.String getKindString()
PTransformPTransform this is.
By default, returns the base name of this
PTransform's class.
getKindString in class PTransform<PCollection<T>,PDone>public java.lang.String getFilenamePrefix()
public java.lang.String getShardTemplate()
public int getNumShards()
public java.lang.String getFilenameSuffix()
public java.lang.Class<T> getType()
public org.apache.avro.Schema getSchema()
public boolean needsValidation()