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] [Commented] (HBASE-17191) Make use of UnsafeByteOperations#unsafeWrap(ByteBuffer buffer) in PBUtil#toCell(Cell cell)
Date Wed, 30 Nov 2016 11:46:58 GMT

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

Anoop Sam John commented on HBASE-17191:
----------------------------------------

So u mean to add a ByteBufferCell check here?
{code}
CellProtos.Cell.Builder kvbuilder = CellProtos.Cell.newBuilder();
    kvbuilder.setRow(UnsafeByteOperations.unsafeWrap(kv.getRowArray(), kv.getRowOffset(),
        kv.getRowLength()));
    kvbuilder.setFamily(UnsafeByteOperations.unsafeWrap(kv.getFamilyArray(),
        kv.getFamilyOffset(), kv.getFamilyLength()));
    kvbuilder.setQualifier(UnsafeByteOperations.unsafeWrap(kv.getQualifierArray(),
        kv.getQualifierOffset(), kv.getQualifierLength()));
    kvbuilder.setCellType(CellProtos.CellType.valueOf(kv.getTypeByte()));
    kvbuilder.setTimestamp(kv.getTimestamp());
    kvbuilder.setValue(UnsafeByteOperations.unsafeWrap(kv.getValueArray(), kv.getValueOffset(),
        kv.getValueLength()));
    return kvbuilder.build();
{code}
I was thinking even we don't have UnsafeByteOperations.unsafeWrap use at all here.

> Make use of UnsafeByteOperations#unsafeWrap(ByteBuffer buffer) in PBUtil#toCell(Cell
cell)
> ------------------------------------------------------------------------------------------
>
>                 Key: HBASE-17191
>                 URL: https://issues.apache.org/jira/browse/HBASE-17191
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 2.0.0
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>
> Since we now have support for BBs in UnsafeByteOperations#unsafeWrap(ByteBuffer) . So
for the non - java clients while creating the PB result we could avoid the copy to an temp
array. 
> Since we have a support to write to BB in ByteOutput having a result backed by Bytebuffer
should be fine. 



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

Mime
View raw message