aerospike - as_ldt_init failed to initialize -- C++ client -
just day before started work aerospike. have problem while writing 1 sample using ldt (large data types -- large list). want create key currdate appended key (20160419_2000_list) , later add raw data (byte array) list values. able connect database correctly, not able create key list. can please guide me on this. can refer following code idea of 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 initialize tfplist key %s", m_stfpliststr.c_str()); m_pcapturemanager->m_plogmgr->logmsg(logmessage); return; }
check length of m_stfpliststr
in code.
the codes of function as_ldt_init
check 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 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
Comments
Post a Comment