[
https://issues.apache.org/jira/browse/HBASE-9359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13752683#comment-13752683
]
Jonathan Hsieh edited comment on HBASE-9359 at 8/28/13 6:30 PM:
In v1, basically, any method whose return type changes will require apps to do
some code changes. Methods where arguments change from KeyValue to Cell should
still work since Cell can accept KeyValues. I'm leaning towards making sure
the commonly used but inefficient KeyValue methods (including #getQualifier,
#getFamily, and #getValue, and #getRow) get ported into the Cell interface.
Clients would essentially only have to replace KeyValue with Cell in these
cases.
{code}
Put:
- public ListKeyValue get(byte[] family, byte[] qualifier)
+ public ListCell get(byte[] family, byte[] qualifier)
Result:
- public KeyValue[] raw() {
+ public Cell[] raw() {
- public ListKeyValue list() {
+ public ListCell list() {
- public ListKeyValue getColumn(byte [] family, byte [] qualifier) {
+ public ListCell getColumn(byte [] family, byte [] qualifier) {
- public KeyValue getColumnLatest(byte [] family, byte [] qualifier) {
+ public Cell getColumnLatest(byte [] family, byte [] qualifier) {
- public KeyValue getColumnLatest(byte [] family, int foffset, int flength,
+ public Cell getColumnLatest(byte [] family, int foffset, int flength,
byte [] qualifier, int qoffset, int qlength) {
{code}
For extension interfaces that have changed signatures (like filters in
HBASE-9334 and in here, coprocessors) we can keep both the old and new
signature and have the abstract implementation helper have the new call the
old. For the shim to handle the ListKeyValue - ListCell conversion, I'm
going to use a naive array copy. (Another option is to change the signature to
List? extends Cell -- will look at this option one more time).
{code}
ColumnInterpreter: (abstract class)
- public abstract T getValue(byte[] colFamily, byte[] colQualifier, KeyValue
kv)
+ public abstract T getValue(byte[] colFamily, byte[] colQualifier, Cell kv)
BaseRegionObserver: (abstract class)
RegionObserver: (inteface)
void preGet(final ObserverContextRegionCoprocessorEnvironment c, final Get
get,
- final ListKeyValue result)
+ final ListCell result)
throws IOException;
void postGet(final ObserverContextRegionCoprocessorEnvironment c, final
Get get,
- final ListKeyValue result)
+ final ListCell result)
throws IOException;
{code}
was (Author: jmhsieh):
In v1, basically, any method whose return type will require apps to do some
code changes. Methods where arguments change from KeyValue to Cell should
still work since Cell can accept KeyValues. I'm leaning towards making sure
the commonly used but inefficient KeyValue methods (including #getQualifier,
#getFamily, and #getValue, and #getRow) get ported into the Cell interface.
Clients would essentially only have to replace KeyValue with Cell in these
cases.
{code}
Put:
- public ListKeyValue get(byte[] family, byte[] qualifier)
+ public ListCell get(byte[] family, byte[] qualifier)
Result:
- public KeyValue[] raw() {
+ public Cell[] raw() {
- public ListKeyValue list() {
+ public ListCell list() {
- public ListKeyValue getColumn(byte [] family, byte [] qualifier) {
+ public ListCell getColumn(byte [] family, byte [] qualifier) {
- public KeyValue getColumnLatest(byte [] family, byte [] qualifier) {
+ public Cell getColumnLatest(byte [] family, byte [] qualifier) {
- public KeyValue getColumnLatest(byte [] family, int foffset, int flength,
+ public Cell getColumnLatest(byte [] family, int foffset, int flength,
byte [] qualifier, int qoffset, int qlength) {
{code}
For extension interfaces that have changed signatures (like filters in
HBASE-9334 and in here, coprocessors) we can keep both the old and new
signature and have the abstract implementation helper have the new call the
old. For the shim to handle the ListKeyValue - ListCell conversion, I'm
going to use a naive array copy. (Another option is to change the signature to
List? extends Cell -- will look at this option one more time).
{code}
ColumnInterpreter: (abstract class)
- public abstract T getValue(byte[] colFamily, byte[] colQualifier, KeyValue
kv)
+ public abstract T getValue(byte[] colFamily, byte[] colQualifier, Cell kv)
BaseRegionObserver: (abstract class)
RegionObserver: (inteface)
void preGet(final ObserverContextRegionCoprocessorEnvironment c, final Get
get,
- final ListKeyValue result)
+ final ListCell result)
throws IOException;
void postGet(final ObserverContextRegionCoprocessorEnvironment c, final
Get get,
- final ListKeyValue result)
+ final ListCell result)
throws IOException;
{code}
Convert KeyValue to Cell in hbase-client module -