hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeroen Hoek <jer...@lable.org>
Subject API deprecations: KeyValue -> Cell, is this the right way to use Cell / CellUtil?
Date Wed, 12 Mar 2014 14:26:14 GMT
Hello,

In the newer HBase versions a number of client API methods have been
deprecated, and newer methods return the Cell interface instead of a
KeyValue. Following the JavaDoc I *think* that the following is
correct:


1) Getting the value of a cell now that getValue() is deprecated:

Cell cell = ...
byte[] value = CellUtil.cloneValue(cell);


2) Also, for getting the row-key from a Cell now that getRow() is
deprecated, I found this StackOverflow question:

http://stackoverflow.com/questions/22246618/java-hbase-how-to-use-cellutil-getrowbytecell-int

Basically, you have to use System.arraycopy or Bytes.toString(array,
offset, length) to get the row-key.


Are these approaches proper? It seems strange not to have a getRow()
and getValue() method on a Cell instance.

Kind regards,

Jeroen Hoek

Mime
View raw message