NonIdempotentWriteRetryOptions Class
- java.
lang. Object - com.
azure. cosmos. NonIdempotentWriteRetryOptions
- com.
public final class NonIdempotentWriteRetryOptions
Class to define the options for non-idempotent write operations
Constructor Summary
| Constructor | Description |
|---|---|
| NonIdempotentWriteRetryOptions() |
Creates an instance of the Non |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| boolean |
isEnabled()
Returns a flag indicating whether automatic retries for write operations even when they are not guaranteed to be idempotent are enabled or not. |
| boolean |
isTrackingIdUsed()
Returns a flag indicating whether write operations can use the tracking |
|
Non |
setEnabled(boolean isEnabled)
Specifies whether automatic retries for write operations even when they are not guaranteed to be idempotent are enabled. |
|
Non |
setTrackingIdUsed(boolean useTrackingIdForCreateAndReplace)
Specifies whether write operations can use the tracking |
Methods inherited from java.lang.Object
Constructor Details
NonIdempotentWriteRetryOptions
public NonIdempotentWriteRetryOptions()
Creates an instance of the NonIdempotentWriteRetryOptions class.
Method Details
isEnabled
public boolean isEnabled()
Returns a flag indicating whether automatic retries for write operations even when they are not guaranteed to be idempotent are enabled or not. The default value is false.
Returns:
isTrackingIdUsed
public boolean isTrackingIdUsed()
Returns a flag indicating whether write operations can use the trackingId system property '/_trackingId' to allow identification of conflicts and pre-condition failures due to retries. If enabled, each document being created or replaced will have an additional '/_trackingId' property for which the value will be updated by the SDK. If it is not desired to add this new json property (for example due to the RU-increase based on the payload size or because it causes documents to exceed the max payload size upper limit), the usage of this system property can be disabled by setting this parameter to false. This means there could be a higher level of 409/312 due to retries - and applications would need to handle them gracefully on their own.
Returns:
setEnabled
public NonIdempotentWriteRetryOptions setEnabled(boolean isEnabled)
Specifies whether automatic retries for write operations even when they are not guaranteed to be idempotent are enabled.
Parameters:
- a flag indicating whether to enable automatic retries even for non-idempotent write operations
Returns:
setTrackingIdUsed
public NonIdempotentWriteRetryOptions setTrackingIdUsed(boolean useTrackingIdForCreateAndReplace)
Specifies whether write operations can use the trackingId system property '/_trackingId' to allow identification of conflicts and pre-condition failures due to retries. If enabled, each document being created or replaced will have an additional '/_trackingId' property for which the value will be updated by the SDK. If it is not desired to add this new json property (for example due to the RU-increase based on the payload size or because it causes documents to exceed the max payload size upper limit), the usage of this system property can be disabled by setting this parameter to false. This means there could be a higher level of 409/312 due to retries - and applications would need to handle them gracefully on their own.
Parameters:
Returns: