public static class DatastoreIO.Source extends BoundedSource<com.google.api.services.datastore.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<com.google.api.services.datastore.DatastoreV1.Entity> |
createReader(PipelineOptions pipelineOptions)
Returns a new
BoundedSource.BoundedReader that reads from this source. |
Coder<com.google.api.services.datastore.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.
|
boolean |
producesSortedKeys(PipelineOptions options)
Whether this source is known to produce key/value pairs with the (encoded) keys in
lexicographically sorted order.
|
List<DatastoreIO.Source> |
splitIntoBundles(long desiredBundleSizeBytes,
PipelineOptions options)
Splits the source into bundles of approximately given size (in bytes).
|
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 |
withMockEstimateSizeBytes(Long estimateSizeBytes)
For testing only.
|
DatastoreIO.Source |
withQuery(com.google.api.services.datastore.DatastoreV1.Query query) |
public DatastoreIO.Source withDataset(String datasetId)
public DatastoreIO.Source withQuery(com.google.api.services.datastore.DatastoreV1.Query query)
public DatastoreIO.Source withHost(String host)
public Coder<com.google.api.services.datastore.DatastoreV1.Entity> getDefaultOutputCoder()
SourceCoder to use for the data read from this source.getDefaultOutputCoder in class Source<com.google.api.services.datastore.DatastoreV1.Entity>public long getEstimatedSizeBytes(PipelineOptions options) throws Exception
BoundedSourcegetEstimatedSizeBytes in class BoundedSource<com.google.api.services.datastore.DatastoreV1.Entity>Exceptionpublic boolean producesSortedKeys(PipelineOptions options)
BoundedSourceproducesSortedKeys in class BoundedSource<com.google.api.services.datastore.DatastoreV1.Entity>public List<DatastoreIO.Source> splitIntoBundles(long desiredBundleSizeBytes, PipelineOptions options) throws Exception
BoundedSourcesplitIntoBundles in class BoundedSource<com.google.api.services.datastore.DatastoreV1.Entity>Exceptionpublic BoundedSource.BoundedReader<com.google.api.services.datastore.DatastoreV1.Entity> createReader(PipelineOptions pipelineOptions) throws IOException
BoundedSourceBoundedSource.BoundedReader that reads from this source.createReader in class BoundedSource<com.google.api.services.datastore.DatastoreV1.Entity>IOExceptionpublic void validate()
SourceIt is recommended to use Preconditions for implementing
this method.
public DatastoreIO.Source withMockEstimateSizeBytes(Long estimateSizeBytes)