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

stack commented on HBASE-11805:
-------------------------------

Do we have to do the below?

-          for (KeyValue kv : value.getKeyValues()) {
+          for (Cell cell : value.getCells()) {
+            KeyValue kv = KeyValueUtil.ensureKeyValue(cell);

Maybe we could make do w/ a Cell? Seems like later changes have determined that 
you don't need KV so you have probably already tried my suggestion and it just 
don't work here... thats fine.  Just asking.

This one is a bit odd Anoop...


-      for (KeyValue kv: kvs) {
-        size += kv.getLength();
+      for (Cell cell: cells) {
+        size += KeyValueUtil.length(cell);
       }


Using a KeyValueUtils on a cell?

Nice one here: 

-         walEdit.add(KeyValueUtil.ensureKeyValue(cell));
+        walEdit.add(cell);

Good

This too....

-            kv.setSequenceId(currentReplaySeqId);
+            CellUtil.setSequenceId(cell, currentReplaySeqId);


+1 on patch.  A few nits above.  Nice stuff.

> KeyValue to Cell Convert in WALEdit APIs
> ----------------------------------------
>
>                 Key: HBASE-11805
>                 URL: https://issues.apache.org/jira/browse/HBASE-11805
>             Project: HBase
>          Issue Type: Improvement
>          Components: wal
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 0.99.0, 2.0.0, 0.98.7
>
>         Attachments: HBASE-11805.patch
>
>
> In almost all other main interface class/APIs we have changed KeyValue to 
> Cell. But missing in WALEdit. This is public marked for Replication (Well it 
> should be for CP also) 
> These 2 APIs deal with KVs
> add(KeyValue kv)
> ArrayList<KeyValue> getKeyValues()
> Suggest deprecate them and add for 0.98
> add(Cell kv) 
> List<Cell> getCells()
> And just replace from 1.0



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to