Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> HBase thrift API - Mutation store a float in a column


Copy link to this message
-
HBase thrift API - Mutation store a float in a column
Hi,

Using the HBase thrift API, and Java as a programming language, it seems that when setting a value in a Mutation :

Mutation mutation = new Mutation();
mutation.setIsDelete(false);
 mutation.setColumn(StringUtils.bytes("data latitude"));

ByteBuffer buf = ByteBuffer.allocate(8);
mutation.setValue(buf.putFloat(12f));

The resulting value in HBase (as seen from the shell) is always:

1234##2013-05-123 03:49:13                            column=data:latitude, timestamp=1367587243318, value=\x00\x00\x00\x00

What am I doing wrong?

NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB