|
22 | 22 | import com.google.cloud.spanner.CommitStats;
|
23 | 23 | import com.google.cloud.spanner.Dialect;
|
24 | 24 | import com.google.cloud.spanner.Mutation;
|
25 |
| -import com.google.cloud.spanner.ResultSet; |
| 25 | +import com.google.cloud.spanner.Options.QueryOption; |
| 26 | +import com.google.cloud.spanner.PartitionOptions; |
26 | 27 | import com.google.cloud.spanner.TimestampBound;
|
27 | 28 | import com.google.cloud.spanner.connection.AutocommitDmlMode;
|
28 | 29 | import com.google.cloud.spanner.connection.SavepointSupport;
|
29 | 30 | import com.google.cloud.spanner.connection.TransactionMode;
|
30 | 31 | import java.sql.Connection;
|
| 32 | +import java.sql.ResultSet; |
31 | 33 | import java.sql.SQLException;
|
32 | 34 | import java.sql.Timestamp;
|
33 | 35 | import java.util.Iterator;
|
@@ -334,6 +336,73 @@ default Dialect getDialect() {
|
334 | 336 | return Dialect.GOOGLE_STANDARD_SQL;
|
335 | 337 | }
|
336 | 338 |
|
| 339 | + /** |
| 340 | + * Enable data boost for partitioned queries. See also {@link |
| 341 | + * CloudSpannerJdbcStatement#partitionQuery(String, PartitionOptions, QueryOption...)} and {@link |
| 342 | + * CloudSpannerJdbcPreparedStatement#partitionQuery(PartitionOptions, QueryOption...)}. |
| 343 | + */ |
| 344 | + default void setDataBoostEnabled(boolean dataBoostEnabled) throws SQLException { |
| 345 | + throw new UnsupportedOperationException(); |
| 346 | + } |
| 347 | + |
| 348 | + /** |
| 349 | + * Returns whether data boost is enabled for partitioned queries. See also {@link |
| 350 | + * CloudSpannerJdbcStatement#partitionQuery(String, PartitionOptions, QueryOption...)} and {@link |
| 351 | + * CloudSpannerJdbcPreparedStatement#partitionQuery(PartitionOptions, QueryOption...)}. |
| 352 | + */ |
| 353 | + default boolean isDataBoostEnabled() throws SQLException { |
| 354 | + throw new UnsupportedOperationException(); |
| 355 | + } |
| 356 | + |
| 357 | + /** |
| 358 | + * Sets whether this connection should always use partitioned queries when a query is executed on |
| 359 | + * this connection. Setting this flag to <code>true</code> and then executing a query that cannot |
| 360 | + * be partitioned, or executing a query in a read/write transaction, will cause an error. Use this |
| 361 | + * flag in combination with {@link #setDataBoostEnabled(boolean)} to force all queries on this |
| 362 | + * connection to use data boost. |
| 363 | + */ |
| 364 | + default void setAutoPartitionMode(boolean alwaysUsePartitionedQueries) throws SQLException { |
| 365 | + throw new UnsupportedOperationException(); |
| 366 | + } |
| 367 | + |
| 368 | + /** Returns whether this connection will execute all queries as partitioned queries. */ |
| 369 | + default boolean isAutoPartitionMode() throws SQLException { |
| 370 | + throw new UnsupportedOperationException(); |
| 371 | + } |
| 372 | + |
| 373 | + /** |
| 374 | + * Sets the maximum number of partitions that should be included as a hint to Cloud Spanner when |
| 375 | + * partitioning a query on this connection. Note that this is only a hint and Cloud Spanner might |
| 376 | + * choose to ignore the hint. |
| 377 | + */ |
| 378 | + default void setMaxPartitions(int maxPartitions) throws SQLException { |
| 379 | + throw new UnsupportedOperationException(); |
| 380 | + } |
| 381 | + |
| 382 | + /** |
| 383 | + * Gets the maximum number of partitions that should be included as a hint to Cloud Spanner when |
| 384 | + * partitioning a query on this connection. Note that this is only a hint and Cloud Spanner might |
| 385 | + * choose to ignore the hint. |
| 386 | + */ |
| 387 | + default int getMaxPartitions() throws SQLException { |
| 388 | + throw new UnsupportedOperationException(); |
| 389 | + } |
| 390 | + |
| 391 | + /** |
| 392 | + * Sets the maximum degree of parallelism that is used when executing a partitioned query. A |
| 393 | + * partitioned query will use up to <code>maxThreads</code> to execute and retrieve the results |
| 394 | + * from Cloud Spanner. Set this value to <code>0</code>> to use the number of available processors |
| 395 | + * as returned by {@link Runtime#availableProcessors()}. |
| 396 | + */ |
| 397 | + default void setMaxPartitionedParallelism(int maxThreads) throws SQLException { |
| 398 | + throw new UnsupportedOperationException(); |
| 399 | + } |
| 400 | + |
| 401 | + /** Returns the maximum degree of parallelism that is used for partitioned queries. */ |
| 402 | + default int getMaxPartitionedParallelism() throws SQLException { |
| 403 | + throw new UnsupportedOperationException(); |
| 404 | + } |
| 405 | + |
337 | 406 | /**
|
338 | 407 | * @see
|
339 | 408 | * com.google.cloud.spanner.connection.Connection#addTransactionRetryListener(com.google.cloud.spanner.connection.TransactionRetryListener)
|
|
0 commit comments