Search code examples
aerospike

Aerospike Apply a UDF to a Predetermined list of Primary Keys


I have a UDF that updates the TTL of a record. I also have a list of Primary Keys to which I want to apply my UDF. The list is generated outside of Aerospike and is quite large containing at least 25 million keys.

I have successfully run my UDF on:

  1. A specific record: execute functions.updateTTL() on namespace.set where PK = 'some key'
  2. A whole set:execute functions.updateTTL() on namespace.set

How can I apply my UDF to only the records whose keys are contained in my list?


Solution

  • You will have to loop through the keys in your client code and use option 1.

    Also, be careful about updating TTL - if you are reducing current remaining TTL of a record to expire it out early, you may be asking for trouble.