Handling Float/Double datatypes using Aerospike Java Client -
i came know java client 3.0.33 supports float/double datatype @ client side.
release notes says: support double/float on client-side. server store these values longs.
fine. when insert float value aerospike bin, stored long integer in aerospike server. whereas while retreiving value using java client, getting long integer saved in server.
expect java client should have converted long float automatically on retrieval. done in python client (serialize/deserialize). have explicitly use getfloat() convert float while using java client.
question how know bin need apply getfloat() , bin should not. because never know datatype reading inserted float.
in advance.
use aerospike java client 3.1.2 following code. double/float stored serialized java type, long write , read jave fine.
key key = new key("test", "some-floats", "float-001"); bin bin = new bin("a-float", 3.14159f); this.client.put(null, key, bin); record record = this.client.get(null, key, "a-float"); double pi = record.getfloat("a-float"); system.out.println("float:"+pi);
Comments
Post a Comment