just day before i started to work with aerospike. I have some problem while writing one sample using LDT (Large data types -- Large List). I want to create a key with currdate with appended as key (20160419_2000_List) and later i will add raw data (byte array) as list values. For that i am able to connect the database correctly, but i am not able to create key for list. Can you please guide me on this. You can refer the following code to get idea of what i am doing exactly.
m_sTFPKeyStr.assign(datevalue); //datavalue consists datatime string
m_sTFPListStr.assign("List_");
m_sTFPListStr.append(datevalue);
as_key_init_str(&m_sTFPKey, m_sInputNameSpace.c_str(), m_sInputSetName.c_str(), m_sTFPKeyStr.c_str());
if (!as_ldt_init(m_sTFPListKey, m_sTFPListStr.c_str(), AS_LDT_LLIST, NULL))
{
memset(logmessage, 0x0, sizeof(logmessage));
sprintf(logmessage, "CDataBaseManager::SaveTFP Fails to initialize tfplist key %s", m_sTFPListStr.c_str());
m_pCaptureManager->m_pLogMgr->LogMsg(logmessage);
return;
}
Check the length of m_sTFPListStr
in your code.
The codes of function as_ldt_init
which will check the parameters :
as_ldt * as_ldt_init(as_ldt * ldt, const as_bin_name name, const as_ldt_type type, const as_udf_module_name module)
{
if (!name || name[0] == '\0' || strlen(name) > AS_BIN_NAME_MAX_LEN
|| (module && strlen(module) > AS_UDF_MODULE_MAX_LEN) )
{
return NULL;
}
...
}
As the value of AS_BIN_NAME_MAX_LEN:
#define AS_BIN_NAME_MAX_LEN (AS_BIN_NAME_MAX_SIZE - 1)
#define AS_BIN_NAME_MAX_SIZE 15