Skip to content

Commit ed270e0

Browse files
ananth7592Copilot
andauthored
Cosmos: promote Full Fidelity Change Feed (AllVersionsAndDeletes) APIs to GA (#49283)
Removes @beta from FFCF / AllVersionsAndDeletes public APIs, including ChangeFeedProcessorContext (parameter type of the BiConsumer overload). The deprecated fullFidelity / createFullFidelityPolicy / createIncrementalPolicy / getFullFidelityRetentionDuration methods are intentionally kept for back-compat. ChangeFeedMode.FULL_FIDELITY enum is also kept (continuation token wire format). Resolves #48959 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1aacd27 commit ed270e0

11 files changed

Lines changed: 6 additions & 44 deletions

eng/lintingconfigs/revapi/track2/revapi.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,11 @@
312312
"justification": "Generated classes were moved into public API, these annotations were already being used in implementation used during serialization and deserialization."
313313
},
314314
{
315-
"code": "java.annotation.removed",
316-
"new": {
317-
"matcher": "regex",
318-
"match": "(class|interface|method|parameter) com\\.azure\\.cosmos\\..*"
319-
},
320-
"justification": "Cosmos SDK removes Beta annotation to GA its APIs and classes."
315+
"regex": true,
316+
"code": "java\\.annotation\\.removed",
317+
"new": "(class|interface|enum|method|parameter) com\\.azure\\.cosmos\\..*",
318+
"annotationType": "com\\.azure\\.cosmos\\.util\\.Beta",
319+
"justification": "Cosmos SDK removes the Beta annotation to GA its APIs. Only Beta annotation removals are permitted; removal of any other annotation (Deprecated, Jackson, etc.) will still fail the build."
321320
},
322321
{
323322
"code": "java.method.removed",

sdk/cosmos/azure-cosmos/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
### 4.81.0-beta.1 (Unreleased)
44

55
#### Features Added
6-
6+
* Promoted the Full Fidelity Change Feed (AllVersionsAndDeletes) APIs to GA - See [PR 49283](https://github.com/Azure/azure-sdk-for-java/pull/49283)
77

88
#### Breaking Changes
99

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import com.azure.cosmos.implementation.changefeed.epkversion.FullFidelityChangeFeedProcessorImpl;
1010
import com.azure.cosmos.models.ChangeFeedProcessorItem;
1111
import com.azure.cosmos.models.ChangeFeedProcessorOptions;
12-
import com.azure.cosmos.util.Beta;
1312
import com.fasterxml.jackson.databind.JsonNode;
1413

1514
import java.util.List;
@@ -255,7 +254,6 @@ public ChangeFeedProcessorBuilder handleLatestVersionChanges(Consumer<List<Chang
255254
* @param consumer the {@link Consumer} to call for handling the feeds.
256255
* @return current Builder.
257256
*/
258-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
259257
public ChangeFeedProcessorBuilder handleAllVersionsAndDeletesChanges(Consumer<List<ChangeFeedProcessorItem>> consumer) {
260258
checkNotNull(consumer, "consumer cannot be null");
261259
checkArgument(this.fullFidelityModeLeaseWithContextConsumer == null,
@@ -285,7 +283,6 @@ public ChangeFeedProcessorBuilder handleAllVersionsAndDeletesChanges(Consumer<Li
285283
* @param biConsumer the {@link BiConsumer} to call for handling the feeds and the {@link ChangeFeedProcessorContext} instance.
286284
* @return current Builder.
287285
*/
288-
@Beta(value = Beta.SinceVersion.V4_51_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
289286
public ChangeFeedProcessorBuilder handleAllVersionsAndDeletesChanges(
290287
BiConsumer<List<ChangeFeedProcessorItem>, ChangeFeedProcessorContext> biConsumer) {
291288

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package com.azure.cosmos;
55

66
import com.azure.cosmos.implementation.apachecommons.lang.NotImplementedException;
7-
import com.azure.cosmos.util.Beta;
87

98
import java.util.function.BiConsumer;
109

@@ -16,23 +15,20 @@
1615
* <br>
1716
* NOTE: This interface is not designed to be implemented by end users.
1817
* */
19-
@Beta(value = Beta.SinceVersion.V4_51_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
2018
public interface ChangeFeedProcessorContext {
2119
/**
2220
* Gets the lease token corresponding to the source of
2321
* a batch of change feed documents.
2422
*
2523
* @return the lease token
2624
* */
27-
@Beta(value = Beta.SinceVersion.V4_51_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
2825
String getLeaseToken();
2926

3027
/**
3128
* Get the diagnostics context from the underlying feed response.
3229
*
3330
* @return The diagnostics object.
3431
*/
35-
@Beta(value = Beta.SinceVersion.V4_64_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
3632
default CosmosDiagnosticsContext getDiagnostics() {
3733
throw new NotImplementedException("Method has not been implemented. NOTE: This method is not designed to be implemented by end users.");
3834
}

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosChangeFeedRequestOptionsImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ public CosmosChangeFeedRequestOptionsImpl fullFidelity() {
269269
return this;
270270
}
271271

272-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
273272
public CosmosChangeFeedRequestOptionsImpl allVersionsAndDeletes() {
274273

275274
if (!this.startFromInternal.supportsFullFidelityRetention()) {

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package com.azure.cosmos.models;
44

55
import com.azure.cosmos.implementation.Utils;
6-
import com.azure.cosmos.util.Beta;
76
import com.fasterxml.jackson.annotation.JsonIgnore;
87
import com.fasterxml.jackson.annotation.JsonProperty;
98
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -13,7 +12,6 @@
1312
/**
1413
* Change Feed response meta data
1514
*/
16-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
1715
public final class ChangeFeedMetaData {
1816
@JsonProperty("crts")
1917
private long conflictResolutionTimestamp;
@@ -31,7 +29,6 @@ public final class ChangeFeedMetaData {
3129
*
3230
* @return conflict resolution timestamp
3331
*/
34-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
3532
@JsonIgnore
3633
public Instant getConflictResolutionTimestamp() {
3734
return Instant.ofEpochSecond(conflictResolutionTimestamp);
@@ -42,7 +39,6 @@ public Instant getConflictResolutionTimestamp() {
4239
*
4340
* @return current logical sequence number
4441
*/
45-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
4642
public long getLogSequenceNumber() {
4743
return logSequenceNumber;
4844
}
@@ -52,7 +48,6 @@ public long getLogSequenceNumber() {
5248
*
5349
* @return change Feed operation type
5450
*/
55-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
5651
public ChangeFeedOperationType getOperationType() {
5752
return operationType;
5853
}
@@ -62,7 +57,6 @@ public ChangeFeedOperationType getOperationType() {
6257
*
6358
* @return previous logical sequence number
6459
*/
65-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
6660
public long getPreviousLogSequenceNumber() {
6761
return previousLogSequenceNumber;
6862
}
@@ -73,7 +67,6 @@ public long getPreviousLogSequenceNumber() {
7367
*
7468
* @return true if ttlExpiration caused the delete.
7569
*/
76-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
7770
public boolean isTimeToLiveExpired() {
7871
return timeToLiveExpired;
7972
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
// Licensed under the MIT License.
33
package com.azure.cosmos.models;
44

5-
import com.azure.cosmos.util.Beta;
65
import com.fasterxml.jackson.annotation.JsonProperty;
76

87
/**
98
* Change feed operation type
109
*/
11-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
1210
public enum ChangeFeedOperationType {
1311
/**
1412
* Represents Create operation

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
* }
5353
* </pre>
5454
*/
55-
@Beta(value = Beta.SinceVersion.V4_12_0,
56-
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
5755
public final class ChangeFeedPolicy {
5856

5957
private final JsonSerializable jsonSerializable;
@@ -94,8 +92,6 @@ public static ChangeFeedPolicy createFullFidelityPolicy(Duration retentionDurati
9492
*
9593
* @return ChangeFeedPolicy for AllVersionsAndDeletes change feed.
9694
*/
97-
@Beta(value = Beta.SinceVersion.V4_37_0,
98-
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
9995
public static ChangeFeedPolicy createAllVersionsAndDeletesPolicy(Duration retentionDuration) {
10096

10197
if (retentionDuration.isNegative() ||
@@ -141,8 +137,6 @@ public static ChangeFeedPolicy createIncrementalPolicy() {
141137
*
142138
* @return ChangeFeedPolicy for default/LatestVersion change feed without AllVersionsAndDeletes.
143139
*/
144-
@Beta(value = Beta.SinceVersion.V4_37_0,
145-
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
146140
public static ChangeFeedPolicy createLatestVersionPolicy() {
147141

148142
ChangeFeedPolicy policy = new ChangeFeedPolicy();
@@ -199,8 +193,6 @@ public Duration getFullFidelityRetentionDuration() {
199193
*
200194
* @return AllVersionsAndDeletes retention duration.
201195
*/
202-
@Beta(value = Beta.SinceVersion.V4_37_0,
203-
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
204196
public Duration getRetentionDurationForAllVersionsAndDeletesPolicy() {
205197
return Duration.ofMinutes(this.getRetentionDurationForAllVersionsAndDeletesPolicyInMinutes());
206198
}

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package com.azure.cosmos.models;
44

55
import com.azure.cosmos.implementation.Utils;
6-
import com.azure.cosmos.util.Beta;
76
import com.fasterxml.jackson.annotation.JsonIgnore;
87
import com.fasterxml.jackson.annotation.JsonInclude;
98
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -17,7 +16,6 @@
1716
*
1817
* Caller is recommended to type cast {@link JsonNode} to cosmos item structure.
1918
*/
20-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
2119
public final class ChangeFeedProcessorItem {
2220
@JsonProperty("current")
2321
@JsonInclude(JsonInclude.Include.NON_NULL)
@@ -37,7 +35,6 @@ public final class ChangeFeedProcessorItem {
3735
*
3836
* @return change feed current item.
3937
*/
40-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
4138
public JsonNode getCurrent() {
4239
return current;
4340
}
@@ -49,7 +46,6 @@ public JsonNode getCurrent() {
4946
*
5047
* @return change feed previous item.
5148
*/
52-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
5349
public JsonNode getPrevious() {
5450
return previous;
5551
}
@@ -59,7 +55,6 @@ public JsonNode getPrevious() {
5955
*
6056
* @return change feed metadata.
6157
*/
62-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
6358
@JsonIgnore
6459
public ChangeFeedMetaData getChangeFeedMetaData() {
6560

@@ -78,7 +73,6 @@ public ChangeFeedMetaData getChangeFeedMetaData() {
7873
* @throws IllegalArgumentException If conversion fails due to incompatible type;
7974
* if so, root cause will contain underlying checked exception data binding functionality threw
8075
*/
81-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
8276
public JsonNode toJsonNode() {
8377

8478
if (this.changeFeedProcessorItemAsJsonNode == null) {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ public CosmosChangeFeedRequestOptions fullFidelity() {
513513
*
514514
* @return a {@link CosmosChangeFeedRequestOptions} instance with AllVersionsAndDeletes mode enabled
515515
*/
516-
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
517516
public CosmosChangeFeedRequestOptions allVersionsAndDeletes() {
518517
this.actualRequestOptions.allVersionsAndDeletes();
519518
return this;

0 commit comments

Comments
 (0)