public static class DatastoreIO.Source extends BoundedSource<DatastoreV1.Entity>
Source that reads the result rows of a Datastore query as Entity objects.BoundedSource.BoundedReader<T>Source.Reader<T>| Modifier and Type | Method and Description |
|---|---|
BoundedSource.BoundedReader<DatastoreV1.Entity> |
createReader(PipelineOptions pipelineOptions)
Returns a new
BoundedSource.BoundedReader that reads from this source. |
String |
getDataset() |
Coder<DatastoreV1.Entity> |
getDefaultOutputCoder()
Returns the default
Coder to use for the data read from this source. |
long |
getEstimatedSizeBytes(PipelineOptions options)
An estimate of the total size (in bytes) of the data that would be read from this source.
|
String |
getHost() |
String |
getNamespace() |
DatastoreV1.Query |
getQuery() |
boolean |
producesSortedKeys(PipelineOptions options)
Whether this source is known to produce key/value pairs sorted by lexicographic order on
the bytes of the encoded key.
|
List<DatastoreIO.Source> |
splitIntoBundles(long desiredBundleSizeBytes,
PipelineOptions options)
Splits the source into bundles of approximately
desiredBundleSizeBytes. |
String |
toString() |
void |
validate()
Checks that this source is valid, before it can be used in a pipeline.
|
DatastoreIO.Source |
withDataset(String datasetId) |
DatastoreIO.Source |
withHost(String host) |
DatastoreIO.Source |
withNamespace(String namespace) |
DatastoreIO.Source |
withQuery(DatastoreV1.Query query) |
public String getHost()
public String getDataset()
public DatastoreV1.Query getQuery()
public DatastoreIO.Source withDataset(String datasetId)
public DatastoreIO.Source withQuery(DatastoreV1.Query query)
public DatastoreIO.Source withHost(String host)
public DatastoreIO.Source withNamespace(@Nullable String namespace)
public Coder<DatastoreV1.Entity> getDefaultOutputCoder()
SourceCoder to use for the data read from this source.getDefaultOutputCoder in class Source<DatastoreV1.Entity>public boolean producesSortedKeys(PipelineOptions options)
BoundedSourceproducesSortedKeys in class BoundedSource<DatastoreV1.Entity>public List<DatastoreIO.Source> splitIntoBundles(long desiredBundleSizeBytes, PipelineOptions options) throws Exception
BoundedSourcedesiredBundleSizeBytes.splitIntoBundles in class BoundedSource<DatastoreV1.Entity>Exceptionpublic BoundedSource.BoundedReader<DatastoreV1.Entity> createReader(PipelineOptions pipelineOptions) throws IOException
BoundedSourceBoundedSource.BoundedReader that reads from this source.createReader in class BoundedSource<DatastoreV1.Entity>IOExceptionpublic void validate()
SourceIt is recommended to use Preconditions for implementing
this method.
validate in class Source<DatastoreV1.Entity>public long getEstimatedSizeBytes(PipelineOptions options) throws Exception
BoundedSourcegetEstimatedSizeBytes in class BoundedSource<DatastoreV1.Entity>Exception