GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Redis 8.12] Add BITRANGEINTARRAY command support by a-TODO-rov · Pull Request #4830 · redis/jedis

Conversation

@a-TODO-rov

@a-TODO-rov a-TODO-rov commented Nov 5, 2026 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Add BITRANGEINTARRAY command support

Summary

Adds bitrangeintarray for the Redis 8.12 BITRANGEINTARRAY command (redis/redis#15986). It returns the offsets of the set bits in a range of a bitmap, or of the clear bits with ZEROS, as List<Long>. It works on string and native bitmaps, and is available across the String, binary and pipeline APIs.

Key Decisions & Assumptions

  • There are two forms: bitrangeintarray(key, start, end) and bitrangeintarray(key, start, end, BitRangeIntArrayParams). Start and end are mandatory, as they are on the server.
  • BitRangeIntArrayParams carries the unit (BitCountOption), limit(long) and zeros(). It sends them in a fixed order, each at most once.
  • A negative limit throws IllegalArgumentException, because the server always rejects it. limit(0) is sent as LIMIT 0.
  • The command is added to DefaultCacheable, like BITCOUNT and BITPOS.
  • StaticCommandFlagsRegistryInitializer is intentionally unchanged. Its entry comes with the next regeneration from an 8.12 server. Routing doesn't depend on it: keyed commands go to the slot's primary, or to a replica via executeCommandToReplica.
  • No ClusterCommandObjects override is needed: it is a single-key command.

Behavioral / Conceptual Changes

  • In BYTE units (the default), a LIMIT page can hold up to count + 7 offsets, because the server completes the last byte. The Javadoc on limit states the paging rule for both units.
  • Servers older than 8.12 reply with ERR unknown command. There is no client-side version check.

Testing

  • Unit tests cover the params (validation, wire order, equals/hashCode), the command arguments, the delegation and cacheability.
  • Integration tests run on standalone and cluster with RESP2 and RESP3. They cover string and native bitmaps, paging, replica reads, client-side cache invalidation and the legacy Jedis client. They are gated with @EnabledOnCommand("BITRANGEINTARRAY").
  • RedisConditions.hasCommand now uses lower-case names to match the COMMAND reply.

Notes

  • The release-notes entry needs this PR's link added.

Note

Low Risk
Additive bitmap read API with no changes to existing commands; failures on Redis older than 8.12 are the expected unknown-command errors.

Overview
Adds client support for Redis 8.12 BITRANGEINTARRAY: new bitrangeintarray overloads on String and binary keys return matching bit offsets as List<Long>, wired through CommandObjects, Jedis, UnifiedJedis, and pipeline APIs.

Introduces BitRangeIntArrayParams for optional BYTE/BIT range units, LIMIT, and zeros() (clear-bit offsets), with protocol registration of BITRANGEINTARRAY and the ZEROS keyword. DefaultCacheable treats the command as cacheable by default.

8.1.0 release notes document the API; build formatting includes the new params/tests. Coverage adds params/unit, integration (ranges, paging, pipeline/transaction), mocked delegation, and a small cacheability test.

Reviewed by Cursor Bugbot for commit 74eca5a. Bugbot is set up for automated code reviews on this repo. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
a-TODO-rov added 12 commits November 4, 2026 19:13
@a-TODO-rov
Add BitRangeIntArrayParams for BITRANGEINTARRAY
896947e
Carries the unit (BYTE or BIT), LIMIT count and ZEROS options of
BITRANGEINTARRAY, sent in that fixed order. A negative count is
rejected before sending, since the server always rejects it.
@a-TODO-rov
Add BITRANGEINTARRAY command
8aa08bc
Returns the offsets of the set bits, or of the clear bits with ZEROS,
in a range of a bitmap, as List<Long>. Added to the String and binary
command interfaces and their pipeline variants, CommandObjects,
UnifiedJedis, PipeliningBase and Jedis.
@a-TODO-rov
Cache BITRANGEINTARRAY replies on the client
1a2e960
BITRANGEINTARRAY is a read-only, single-key command like BITCOUNT and
BITPOS, so its replies are cacheable by default.
@a-TODO-rov
Document BITRANGEINTARRAY in the release notes
7c6acc3
@a-TODO-rov
Add BITRANGEINTARRAY unit tests
bef10fa
Cover the params arguments, the command arguments, delegation from
UnifiedJedis and PipeliningBase, and default cacheability.
@a-TODO-rov
Add BITRANGEINTARRAY integration tests
9ae79e0
Cover ranges, empty replies, LIMIT and paging, ZEROS, native bitmaps,
errors, the legacy client with pipeline and transaction, client-side
caching and the connection close on the output buffer limit.
@a-TODO-rov
Add BITRANGEINTARRAY cluster replica read test
c876bda
@a-TODO-rov
Fix RedisConditions.hasCommand lookup in tests
deb60bf
COMMAND replies command names in lower case, so the upper-case lookup
never matched and the command assumptions in the BITRANGEINTARRAY
caching and unknown-command tests always took the same branch.
@a-TODO-rov
State both units in the BitRangeIntArrayParams.limit summary
e40c8fc
In BYTE units the server completes the byte of the last offset, so a
page can hold more than count offsets.
@a-TODO-rov
Note what writes between BITRANGEINTARRAY pages can do
453df9a
@a-TODO-rov
Describe the range in the BITRANGEINTARRAY params Javadoc
cd5c79d
@a-TODO-rov
Move the ZEROS and LIMIT complexity to the BITRANGEINTARRAY params form
11bbf5e
Only the form with BitRangeIntArrayParams can send ZEROS or LIMIT.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T12:12:42.379366Z 74eca5a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Test Results

  220 files  +    9    220 suites  +9   1m 8s ⏱️ - 6m 36s
3 936 tests  - 4 427  3 930 ✅  - 4 170  6 💤  - 257  0 ❌ ±0 
3 905 runs   - 4 478  3 899 ✅  - 4 221  6 💤  - 257  0 ❌ ±0 

Results for commit 8308d7a. ± Comparison against base commit c701a36.

This pull request removes 8363 and adds 3936 tests. Note that renamed tests count towards both.
redis.clients.jedis.ACLJedisPoolTest ‑ allowUrlWithNoDBAndNoPassword
redis.clients.jedis.ACLJedisPoolTest ‑ checkCloseableConnections
redis.clients.jedis.ACLJedisPoolTest ‑ checkConnections
redis.clients.jedis.ACLJedisPoolTest ‑ checkPoolOverflow
redis.clients.jedis.ACLJedisPoolTest ‑ checkPoolRepairedWhenJedisIsBroken
redis.clients.jedis.ACLJedisPoolTest ‑ checkResourceIsClosableAndReusable
redis.clients.jedis.ACLJedisPoolTest ‑ checkResourceWithConfigIsClosableAndReusable
redis.clients.jedis.ACLJedisPoolTest ‑ customClientName
redis.clients.jedis.ACLJedisPoolTest ‑ customClientNameNoSSL
redis.clients.jedis.ACLJedisPoolTest ‑ nonDefaultDatabase
…
ALL_AVAILABLE Policy Tests ‑ shouldContinueWhenAllPending
ALL_AVAILABLE Policy Tests ‑ shouldContinueWhenPending
ALL_AVAILABLE Policy Tests ‑ shouldFailImmediatelyWithAnyFailure
ALL_AVAILABLE Policy Tests ‑ shouldFailWhenAllConnectionsFail
ALL_AVAILABLE Policy Tests ‑ shouldFailWhenAnyConnectionFails
ALL_AVAILABLE Policy Tests ‑ shouldFailWithEmptyContext
ALL_AVAILABLE Policy Tests ‑ shouldFailWithSingleFailure
ALL_AVAILABLE Policy Tests ‑ shouldSucceedWhenAllAvailable
ALL_AVAILABLE Policy Tests ‑ shouldSucceedWithSingleConnection
ConformsTo Policy Evaluation Tests ‑ shouldDelegateToPolicy
…
This pull request removes 263 skipped tests and adds 6 skipped tests. Note that renamed tests count towards both.
redis.clients.jedis.MultiDbClientTest[2] ‑ testCachePreservedAcrossDatabaseSwitches()[2]
redis.clients.jedis.MultiDbClientTest[2] ‑ testCacheWithDynamicDatabaseAddition()[2]
redis.clients.jedis.MultiDbClientTest[2] ‑ testCacheWithMultiDbClient()[2]
redis.clients.jedis.MultiDbClientTest[2] ‑ testCacheWithMultiDbClientPoolRecreation()[2]
redis.clients.jedis.commands.commandobjects.CommandObjectsJsonCommandsTest[2] ‑ testJsonArrLenRoot()[2]
redis.clients.jedis.commands.commandobjects.CommandObjectsJsonCommandsTest[2] ‑ testJsonDebugMemoryRoot()[2]
redis.clients.jedis.commands.commandobjects.CommandObjectsJsonCommandsTest[2] ‑ testJsonGetWithClass()[2]
redis.clients.jedis.commands.commandobjects.CommandObjectsJsonCommandsTest[2] ‑ testJsonObjKeysRoot()[2]
redis.clients.jedis.commands.commandobjects.CommandObjectsJsonCommandsTest[2] ‑ testJsonObjLenRoot()[2]
redis.clients.jedis.commands.commandobjects.CommandObjectsJsonCommandsTest[2] ‑ testJsonStrAppendRootPath()[2]
…
redis.clients.jedis.PushMessageNotificationTest ‑ testConnectionResp3PushNotifications
redis.clients.jedis.PushMessageNotificationTest ‑ testConnectionResp3PushNotificationsWithCustomListener
redis.clients.jedis.UdsTest ‑ jedisConnectsToUds
redis.clients.jedis.UdsTest ‑ jedisConnectsToUdsResp3
redis.clients.jedis.UdsTest ‑ redisClientConnectsToUds
redis.clients.jedis.UdsTest ‑ redisClientConnectsToUdsResp3

♻️ This comment has been updated with latest results.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@a-TODO-rov
Restore the previous server config after BITRANGEINTARRAY native bitm…
c34c19b
…ap tests

The native bitmap tests now read each node's bitmap-default-roaring and
proto-max-bulk-len before changing them and restore exactly those values,
trying every node even when one restore fails.
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 5, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c34c19bc65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/main/java/redis/clients/jedis/CommandObjects.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/test/java/redis/clients/jedis/mocked/pipeline/PipeliningBaseBitmapCommandsTest.java
@Test
public void testBitrangeintarray() {
String key = "key";
byte[] bkey = "key".getBytes();

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 5, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use SafeEncoder for the new binary test keys

Both new mocked binary-key cases construct bytes with String.getBytes(); the same pattern appears in UnifiedJedisBitmapCommandsTest. This uses the platform charset instead of Jedis's configured SafeEncoder charset, so these tests do not exercise the supported string-to-byte conversion path on alternate-charset setups. Replace both calls with SafeEncoder.encode("key").

AGENTS.md reference: AGENTS.md:L81-L83

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ggivo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread src/test/java/redis/clients/jedis/util/RedisConditions.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

a-TODO-rov added 3 commits November 5, 2026 10:45
@a-TODO-rov
Revert the RedisConditions.hasCommand lookup change
7dab803
No test relies on it any more: every BITRANGEINTARRAY test is gated by @EnabledOnCommand.
@a-TODO-rov
Remove the BITRANGEINTARRAY unknown-command test
2ea997f
Tests of the command run only where the server has it.
@a-TODO-rov
Gate the cached BITRANGEINTARRAY test with @EnabledOnCommand
9021f03
The client-side cache test base now registers EnabledOnCommandCondition, as JedisCommandsTestBase does, so the annotation takes effect in all its runners.
@ggivo ggivo changed the title Add BITRANGEINTARRAY command support [8.12] Add BITRANGEINTARRAY command support Nov 5, 2026
@ggivo ggivo added the feature label Nov 5, 2026
@ggivo ggivo added this to the 8.1.0 milestone Nov 5, 2026
ggivo added 4 commits November 5, 2026 13:55
@ggivo
Keep the BITRANGEINTARRAY Javadoc to the API
aa06d43
The interface and params Javadocs restated the server's paging rules;
they now say what each method and option does and link the command page.
Test comments drop the Scenario BRIA-xx ids, which refer to a document
that isn't in the repo.
@ggivo
Drop the BITRANGEINTARRAY replica and client-side cache tests
7449b0f
Reading from a replica and caching a reply work the same for every
command, so these tests add nothing specific to BITRANGEINTARRAY. The
replica test also repeated testReadFromReplicas' replica setup and waited
up to 10 s. DefaultCacheableTest still covers that the command is cacheable.
@ggivo
Drop BITRANGEINTARRAY tests that change server config
e2fe446
The native bitmap, 32-bit offset and output-buffer tests set
bitmap-default-roaring, proto-max-bulk-len and client-output-buffer-limit
on the shared test servers, which stay changed if the restore fails. What
they check on the client side, decoding integer arrays and a closed
connection, is not specific to this command.
@ggivo
Test what Jedis does for BITRANGEINTARRAY, not the server
2c861f5
Keep the integration tests that exercise the client: the range forms and
units, empty replies, the byte[] forms, all options together, and the
legacy String/byte[], pipeline and transaction calls. Drop the ones that
check server semantics (BITCOUNT parity, paging, LIMIT and ZEROS rules,
WRONGTYPE, the value left unchanged) or repeat a params unit test.
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 5, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c861f5a9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/main/java/redis/clients/jedis/commands/BitCommands.java
* Same as {@link #bitrangeintarray(String, long, long)}, with these options from {@code params}:
* <ul>
* <li>{@code unit(BIT)}: start and end are bit indexes instead of byte indexes</li>
* <li>{@code limit(count)}: return at most {@code count} offsets</li>

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 5, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the LIMIT guarantee for BYTE ranges

When callers leave the default BYTE unit or explicitly select it, the server completes the byte containing the countth match, so the response can contain up to count + 7 offsets—as the new BitRangeIntArrayParams.limit documentation itself explains. This public API therefore promises a hard maximum it does not provide, which can mislead callers that size buffers or reject responses based on count; qualify the guarantee as BIT-only and document the BYTE behavior here.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ggivo
ggivo approved these changes Nov 5, 2026
View reviewed changes
This was referenced Nov 5, 2026
[Redis 8.12] Regenerate command flags registry from Redis 8.12-rc2 #4831
Merged
[Redis 8.12] Support the BLESS command family #4773
Merged
@ggivo ggivo added the ready to merge label Nov 5, 2026
@ggivo
Merge branch 'master' into bitrangeintarray-8.12
4cd7c7a
@ggivo ggivo changed the title [8.12] Add BITRANGEINTARRAY command support [Redis 8.12] Add BITRANGEINTARRAY command support Nov 6, 2026
@ggivo ggivo removed the ready to merge label Nov 10, 2026
@ggivo
Merge branch 'master' into bitrangeintarray-8.12
8308d7a
This was referenced Nov 10, 2026
DOC-7292 Add API mappings for the new Redis 8.12 commands redis/docs#4525
Merged
DOC-7294 Add Python and Go BITRANGEINTARRAY examples to the bitmaps page redis/docs#4527
Merged
@ggivo
Merge branch 'master' into bitrangeintarray-8.12
74eca5a
@ggivo
ggivo merged commit 31cf855 into master Nov 11, 2026
14 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
@ggivo ggivo ggivo approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

feature

Projects

None yet

Milestone

8.1.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@a-TODO-rov @ggivo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.