kvrocks
kvrocks copied to clipboard
feat(stream): support exclusive range for XPENDING command
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
StreamPendingOptionsto includeexclude_startandexclude_endflags. - Updated
CommandXPending::Parseto detect the(prefix instart_idandend_idarguments. - Updated
Stream::GetPendingEntriesto 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,类似于 XRANGE 和 XREVRANGE。
- 修改了
StreamPendingOptions,增加了exclude_start和exclude_end标志。 - 更新了
CommandXPending::Parse,以检测start_id和end_id参数中的(前缀。 - 更新了
Stream::GetPendingEntries,根据排他标志正确过滤条目。 - 添加了全面的 Go 测试以验证排他范围功能。