public static class DatastoreIO.Sink extends PTransform<PCollection<com.google.api.services.datastore.DatastoreV1.Entity>,PDone>
PTransform that writes a PCollection<Entity> containing
entities to a Datastore kind.
Current version only supports Write operation running on
DirectPipelineRunner. If Write is used on
DataflowPipelineRunner,
it throws UnsupportedOperationException and won't continue on the
operation.
name| Modifier and Type | Method and Description |
|---|---|
PDone |
apply(PCollection<com.google.api.services.datastore.DatastoreV1.Entity> 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. |
protected java.lang.String |
getKindString()
Returns a string describing what kind of
PTransform this is. |
DatastoreIO.Sink |
named(java.lang.String name)
Returns a DatastoreIO.Write PTransform with the name
associated with this PTransform.
|
DatastoreIO.Sink |
to(java.lang.String datasetId)
Returns a DatastoreIO.Write PTransform with given datasetId.
|
DatastoreIO.Sink |
withHost(java.lang.String host)
Returns a new DatastoreIO.Write PTransform with specified host.
|
finishSpecifying, getCoderRegistry, getDefaultName, getDefaultOutputCoder, getInput, getName, getOutput, getPipeline, setName, setPipeline, toString, withNamepublic DatastoreIO.Sink named(java.lang.String name)
public DatastoreIO.Sink to(java.lang.String datasetId)
public DatastoreIO.Sink withHost(java.lang.String host)
public PDone apply(PCollection<com.google.api.services.datastore.DatastoreV1.Entity> 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<com.google.api.services.datastore.DatastoreV1.Entity>,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<com.google.api.services.datastore.DatastoreV1.Entity>,PDone>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<com.google.api.services.datastore.DatastoreV1.Entity>,PDone>