hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ramkrishna.s.vasudevan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-11874) Support Cell to be passed to StoreFile.Writer rather than KeyValue
Date Mon, 08 Sep 2014 12:24:29 GMT

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

ramkrishna.s.vasudevan commented on HBASE-11874:
------------------------------------------------

{code}
+  public static void writeRowKeyPart(Cell cell, short rLen, int commonPrefix, DataOutputStream
out)
+      throws IOException {
+    if (commonPrefix == 0) {
+      out.writeShort(rLen);
+    } else if (commonPrefix == 1) {
+      out.writeByte((byte) rLen);
+      commonPrefix--;
+    } else {
+      commonPrefix -= KeyValue.ROW_LENGTH_SIZE;
+    }
+    if (rLen > commonPrefix) {
+      out.write(cell.getRowArray(), cell.getRowOffset() + commonPrefix, rLen - commonPrefix);
+    }
+  }
{code}
I think here we can seperate it out. Because the intention here is to make commonPrefix 0.
The row key length is the part we need to write so just extract it out and write that and
then just do out.write(cell.getRowArray(), cell.getRowOffset(), rLen). It is easy for reading.

> Support Cell to be passed to StoreFile.Writer rather than KeyValue
> ------------------------------------------------------------------
>
>                 Key: HBASE-11874
>                 URL: https://issues.apache.org/jira/browse/HBASE-11874
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 0.99.0, 2.0.0
>
>         Attachments: HBASE-11874.patch, HBASE-11874_V2.patch, HBASE-11874_V3.patch, HBASE-11874_V3.patch,
HBASE-11874_V4.patch, HBASE-11874_V5.patch
>
>
> This is the in write path and touches StoreFile.Writer,  HFileWriter , HFileDataBlockEncoder
and different DataBlockEncoder impl.
> We will have to avoid KV#getBuffer() KV#getKeyOffset/Length() calls.



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

Mime
View raw message