Got Bin type AS_NIL


#1

by Hanson » Wed Aug 13, 2014 8:54 am

Got Bin type AS_NIL Postby Hanson » Wed Aug 13, 2014 8:54 am

I have a table with 2 Bins: Integer Bin + LDT Bin

Use aerospike_key_get() to get an as_record and then use as_bin_get_type() to get the Bin type of the LDT Bin, but result as AS_NIL (=1). The as_bin_get_value() to that LDT Bin return NIL. What does this mean?

The type and value for that Integer Bin is correct.


Parsing record with ldt
#2

by Toby » Thu Aug 14, 2014 12:08 pm

Hi,

Thank you for your question.

The contents of the LDT (llist, lmap, lset, lstack) instances are actually complex structures. In each bin that contains an LDT, there’s a list of two maps – the first map contains standard properties that are shared across all LDTs, and the second map contains all of the LDT-specific information.

As we were developing LDTs, we noticed that a record “get” would return this complex structure, and would most certainly confuse users who probably expected to see actual data and not internal control information. The actual data lies not in the LDT bin itself, but instead lives in other linked sub-records. So, to bypass this confusion, we hid the contents of LDT instances by making them special. In the AS Server, LDT bins are considered “hidden bins”. If you try to access an LDT bin by any means other than an LDT function, you will simply see a NIL value. However, you still see the LDT bin name, because that reassurance is needed to show that the LDT instances are really there.

Toby