You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add xtrim with minid and new 8.2 stream features (#2912)
* add minId overloads
* fix test.
clarify doc comment
i now think the XTRIM documentation is saying that an entry at exactly MINID is kept.
https://redis.io/docs/latest/commands/xtrim/
* fix test.
forgot to update the length check.
* change method name to StreamTrimByMinIdAsync
implement useApproximateMaxLength and limit as per docs
* add stream delete mode to minid api
add xackdel
* xref new pr
* add limit to StreamTrim (maxlen)
* XADD KEEPREF|DELREF|ACKED
* more release notes
* naming is hard
* XDELEX
* merge shipped
* Update StreamTests.cs
---------
Co-authored-by: Kijana Woodard <kijana.woodard@kaizen.io>
Copy file name to clipboardExpand all lines: docs/ReleaseNotes.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ Current package versions:
16
16
- Package updates ([#2906 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2906))
17
17
- Docs: added [guidance on async timeouts](https://stackexchange.github.io/StackExchange.Redis/AsyncTimeouts) ([#2910 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2910))
18
18
- Fix handshake error with `CLIENT ID` ([#2909 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2909))
19
+
- Add `XTRIM MINID` support ([#2842 by kijanawoodard](https://github.com/StackExchange/StackExchange.Redis/pull/2842))
20
+
- Add new CE 8.2 stream support - `XDELEX`, `XACKDEL`, `{XADD|XTRIM} [KEEPREF|DELREF|ACKED]` ([#2912 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2912))
/// Trims the stream according to the specified policy (MAXLEN or MINID) regardless of whether entries are referenced by any consumer groups, but preserves existing references to these entries in all consumer groups' PEL.
10
+
/// </summary>
11
+
KeepReferences=0,
12
+
13
+
/// <summary>
14
+
/// Trims the stream according to the specified policy and also removes all references to the trimmed entries from all consumer groups' PEL.
15
+
/// </summary>
16
+
/// <remarks>Requires server 8.2 or above.</remarks>
17
+
DeleteReferences=1,
18
+
19
+
/// <summary>
20
+
/// With ACKED: Only trims entries that were read and acknowledged by all consumer groups.
21
+
/// </summary>
22
+
/// <remarks>Requires server 8.2 or above.</remarks>
/// Adds an entry using the specified values to the given stream key.
2504
+
/// If key does not exist, a new key holding a stream is created.
2505
+
/// The command returns the ID of the newly created stream entry.
2506
+
/// </summary>
2507
+
/// <param name="key">The key of the stream.</param>
2508
+
/// <param name="streamField">The field name for the stream entry.</param>
2509
+
/// <param name="streamValue">The value to set in the stream entry.</param>
2510
+
/// <param name="messageId">The ID to assign to the stream entry, defaults to an auto-generated ID ("*").</param>
2511
+
/// <param name="maxLength">The maximum length of the stream.</param>
2512
+
/// <param name="useApproximateMaxLength">If true, the "~" argument is used to allow the stream to exceed max length by a small number. This improves performance when removing messages.</param>
2513
+
/// <param name="limit">Specifies the maximal count of entries that will be evicted.</param>
2514
+
/// <param name="trimMode">Determines how stream trimming should be performed.</param>
2515
+
/// <param name="flags">The flags to use for this operation.</param>
2516
+
/// <returns>The ID of the newly created message.</returns>
/// Adds an entry using the specified values to the given stream key.
2524
+
/// If key does not exist, a new key holding a stream is created.
2525
+
/// The command returns the ID of the newly created stream entry.
2526
+
/// </summary>
2527
+
/// <param name="key">The key of the stream.</param>
2528
+
/// <param name="streamPairs">The fields and their associated values to set in the stream entry.</param>
2529
+
/// <param name="messageId">The ID to assign to the stream entry, defaults to an auto-generated ID ("*").</param>
2530
+
/// <param name="maxLength">The maximum length of the stream.</param>
2531
+
/// <param name="useApproximateMaxLength">If true, the "~" argument is used to allow the stream to exceed max length by a small number. This improves performance when removing messages.</param>
2532
+
/// <param name="limit">Specifies the maximal count of entries that will be evicted.</param>
2533
+
/// <param name="trimMode">Determines how stream trimming should be performed.</param>
2534
+
/// <param name="flags">The flags to use for this operation.</param>
2535
+
/// <returns>The ID of the newly created message.</returns>
/// Trim the stream to a specified maximum length.
2862
+
/// </summary>
2863
+
/// <param name="key">The key of the stream.</param>
2864
+
/// <param name="maxLength">The maximum length of the stream.</param>
2865
+
/// <param name="useApproximateMaxLength">If true, the "~" argument is used to allow the stream to exceed max length by a small number. This improves performance when removing messages.</param>
2866
+
/// <param name="limit">Specifies the maximal count of entries that will be evicted.</param>
2867
+
/// <param name="mode">Determines how stream trimming should be performed.</param>
2868
+
/// <param name="flags">The flags to use for this operation.</param>
2869
+
/// <returns>The number of messages removed from the stream.</returns>
/// Trim the stream to a specified minimum timestamp.
2875
+
/// </summary>
2876
+
/// <param name="key">The key of the stream.</param>
2877
+
/// <param name="minId">All entries with an id (timestamp) earlier minId will be removed.</param>
2878
+
/// <param name="useApproximateMaxLength">If true, the "~" argument is used to allow the stream to exceed minId by a small number. This improves performance when removing messages.</param>
2879
+
/// <param name="limit">The maximum number of entries to remove per call when useApproximateMaxLength = true. If 0, the limiting mechanism is disabled entirely.</param>
2880
+
/// <param name="mode">Determines how stream trimming should be performed.</param>
2881
+
/// <param name="flags">The flags to use for this operation.</param>
2882
+
/// <returns>The number of messages removed from the stream.</returns>
0 commit comments