chore(benchmark): wire excludedRegionsList into Cosmos*RequestOptions#49313
Merged
jeet1995 merged 2 commits intoMay 29, 2026
Merged
Conversation
Adds an excludedRegionsList field on TenantDefaultConfig (mirroring preferredRegionsList) and threads getExcludedRegionsList() into every Cosmos*RequestOptions constructed by the vanilla async/sync benchmark workloads (read, write, query, readMany, bulk). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…exclude-regions-wiring
Contributor
There was a problem hiding this comment.
Pull request overview
Wires the existing excludedRegionsList benchmark config field into per-request Cosmos*RequestOptions across vanilla async/sync workloads in azure-cosmos-benchmark. Excluded regions are a per-request SDK feature, so configuring this field previously had no effect.
Changes:
- Add
excludedRegionsListfield, getter, andapplyTo(...)inheritance inTenantDefaultConfig(mirroringpreferredRegionsList). - Call
setExcludedRegions(...)onCosmosItemRequestOptions,CosmosQueryRequestOptions,CosmosReadManyRequestOptions, andCosmosBulkExecutionOptionsacross the vanilla async/sync workloads. - Switch
AsyncReadBenchmarkandAsyncReadManyBenchmarkto overloads that accept request options.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
TenantDefaultConfig.java |
Adds excludedRegionsList field, comma-split getter, and inheritance in applyTo. |
AsyncBenchmark.java |
Sets excluded regions on bulk pre-population options. |
AsyncQueryBenchmark.java |
Sets excluded regions on per-call query options. |
AsyncQuerySinglePartitionMultiple.java |
Sets excluded regions on constructor-level query options. |
AsyncReadBenchmark.java |
Switches to readItem options overload and sets excluded regions. |
AsyncReadManyBenchmark.java |
Switches to readMany options overload and sets excluded regions. |
AsyncWriteBenchmark.java |
Sets excluded regions on item options for both create branches. |
SyncBenchmark.java |
Sets excluded regions on bulk pre-population options. |
SyncReadBenchmark.java |
Hoists item options to local and sets excluded regions. |
SyncWriteBenchmark.java |
Sets excluded regions on item options for both create branches. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plumbs the existing
excludedRegionsListbenchmark config field through every per-requestCosmos*RequestOptionsconstruction site in the vanilla async/sync workloads ofazure-cosmos-benchmark. Without this, configuringexcludedRegionsListhad no effect on the actual request paths.Note:
CosmosClientBuilderalso exposesexcludedRegionsSupplier(Supplier<CosmosExcludedRegions>)for client-wide configuration. This PR takes the per-request approach to keep the change localized to the request-options layer; a follow-up can switch to the client-level supplier if preferred.Changes
TenantDefaultConfig.java— mirrorspreferredRegionsList:excludedRegionsListfield with@JsonPropertygetExcludedRegionsList()that splits the comma-separated value (returnsnullwhen empty)applyTo(TenantWorkloadConfig)Wired
setExcludedRegions(workloadConfig.getExcludedRegionsList())into:AsyncBenchmark—CosmosBulkExecutionOptions(pre-population bulk path)AsyncQueryBenchmark—CosmosQueryRequestOptionsAsyncQuerySinglePartitionMultiple—CosmosQueryRequestOptionsin constructorAsyncReadBenchmark— switched to thereadItemoverload acceptingCosmosItemRequestOptionsAsyncReadManyBenchmark— switched to thereadManyoverload acceptingCosmosReadManyRequestOptionsAsyncWriteBenchmark—CosmosItemRequestOptionson bothcreateItembranchesSyncBenchmark—CosmosBulkExecutionOptions(pre-population bulk path)SyncReadBenchmark— hoisted inlineCosmosItemRequestOptionsto a localSyncWriteBenchmark—CosmosItemRequestOptionson bothcreateItembranchesOut of scope (intentionally not modified)
AsyncMixedBenchmark,ctl/AsyncCtlWorkload,ReadMyWriteWorkflow, allencryption/*workloads — deferred.DocDBUtils,BenchmarkHelperretry path,CosmosMetricsReporter— not workload paths (management metadata, retry helper, reporter infra).Verification
mvn -f sdk/cosmos/azure-cosmos-benchmark/pom.xml -DskipTests -am compile— passesmvn -f sdk/cosmos/azure-cosmos-benchmark/pom.xml checkstyle:check spotbugs:check— passesnew Cosmos*RequestOptions/new CosmosBulkExecutionOptionsinsrc/mainconfirms every remaining occurrence is either followed bysetExcludedRegions(...)or is in the intentionally-skipped list above.10 files changed, +38/-8.