Follow scenario:
import aerospike
AEROSPIKE_CONNECTION_STRING = {'hosts': [("localhost", 3000)], 'policies': {'timeout': 10000, 'retry': 10000}}
remote = aerospike.client(AEROSPIKE_CONNECTION_STRING).connect()
(key, metadata, bins) = remote.get(("ns", "some_set", "key-here"))
print bins # cannot reach because exception
It raises a exception:
exception.ClientError: (-1L, 'Unable to deserialize bytes', 'src/main/serializer.c', 475)
How to reproduce this problem: Write using java this bin: {“key”: {“id”: {“key”: “value”} }}
HashMap<String,HashMap<String, String>> map = new HashMap<String,HashMap<String, String>>();
HashMap<String, String> am = new HashMap<String, String>();
am.put("key", "value");
map.put("id", am);
Bin bin = new Bin("key", map);
client.put(params.writePolicy, key, bin); // for short, have some code behind
Then using python try to read that data.
Is there a way to write a Java HashMap and read using python as dictionary?