[ 
https://issues.apache.org/jira/browse/HBASE-9359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13752683#comment-13752683
 ] 

Jonathan Hsieh commented on HBASE-9359:
---------------------------------------

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 List<KeyValue> get(byte[] family, byte[] qualifier)
+  public List<Cell> get(byte[] family, byte[] qualifier) 

Result:
-  public KeyValue[] raw() {
+  public Cell[] raw() {

-  public List<KeyValue> list() {
+  public List<Cell> list() {

-  public List<KeyValue> getColumn(byte [] family, byte [] qualifier) {
+  public List<Cell> 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 List<KeyValue> -> List<Cell> 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 ObserverContext<RegionCoprocessorEnvironment> c, final Get 
get,
-      final List<KeyValue> result)
+      final List<Cell> result)
     throws IOException;
   void postGet(final ObserverContext<RegionCoprocessorEnvironment> c, final 
Get get,
-      final List<KeyValue> result)
+      final List<Cell> result)
     throws IOException;
{code}
                
> Convert KeyValue to Cell in hbase-client module - Result/Put/Delete, 
> ColumnInterpreter
> --------------------------------------------------------------------------------------
>
>                 Key: HBASE-9359
>                 URL: https://issues.apache.org/jira/browse/HBASE-9359
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Client
>    Affects Versions: 0.95.2
>            Reporter: Jonathan Hsieh
>            Assignee: Jonathan Hsieh
>         Attachments: hbase-9359.patch
>
>
> This path is the second half of eliminating KeyValue from the client 
> interfaces.  This percolated through quite a bit. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to