aerospike / aerospike-client-java

Aerospike Java Client Library
Other
236 stars 212 forks source link

Java client ERROR: /opt/aerospike/sys/udf/lua/ldt/lib_lmap.lua:868 LDT-Bin Does Not Exist #58

Closed wongyum closed 8 years ago

wongyum commented 8 years ago

Client cannot execute "scan", "config" and the exception com.aerospike.client.AerospikeException: Error Code 1417: /opt/aerospike/sys/udf/lua/ldt/lib_lmap.lua:868 LDT-Bin Does Not Exist is flow

WritePolicy policy = new WritePolicy(); policy.sendKey= true; Key key = new Key(SystemVariable.DEFAULT_NAME_SPACE, Account.class, uuid); LargeMap lg= ((LargeMap)aerospikeClient.getLargeMap(policy, key, "userGroupMap", null)); Map<?,?> map = lg.getConfig(); //ERROR Map<String,String> if (lg.size()>0){ //ERROR

}

com.aerospike.client.AerospikeException: Error Code 1417: /opt/aerospike/sys/udf/lua/ldt/lib_lmap.lua:868 LDT-Bin Does Not Exist at com.aerospike.client.command.ReadCommand.handleUdfError(ReadCommand.java:157) at com.aerospike.client.command.ReadCommand.parseResult(ReadCommand.java:118) at com.aerospike.client.command.SyncCommand.execute(SyncCommand.java:56) at com.aerospike.client.AerospikeClient.execute(AerospikeClient.java:1145) at com.aerospike.client.large.LargeMap.getConfig(LargeMap.java:145)

BrianNichols commented 8 years ago

The key's set name argument is a string. You are passing Account.class.

Was the LDT map already created?
Was it created in the "userGroupMap" bin?

wongyum commented 8 years ago

Good morning,

The LDT map is not created yet as the new account (e.g.: User A) is registered, and the map is scanned once the user login. However, this map store (system/other user request) for such user (User A) and it maybe clear if user read all of the msg (Stored in LDT map).

Now we have some workaround such as put a DUMMY record to the LDT Map/List bin, or get the record to check if the bin existed. However, all of the above solution have tradeoff on storage/performance. And some of the java developers used to check the map/set/list by compare to null value or get collection size. Thus i would like to know if there is any solution. Thanks

BrianNichols commented 8 years ago

The LDT map will not be created unless items are added to it. Trying to obtain map configuration will not work for a non-existant map.

wongyum commented 8 years ago

It's OK now, Thanks for your help. :)