public interface ArrayCommands
| Modifier and Type | Method and Description |
|---|---|
long |
arcount(java.lang.String key)
ARCOUNT Command Returns the number of
non-empty elements in an array.
|
long |
ardel(java.lang.String key,
long... indices)
ARDEL Command Deletes elements at the
specified indices in an array.
|
long |
ardel(java.lang.String key,
long index)
ARDEL Command Deletes the element at a
single index in an array.
|
long |
ardelrange(java.lang.String key,
long start,
long end)
ARDELRANGE Command Convenience
single-range overload of
ardelrange(String, LongRange...) that accepts the inclusive
[start, end] range as primitives. |
long |
ardelrange(java.lang.String key,
LongRange... ranges)
ARDELRANGE Command Deletes elements
in one or more inclusive
LongRange ranges of indices. |
java.lang.String |
arget(java.lang.String key,
long index)
ARGET Command Returns the value stored at
a single index in an array.
|
java.util.List<java.lang.String> |
argetrange(java.lang.String key,
long start,
long end)
ARGETRANGE Command Returns the values
at a contiguous range of indices.
|
java.util.List<java.lang.Long> |
argrep(java.lang.String key,
ArgrepParams params)
ARGREP Command Searches array elements
within an inclusive index range (carried by
ArgrepParams) using one or more textual
predicates and returns the matching indices. |
java.util.List<KeyValue<java.lang.Long,java.lang.String>> |
argrepWithValues(java.lang.String key,
ArgrepParams params)
ARGREP Command Searches array elements
within an inclusive index range (carried by
ArgrepParams) and returns the matching
index/value pairs. |
ArrayInfo |
arinfo(java.lang.String key)
ARINFO Command Returns metadata
describing an array (counts, length, insertion cursor).
|
ArrayFullInfo |
arinfoFull(java.lang.String key)
ARINFO Command Returns the
FULL
variant of the array metadata: the top-level fields plus the per-slice statistics block. |
long |
arinsert(java.lang.String key,
java.lang.String... values)
ARINSERT Command Inserts one or more
values at consecutive indices, beginning at the current insert cursor position.
|
long |
arinsert(java.lang.String key,
java.lang.String value)
ARINSERT Command Convenience
single-value overload of
arinsert(String, String...). |
java.util.List<java.lang.String> |
arlastitems(java.lang.String key,
long count)
ARLASTITEMS Command Returns the most
recently inserted elements in oldest-first order.
|
java.util.List<java.lang.String> |
arlastitems(java.lang.String key,
long count,
boolean rev)
ARLASTITEMS Command Returns the most
recently inserted elements.
|
long |
arlen(java.lang.String key)
ARLEN Command Returns the length of an
array (max index + 1).
|
java.util.List<java.lang.String> |
armget(java.lang.String key,
long... indices)
ARMGET Command Returns the values at
multiple indices.
|
long |
armset(java.lang.String key,
java.util.Map<java.lang.Long,java.lang.String> indexValueMap)
ARMSET Command Sets multiple index-value
pairs.
|
java.lang.Long |
arnext(java.lang.String key)
ARNEXT Command Returns the next index
that
ARINSERT would use. |
java.lang.String |
aropAggregate(java.lang.String key,
long start,
long end,
ArrayAggregate op)
AROP Command Applies a numeric aggregate
(
SUM, MIN, MAX) over the non-empty elements in the inclusive [start, end] range. |
long |
aropBitwise(java.lang.String key,
long start,
long end,
ArrayBitwise op)
AROP Command Applies a bitwise operation
(
AND, OR, XOR) over
the non-empty elements in the inclusive [start, end] range. |
long |
aropCount(java.lang.String key,
long start,
long end)
AROP Command Counts the number of non-empty
elements in the inclusive
[start, end] range using the USED subcommand. |
long |
aropCount(java.lang.String key,
long start,
long end,
java.lang.String match)
AROP Command Counts elements in the
inclusive
[start, end] range whose value equals match using the MATCH
subcommand. |
long |
arring(java.lang.String key,
long size,
java.lang.String... values)
ARRING Command Inserts one or more values
into an array as a fixed-size ring buffer.
|
long |
arring(java.lang.String key,
long size,
java.lang.String value)
ARRING Command Convenience single-value
overload of
arring(String, long, String...). |
java.util.List<KeyValue<java.lang.Long,java.lang.String>> |
arscan(java.lang.String key,
long start,
long end)
ARSCAN Command Iterates existing elements
in an inclusive index range and returns the index/value pairs in traversal order.
|
java.util.List<KeyValue<java.lang.Long,java.lang.String>> |
arscan(java.lang.String key,
long start,
long end,
long limit)
ARSCAN Command Iterates existing elements
in an inclusive index range with a cap on the number of pairs returned.
|
long |
arseek(java.lang.String key,
long index)
ARSEEK Command Sets the insert cursor of
an array to a specific index.
|
long |
arset(java.lang.String key,
long index,
java.lang.String... values)
ARSET Command Sets one or more contiguous
values starting at
index. |
long |
arset(java.lang.String key,
long index,
java.lang.String value)
ARSET Command Convenience single-value
overload of
arset(String, long, String...). |
@Experimental long arcount(java.lang.String key)
Time complexity: O(1)
Wire: ARCOUNT key
key - the name of the key that holds the array0 if key does not exist@Experimental long ardel(java.lang.String key, long index)
Time complexity: O(1)
Wire: ARDEL key index
key - the name of the key that holds the arrayindex - the zero-based index to delete1 if an element was deleted, 0 otherwise@Experimental long ardel(java.lang.String key, long... indices)
Time complexity: O(N) where N is the number of indices supplied.
Wire: ARDEL key index1 [index2 ...]
key - the name of the key that holds the arrayindices - one or more zero-based indices to delete@Experimental long ardelrange(java.lang.String key, LongRange... ranges)
LongRange ranges of indices. Each range is processed in
ascending order even if start > end; overlapping ranges count each element at most
once.
Time complexity: O(M + N) where M is the number of ranges and N the total number of elements they cover.
Wire: ARDELRANGE key r1.start r1.end [r2.start r2.end ...]
key - the name of the key that holds the arrayranges - one or more inclusive index ranges@Experimental long ardelrange(java.lang.String key, long start, long end)
ardelrange(String, LongRange...) that accepts the inclusive
[start, end] range as primitives.
Wire: ARDELRANGE key start end
key - the name of the key that holds the arraystart - zero-based start index (inclusive)end - zero-based end index (inclusive)@Experimental java.lang.String arget(java.lang.String key, long index)
Time complexity: O(1)
Wire: ARGET key index
key - the name of the key that holds the arrayindex - the zero-based index of the element to retrievenull if the key or index does not exist@Experimental java.util.List<java.lang.String> argetrange(java.lang.String key, long start, long end)
start > end, elements are returned in reverse
index order.
Time complexity: O(N) where N is the number of elements in the range.
Wire: ARGETRANGE key start end
key - the name of the key that holds the arraystart - zero-based start index of the rangeend - zero-based end index of the range (inclusive)null entries@Experimental java.util.List<java.lang.Long> argrep(java.lang.String key, ArgrepParams params)
ArgrepParams) using one or more textual
predicates and returns the matching indices. Empty slots are skipped. Multiple predicates can
be combined with AND/OR via ArgrepParams. Use
argrepWithValues(String, ArgrepParams) to also return the matching values.
Time complexity: O(N) where N is the number of elements scanned.
Wire: ARGREP key start end <params>
key - the name of the key that holds the arrayparams - the search range, predicates and options to apply@Experimental java.util.List<KeyValue<java.lang.Long,java.lang.String>> argrepWithValues(java.lang.String key, ArgrepParams params)
ArgrepParams) and returns the matching
index/value pairs. Empty slots are skipped. This overload appends the WITHVALUES
keyword to the wire arguments; do not also request it on ArgrepParams.
Time complexity: O(N) where N is the number of elements scanned.
Wire: ARGREP key start end <params> WITHVALUES
key - the name of the key that holds the arrayparams - the search range, predicates and options to apply@Experimental ArrayInfo arinfo(java.lang.String key)
arinfoFull(String) for the
per-slice statistics.
Time complexity: O(1)
Wire: ARINFO key
key - the name of the key that holds the arrayArrayInfo, or null if the key does not exist@Experimental ArrayFullInfo arinfoFull(java.lang.String key)
FULL
variant of the array metadata: the top-level fields plus the per-slice statistics block.
Time complexity: O(S) where S is the number of slices.
Wire: ARINFO key FULL
key - the name of the key that holds the arrayArrayFullInfo, or null if the key does not exist@Experimental long arinsert(java.lang.String key, java.lang.String... values)
Time complexity: O(N) where N is the number of values inserted.
Wire: ARINSERT key value1 [value2 ...]
key - the name of the key that holds the arrayvalues - one or more values to insert@Experimental long arinsert(java.lang.String key, java.lang.String value)
arinsert(String, String...).
Wire: ARINSERT key value
key - the name of the key that holds the arrayvalue - the value to insert at the current insert cursor@Experimental java.util.List<java.lang.String> arlastitems(java.lang.String key, long count)
Time complexity: O(N) where N is the number of returned elements.
Wire: ARLASTITEMS key count
key - the name of the key that holds the arraycount - the maximum number of elements to return@Experimental java.util.List<java.lang.String> arlastitems(java.lang.String key, long count, boolean rev)
rev is true, elements are returned in reverse
chronological order (most recent first) instead of the default oldest-first order.
Time complexity: O(N) where N is the number of returned elements.
Wire: ARLASTITEMS key count [REV] (REV is appended when rev is
true).
key - the name of the key that holds the arraycount - the maximum number of elements to returnrev - whether to request the REV variant@Experimental long arlen(java.lang.String key)
key - the name of the key that holds the array0 if the key does not exist@Experimental java.util.List<java.lang.String> armget(java.lang.String key, long... indices)
null for any index that is not set.
Time complexity: O(N) where N is the number of requested indices.
Wire: ARMGET key index1 [index2 ...]
key - the name of the key that holds the arrayindices - one or more zero-based indices to retrieveindices@Experimental long armset(java.lang.String key, java.util.Map<java.lang.Long,java.lang.String> indexValueMap)
Time complexity: O(N) where N is the number of pairs.
Wire: ARMSET key index1 value1 [index2 value2 ...]
key - the name of the key that holds the arrayindexValueMap - the index-to-value pairs to write@Experimental java.lang.Long arnext(java.lang.String key)
ARINSERT would use.
Time complexity: O(1)
Wire: ARNEXT key
key - the name of the key that holds the array0L for a missing key or when no insert has happened yet; the next insert index
when one is available; null when the insertion cursor is exhausted@Experimental long aropBitwise(java.lang.String key, long start, long end, ArrayBitwise op)
AND, OR, XOR) over
the non-empty elements in the inclusive [start, end] range.
Time complexity: O(N) where N is the number of elements scanned.
Wire: AROP key start end AND|OR|XOR
key - the name of the key that holds the arraystart - zero-based start index (inclusive)end - zero-based end index (inclusive)op - the bitwise operator to apply@Experimental java.lang.String aropAggregate(java.lang.String key, long start, long end, ArrayAggregate op)
SUM, MIN, MAX) over the non-empty elements in the inclusive [start, end] range.
Time complexity: O(N) where N is the number of elements scanned.
Wire: AROP key start end SUM|MIN|MAX
key - the name of the key that holds the arraystart - zero-based start index (inclusive)end - zero-based end index (inclusive)op - the aggregate operator to applynull when the range is empty@Experimental long aropCount(java.lang.String key, long start, long end)
[start, end] range using the USED subcommand.
Time complexity: O(N) where N is the number of elements scanned.
Wire: AROP key start end USED
key - the name of the key that holds the arraystart - zero-based start index (inclusive)end - zero-based end index (inclusive)@Experimental long aropCount(java.lang.String key, long start, long end, java.lang.String match)
[start, end] range whose value equals match using the MATCH
subcommand.
Time complexity: O(N) where N is the number of elements scanned.
Wire: AROP key start end MATCH match
key - the name of the key that holds the arraystart - zero-based start index (inclusive)end - zero-based end index (inclusive)match - the value to match@Experimental long arring(java.lang.String key, long size, java.lang.String... values)
Time complexity: O(N) where N is the number of values inserted.
Wire: ARRING key size value1 [value2 ...]
key - the name of the key that holds the arraysize - the ring buffer window sizevalues - one or more values to insert@Experimental long arring(java.lang.String key, long size, java.lang.String value)
arring(String, long, String...).
Wire: ARRING key size value
key - the name of the key that holds the arraysize - the ring buffer window sizevalue - the value to insert@Experimental java.util.List<KeyValue<java.lang.Long,java.lang.String>> arscan(java.lang.String key, long start, long end)
Time complexity: O(N) where N is the number of populated elements.
Wire: ARSCAN key start end
key - the name of the key that holds the arraystart - zero-based start index; when start > end the iteration is reversedend - zero-based end index (inclusive)(index, value) pairs; empty when the key does not exist@Experimental java.util.List<KeyValue<java.lang.Long,java.lang.String>> arscan(java.lang.String key, long start, long end, long limit)
Time complexity: O(N) where N is the number of populated elements returned.
Wire: ARSCAN key start end LIMIT limit
key - the name of the key that holds the arraystart - zero-based start index; when start > end the iteration is reversedend - zero-based end index (inclusive)limit - cap on the number of returned populated elements(index, value) pairs@Experimental long arseek(java.lang.String key, long index)
Time complexity: O(1)
Wire: ARSEEK key index
key - the name of the key that holds the arrayindex - the zero-based index to set as the new insert cursor1 if the cursor was set, 0 if the key does not exist@Experimental long arset(java.lang.String key, long index, java.lang.String... values)
index. When multiple values are provided, they are stored at
consecutive indices.
Time complexity: O(N) where N is the number of values written.
Wire: ARSET key index value1 [value2 ...]
key - the name of the key that holds the arrayindex - zero-based starting indexvalues - one or more values to write at consecutive indices@Experimental long arset(java.lang.String key, long index, java.lang.String value)
arset(String, long, String...).
Wire: ARSET key index value
key - the name of the key that holds the arrayindex - zero-based index at which to store the valuevalue - the value to writeCopyright © 2026. All rights reserved.