aerospike / aerospike-client-java

Aerospike Java Client Library
Other
236 stars 212 forks source link

What is the difference between `BatchRecordArrayListener` and `RecordArrayListener`? #285

Closed mykytamykhailenko closed 1 year ago

mykytamykhailenko commented 1 year ago

Judging by the documentation, they serve similar purpose, the only difference being slightly different API. The question is, does BatchRecordArrayListener has any performance improvements compared to RecordArrayListener?

BrianNichols commented 1 year ago

BatchRecordArrayListener responds with BatchRecord[] which includes a resultCode for each key. RecordArrayListener responds with Record[] which does not include a resultCode for each key. If an error occurred for a key, the corresponding record will be null. Performance differences are negligible.

RecordArrayListener was used in the original batch read only implementation and still exists in that form for legacy reasons.

mykytamykhailenko commented 1 year ago

good, thank you for clarifications