Work with more that one record in a scan Job


#1

Work with more that one record in a scan Job by Akram » Tue Aug 05, 2014 7:24 am

Hi,

I have a Scan job for all records in an aerospike Set (Set A), and based on some logic I need to check for an existence of another record in another Set (Set B), and if that record is exists (in Set B) I need to delete the scanned record (In Set A), and also I need to delete another records in another sets (Set C, Set D).

My question is: is this doable by UDF? or I should run my scan job and execute my logic in the client code (scanCallback) ?


#2

Hi,

Thanks for your question.

Currently, a record UDF (called from scan or otherwise) can operate ONLY on the record it was called with. It cannot access other records. This may seem like a strong restriction, but the problem comes from multi-node (i.e. cluster) behavior. If we could know that a record was on the same DB node, then it would be relatively straight-forward to allow a UDF to access multiple (local) records. However, once the node boundary is crossed, then the complexity increases significantly. So, currently, we restrict UDF access to only the single record it was called with.

Anyway, your statement regarding this operation being a client-side activity is correct. That is the advised method.

Toby