I am working on an enterprise project for a large organization that is onboarding onto Aerospike. I am building a piece of functionality that essentially requires the following workflow: for a given record, (1) check if a condition about the record’s current state is true and (2) if it is, perform a set of update actions on the record’s bins.
To accomplish this, I am using Aerospike’s
client.operate method in the Java client. However, when I set the
filterExp field of the policy, it causes the operation to fail with a Parameter error. As far as I was able to tell, this behavior was not documented - if anything, it seems it should succeed in the same way a put request would. Therefore, I believe it’s a bug (and if it’s not, would it be possible to update the documentation to show that this is not supported)?
Here’s some more information: Java library version: 5.0.4 Server Version: 184.108.40.206 , latest (running inside a container)
Here is a minimum working example:
IAerospikeClient client = new AerospikeClient(HOST_NAME, PORT); WritePolicy wp = new WritePolicy(client.getWritePolicyDefault()); wp.filterExp = Exp.build(Exp.val(true)); Operation op = Operation.put(new Bin("bin", "val")); Key key = new Key(NAMESPACE, null, "key"); client.put(null, key, new Bin("bin", "val2")); client.operate(wp, key, op);
And the corresponding error:
com.aerospike.client.AerospikeException: Error 4,1,0,30000,0,0,BB9030011AC4202 127.0.0.1 55727: Parameter error at com.aerospike.client.command.ReadCommand.parseResult(ReadCommand.java:179) at com.aerospike.client.command.SyncCommand.executeCommand(SyncCommand.java:104) at com.aerospike.client.command.SyncCommand.execute(SyncCommand.java:64) at com.aerospike.client.AerospikeClient.operate(AerospikeClient.java:1457)
Apologies if this is tagged incorrectly, or in the wrong place.