Class CosmosBulkExecutionOptions

java.lang.Object
com.azure.cosmos.models.CosmosBulkExecutionOptions

public final class CosmosBulkExecutionOptions extends Object
Encapsulates options that can be specified for operations used in Bulk execution. It can be passed while processing bulk operations.
  • Constructor Details

    • CosmosBulkExecutionOptions

      public CosmosBulkExecutionOptions(CosmosBulkExecutionThresholdsState thresholdsState)
      Constructor
      Parameters:
      thresholdsState - thresholds
    • CosmosBulkExecutionOptions

      public CosmosBulkExecutionOptions()
      Constructor
  • Method Details

    • getMaxMicroBatchConcurrency

      public int getMaxMicroBatchConcurrency()
      The maximum concurrency for executing requests for a partition key range. By default, the maxMicroBatchConcurrency is 1.
      Returns:
      max micro batch concurrency
    • setMaxMicroBatchConcurrency

      public CosmosBulkExecutionOptions setMaxMicroBatchConcurrency(int maxMicroBatchConcurrency)
      Set the maximum concurrency for executing requests for a partition key range. By default, the maxMicroBatchConcurrency is 1. It only allows values ≥1 and ≤5. Attention! Please adjust this value with caution. By increasing this value, more concurrent requests will be allowed to be sent to the server, in which case may cause 429 or request timed out due to saturate local resources, which could degrade the performance.
      Parameters:
      maxMicroBatchConcurrency - the micro batch concurrency.
      Returns:
      the bulk processing options.
    • getThresholdsState

      public CosmosBulkExecutionThresholdsState getThresholdsState()
      Returns threshold state that can be passed to other CosmosBulkExecutionOptions in the future
      Returns:
      thresholds
    • getThroughputControlGroupName

      public String getThroughputControlGroupName()
      Gets the throughput control group name.
      Returns:
      the throughput control group name.
    • setThroughputControlGroupName

      public CosmosBulkExecutionOptions setThroughputControlGroupName(String throughputControlGroupName)
      Sets the throughput control group name.
      Parameters:
      throughputControlGroupName - the throughput control group name.
      Returns:
      the CosmosBulkExecutionOptions.
    • setExcludedRegions

      public CosmosBulkExecutionOptions setExcludedRegions(List<String> excludeRegions)
      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 CosmosBulkExecutionOptions
    • getExcludedRegions

      public List<String> 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