public class CosmosQueryRequestOptions extends Object
Constructor and Description |
---|
CosmosQueryRequestOptions()
Instantiates a new query request options.
|
Modifier and Type | Method and Description |
---|---|
ConsistencyLevel |
getConsistencyLevel()
Gets the consistency level required for the request.
|
DedicatedGatewayRequestOptions |
getDedicatedGatewayRequestOptions()
Gets the Dedicated Gateway Request Options
|
FeedRange |
getFeedRange()
Gets the
FeedRange |
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.
|
Duration |
getThresholdForDiagnosticsOnTracer()
Gets the thresholdForDiagnosticsOnTracer, if latency on query operation is greater than this
diagnostics will be send to open telemetry exporter as events in tracer span of end to end CRUD api.
|
String |
getThroughputControlGroupName()
Get throughput control group name.
|
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 |
setConsistencyLevel(ConsistencyLevel consistencyLevel)
Sets the consistency level required for the request.
|
CosmosQueryRequestOptions |
setDedicatedGatewayRequestOptions(DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions)
Sets the Dedicated Gateway Request Options
|
CosmosQueryRequestOptions |
setFeedRange(FeedRange feedRange)
Sets the
FeedRange that we want to query |
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.
|
CosmosQueryRequestOptions |
setThresholdForDiagnosticsOnTracer(Duration thresholdForDiagnosticsOnTracer)
Sets the thresholdForDiagnosticsOnTracer, if latency on query operation is greater than this
diagnostics will be send to open telemetry exporter as events in tracer span of end to end CRUD api.
|
CosmosQueryRequestOptions |
setThroughputControlGroupName(String throughputControlGroupName)
Set the throughput control group name.
|
public CosmosQueryRequestOptions()
public ConsistencyLevel getConsistencyLevel()
public CosmosQueryRequestOptions setConsistencyLevel(ConsistencyLevel consistencyLevel)
consistencyLevel
- the consistency level.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 metrics@Beta(value=V4_13_0, warningText="Preview API - subject to change in non-backwards compatible way") public FeedRange getFeedRange()
FeedRange
FeedRange
@Beta(value=V4_13_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosQueryRequestOptions setFeedRange(FeedRange feedRange)
FeedRange
that we want to queryfeedRange
- the FeedRange
@Beta(value=V4_13_0, warningText="Preview API - subject to change in non-backwards compatible way") public String getThroughputControlGroupName()
@Beta(value=V4_13_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosQueryRequestOptions setThroughputControlGroupName(String throughputControlGroupName)
throughputControlGroupName
- The throughput control group name.CosmosQueryRequestOptions
.@Beta(value=V4_15_0, warningText="Preview API - subject to change in non-backwards compatible way") public DedicatedGatewayRequestOptions getDedicatedGatewayRequestOptions()
@Beta(value=V4_15_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosQueryRequestOptions setDedicatedGatewayRequestOptions(DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions)
dedicatedGatewayRequestOptions
- Dedicated Gateway Request Optionspublic Duration getThresholdForDiagnosticsOnTracer()
public CosmosQueryRequestOptions setThresholdForDiagnosticsOnTracer(Duration thresholdForDiagnosticsOnTracer)
thresholdForDiagnosticsOnTracer
- the latency threshold for diagnostics on tracer.Copyright © 2021 Microsoft Corporation. All rights reserved.