I am trying to maintain a map of object id and List of Aerospike Keys where it is listed. But when I try to publish that to Aerospike I get following exception:
Caused by: java.io.NotSerializableException: com.aerospike.client.Key
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.ArrayList.writeObject(Unknown Source)
Code being used:
Bin include = new Bin(CacheConstants.BIN_INCLUDE, idToKeysMap);
client.put(new WritePolicy(), cacheKey, include);
Thank you so much. I thought about this approach as well but then I thought to bypassed this by saving my raw object itself and reconstructing keys at receiving end. The function is a util method which can generate the required keys.
I was wondering if there is some inbuilt support.
For answers to questions:
I did not read the digest and I know the ns and setname as I was building the map while creating the keys for storing the ids.
There is no inbuilt support for storing the raw key information, if you need it you can make it into a map as we discussed previously, but another approach would be to store a subset of the key info in a Bin, i.e. a counter value concatenated on another value.
Ping me if you want to chat about this, my skype is peter.d.milne