你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
CosmosBulkExecutionOptions 类
- java.
lang. Object - com.
azure. cosmos. models. CosmosBulkExecutionOptions
- com.
public final class CosmosBulkExecutionOptions
封装可为批量执行中使用的操作指定的选项。 可以在处理批量操作时传递它。
构造函数摘要
构造函数 | 说明 |
---|---|
CosmosBulkExecutionOptions() |
构造函数 |
CosmosBulkExecutionOptions(CosmosBulkExecutionThresholdsState thresholdsState) |
构造函数 |
方法摘要
修饰符和类型 | 方法和描述 |
---|---|
List<String> |
getExcludedRegions()
获取要为请求/重试排除的区域的列表。 |
int |
getInitialMicroBatchSize()
获取将发送到后端的微批的初始大小。 |
int |
getMaxMicroBatchConcurrency()
对分区键范围执行请求的最大并发性。 |
Cosmos |
getThresholdsState()
返回将来可传递给其他 Cosmos |
String |
getThroughputControlGroupName()
获取吞吐量控制组名称。 |
Cosmos |
setExcludedRegions(List<String> excludeRegions)
要为请求/重试排除的区域列表。 |
Cosmos |
setInitialMicroBatchSize(int initialMicroBatchSize)
设置将发送到后端的微批的初始大小。 |
Cosmos |
setMaxMicroBatchConcurrency(int maxMicroBatchConcurrency)
为分区键范围设置执行请求的最大并发性。 |
Cosmos |
setThroughputControlGroupName(String throughputControlGroupName)
设置吞吐量控制组名称。 |
方法继承自 java.lang.Object
构造函数详细信息
CosmosBulkExecutionOptions
public CosmosBulkExecutionOptions()
构造函数
CosmosBulkExecutionOptions
public CosmosBulkExecutionOptions(CosmosBulkExecutionThresholdsState thresholdsState)
构造函数
Parameters:
方法详细信息
getExcludedRegions
public List
获取要为请求/重试排除的区域的列表。 这些区域从首选区域列表中排除。
Returns:
getInitialMicroBatchSize
public int getInitialMicroBatchSize()
获取将发送到后端的微批的初始大小。 微批的大小将根据限制速率动态调整。 默认值为 100 - 因此,它从相对较大的微批开始,当限制速率过高时,它将减小批大小。 如果在动态减小初始批大小之前出现短时间限制峰值,导致对其他工作负荷产生副作用,则可以减小初始微批大小(例如设置为 1),此时会从小微批开始,然后随时间推移增加批大小。
Returns:
getMaxMicroBatchConcurrency
public int getMaxMicroBatchConcurrency()
对分区键范围执行请求的最大并发性。 默认情况下,maxMicroBatchConcurrency 为 1。
Returns:
getThresholdsState
public CosmosBulkExecutionThresholdsState getThresholdsState()
返回将来可传递给其他 CosmosBulkExecutionOptions 的阈值状态
Returns:
getThroughputControlGroupName
public String getThroughputControlGroupName()
获取吞吐量控制组名称。
Returns:
setExcludedRegions
public CosmosBulkExecutionOptions setExcludedRegions(List
要为请求/重试排除的区域列表。 示例“美国东部”或“美国东部,美国西部”这些区域将从首选区域列表中排除
Parameters:
Returns:
setInitialMicroBatchSize
public CosmosBulkExecutionOptions setInitialMicroBatchSize(int initialMicroBatchSize)
设置将发送到后端的微批的初始大小。 微批的大小将根据限制速率动态调整。 默认值为 100 - 因此,它从相对较大的微批开始,当限制速率过高时,它将减小批大小。 如果在动态减小初始批大小之前出现短时间限制峰值,导致对其他工作负荷产生副作用,则可以减小初始微批大小(例如设置为 1),此时会从小微批开始,然后随时间推移增加批大小。
Parameters:
Returns:
setMaxMicroBatchConcurrency
public CosmosBulkExecutionOptions setMaxMicroBatchConcurrency(int maxMicroBatchConcurrency)
为分区键范围设置执行请求的最大并发性。 默认情况下,maxMicroBatchConcurrency 为 1。 它只允许值 ?1 和 ?5。 注意! 请谨慎调整此值。 通过增大此值,将允许将更多并发请求发送到服务器,在这种情况下,可能会导致 429 或请求由于本地资源饱和而超时,这可能会降低性能。
Parameters:
Returns:
setThroughputControlGroupName
public CosmosBulkExecutionOptions setThroughputControlGroupName(String throughputControlGroupName)
设置吞吐量控制组名称。
Parameters:
Returns: