Skip to content

Add arrays API - #3745

Merged
a-TODO-rov merged 12 commits into
mainfrom
arrays
May 22, 2026
Merged

a-TODO-rov merged 12 commits into
mainfrom
arrays

Conversation

@a-TODO-rov

@a-TODO-rov a-TODO-rov commented May 13, 2026 •

Copy link
Copy Markdown
Collaborator

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

Note

Medium Risk
Introduces a new command family and extends core command/type/keyword enums, which can affect command dispatch and protocol parsing across all clients despite being additive and marked experimental.

Overview
Adds experimental Redis Arrays support end-to-end: new RedisArray*Commands APIs (sync/async/reactive), cluster node-selection variants, and Kotlin coroutines bindings.

Implements command construction via new RedisArrayCommandBuilder and wires it into AbstractRedisAsyncCommands/AbstractRedisReactiveCommands, plus adds parsers/outputs for array-specific responses (ArrayInfo*Parser, IndexedValueListOutput) and new array-related model/arg types (e.g., ArGrepArgs, ArrayInfo, IndexedValue).

Extends protocol enums to recognize the new commands/keywords (CommandType, CommandKeyword) and marks relevant commands as read-only in ReadOnlyCommands; includes unit tests for command encoding and a cluster integration test scaffold.

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

@jit-ci

jit-ci Bot commented May 13, 2026 •

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@a-TODO-rov a-TODO-rov linked an issue May 15, 2026 that may be closed by this pull request
@a-TODO-rov
a-TODO-rov marked this pull request as ready for review May 15, 2026 07:14
* @see <a href="https://redis.io/docs/latest/commands/argrep/">Redis Documentation: ARGREP</a>
*/
@Experimental
Flux<Long> argrep(K key, ArGrepArgs grepArgs);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

range is mandatory

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually its not. It supports + - syntax:
ARGREP myarray - + EXACT foo AND EXACT bar
This means we can treat it like optional and default to + - , which essentially means the full range.

}

@Override
public RedisFuture<List<IndexedValue<V>>> argrepWithValues(K key, ArGrepArgs grepArgs) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Range is mandatory

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually its not. It supports + - syntax:
ARGREP myarray - + EXACT foo AND EXACT bar
This means we can treat it like optional and default to + - , which essentially means the full range.

*
* @return {@code this}.
*/
public ArGrepArgs withValues() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

changes the output.

* @see <a href="https://redis.io/docs/latest/commands/argrep/">Redis Documentation: ARGREP</a>
*/
@Experimental
Flux<IndexedValue<V>> argrepWithValues(K key, ArGrepArgs grepArgs);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

range is mandatory

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually its not. It supports + - syntax:
ARGREP myarray - + EXACT foo AND EXACT bar
This means we can treat it like optional and default to + - , which essentially means the full range.

* @see <a href="https://redis.io/docs/latest/commands/arlastitems/">Redis Documentation: ARLASTITEMS</a>
*/
@Experimental
Executions<List<V>> arlastitemsRev(K key, long count);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or
Executions<List<V>> arlastitems(K key, long count. boolean rev);

* @since 7.6
* @see <a href="https://redis.io/docs/latest/commands/arop/">Redis Documentation: AROP</a>
*/
public enum ArCountType {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bitwise ops?

* @see <a href="https://redis.io/docs/latest/commands/arop/">Redis Documentation: AROP</a>
*/
@Experimental
Mono<Long> aropCount(K key, Range<Long> range, ArCountType operation);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

better separate Bitwise ops and USED

* @see <a href="https://redis.io/docs/latest/commands/arop/">Redis Documentation: AROP</a>
*/
@Experimental
Mono<Long> aropMatch(K key, Range<Long> range, V matchValue);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

aropCount?

* @see <a href="https://redis.io/docs/latest/commands/arscan/">Redis Documentation: ARSCAN</a>
*/
@Experimental
Flux<IndexedValue<V>> arscan(K key, ArScanArgs scanArgs);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

start/end mandatory
ArScanArgs can be dropped

return directorySize;
}

public void setDirectorySize(Long directorySize) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Rm setters

return denseSlices;
}

public void setDenseSlices(Long denseSlices) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Remove setters

@a-TODO-rov
a-TODO-rov requested a review from atakavci May 20, 2026 13:33

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3b8492c. Configure here.

subscriber.onNext(output, new IndexedValue<>(currentIndex, value));
hasIndex = false;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

IndexedValueListOutput silently drops bulk-string indices

Medium Severity

IndexedValueListOutput.set(ByteBuffer) silently discards any buffer received when hasIndex is false. The index is only recognized via set(long). If the server returns indices as bulk strings (e.g. under RESP2), set(ByteBuffer) is called for both index and value, hasIndex never becomes true, and the entire response is silently dropped — producing an empty list for ARSCAN and ARGREP WITHVALUES.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3b8492c. Configure here.

@uglide uglide left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@a-TODO-rov
a-TODO-rov merged commit cc2830a into main May 22, 2026
13 checks passed
@a-TODO-rov
a-TODO-rov deleted the arrays branch May 22, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Redis Array data type (Redis 8.8)

3 participants