-
Notifications
You must be signed in to change notification settings - Fork 533
Expand file tree
/
Copy pathChangeFeedMode.cs
More file actions
58 lines (52 loc) · 3.14 KB
/
ChangeFeedMode.cs
File metadata and controls
58 lines (52 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------
namespace Microsoft.Azure.Cosmos
{
using Microsoft.Azure.Cosmos.ChangeFeed;
/// <summary>
/// Base class for the change feed mode <see cref="ChangeFeedRequestOptions"/>.
/// </summary>
/// <remarks>Use one of the static constructors to generate a ChangeFeedMode option.</remarks>
public abstract class ChangeFeedMode
{
/// <summary>
/// Initializes an instance of the <see cref="ChangeFeedMode"/> class.
/// </summary>
internal ChangeFeedMode()
{
// Internal so people can't derive from this type.
}
internal abstract void Accept(RequestMessage requestMessage);
/// <summary>
/// Creates a <see cref="ChangeFeedMode"/> to receive incremental item changes.
/// </summary>
/// <remarks>
/// Incremental mode includes item creations and updates, not deletions.
/// </remarks>
/// <returns>A <see cref="ChangeFeedMode"/> to receive incremental item changes.</returns>
public static ChangeFeedMode Incremental => ChangeFeedModeIncremental.Instance;
/// <summary>
/// Creates a <see cref="ChangeFeedMode"/> to receive latest version item changes.
/// </summary>
/// <remarks>
/// Latest version mode includes item creations and updates, not deletions.
/// </remarks>
/// <returns>A <see cref="ChangeFeedMode"/> to receive latest version item changes.</returns>
public static ChangeFeedMode LatestVersion => ChangeFeedModeIncremental.Instance;
/// <summary>
/// Creates a <see cref="ChangeFeedMode"/> to receive notifications for creations, deletes, as well as all intermediary snapshots for updates.
/// </summary>
/// <remarks>
/// A container with a <see cref="ChangeFeedPolicy"/> configured is required. The delete operations will be included only within the configured retention period.
/// When enabling full fidelity mode you will only be able to process change feed events within the retention window configured in the change feed policy of the container.
/// If you attempt to process a change feed after more than the retention window an error(Status Code 400) will be returned because the events for intermediary
/// updates and deletes have vanished.
/// It would still be possible to process changes using <see cref="ChangeFeedMode.Incremental"/> mode even when configuring a full fidelity change feed policy
/// with retention window on the container and when using Incremental mode it doesn't matter whether your are out of the retention window or not -
/// 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 AllVersionsAndDeletes => ChangeFeedModeFullFidelity.Instance;
}
}