Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
82f279f
Changes for string operations
mirzakaracic May 5, 2026
968e161
Updated protocol changes
mirzakaracic May 6, 2026
ac6e36e
Updated api's to fix failing tests
mirzakaracic May 6, 2026
9568458
Updated StringOperation
mirzakaracic May 6, 2026
aa2ab3f
Updated javadocs for StringOperation and StringExp, pack clena-up
mirzakaracic May 7, 2026
a7c101b
Removed policy from call since server is ignoring it. Also updated co…
mirzakaracic May 11, 2026
531e2cb
Added TestStringExp
mirzakaracic May 20, 2026
38ec7bf
Fixed test with working version of server
mirzakaracic May 21, 2026
e1d55a2
Added server 8.1.3 gates for string ops feature
mirzakaracic May 21, 2026
150c0ed
Added additional tests to include negative tests
mirzakaracic Jun 9, 2026
635a134
Added test
mirzakaracic Jun 10, 2026
83a0235
Removed single arg snip
mirzakaracic Jun 11, 2026
374037b
Renamed lenght -> end for substr(ofset-to-ned form, ...) method in St…
mirzakaracic Jun 12, 2026
0fc4f60
Added tests for validating `self-overlapping needle` for strings
mirzakaracic Jun 17, 2026
4f47527
Added examples for string operations
mirzakaracic Jun 18, 2026
7a80fdd
Added query test using String expressiolns
mirzakaracic Jun 18, 2026
d2188cf
Updated server version filter
mirzakaracic Jun 18, 2026
73e1755
Updated client version since in deprecation annotation
mirzakaracic Jun 19, 2026
55bd2db
Updated contracts to follow product request
mirzakaracic Jun 29, 2026
20b22cd
Removed skipped tests due to sever bugs
mirzakaracic Jul 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion client/src/com/aerospike/client/Operation.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,24 @@ public static Operation put(Bin bin) {

/**
* Create string append database operation.
*
* @deprecated Use {@link com.aerospike.client.operation.StringOperation#append(com.aerospike.client.operation.StringPolicy, String, String, com.aerospike.client.cdt.CTX...)}
* instead. This legacy operation performs a raw byte concatenation that is not Unicode/DBCS-aware;
* the string-package equivalent provides consistent Unicode handling and policy/CTX support.
*/
@Deprecated(since = "10.4.0", forRemoval = true)
public static Operation append(Bin bin) {
return new Operation(Type.APPEND, bin.name, bin.value);
}

/**
* Create string prepend database operation.
*
* @deprecated Use {@link com.aerospike.client.operation.StringOperation#prepend(com.aerospike.client.operation.StringPolicy, String, String, com.aerospike.client.cdt.CTX...)}
* instead. This legacy operation performs a raw byte concatenation that is not Unicode/DBCS-aware;
* the string-package equivalent provides consistent Unicode handling and policy/CTX support.
*/
@Deprecated(since = "10.4.0", forRemoval = true)
public static Operation prepend(Bin bin) {
return new Operation(Type.PREPEND, bin.name, bin.value);
}
Expand Down Expand Up @@ -111,7 +121,10 @@ public static enum Type {
BIT_MODIFY(13, true),
DELETE(14, true),
HLL_READ(15, false),
HLL_MODIFY(16, true);
HLL_MODIFY(16, true),
STRING_READ(17, false),
STRING_MODIFY(18, true),
TO_STRING(19, false);

public final int protocolType;
public final boolean isWrite;
Expand Down
10 changes: 10 additions & 0 deletions client/src/com/aerospike/client/ResultCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ public final class ResultCode {
*/
public static final int LOST_CONFLICT = 28;

/**
* String bin or string argument contains invalid UTF-8.
* Returned by server 8.1.3+ string operations when the bin value or a
* string argument fails the UTF-8 well-formedness gate.
*/
public static final int INVALID_ENCODING = 29;

/**
* Write can't complete until XDR finishes shipping.
*/
Expand Down Expand Up @@ -652,6 +659,9 @@ public static String getResultString(int resultCode) {
case LOST_CONFLICT:
return "Command failed due to conflict with XDR";

case INVALID_ENCODING:
return "Invalid UTF-8 encoding";

case XDR_KEY_BUSY:
return "Write can't complete until XDR finishes shipping";

Expand Down
7 changes: 5 additions & 2 deletions client/src/com/aerospike/client/command/OperateArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public OperateArgs(
case EXP_READ:
case HLL_READ:
case MAP_READ:
// Map operations require respondAllOps to be true.
case STRING_READ:
case TO_STRING:
// These operations require respondAllOps to be true.
respondAllOps = true;
// Fall through to read.
case CDT_READ:
Expand All @@ -72,7 +74,8 @@ public OperateArgs(
case EXP_MODIFY:
case HLL_MODIFY:
case MAP_MODIFY:
// Map operations require respondAllOps to be true.
case STRING_MODIFY:
// These operations require respondAllOps to be true.
respondAllOps = true;
// Fall through to write.
default:
Expand Down
15 changes: 15 additions & 0 deletions client/src/com/aerospike/client/exp/Exp.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,11 @@ public static Exp digestModulo(int mod) {
* @param regex regular expression string
* @param flags regular expression bit flags. See {@link com.aerospike.client.query.RegexFlag}
* @param bin string bin or string value expression
* @deprecated Use {@link com.aerospike.client.exp.StringExp#regexCompare(Exp, int, Exp)} instead.
* This legacy comparison uses POSIX regex and is not Unicode/DBCS-aware; the string-package
* equivalent uses ICU regex and provides consistent Unicode handling across the string ops.
*/
@Deprecated(since = "10.4.0", forRemoval = true)
public static Exp regexCompare(String regex, int flags, Exp bin) {
return new Regex(bin, regex, flags);
}
Expand Down Expand Up @@ -1458,10 +1462,21 @@ public static Exp expr(Expression e) {
private static final int QUOTED = 126;
public static final int CALL = 127;
public static final int MODIFY = 0x40;
private static final int TO_STRING = 99;
private static final long NANOS_PER_MILLIS = 1000000L;

public abstract void pack(Packer packer);

/**
* For internal use only. Build the dedicated TO_STRING opcode node, encoded
* as {@code [99, bin]}. Replaces the obsolete CALL_REPR (module 4) shape that
* current servers reject with PARAMETER. Mirrors aerospike-client-c
* CLIENT-5164 (PR #228).
*/
static Exp toStringExp(Exp bin) {
return new CmdExp(TO_STRING, bin);
}

/**
* For internal use only.
*/
Expand Down
Loading