kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

feat(stream): support exclusive range for XPENDING command

Open i18nsite opened this issue 3 weeks ago • 0 comments

English / 中文

English

Issue: https://github.com/apache/kvrocks/issues/3276

Description: This PR adds support for exclusive ranges in the XPENDING command, allowing users to specify exclusive start and end IDs using the ( prefix, similar to XRANGE and XREVRANGE.

  • Modified StreamPendingOptions to include exclude_start and exclude_end flags.
  • Updated CommandXPending::Parse to detect the ( prefix in start_id and end_id arguments.
  • Updated Stream::GetPendingEntries to correctly filter entries based on the exclusion flags.
  • Added comprehensive Go tests to verify the exclusive range functionality.

中文

Issue: https://github.com/apache/kvrocks/issues/3276

描述: 本 PR 为 XPENDING 命令添加了对排他范围的支持,允许用户使用 ( 前缀指定排他的起始和结束 ID,类似于 XRANGEXREVRANGE

  • 修改了 StreamPendingOptions,增加了 exclude_startexclude_end 标志。
  • 更新了 CommandXPending::Parse,以检测 start_idend_id 参数中的 ( 前缀。
  • 更新了 Stream::GetPendingEntries,根据排他标志正确过滤条目。
  • 添加了全面的 Go 测试以验证排他范围功能。

i18nsite avatar Dec 01 '25 04:12 i18nsite