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 >> how to create a Result object with some null value?


Copy link to this message
-
how to create a Result object with some null value?
Now I want to test HBase with mock Result object.In the map(), we get value like this:
byte[] date = value.getValue(Bytes.toBytes("f"),
Bytes.toBytes("date"));
Sometimes,  the byte[] date will be null because of null value in hbase.
Now I want to create fake HBase object by using :

new KeyValue(
Bytes.toBytes(rowkey),
Bytes.toBytes(family),
Bytes.toBytes(qualifier),
1,
Bytes.toBytes(value));
But I can't set value to null to create KeyValue object.
Anybody knows how to simulate this situation?    
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