Commit 014d0df
[Cosmos] ThroughputControl API
Add SDK-level throughput control API for server-side priority-based
execution and throughput buckets (issue #3904).
New SDK types:
- ThroughputControlGroup enum with PriorityBased and ThroughputBucket
variants, hiding the driver's unimplemented ClientSide variant
- Re-exports PriorityLevel, ThroughputControlGroupName, ContainerReference
Registration and resolution:
- CosmosClientOptions::with_throughput_control_group() for registration
- ThroughputControlGroupRegistry threaded through CosmosClient,
DatabaseClient, and ContainerClient
- apply_throughput_control() on ItemWriteOptions, QueryOptions, and
BatchOptions resolves group name to x-ms-cosmos-priority-level and
x-ms-cosmos-throughput-bucket headers
Driver:
- ContainerReference::stub() doc-hidden helper for unit testing
Tests cover registration errors, header application for priority and
bucket groups, default group resolution, and empty registry behavior.
Fixes #3904
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4d39ccc commit 014d0df
File tree
13 files changed
+303
-341
lines changed- sdk/cosmos
- azure_data_cosmos_driver/src
- driver
- pipeline
- options
- azure_data_cosmos
- src
- clients
- options
13 files changed
+303
-341
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
Lines changed: 14 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | | - | |
23 | | - | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
28 | | - | |
29 | 25 | | |
30 | 26 | | |
31 | 27 | | |
| |||
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
38 | | - | |
39 | 34 | | |
40 | 35 | | |
41 | | - | |
42 | 36 | | |
| 37 | + | |
43 | 38 | | |
44 | 39 | | |
45 | 40 | | |
46 | 41 | | |
47 | | - | |
| 42 | + | |
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 46 | | |
55 | 47 | | |
56 | 48 | | |
57 | 49 | | |
58 | 50 | | |
59 | 51 | | |
60 | 52 | | |
61 | | - | |
| 53 | + | |
| 54 | + | |
62 | 55 | | |
63 | 56 | | |
64 | 57 | | |
| |||
68 | 61 | | |
69 | 62 | | |
70 | 63 | | |
71 | | - | |
| 64 | + | |
72 | 65 | | |
73 | | - | |
| 66 | + | |
74 | 67 | | |
75 | 68 | | |
76 | | - | |
| 69 | + | |
77 | 70 | | |
78 | | - | |
| 71 | + | |
79 | 72 | | |
80 | 73 | | |
81 | 74 | | |
82 | 75 | | |
83 | 76 | | |
84 | 77 | | |
85 | | - | |
86 | 78 | | |
87 | 79 | | |
88 | | - | |
89 | 80 | | |
| 81 | + | |
90 | 82 | | |
91 | 83 | | |
92 | 84 | | |
| |||
190 | 182 | | |
191 | 183 | | |
192 | 184 | | |
193 | | - | |
| 185 | + | |
194 | 186 | | |
195 | 187 | | |
196 | 188 | | |
| |||
222 | 214 | | |
223 | 215 | | |
224 | 216 | | |
225 | | - | |
| 217 | + | |
226 | 218 | | |
227 | 219 | | |
228 | 220 | | |
| |||
575 | 567 | | |
576 | 568 | | |
577 | 569 | | |
| 570 | + | |
578 | 571 | | |
579 | 572 | | |
580 | 573 | | |
| |||
706 | 699 | | |
707 | 700 | | |
708 | 701 | | |
709 | | - | |
| 702 | + | |
710 | 703 | | |
711 | 704 | | |
712 | 705 | | |
| |||
Lines changed: 16 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
18 | | - | |
19 | 14 | | |
20 | | - | |
21 | 15 | | |
22 | 16 | | |
23 | 17 | | |
| |||
70 | 64 | | |
71 | 65 | | |
72 | 66 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 67 | + | |
77 | 68 | | |
78 | 69 | | |
79 | 70 | | |
| |||
105 | 96 | | |
106 | 97 | | |
107 | 98 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 99 | + | |
115 | 100 | | |
116 | 101 | | |
117 | 102 | | |
118 | 103 | | |
119 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
120 | 113 | | |
121 | 114 | | |
122 | 115 | | |
| |||
149 | 142 | | |
150 | 143 | | |
151 | 144 | | |
152 | | - | |
| 145 | + | |
153 | 146 | | |
154 | 147 | | |
155 | 148 | | |
| |||
184 | 177 | | |
185 | 178 | | |
186 | 179 | | |
187 | | - | |
| 180 | + | |
| 181 | + | |
188 | 182 | | |
189 | 183 | | |
190 | 184 | | |
| |||
Lines changed: 25 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
142 | 156 | | |
143 | 157 | | |
144 | 158 | | |
| |||
348 | 362 | | |
349 | 363 | | |
350 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
351 | 370 | | |
352 | 371 | | |
353 | 372 | | |
354 | 373 | | |
355 | 374 | | |
356 | 375 | | |
357 | 376 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
362 | 383 | | |
363 | 384 | | |
364 | 385 | | |
| |||
0 commit comments