hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-15721) Optimization in cloning cells into MSLAB
Date Wed, 27 Apr 2016 08:12:12 GMT

     [ https://issues.apache.org/jira/browse/HBASE-15721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Anoop Sam John updated HBASE-15721:
    Attachment: HBASE-15721.patch

This also avoid lot of garbage. With every cell, we used to create a ByteRange instance to
pass the allocated  chunk + offset. Now that is also avoided.

Removed the deprecation in KeyValue#getBuffer().  Now we have Cell in read and write paths.
 Ya in Cell we dont have any assumption that the entire thing is backed by single byte[].
But in KeyValue it is backed by single byte[] and so a getter for getting this ref is just
fine IMO.

> Optimization in cloning cells into MSLAB
> ----------------------------------------
>                 Key: HBASE-15721
>                 URL: https://issues.apache.org/jira/browse/HBASE-15721
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 2.0.0
>         Attachments: HBASE-15721.patch
> Before cells added to memstore CSLM, there is a clone of cell after copying it to MSLAB
chunk area.  This is done not in an efficient way.
> {code}
> public static int appendToByteArray(final Cell cell, final byte[] output, final int offset)
>     int pos = offset;
>     pos = Bytes.putInt(output, pos, keyLength(cell));
>     pos = Bytes.putInt(output, pos, cell.getValueLength());
>     pos = appendKeyTo(cell, output, pos);
>     pos = CellUtil.copyValueTo(cell, output, pos);
>     if ((cell.getTagsLength() > 0)) {
>       pos = Bytes.putAsShort(output, pos, cell.getTagsLength());
>       pos = CellUtil.copyTagTo(cell, output, pos);
>     }
>     return pos;
>   }
> {code}
> Copied in 9 steps and we end up parsing all lengths.  When the cell implementation is
backed by a single byte[] (Like KeyValue) this can be done in single step copy.

This message was sent by Atlassian JIRA

View raw message