public static class DatastoreIO.Source extends BoundedSource<com.google.api.services.datastore.DatastoreV1.Entity>
Entity objects.BoundedSource.AbstractBoundedReader<T>, BoundedSource.BoundedReader<T>Source.AbstractReader<T>, Source.Reader<T>| Modifier and Type | Method and Description |
|---|---|
BoundedSource.BoundedReader<com.google.api.services.datastore.DatastoreV1.Entity> |
createReader(PipelineOptions pipelineOptions,
com.google.cloud.dataflow.sdk.util.ExecutionContext executionContext)
Creates a reader for 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.
|
java.util.List<DatastoreIO.Source> |
splitIntoBundles(long desiredBundleSizeBytes,
PipelineOptions options)
Splits the source into bundles.
|
java.lang.String |
toString() |
void |
validate()
Checks that this source is valid, before it can be used in a pipeline.
|
DatastoreIO.Source |
withDataset(java.lang.String datasetId) |
DatastoreIO.Source |
withHost(java.lang.String host) |
DatastoreIO.Source |
withMockEstimateSizeBytes(com.google.common.base.Supplier<java.lang.Long> estimateSizeBytes)
For testing only.
|
DatastoreIO.Source |
withQuery(com.google.api.services.datastore.DatastoreV1.Query query) |
public DatastoreIO.Source withDataset(java.lang.String datasetId)
public DatastoreIO.Source withQuery(com.google.api.services.datastore.DatastoreV1.Query query)
public DatastoreIO.Source withHost(java.lang.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 java.lang.Exception
BoundedSourcegetEstimatedSizeBytes in class BoundedSource<com.google.api.services.datastore.DatastoreV1.Entity>java.lang.Exceptionpublic boolean producesSortedKeys(PipelineOptions options)
BoundedSourceproducesSortedKeys in class BoundedSource<com.google.api.services.datastore.DatastoreV1.Entity>public java.util.List<DatastoreIO.Source> splitIntoBundles(long desiredBundleSizeBytes, PipelineOptions options) throws java.lang.Exception
Source PipelineOptions can be used to get information such as
credentials for accessing an external storage.
splitIntoBundles in class Source<com.google.api.services.datastore.DatastoreV1.Entity>java.lang.Exceptionpublic BoundedSource.BoundedReader<com.google.api.services.datastore.DatastoreV1.Entity> createReader(PipelineOptions pipelineOptions, com.google.cloud.dataflow.sdk.util.ExecutionContext executionContext) throws java.io.IOException
SourcecreateReader in class BoundedSource<com.google.api.services.datastore.DatastoreV1.Entity>java.io.IOExceptionpublic void validate()
SourceIt is recommended to use Preconditions for implementing
this method.
public DatastoreIO.Source withMockEstimateSizeBytes(com.google.common.base.Supplier<java.lang.Long> estimateSizeBytes)
public java.lang.String toString()
toString in class java.lang.Object