Beispiel #1
0
 /**
  * Returns a new {@link Source} that reads the results of the specified query.
  *
  * <p>Does not modify this object.
  *
  * <p><b>Note:</b> Normally, a Cloud Dataflow job will read from Cloud Datastore in parallel
  * across many workers. However, when the {@link Query} is configured with a limit using {@link
  * com.google.api.services.datastore.DatastoreV1.Query.Builder#setLimit(int)}, then all returned
  * results will be read by a single Dataflow worker in order to ensure correct data.
  */
 public Source withQuery(Query query) {
   checkNotNull(query, "query");
   checkArgument(
       !query.hasLimit() || query.getLimit() > 0,
       "Invalid query limit %s: must be positive",
       query.getLimit());
   return new Source(host, datasetId, query, namespace);
 }