public class CosmosQueryRequestOptions extends Object
Constructor and Description |
---|
CosmosQueryRequestOptions()
Instantiates a new query request options.
|
Modifier and Type | Method and Description |
---|---|
int |
getMaxBufferedItemCount()
Gets the maximum number of items that can be buffered client side during
parallel query execution.
|
int |
getMaxDegreeOfParallelism()
Gets the number of concurrent operations run client side during parallel
query execution.
|
PartitionKey |
getPartitionKey()
Gets the partition key used to identify the current request's target
partition.
|
int |
getResponseContinuationTokenLimitInKb()
Gets the ResponseContinuationTokenLimitInKb request option for item query
requests in the Azure Cosmos DB service.
|
String |
getSessionToken()
Gets the session token for use with session consistency.
|
boolean |
isQueryMetricsEnabled()
Gets the option to enable populate query metrics.
|
Boolean |
isScanInQueryEnabled()
Gets the option to allow scan on the queries which couldn't be served as
indexing was opted out on the requested paths.
|
CosmosQueryRequestOptions |
setMaxBufferedItemCount(int maxBufferedItemCount)
Sets the maximum number of items that can be buffered client side during
parallel query execution.
|
CosmosQueryRequestOptions |
setMaxDegreeOfParallelism(int maxDegreeOfParallelism)
Sets the number of concurrent operations run client side during parallel
query execution.
|
CosmosQueryRequestOptions |
setPartitionKey(PartitionKey partitionkey)
Sets the partition key used to identify the current request's target
partition.
|
CosmosQueryRequestOptions |
setQueryMetricsEnabled(boolean queryMetricsEnabled)
Sets the option to enable/disable getting metrics relating to query execution on item query requests.
|
CosmosQueryRequestOptions |
setResponseContinuationTokenLimitInKb(int limitInKb)
Sets the ResponseContinuationTokenLimitInKb request option for item query
requests in the Azure Cosmos DB service.
|
CosmosQueryRequestOptions |
setScanInQueryEnabled(Boolean scanInQueryEnabled)
Sets the option to allow scan on the queries which couldn't be served as
indexing was opted out on the requested paths.
|
CosmosQueryRequestOptions |
setSessionToken(String sessionToken)
Sets the session token for use with session consistency.
|
public CosmosQueryRequestOptions()
public String getSessionToken()
public CosmosQueryRequestOptions setSessionToken(String sessionToken)
sessionToken
- the session token.public Boolean isScanInQueryEnabled()
public CosmosQueryRequestOptions setScanInQueryEnabled(Boolean scanInQueryEnabled)
scanInQueryEnabled
- the option of enable scan in query.public int getMaxDegreeOfParallelism()
public CosmosQueryRequestOptions setMaxDegreeOfParallelism(int maxDegreeOfParallelism)
maxDegreeOfParallelism
- number of concurrent operations.public int getMaxBufferedItemCount()
public CosmosQueryRequestOptions setMaxBufferedItemCount(int maxBufferedItemCount)
maxBufferedItemCount
- maximum number of items.public CosmosQueryRequestOptions setResponseContinuationTokenLimitInKb(int limitInKb)
ResponseContinuationTokenLimitInKb is used to limit the length of continuation token in the query response. Valid values are >= 1.
The continuation token contains both required and optional fields. The required fields are necessary for resuming the execution from where it was stooped. The optional fields may contain serialized index lookup work that was done but not yet utilized. This avoids redoing the work again in subsequent continuations and hence improve the query performance. Setting the maximum continuation size to 1KB, the Azure Cosmos DB service will only serialize required fields. Starting from 2KB, the Azure Cosmos DB service would serialize as much as it could fit till it reaches the maximum specified size.
limitInKb
- continuation token size limit.public int getResponseContinuationTokenLimitInKb()
ResponseContinuationTokenLimitInKb is used to limit the length of continuation token in the query response. Valid values are >= 1.
public PartitionKey getPartitionKey()
public CosmosQueryRequestOptions setPartitionKey(PartitionKey partitionkey)
partitionkey
- the partition key value.public boolean isQueryMetricsEnabled()
public CosmosQueryRequestOptions setQueryMetricsEnabled(boolean queryMetricsEnabled)
queryMetricsEnabled
- whether to enable or disable query metricsCopyright © 2020 Microsoft Corporation. All rights reserved.