Can't get Large List or Large Map working


#1

Can’t get Large List or Large Map working by tlarkworthy » Thu Jul 17, 2014 9:15 am

I have three unit tests, and only the set one seems to work.

The map breaks if you remove an entry then put one back in its place.

The ordered list fails to remove things and throw an error:

com.aerospike.client.AerospikeException:
 Error Code 100: /opt/aerospike/sys/udf/lua/ldt/lib_llist.lua:4687: 
attempt to call field 'deleteListUnique' (a nil value)
	at com.aerospike.client.command.ReadCommand.handleUdfError(ReadCommand.java:134)
	at com.aerospike.client.command.ReadCommand.parseResult(ReadCommand.java:106)
	at com.aerospike.client.command.SyncCommand.execute(SyncCommand.java:56)
	at com.aerospike.client.AerospikeClient.execute(AerospikeClient.java:778)

I’d love a more direct method for reporting bugs.

@Test def testMap() {
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "lmap", "create", Value.get("map"))

    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), 
"lmap", "put",    Value.get("map"), Value.get("test"), 
Value.get("test"))
    AerospikeAPI.client.execute(new Policy(), 
Converter.key(rootPath), "lmap", "put",    Value.get("map"), 
Value.get("test"), Value.get("test"))

    val largeMap = new LargeMap(AerospikeAPI.client, null, Converter.key(rootPath), "map", null)
    assertEquals(1, largeMap.size())
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "lmap", "remove",    Value.get("map"), Value.get("test"))
    assertEquals(0, largeMap.size())

    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), 
"lmap", "put",    Value.get("map"), Value.get("test"), 
Value.get("test"))
    assertEquals(1, largeMap.size())  // <---- FAIL HERE!!!!
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "lmap", "remove",    Value.get("map"), Value.get("test"))
    assertEquals(0, largeMap.size())
  }

  @Test def testLargeList() {
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "llist", "create", Value.get("list"))
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "llist", "add",    Value.get("list"), Value.get("val"))

    val largeList = new LargeList(AerospikeAPI.client, null, Converter.key(rootPath), "list", null)
    assertEquals(1, largeList.size())

    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), 
"llist", "remove",    Value.get("list"), Value.get("val"))   //<--- 
FAIL HERE!!!!
    assertEquals(0, largeList.size())
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "llist", "put",    Value.get("list"), Value.get("val"))
    assertEquals(1, largeList.size())

    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), 
"llist", "remove",    Value.get("list"), Value.get("val"))
    assertEquals(0, largeList.size())
  }

  @Test def testLargeSet() {
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "lset", "create", Value.get("set"))
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "lset", "add",    Value.get("set"), Value.get("val"))

    val largeList = new LargeSet(AerospikeAPI.client, null, Converter.key(rootPath), "set", null)
    assertEquals(1, largeList.size())
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "lset", "remove",    Value.get("set"), Value.get("val"))
    assertEquals(0, largeList.size())
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "lset", "add",    Value.get("set"), Value.get("val"))
    assertEquals(1, largeList.size())
    AerospikeAPI.client.execute(new Policy(), Converter.key(rootPath), "lset", "remove",    Value.get("set"), Value.get("val"))
    assertEquals(0, largeList.size())
  }

tlarkworthy Posts: 5Joined: Thu Jul 10, 2014 8:20 am


#2

We experienced some regression bugs during that period. They have been fixed and tested.

As of the current build (3.3.12) all LDT features pass the full regression tests.

Toby