Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions eng/lintingconfigs/revapi/track2/revapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@
},
"justification": "Cosmos SDK removes Beta annotation to GA its APIs and classes."
},
{
"code": "java.annotation.removed",
"new": "enum com.azure.cosmos.models.ChangeFeedOperationType",
"justification": "Promoting ChangeFeedOperationType enum from Beta to GA - see issue #48959."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this new rule, we can use the existing one above and add enum to it. Would that not work?

},
{
"code": "java.method.removed",
"old": {
Expand Down
19 changes: 18 additions & 1 deletion sdk/cosmos/azure-cosmos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@
### 4.81.0-beta.1 (Unreleased)

#### Features Added

* Promoted the Full Fidelity Change Feed (AllVersionsAndDeletes) APIs to GA. See [Issue 48959](https://github.com/Azure/azure-sdk-for-java/issues/48959). The following types and members are no longer marked `@Beta`:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too big of a changelog entry, lets just keep it to

Promoted the Full Fidelity Change Feed (AllVersionsAndDeletes) APIs to GA. See [PR 49283](https://github.com/Azure/azure-sdk-for-java/pull/49283)

* `ChangeFeedPolicy` (class) and `createAllVersionsAndDeletesPolicy(Duration)`, `createLatestVersionPolicy()`, `getRetentionDurationForAllVersionsAndDeletesPolicy()`
* `CosmosChangeFeedRequestOptions.allVersionsAndDeletes()`
* `CosmosContainerProperties.getChangeFeedPolicy()` / `setChangeFeedPolicy(ChangeFeedPolicy)`
* `ChangeFeedProcessorBuilder.handleAllVersionsAndDeletesChanges` (both `Consumer` and `BiConsumer` overloads)
* `ChangeFeedProcessorContext` (interface) and `getLeaseToken()`, `getDiagnostics()`
* `ChangeFeedProcessorItem` (class) and `getCurrent()`, `getPrevious()`, `getChangeFeedMetaData()`, `toJsonNode()`
* `ChangeFeedMetaData` (class) and all accessors
* `ChangeFeedOperationType` (enum)

Migration from deprecated APIs: the previously `@Beta @Deprecated` legacy-named methods remain available for back-compat but will be removed in a future release. Callers should migrate to the GA equivalents:

| Deprecated | GA replacement |
| --------------------------------------------------------- | ----------------------------------------------------------------------- |
| `ChangeFeedPolicy.createFullFidelityPolicy(Duration)` | `ChangeFeedPolicy.createAllVersionsAndDeletesPolicy(Duration)` |
| `ChangeFeedPolicy.createIncrementalPolicy()` | `ChangeFeedPolicy.createLatestVersionPolicy()` |
| `ChangeFeedPolicy.getFullFidelityRetentionDuration()` | `ChangeFeedPolicy.getRetentionDurationForAllVersionsAndDeletesPolicy()` |
| `CosmosChangeFeedRequestOptions.fullFidelity()` | `CosmosChangeFeedRequestOptions.allVersionsAndDeletes()` |

#### Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.azure.cosmos.implementation.changefeed.epkversion.FullFidelityChangeFeedProcessorImpl;
import com.azure.cosmos.models.ChangeFeedProcessorItem;
import com.azure.cosmos.models.ChangeFeedProcessorOptions;
import com.azure.cosmos.util.Beta;
import com.fasterxml.jackson.databind.JsonNode;

import java.util.List;
Expand Down Expand Up @@ -255,7 +254,6 @@ public ChangeFeedProcessorBuilder handleLatestVersionChanges(Consumer<List<Chang
* @param consumer the {@link Consumer} to call for handling the feeds.
* @return current Builder.
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public ChangeFeedProcessorBuilder handleAllVersionsAndDeletesChanges(Consumer<List<ChangeFeedProcessorItem>> consumer) {
checkNotNull(consumer, "consumer cannot be null");
checkArgument(this.fullFidelityModeLeaseWithContextConsumer == null,
Expand Down Expand Up @@ -285,7 +283,6 @@ public ChangeFeedProcessorBuilder handleAllVersionsAndDeletesChanges(Consumer<Li
* @param biConsumer the {@link BiConsumer} to call for handling the feeds and the {@link ChangeFeedProcessorContext} instance.
* @return current Builder.
*/
@Beta(value = Beta.SinceVersion.V4_51_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public ChangeFeedProcessorBuilder handleAllVersionsAndDeletesChanges(
BiConsumer<List<ChangeFeedProcessorItem>, ChangeFeedProcessorContext> biConsumer) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package com.azure.cosmos;

import com.azure.cosmos.implementation.apachecommons.lang.NotImplementedException;
import com.azure.cosmos.util.Beta;

import java.util.function.BiConsumer;

Expand All @@ -16,23 +15,20 @@
* <br>
* NOTE: This interface is not designed to be implemented by end users.
* */
@Beta(value = Beta.SinceVersion.V4_51_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public interface ChangeFeedProcessorContext {
/**
* Gets the lease token corresponding to the source of
* a batch of change feed documents.
*
* @return the lease token
* */
@Beta(value = Beta.SinceVersion.V4_51_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
String getLeaseToken();

/**
* Get the diagnostics context from the underlying feed response.
*
* @return The diagnostics object.
*/
@Beta(value = Beta.SinceVersion.V4_64_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
default CosmosDiagnosticsContext getDiagnostics() {
throw new NotImplementedException("Method has not been implemented. NOTE: This method is not designed to be implemented by end users.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.azure.cosmos.models.DedicatedGatewayRequestOptions;
import com.azure.cosmos.models.FeedRange;
import com.azure.cosmos.models.PartitionKeyDefinition;
import com.azure.cosmos.util.Beta;

import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -251,8 +250,6 @@ public void setRequestContinuation(String etag) {
this.feedRangeInternal);
}

@Beta(value = Beta.SinceVersion.V4_12_0, warningText =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not remove the @Beta annotation from these deprecated APIs, since they are deprecated anyway, let's keep the @Beta annotation on these.
Idea is to remove them completely from the SDK in the long run, so let's not GA them.

Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
@Deprecated //since = "V4_37_0", forRemoval = true
public CosmosChangeFeedRequestOptionsImpl fullFidelity() {

Expand All @@ -269,7 +266,6 @@ public CosmosChangeFeedRequestOptionsImpl fullFidelity() {
return this;
}

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

if (!this.startFromInternal.supportsFullFidelityRetention()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package com.azure.cosmos.models;

import com.azure.cosmos.implementation.Utils;
import com.azure.cosmos.util.Beta;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
Expand All @@ -13,7 +12,6 @@
/**
* Change Feed response meta data
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public final class ChangeFeedMetaData {
@JsonProperty("crts")
private long conflictResolutionTimestamp;
Expand All @@ -31,7 +29,6 @@ public final class ChangeFeedMetaData {
*
* @return conflict resolution timestamp
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
@JsonIgnore
public Instant getConflictResolutionTimestamp() {
return Instant.ofEpochSecond(conflictResolutionTimestamp);
Expand All @@ -42,7 +39,6 @@ public Instant getConflictResolutionTimestamp() {
*
* @return current logical sequence number
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public long getLogSequenceNumber() {
return logSequenceNumber;
}
Expand All @@ -52,7 +48,6 @@ public long getLogSequenceNumber() {
*
* @return change Feed operation type
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public ChangeFeedOperationType getOperationType() {
return operationType;
}
Expand All @@ -62,7 +57,6 @@ public ChangeFeedOperationType getOperationType() {
*
* @return previous logical sequence number
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public long getPreviousLogSequenceNumber() {
return previousLogSequenceNumber;
}
Expand All @@ -73,7 +67,6 @@ public long getPreviousLogSequenceNumber() {
*
* @return true if ttlExpiration caused the delete.
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public boolean isTimeToLiveExpired() {
return timeToLiveExpired;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
// Licensed under the MIT License.
package com.azure.cosmos.models;

import com.azure.cosmos.util.Beta;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Change feed operation type
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public enum ChangeFeedOperationType {
/**
* Represents Create operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
* }
* </pre>
*/
@Beta(value = Beta.SinceVersion.V4_12_0,
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public final class ChangeFeedPolicy {

private final JsonSerializable jsonSerializable;
Expand Down Expand Up @@ -94,8 +92,6 @@ public static ChangeFeedPolicy createFullFidelityPolicy(Duration retentionDurati
*
* @return ChangeFeedPolicy for AllVersionsAndDeletes change feed.
*/
@Beta(value = Beta.SinceVersion.V4_37_0,
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public static ChangeFeedPolicy createAllVersionsAndDeletesPolicy(Duration retentionDuration) {

if (retentionDuration.isNegative() ||
Expand Down Expand Up @@ -141,8 +137,6 @@ public static ChangeFeedPolicy createIncrementalPolicy() {
*
* @return ChangeFeedPolicy for default/LatestVersion change feed without AllVersionsAndDeletes.
*/
@Beta(value = Beta.SinceVersion.V4_37_0,
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public static ChangeFeedPolicy createLatestVersionPolicy() {

ChangeFeedPolicy policy = new ChangeFeedPolicy();
Expand Down Expand Up @@ -199,8 +193,6 @@ public Duration getFullFidelityRetentionDuration() {
*
* @return AllVersionsAndDeletes retention duration.
*/
@Beta(value = Beta.SinceVersion.V4_37_0,
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public Duration getRetentionDurationForAllVersionsAndDeletesPolicy() {
return Duration.ofMinutes(this.getRetentionDurationForAllVersionsAndDeletesPolicyInMinutes());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package com.azure.cosmos.models;

import com.azure.cosmos.implementation.Utils;
import com.azure.cosmos.util.Beta;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -17,7 +16,6 @@
*
* Caller is recommended to type cast {@link JsonNode} to cosmos item structure.
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public final class ChangeFeedProcessorItem {
@JsonProperty("current")
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand All @@ -37,7 +35,6 @@ public final class ChangeFeedProcessorItem {
*
* @return change feed current item.
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public JsonNode getCurrent() {
return current;
}
Expand All @@ -49,7 +46,6 @@ public JsonNode getCurrent() {
*
* @return change feed previous item.
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public JsonNode getPrevious() {
return previous;
}
Expand All @@ -59,7 +55,6 @@ public JsonNode getPrevious() {
*
* @return change feed metadata.
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
@JsonIgnore
public ChangeFeedMetaData getChangeFeedMetaData() {

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

if (this.changeFeedProcessorItemAsJsonNode == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@ public CosmosChangeFeedRequestOptions fullFidelity() {
*
* @return a {@link CosmosChangeFeedRequestOptions} instance with AllVersionsAndDeletes mode enabled
*/
@Beta(value = Beta.SinceVersion.V4_37_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public CosmosChangeFeedRequestOptions allVersionsAndDeletes() {
this.actualRequestOptions.allVersionsAndDeletes();
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.azure.cosmos.implementation.ImplementationBridgeHelpers;
import com.azure.cosmos.implementation.Resource;
import com.azure.cosmos.implementation.apachecommons.lang.StringUtils;
import com.azure.cosmos.util.Beta;
import com.fasterxml.jackson.databind.node.ObjectNode;

import java.time.Instant;
Expand Down Expand Up @@ -161,8 +160,6 @@ public CosmosContainerProperties setConflictResolutionPolicy(ConflictResolutionP
*
* @return ChangeFeedPolicy
*/
@Beta(value = Beta.SinceVersion.V4_12_0,
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public ChangeFeedPolicy getChangeFeedPolicy() {
return this.documentCollection.getChangeFeedPolicy();
}
Expand All @@ -173,8 +170,6 @@ public ChangeFeedPolicy getChangeFeedPolicy() {
* @param value ChangeFeedPolicy to be used.
* @return the CosmosContainerProperties.
*/
@Beta(value = Beta.SinceVersion.V4_12_0,
warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public CosmosContainerProperties setChangeFeedPolicy(ChangeFeedPolicy value) {
this.documentCollection.setChangeFeedPolicy(value);
return this;
Expand Down
Loading