Package com.azure.cosmos.models
Class CosmosBatchRequestOptions
java.lang.Object
com.azure.cosmos.models.CosmosBatchRequestOptions
Encapsulates options that can be specified for a
CosmosBatch
.-
Constructor Summary
ConstructorDescriptionCreates an instance of the CosmosBatchRequestOptions class -
Method Summary
Modifier and TypeMethodDescriptionGets the custom item serializer defined for this instance of request optionsGets the diagnostic thresholds used as an override for a specific operation.Gets the list of regions to be excluded for the request/retries.Gets the custom ids.Gets the token for use with session consistency.setCustomItemSerializer
(CosmosItemSerializer customItemSerializer) Allows specifying a custom item serializer to be used for this operation.setDiagnosticsThresholds
(CosmosDiagnosticsThresholds operationSpecificThresholds) Allows overriding the diagnostic thresholds for a specific operation.setExcludedRegions
(List<String> excludeRegions) List of regions to exclude for the request/retries.setKeywordIdentifiers
(Set<String> keywordIdentifiers) Sets the custom ids.setSessionToken
(String sessionToken) Sets the token for use with session consistency.
-
Constructor Details
-
CosmosBatchRequestOptions
public CosmosBatchRequestOptions()Creates an instance of the CosmosBatchRequestOptions class
-
-
Method Details
-
getSessionToken
Gets the token for use with session consistency.- Returns:
- the session token.
-
setSessionToken
Sets the token for use with session consistency.- Parameters:
sessionToken
- the session token.- Returns:
- the TransactionalBatchRequestOptions.
-
setDiagnosticsThresholds
public CosmosBatchRequestOptions setDiagnosticsThresholds(CosmosDiagnosticsThresholds operationSpecificThresholds) Allows overriding the diagnostic thresholds for a specific operation.- Parameters:
operationSpecificThresholds
- the diagnostic threshold override for this operation- Returns:
- the TransactionalBatchRequestOptions.
-
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:
- the diagnostic thresholds used as an override for a specific operation.
-
setExcludedRegions
List of regions to exclude for the request/retries. Example "East US" or "East US, West US" These regions will be excluded from the preferred regions list- Parameters:
excludeRegions
- list of regions- Returns:
- the
CosmosBatchRequestOptions
-
getExcludedRegions
Gets the list of regions to be excluded for the request/retries. These regions are excluded from the preferred region list.- Returns:
- a list of excluded regions
-
getCustomItemSerializer
Gets the custom item serializer defined for this instance of request options- Returns:
- the custom item serializer
-
setCustomItemSerializer
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:
customItemSerializer
- the custom item serializer for this operation- Returns:
- the CosmosItemRequestOptions.
-
setKeywordIdentifiers
Sets the custom ids.- Parameters:
keywordIdentifiers
- the custom ids.- Returns:
- the current request options.
-
getKeywordIdentifiers
Gets the custom ids.- Returns:
- the custom ids.
-