Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Feed: Adds ChangeFeedIterator in GA #2509

Merged
merged 6 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
14 changes: 7 additions & 7 deletions Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ namespace Microsoft.Azure.Cosmos
/// Base class for the change feed mode <see cref="ChangeFeedRequestOptions"/>.
/// </summary>
/// <remarks>Use one of the static constructors to generate a ChangeFeedMode option.</remarks>
#if PREVIEW
public
#else
internal
#endif
abstract class ChangeFeedMode
public abstract class ChangeFeedMode
{
/// <summary>
/// Initializes an instance of the <see cref="ChangeFeedMode"/> class.
Expand Down Expand Up @@ -49,6 +44,11 @@ internal ChangeFeedMode()
/// but no events for deletes or intermediary updates would be included.
/// </remarks>
/// <returns>A <see cref="ChangeFeedMode"/> to receive notifications for insertions, updates, and delete operations.</returns>
public static ChangeFeedMode FullFidelity => ChangeFeedModeFullFidelity.Instance;
#if PREVIEW
public
#else
internal
#endif
static ChangeFeedMode FullFidelity => ChangeFeedModeFullFidelity.Instance;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ namespace Microsoft.Azure.Cosmos
/// Base class for where to start a ChangeFeed operation in <see cref="ChangeFeedRequestOptions"/>.
/// </summary>
/// <remarks>Use one of the static constructors to generate a StartFrom option.</remarks>
#if PREVIEW
public
#else
internal
#endif
abstract class ChangeFeedStartFrom
public abstract class ChangeFeedStartFrom
{
/// <summary>
/// Initializes an instance of the <see cref="ChangeFeedStartFrom"/> class.
Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Azure.Cosmos/src/CosmosClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ public virtual Task<AccountProperties> ReadAccountAsync()
/// <example>
/// <code language="c#">
/// <![CDATA[
/// Database db = cosmosClient.GetDatabase("myDatabaseId"];
/// Database db = cosmosClient.GetDatabase("myDatabaseId");
/// DatabaseResponse response = await db.ReadAsync();
/// ]]>
/// </code>
Expand Down
7 changes: 1 addition & 6 deletions Microsoft.Azure.Cosmos/src/FeedRange/FeedRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ namespace Microsoft.Azure.Cosmos
/// Represents a unit of feed consumption that can be used as unit of parallelism.
/// </summary>
[Serializable]
#if PREVIEW || INTERNAL
public
#else
internal
#endif
abstract class FeedRange
public abstract class FeedRange
ealsur marked this conversation as resolved.
Show resolved Hide resolved
{
/// <summary>
/// Gets a string representation of the current range.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ namespace Microsoft.Azure.Cosmos
/// <summary>
/// The Cosmos Change Feed request options
/// </summary>
#if PREVIEW
public
#else
internal
#endif
sealed class ChangeFeedRequestOptions : RequestOptions
public sealed class ChangeFeedRequestOptions : RequestOptions
{
private int? pageSizeHint;

Expand Down
38 changes: 19 additions & 19 deletions Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1234,25 +1234,6 @@ public abstract ChangeFeedEstimator GetChangeFeedEstimator(
/// <returns>A new instance of <see cref="TransactionalBatch"/>.</returns>
public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey);

#if INTERNAL
/// <summary>
/// Deletes all items in the Container with the specified <see cref="PartitionKey"/> value.
/// Starts an asynchronous Cosmos DB background operation which deletes all items in the Container with the specified value.
/// The asynchronous Cosmos DB background operation runs using a percentage of user RUs.
/// </summary>
/// <param name="partitionKey">The <see cref="PartitionKey"/> of the items to be deleted.</param>
/// <param name="requestOptions">(Optional) The options for the Partition Key Delete request.</param>
/// <param name="cancellationToken">(Optional) <see cref="CancellationToken"/> representing request cancellation.</param>
/// <returns>
/// A <see cref="Task"/> containing a <see cref="ResponseMessage"/>.
/// </returns>
public abstract Task<ResponseMessage> DeleteAllItemsByPartitionKeyStreamAsync(
Cosmos.PartitionKey partitionKey,
RequestOptions requestOptions = null,
CancellationToken cancellationToken = default(CancellationToken));
#endif

#if PREVIEW
/// <summary>
/// Obtains a list of <see cref="FeedRange"/> that can be used to parallelize Feed operations.
/// </summary>
Expand Down Expand Up @@ -1363,6 +1344,25 @@ public abstract Task<IEnumerable<string>> GetPartitionKeyRangesAsync(
FeedRange feedRange,
CancellationToken cancellationToken = default);

#if INTERNAL
ealsur marked this conversation as resolved.
Show resolved Hide resolved
/// <summary>
/// Deletes all items in the Container with the specified <see cref="PartitionKey"/> value.
/// Starts an asynchronous Cosmos DB background operation which deletes all items in the Container with the specified value.
/// The asynchronous Cosmos DB background operation runs using a percentage of user RUs.
/// </summary>
/// <param name="partitionKey">The <see cref="PartitionKey"/> of the items to be deleted.</param>
/// <param name="requestOptions">(Optional) The options for the Partition Key Delete request.</param>
/// <param name="cancellationToken">(Optional) <see cref="CancellationToken"/> representing request cancellation.</param>
/// <returns>
/// A <see cref="Task"/> containing a <see cref="ResponseMessage"/>.
/// </returns>
public abstract Task<ResponseMessage> DeleteAllItemsByPartitionKeyStreamAsync(
Cosmos.PartitionKey partitionKey,
RequestOptions requestOptions = null,
CancellationToken cancellationToken = default(CancellationToken));
#endif

#if PREVIEW
/// <summary>
/// This method creates a query for items under a container in an Azure Cosmos database using a SQL statement with parameterized values. It returns a FeedIterator.
/// For more information on preparing SQL statements with parameterized values, please see <see cref="QueryDefinition"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,6 @@ public abstract Task<ItemResponse<T>> PatchItemAsync<T>(
PatchItemRequestOptions requestOptions = null,
CancellationToken cancellationToken = default);

public abstract Task<IReadOnlyList<FeedRange>> GetFeedRangesAsync(CancellationToken cancellationToken = default);

public abstract FeedIterator GetChangeFeedStreamIterator(
ChangeFeedStartFrom changeFeedStartFrom,
ChangeFeedMode changeFeedMode,
ChangeFeedRequestOptions changeFeedRequestOptions = null);

public abstract FeedIterator<T> GetChangeFeedIterator<T>(
ChangeFeedStartFrom changeFeedStartFrom,
ChangeFeedMode changeFeedMode,
ChangeFeedRequestOptions changeFeedRequestOptions = null);

public abstract Task<IEnumerable<string>> GetPartitionKeyRangesAsync(
FeedRange feedRange,
CancellationToken cancellationToken = default);

public abstract FeedIterator GetItemQueryStreamIterator(
FeedRange feedRange,
QueryDefinition queryDefinition,
Expand Down
Loading