[
https://issues.apache.org/jira/browse/HBASE-11805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14119994#comment-14119994
]
Anoop Sam John commented on HBASE-11805:
----------------------------------------
Thanks Stack.
{quote}
{code}
Do we have to do the below?
- for (KeyValue kv : value.getKeyValues()) {
+ for (Cell cell : value.getCells()) {
+ KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
{code}
{quote}
This is in WALPlayer#HLogKeyValueMapper. The mapper o/p value is KeyValue.
This also we can change to Cell. But I thought of doing all these as part of
HBASE-11871. One sub task to remove enusreKeyValue from MR tools. Sounds ok?
{quote}
This one is a bit odd Anoop...
{code}
-for (KeyValue kv: kvs) {
-size += kv.getLength();
+ for (Cell cell: cells) { + size += KeyValueUtil.length(cell); }
{code}
Using a KeyValueUtils on a cell?
{quote}
We have CellUtil#estimatedSizeOf() but that is not KV length. That is length +
SIZEOF_INT. The bytes a Cell takes when serialized to Encoder.
KKUtil method was existing and been used by Prefix Tree also. May be will add
length() in CellUtil , same way as in KVUtil and make code to use that.
> 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)