com.google.cloud.dataflow.sdk.io

## Class DatastoreIO.Sink

- java.lang.Object
- - com.google.cloud.dataflow.sdk.io.Sink<DatastoreV1.Entity>
  - - com.google.cloud.dataflow.sdk.io.DatastoreIO.Sink

All Implemented Interfaces:
  HasDisplayData, Serializable

Enclosing class:
  DatastoreIO

    public static class DatastoreIO.Sink
    extends Sink<DatastoreV1.Entity>

A `Sink` that writes a `PCollection` containing `Entities` to a Datastore kind.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class com.google.cloud.dataflow.sdk.io.Sink

`Sink.WriteOperation<T,WriteT>, Sink.Writer<T,WriteT>`

### Constructor Summary

Constructors
`protected` `Sink(String host, String datasetId)` Constructs a Sink with given host and dataset.

### Method Summary

All Methods Instance Methods Concrete Methods
`com.google.cloud.dataflow.sdk.io.DatastoreIO.DatastoreWriteOperation` `createWriteOperation(PipelineOptions options)` Returns an instance of a `Sink.WriteOperation` that can write to this Sink.
`void` `populateDisplayData(DisplayData.Builder builder)` Register display data for the given transform or component.
`void` `validate(PipelineOptions options)` Ensures the host and dataset are set.
`DatastoreIO.Sink` `withDataset(String datasetId)` Returns a `Sink` that is like this one, but will write to the specified dataset.
`DatastoreIO.Sink` `withHost(String host)` Returns a `Sink` that is like this one, but will use the given host.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Sink

    protected Sink(String host,
                   String datasetId)

Constructs a Sink with given host and dataset.

### Method Detail

#### withDataset

    public DatastoreIO.Sink withDataset(String datasetId)

Returns a `Sink` that is like this one, but will write to the specified dataset.

#### withHost

    public DatastoreIO.Sink withHost(String host)

Returns a `Sink` that is like this one, but will use the given host. If not specified, the `default host` will be used.

#### validate

    public void validate(PipelineOptions options)

Ensures the host and dataset are set.

Specified by:
  `validate` in class `Sink<DatastoreV1.Entity>`

#### createWriteOperation

    public com.google.cloud.dataflow.sdk.io.DatastoreIO.DatastoreWriteOperation createWriteOperation(PipelineOptions options)

Description copied from class: `Sink`
Returns an instance of a `Sink.WriteOperation` that can write to this Sink.

Specified by:
  `createWriteOperation` in class `Sink<DatastoreV1.Entity>`

#### populateDisplayData

    public void populateDisplayData(DisplayData.Builder builder)

Description copied from class: `Sink`
Register display data for the given transform or component.

`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.

Specified by:
  `populateDisplayData` in interface `HasDisplayData`
Overrides:
  `populateDisplayData` in class `Sink<DatastoreV1.Entity>`
Parameters:
  `builder` - The builder to populate with display data.
See Also:
  `HasDisplayData`