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

Mukul Kumar Singh commented on HDDS-3815:
-----------------------------------------

This need to be changed to the following, this will only copy the 4 bytes and 
avoid copying the entire buffer

{code}
    ByteString str = bytes.substring(0, 4);
    final int i = 4 + str.asReadOnlyByteBuffer().getInt();
{code}

> Avoid buffer copy in ContainerCommandRequestProto
> -------------------------------------------------
>
>                 Key: HDDS-3815
>                 URL: https://issues.apache.org/jira/browse/HDDS-3815
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: Ozone Datanode
>    Affects Versions: 0.6.0
>            Reporter: Mukul Kumar Singh
>            Assignee: Mukul Kumar Singh
>            Priority: Major
>         Attachments: fstree-DN1-102400Files-10Bytes-003.svg
>
>
> Avoid buffer copy because of
> {code}
>  final int i = 4 + bytes.asReadOnlyByteBuffer().getInt();
> {code}
>  bytes.asReadOnlyByteBuffer() causes the entire buffer to be copied.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to