|
16 | 16 |
|
17 | 17 | package com.google.cloud.datastore; |
18 | 18 |
|
| 19 | +import com.google.api.core.BetaApi; |
19 | 20 | import com.google.api.gax.retrying.RetrySettings; |
20 | 21 | import com.google.cloud.BaseService; |
21 | 22 | import com.google.cloud.ExceptionHandler; |
|
30 | 31 | import com.google.common.collect.ImmutableList; |
31 | 32 | import com.google.common.collect.Iterables; |
32 | 33 | import com.google.common.collect.Sets; |
| 34 | +import com.google.datastore.v1.ExplainOptions; |
33 | 35 | import com.google.datastore.v1.ReadOptions; |
34 | 36 | import com.google.datastore.v1.ReserveIdsRequest; |
35 | 37 | import com.google.datastore.v1.TransactionOptions; |
@@ -182,28 +184,54 @@ public <T> T runInTransaction( |
182 | 184 |
|
183 | 185 | @Override |
184 | 186 | public <T> QueryResults<T> run(Query<T> query) { |
185 | | - return run(Optional.empty(), query); |
| 187 | + return run(Optional.empty(), query, null); |
186 | 188 | } |
187 | 189 |
|
188 | 190 | @Override |
189 | 191 | public <T> QueryResults<T> run(Query<T> query, ReadOption... options) { |
190 | | - return run(toReadOptionsPb(options), query); |
| 192 | + return run(toReadOptionsPb(options), query, null); |
| 193 | + } |
| 194 | + |
| 195 | + @Override |
| 196 | + @BetaApi |
| 197 | + public <T> QueryResults<T> run( |
| 198 | + Query<T> query, |
| 199 | + com.google.cloud.datastore.models.ExplainOptions explainOptions, |
| 200 | + ReadOption... options) { |
| 201 | + return run(toReadOptionsPb(options), query, explainOptions.toPb()); |
191 | 202 | } |
192 | 203 |
|
193 | 204 | @SuppressWarnings("unchecked") |
194 | | - <T> QueryResults<T> run(Optional<ReadOptions> readOptionsPb, Query<T> query) { |
| 205 | + <T> QueryResults<T> run( |
| 206 | + Optional<ReadOptions> readOptionsPb, Query<T> query, ExplainOptions explainOptions) { |
195 | 207 | return new QueryResultsImpl<T>( |
196 | | - this, readOptionsPb, (RecordQuery<T>) query, query.getNamespace()); |
| 208 | + this, readOptionsPb, (RecordQuery<T>) query, query.getNamespace(), explainOptions); |
197 | 209 | } |
198 | 210 |
|
199 | 211 | @Override |
200 | 212 | public AggregationResults runAggregation(AggregationQuery query) { |
201 | | - return aggregationQueryExecutor.execute(query); |
| 213 | + return aggregationQueryExecutor.execute(query, null); |
202 | 214 | } |
203 | 215 |
|
204 | 216 | @Override |
205 | 217 | public AggregationResults runAggregation(AggregationQuery query, ReadOption... options) { |
206 | | - return aggregationQueryExecutor.execute(query, options); |
| 218 | + return aggregationQueryExecutor.execute(query, null, options); |
| 219 | + } |
| 220 | + |
| 221 | + @Override |
| 222 | + @BetaApi |
| 223 | + public AggregationResults runAggregation( |
| 224 | + AggregationQuery query, com.google.cloud.datastore.models.ExplainOptions explainOptions) { |
| 225 | + return aggregationQueryExecutor.execute(query, explainOptions); |
| 226 | + } |
| 227 | + |
| 228 | + @Override |
| 229 | + @BetaApi |
| 230 | + public AggregationResults runAggregation( |
| 231 | + AggregationQuery query, |
| 232 | + com.google.cloud.datastore.models.ExplainOptions explainOptions, |
| 233 | + ReadOption... options) { |
| 234 | + return aggregationQueryExecutor.execute(query, explainOptions, options); |
207 | 235 | } |
208 | 236 |
|
209 | 237 | com.google.datastore.v1.RunQueryResponse runQuery( |
|
0 commit comments