Hello Experts,
I went through “aerospike_batch_get” function to read records in batch, where we can define call_back function to read each record. Like wise what is the way to read record using “aerospike_batch_read”, Can someone please advice.
I have referred below sample code from Aerospike.
as_batch_read_records records;
as_batch_read_inita(&records, 10);
char* bin_names[] = {"bin1", "bin2"};
char* ns = "ns";
char* set = "set";
as_batch_read_record* record = as_batch_read_reserve(&records);
as_key_init(&record->key, ns, set, "key1");
record->bin_names = bin_names;
record->n_bin_names = 2;
record = as_batch_read_reserve(&records);
as_key_init(&record->key, ns, set, "key2");
record->read_all_bins = true;
if (aerospike_batch_read(&as, &err, NULL, &records) != AEROSPIKE_OK) {
fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
}
as_batch_read_destroy(&records);
here, how we can retrieve data from “records”.