Search code examples
luauser-defined-functionsaerospike

Manipulate multiple Aerospike Sets consistently using a single UDF


Is there a way to write a single Aerospike UDF(in lua), which has the ability to consistently manipulate mulitple aerospike sets(not records).

Example:-

I have Aerospike Sets {P, Q}. I have to manipulate a record, Rp of Set P, and a record, Rq of Set Q in a single UDF. If any of the set manipulation fails, both set records should revert to the original state, i.e. consistency should be maintained.

Any way out?


Solution

  • You can't do this. A record UDF allows you to manipulate a single record. A stream UDF allows you to build aggregate functions like SUM, COUNT, MIN, MAX, AVG, but they're read-only.