public static class DatastoreV1.Read extends PTransform<PBegin,PCollection<com.google.datastore.v1.Entity>>
PTransform that reads the result rows of a Cloud atastore query as Entity
objects.DatastoreIO,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
NUM_QUERY_SPLITS_MAX
An upper bound on the number of splits for a query.
|
name| Modifier and Type | Method and Description |
|---|---|
PCollection<com.google.datastore.v1.Entity> |
apply(PBegin input)
Applies this
PTransform on the given InputT, and returns its
Output. |
String |
getNamespace() |
String |
getProjectId() |
com.google.datastore.v1.Query |
getQuery() |
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
String |
toString() |
void |
validate(PBegin input)
Called before invoking apply (which may be intercepted by the runner) to
verify this transform is fully specified and applicable to the specified
input.
|
DatastoreV1.Read |
withNamespace(String namespace)
Returns a new
DatastoreV1.Read that reads from the given namespace. |
DatastoreV1.Read |
withNumQuerySplits(int numQuerySplits)
|
DatastoreV1.Read |
withProjectId(String projectId)
Returns a new
DatastoreV1.Read that reads from the Cloud Datastore for the specified
project. |
DatastoreV1.Read |
withQuery(com.google.datastore.v1.Query query)
Returns a new
DatastoreV1.Read that reads the results of the specified query. |
getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getNamepublic static final int NUM_QUERY_SPLITS_MAX
public DatastoreV1.Read withProjectId(String projectId)
DatastoreV1.Read that reads from the Cloud Datastore for the specified
project.public DatastoreV1.Read withQuery(com.google.datastore.v1.Query query)
DatastoreV1.Read that reads the results of the specified query.
Note: Normally, DatastoreIO will read from Cloud Datastore in parallel
across many workers. However, when the Query is configured with a limit using
Query.Builder#setLimit, then all results will be read by a single worker in order
to ensure correct results.
public DatastoreV1.Read withNamespace(String namespace)
DatastoreV1.Read that reads from the given namespace.public DatastoreV1.Read withNumQuerySplits(int numQuerySplits)
DatastoreV1.Read that reads by splitting the given query into
numQuerySplits.
The semantics for the query splitting is defined below:
NUM_QUERY_SPLITS_MAX will be capped at
NUM_QUERY_SPLITS_MAX.
query has a user limit set, then numQuerySplits will be
ignored and no split will be performed.
@Nullable public com.google.datastore.v1.Query getQuery()
public PCollection<com.google.datastore.v1.Entity> apply(PBegin input)
PTransform on the given InputT, 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<InputT, OutputT>, InputT).
apply in class PTransform<PBegin,PCollection<com.google.datastore.v1.Entity>>public void validate(PBegin input)
PTransformBy default, does nothing.
validate in class PTransform<PBegin,PCollection<com.google.datastore.v1.Entity>>public void populateDisplayData(DisplayData.Builder builder)
PTransformpopulateDisplayData(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.
populateDisplayData in interface HasDisplayDatapopulateDisplayData in class PTransform<PBegin,PCollection<com.google.datastore.v1.Entity>>builder - The builder to populate with display data.HasDisplayDatapublic String toString()
toString in class PTransform<PBegin,PCollection<com.google.datastore.v1.Entity>>