Skip to content

Commit 4a8babb

Browse files
Fixing Beta-Version for Changefeed Pull public API (Azure#18838)
* Initial draft of FeedRange artifacts * Iterating on FeedRange Apis * Adding public surface area * Adding FeedRange unit tests * Adding test FeedRangePKRangeId_GetEffectiveRangesAsync_Refresh * Adding test FeedRangePKRangeId_GetEffectiveRangesAsync_Null * Adding test feedRangeEPK_getPartitionKeyRangesAsync * Adding test feedRangePK_getPartitionKeyRangesAsync * Adding test feedRangePKRangeId_getPartitionKeyRangesAsync * Adding request visitor unit tests * Finishing FeedRange tests * Cleanup and prettifying * Prettifying feed range tests * Fixes and new test for Conatiner.getFeedRanges() * Addressing some SpotBug violations * Iterating on Changefeed Pull model draft * Snapshot to be able to switch branches * Finishing switch from deleted ChangeFeedOptions to new public CosmosChangeFeedRequestOptions * Adding basic json serialization test coverage for FeedRangeContinuation * Snapshot - converting Chagefeed to FeedRanges - tests not working yet * Snapshot * Snapshot * Removing TODOs * Fixing test regressions * Fixing a couple SpotBug violations * Fixing few more SPotBug violations * Fixing ChangeFeedState unit test * Code cleanup * Test code cleanup * Fixing a regression in Range json serialization * Fixing CF split unit test failure * Fixes for some code review feedback * Fixing test flakiness (unrelated to actual change) * Adding ChangeFeedPolicy * Adding tests for ChangeFeedPolicy * Fixing build break * Fixing SpotBug issue * Re-triggering CI * Deleting temp data * Deleting CosmosDB Emulator temp data * Fixing scritp to delete temp folder * Fixing PS script * Adding message with Emulator version to emulator install yaml file * Adding Cosmos DB Emulator installation logs * Adding logic to unistall emulator to Cosmos Emulator yml * Update cosmos-emulator.yml * Fixing missing admin elevation in the uninstall step in Cosmos Emulator yml * Iterating on cosmos-emulator.yml * Iteratiing on cosmos-emulator.yml * Iterating on cosmos-emulator.yml * Iterating on cosmos-emulator.yml * Iterating on comsos-emulator.yml * Iterating on comsos-emulator.yml * Iterate on cosmos-emulator.yml * Adding FF changefeed unit tests * Fixing build warning * Fixing test regression when ContainerTest hit emulator limit of number of containers * Fixing emulator config for CI tests * Fixing test issue - causing Begin/After Method/Class to also happen for emulator tests in ChangeFeedTest * Refactoring FeedRange visitors to populate request headers * Implementing FeedRangeInternal.populateFeedRangeFilteringHeaders * Fixes for FeedRangeTest * Refactoring FeedRangeINternal.getEffectiveRanges to getEffectiveRange * Fixing test issue in FeedRangeTest * Reacting to self-Code review * Actually adding public APIs for queryChangeFeed * Adding public API in CosmosContainer and SomsosAsyncContainer for CF pull model * Reacting to CR comments * SpotBug fixes * Fixing JavaDoc bug * Reverting switch to @JsonDeserialize for custom deserializers * Iterating on code review comments * Adding more unit tests * Spotbug fix * Fix for test failures in FeedRangeTest * Fixing SpotBUg issue * Fixing test issues * Iterating on Cosmos Container ChangeFeed tests * Fixing test issue for small page size * Adding addiitonal unit tests for change feed pull model * Adding remaining tests for CF pull model * Update FeedRange.java * Cleanup * Fixing typos in comments * Fixing Duration in ChangeFeedPolicy * Changing the encoding of FeedRange and ChangeFeedState to be base64-encoded Json vs. Json * Cleanup * Fixing spotbug issue * Fixing test issue * Switching deserializer registration to annotation based approach * Reacting to code review feedback from Milis * Fixing Test issues after changing ChangeFeedStateVersion from 0 to 1 * Fix test issue * Renaming ShouldretryResult.RETRY_IMMEDIATELY to RETRY_NOW * Adding Status code to JavaDoc description when processing FF CF outside retention * Fixing ChangeFeedProcessor issues Matias found - Continuation persisted in leases was stored as Base64-encoded josn of ChangeFeedState (vs. just LSN) - Split handling was broken because the Change feed pull model is split-proof and doesn't surface GoneException which Change Feed processor relies on for splitting leases. * Addressing code review comments from Mo * Fixing SpotBUg issue * Adding additional assert in CFP split test * Addressing code review comments from Milis * Fixing Beta-Version for Changefeed Pull public API
1 parent 2e197c9 commit 4a8babb

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosAsyncContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ <T> Function<CosmosPagedFluxOptions, Flux<FeedResponse<T>>> queryItemsInternalFu
495495
* @return a {@link CosmosPagedFlux} containing one or several feed response pages of the obtained
496496
* items or an error.
497497
*/
498-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
498+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
499499
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
500500
public <T> CosmosPagedFlux<T> queryChangeFeed(CosmosChangeFeedRequestOptions options, Class<T> classType) {
501501
checkNotNull(options, "Argument 'options' must not be null.");

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosContainer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
import java.util.List;
2929

30-
import static com.azure.cosmos.implementation.Utils.setContinuationTokenAndMaxItemCount;
3130
import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull;
3231

3332
/**
@@ -352,7 +351,7 @@ public <T> CosmosPagedIterable<T> queryItems(SqlQuerySpec querySpec, CosmosQuery
352351
* @param classType the class type.
353352
* @return a {@link CosmosPagedFlux} containing one feed response page
354353
*/
355-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
354+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
356355
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
357356
public <T> CosmosPagedIterable<T> queryChangeFeed(
358357
CosmosChangeFeedRequestOptions options,

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ChangeFeedPolicy.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
* }
5353
* </pre>
5454
*/
55-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION,
55+
@Beta(value = Beta.SinceVersion.V4_12_0,
5656
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
5757
public final class ChangeFeedPolicy {
5858

@@ -68,7 +68,7 @@ public final class ChangeFeedPolicy {
6868
*
6969
* @return ChangeFeedPolicy for full fidelity change feed.
7070
*/
71-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION,
71+
@Beta(value = Beta.SinceVersion.V4_12_0,
7272
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
7373
public static ChangeFeedPolicy createFullFidelityPolicy(Duration retentionDuration) {
7474

@@ -95,7 +95,7 @@ public static ChangeFeedPolicy createFullFidelityPolicy(Duration retentionDurati
9595
*
9696
* @return ChangeFeedPolicy for default/incremental change feed without full fidelity.
9797
*/
98-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION,
98+
@Beta(value = Beta.SinceVersion.V4_12_0,
9999
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
100100
public static ChangeFeedPolicy createIncrementalPolicy() {
101101

@@ -137,7 +137,7 @@ public static ChangeFeedPolicy createIncrementalPolicy() {
137137
*
138138
* @return full fidelity retention duration.
139139
*/
140-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION,
140+
@Beta(value = Beta.SinceVersion.V4_12_0,
141141
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
142142
public Duration getFullFidelityRetentionDuration() {
143143
return Duration.ofMinutes(this.getFullFidelityRetentionDurationInMinutes());

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosChangeFeedRequestOptions.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkArgument;
2020
import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull;
2121

22-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
22+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
2323
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
2424
public final class CosmosChangeFeedRequestOptions {
2525
private static final int DEFAULT_MAX_ITEM_COUNT = 100;
@@ -70,7 +70,7 @@ ChangeFeedState getContinuation() {
7070
return this.continuationState;
7171
}
7272

73-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
73+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
7474
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
7575
public FeedRange getFeedRange() {
7676
return this.feedRangeInternal;
@@ -82,7 +82,7 @@ public FeedRange getFeedRange() {
8282
*
8383
* @return the max number of items.
8484
*/
85-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
85+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
8686
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
8787
public int getMaxItemCount() {
8888
return this.maxItemCount;
@@ -95,7 +95,7 @@ public int getMaxItemCount() {
9595
* @param maxItemCount the max number of items.
9696
* @return the FeedOptionsBase.
9797
*/
98-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
98+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
9999
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
100100
public CosmosChangeFeedRequestOptions setMaxItemCount(int maxItemCount) {
101101
this.maxItemCount = maxItemCount;
@@ -114,7 +114,7 @@ public CosmosChangeFeedRequestOptions setMaxItemCount(int maxItemCount) {
114114
*
115115
* @return the modified change feed request options.
116116
*/
117-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
117+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
118118
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
119119
public int getMaxPrefetchPageCount() {
120120
return this.maxPrefetchPageCount;
@@ -134,7 +134,7 @@ public int getMaxPrefetchPageCount() {
134134
* asynchronously in the background
135135
* @return the modified change feed request options.
136136
*/
137-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
137+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
138138
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
139139
public CosmosChangeFeedRequestOptions setMaxPrefetchPageCount(int maxPrefetchPageCount) {
140140
checkArgument(
@@ -179,7 +179,7 @@ ChangeFeedStartFromInternal getStartFromSettings() {
179179
* logical partition or subset of a container)
180180
* @return a new {@link CosmosChangeFeedRequestOptions} instance
181181
*/
182-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
182+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
183183
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
184184
public static CosmosChangeFeedRequestOptions createForProcessingFromBeginning(FeedRange feedRange) {
185185
checkNotNull(feedRange, "Argument 'feedRange' must not be null.");
@@ -199,7 +199,7 @@ public static CosmosChangeFeedRequestOptions createForProcessingFromBeginning(Fe
199199
* FeedResponse
200200
* @return a new {@link CosmosChangeFeedRequestOptions} instance
201201
*/
202-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
202+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
203203
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
204204
public static CosmosChangeFeedRequestOptions createForProcessingFromContinuation(
205205
String continuation) {
@@ -271,7 +271,7 @@ static CosmosChangeFeedRequestOptions createForProcessingFromEtagAndFeedRange(
271271
* logical partition or subset of a container)
272272
* @return a new {@link CosmosChangeFeedRequestOptions} instance
273273
*/
274-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
274+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
275275
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
276276
public static CosmosChangeFeedRequestOptions createForProcessingFromNow(FeedRange feedRange) {
277277
if (feedRange == null) {
@@ -294,7 +294,7 @@ public static CosmosChangeFeedRequestOptions createForProcessingFromNow(FeedRang
294294
* logical partition or subset of a container)
295295
* @return a new {@link CosmosChangeFeedRequestOptions} instance
296296
*/
297-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
297+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
298298
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
299299
public static CosmosChangeFeedRequestOptions createForProcessingFromPointInTime(
300300
Instant pointInTime,
@@ -368,7 +368,7 @@ CosmosChangeFeedRequestOptions withCosmosPagedFluxOptions(
368368
*
369369
* @return a {@link CosmosChangeFeedRequestOptions} instance with full fidelity mode enabled
370370
*/
371-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText =
371+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
372372
Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
373373
public CosmosChangeFeedRequestOptions fullFidelity() {
374374

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public CosmosContainerProperties setConflictResolutionPolicy(ConflictResolutionP
152152
*
153153
* @return ChangeFeedPolicy
154154
*/
155-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION,
155+
@Beta(value = Beta.SinceVersion.V4_12_0,
156156
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
157157
public ChangeFeedPolicy getChangeFeedPolicy() {
158158
return this.documentCollection.getChangeFeedPolicy();
@@ -164,7 +164,7 @@ public ChangeFeedPolicy getChangeFeedPolicy() {
164164
* @param value ChangeFeedPolicy to be used.
165165
* @return the CosmosContainerProperties.
166166
*/
167-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION,
167+
@Beta(value = Beta.SinceVersion.V4_12_0,
168168
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
169169
public CosmosContainerProperties setChangeFeedPolicy(ChangeFeedPolicy value) {
170170
this.documentCollection.setChangeFeedPolicy(value);

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/FeedRange.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static FeedRange fromString(String json) {
3636
* @param partitionKey the logical partition key value
3737
* @return A feed range for a certain logical partition
3838
*/
39-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
39+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
4040
public static FeedRange forLogicalPartition(PartitionKey partitionKey) {
4141
checkNotNull(partitionKey, "Argument 'partitionKey' must not be null.");
4242

@@ -48,7 +48,7 @@ public static FeedRange forLogicalPartition(PartitionKey partitionKey) {
4848
* Creates a range for an entire container
4949
* @return A feed range for an entire container
5050
*/
51-
@Beta(value = Beta.SinceVersion.WHATEVER_NEW_VERSION, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
51+
@Beta(value = Beta.SinceVersion.V4_12_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
5252
public static FeedRange forFullRange() {
5353
return FeedRangeEpkImpl.forFullRange();
5454
}

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/util/Beta.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public enum SinceVersion {
5555
V4_9_0,
5656
/** v4.11.0 */
5757
V4_11_0,
58-
WHATEVER_NEW_VERSION
58+
/** v4.12.0 */
59+
V4_12_0
5960
}
6061
}

0 commit comments

Comments
 (0)