CosmosReadManyRequestOptions Class
- java.
lang. Object - com.
azure. cosmos. models. CosmosReadManyRequestOptions
- com.
public final class CosmosReadManyRequestOptions
Specifies the options associated with read many operation in the Azure Cosmos DB database service.
Constructor | Description |
---|---|
Cosmos |
Instantiates a new read many request options. |
Modifier and Type | Method and Description |
---|---|
Consistency |
get Gets the consistency level required for the request. |
Cosmos |
get Gets the custom item serializer defined for this instance of request options |
Dedicated |
get Gets the Dedicated Gateway Request Options |
Cosmos |
get Gets the diagnostic thresholds used as an override for a specific operation. |
List<String> |
get Gets the list of regions to exclude for the request/retries. |
Set<String> |
get Gets the custom ids. |
int |
get Gets the Response |
String |
get Gets the session token for use with session consistency. |
Duration |
get Gets the threshold |
String |
get Get throughput control group name. |
boolean |
is Gets index |
boolean |
is Gets the option to enable populate query metrics. |
Cosmos |
set Sets the consistency level required for the request. |
Cosmos |
set Sets the CosmosEndToEndOperationLatencyPolicyConfig to be used for the request. |
Cosmos |
set Allows specifying a custom item serializer to be used for this operation. |
Cosmos |
set Sets the Dedicated Gateway Request Options |
Cosmos |
set Allows overriding the diagnostic thresholds for a specific operation. |
Cosmos |
set List of regions to be excluded for the request/retries. |
Cosmos |
set Sets index |
Cosmos |
set Sets the custom ids. |
Cosmos |
set Sets the option to enable/disable getting metrics relating to query execution on item query requests. |
Cosmos |
set Sets the Response |
Cosmos |
set Sets the session token for use with session consistency. |
Cosmos |
set Sets the threshold |
Cosmos |
set Set the throughput control group name. |
Methods inherited from java.lang.Object
CosmosReadManyRequestOptions
public CosmosReadManyRequestOptions()
Instantiates a new read many request options.
getConsistencyLevel
public ConsistencyLevel getConsistencyLevel()
Gets the consistency level required for the request.
Returns:
getCustomItemSerializer
public CosmosItemSerializer getCustomItemSerializer()
Gets the custom item serializer defined for this instance of request options
Returns:
getDedicatedGatewayRequestOptions
public DedicatedGatewayRequestOptions getDedicatedGatewayRequestOptions()
Gets the Dedicated Gateway Request Options
Returns:
getDiagnosticsThresholds
public CosmosDiagnosticsThresholds getDiagnosticsThresholds()
Gets the diagnostic thresholds used as an override for a specific operation. If no operation specific diagnostic threshold has been specified, this method will return null, although at runtime the default thresholds specified at the client-level will be used.
Returns:
getExcludedRegions
public List
Gets the list of regions to exclude for the request/retries. These regions are excluded from the preferred region list.
Returns:
getKeywordIdentifiers
public Set
Gets the custom ids.
Returns:
getResponseContinuationTokenLimitInKb
public int getResponseContinuationTokenLimitInKb()
Gets the ResponseContinuationTokenLimitInKb request option for item query requests in the Azure Cosmos DB service. If not already set returns 0.
ResponseContinuationTokenLimitInKb is used to limit the length of continuation token in the query response. Valid values are >= 1.
Returns:
getSessionToken
public String getSessionToken()
Gets the session token for use with session consistency.
Returns:
getThresholdForDiagnosticsOnTracer
public 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. Default is 500 ms.
Returns:
getThroughputControlGroupName
public String getThroughputControlGroupName()
Get throughput control group name.
Returns:
isIndexMetricsEnabled
public boolean isIndexMetricsEnabled()
Gets indexMetricsEnabled, which is used to obtain the index metrics to understand how the query engine used existing indexes and could use potential new indexes. The results will be displayed in QueryMetrics. Please note that this options will incurs overhead, so it should be enabled when debuging slow queries.
Returns:
isQueryMetricsEnabled
public boolean isQueryMetricsEnabled()
Gets the option to enable populate query metrics. By default query metrics are enabled.
Returns:
setConsistencyLevel
public CosmosReadManyRequestOptions setConsistencyLevel(ConsistencyLevel consistencyLevel)
Sets the consistency level required for the request. The effective consistency level can only be reduce for read/query requests. So when the Account's default consistency level is for example Session you can specify on a request-by-request level for individual requests that Eventual consistency is sufficient - which could reduce the latency and RU charges for this request but will not guarantee session consistency (read-your-own-write) anymore
Parameters:
Returns:
setCosmosEndToEndOperationLatencyPolicyConfig
public CosmosReadManyRequestOptions setCosmosEndToEndOperationLatencyPolicyConfig(CosmosEndToEndOperationLatencyPolicyConfig cosmosEndToEndOperationLatencyPolicyConfig)
Sets the CosmosEndToEndOperationLatencyPolicyConfig to be used for the request. If the config is already set * on the client, then this will override the client level config for this request
Parameters:
Returns:
setCustomItemSerializer
public CosmosReadManyRequestOptions setCustomItemSerializer(CosmosItemSerializer customItemSerializer)
Allows specifying a custom item serializer to be used for this operation. If the serializer on the request options is null, the serializer on CosmosClientBuilder is used. If both serializers are null (the default), an internal Jackson ObjectMapper is ued for serialization/deserialization.
Parameters:
Returns:
setDedicatedGatewayRequestOptions
public CosmosReadManyRequestOptions setDedicatedGatewayRequestOptions(DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions)
Sets the Dedicated Gateway Request Options
Parameters:
Returns:
setDiagnosticsThresholds
public CosmosReadManyRequestOptions setDiagnosticsThresholds(CosmosDiagnosticsThresholds operationSpecificThresholds)
Allows overriding the diagnostic thresholds for a specific operation.
Parameters:
Returns:
setExcludedRegions
public CosmosReadManyRequestOptions setExcludedRegions(List
List of regions to be excluded for the request/retries. Example "East US" or "East US, West US" These regions will be excluded from the preferred regions list
Parameters:
Returns:
setIndexMetricsEnabled
public CosmosReadManyRequestOptions setIndexMetricsEnabled(boolean indexMetricsEnabled)
Sets indexMetricsEnabled, which is used to obtain the index metrics to understand how the query engine used existing indexes and could use potential new indexes. The results will be displayed in QueryMetrics. Please note that this options will incurs overhead, so it should be enabled when debugging slow queries. By default the indexMetrics are disabled.
Parameters:
Returns:
setKeywordIdentifiers
public CosmosReadManyRequestOptions setKeywordIdentifiers(Set
Sets the custom ids.
Parameters:
Returns:
setQueryMetricsEnabled
public CosmosReadManyRequestOptions setQueryMetricsEnabled(boolean queryMetricsEnabled)
Sets the option to enable/disable getting metrics relating to query execution on item query requests. By default query metrics are enabled.
Parameters:
Returns:
setResponseContinuationTokenLimitInKb
public CosmosReadManyRequestOptions setResponseContinuationTokenLimitInKb(int limitInKb)
Sets the ResponseContinuationTokenLimitInKb request option for item query requests in the Azure Cosmos DB service.
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.
Parameters:
Returns:
setSessionToken
public CosmosReadManyRequestOptions setSessionToken(String sessionToken)
Sets the session token for use with session consistency.
Parameters:
Returns:
setThresholdForDiagnosticsOnTracer
public CosmosReadManyRequestOptions 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. Default is 500 ms
Parameters:
Returns:
setThroughputControlGroupName
public CosmosReadManyRequestOptions setThroughputControlGroupName(String throughputControlGroupName)
Set the throughput control group name.
Parameters:
Returns: