aerospike / aerospike-client-c

Aerospike C Client
Other
98 stars 103 forks source link

fetching one bin of a record at a given time from the cluster #79

Closed lathakris closed 6 years ago

lathakris commented 6 years ago

Hi,

I am using the aerospike C library. I currently have a record with multiple bins. To fetch this, I get the record using - aerospike_key_get and then use a record iterator - as_record_iterator_next to fetch each of the bins from the record. and get the bin name and value and process the data. The issue is the size of the records are huge for us and there are multiple bins in a single record too. We see read timeouts in the process, especially in slow networks. (I assume aerospike_key_get will fetch the entire record from the server once and process the bins locally)

So I am wondering instead of fetching the complete record , can I get each bin one by one ? I see that I can use - aerospike_key_select API to achieve this. I can provide only one bin name in the list and do this one by one for all the bins.

Is there any other API where I can fetch the bins one by one without knowing the binname ahead of time ? Please guide.

Thank you.

BrianNichols commented 6 years ago

This UDF returns the bin names in a record.

function readBinNames(r)
    return list(record.bin_names(r))
end
lathakris commented 6 years ago

I am not aware of this UDF functionality. I will need to check it out. So, does this return the bin names without downloading the entire record ?

BrianNichols commented 6 years ago

Yes.