distributedlog-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DL-45) DL should allow ByteBuffer based API and should avoid copying of arrays
Date Tue, 22 Nov 2016 15:57:58 GMT

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

ASF GitHub Bot commented on DL-45:
----------------------------------

Github user jiazhai commented on a diff in the pull request:

    https://github.com/apache/incubator-distributedlog/pull/21#discussion_r89146667
  
    --- Diff: distributedlog-core/src/main/java/com/twitter/distributedlog/EnvelopedEntry.java
---
    @@ -254,21 +253,22 @@ private void read(DataInputStream in) throws IOException {
             Payload() {
             }
     
    -        Payload(int length, byte[] payload) {
    +        Payload(int length, ByteBuffer payload) {
                 this.length = length;
                 this.payload = payload;
                 this.ready = true;
             }
     
             private void write(DataOutputStream out) throws IOException {
                 out.writeInt(length);
    -            out.write(payload, 0, length);
    +            out.write(payload.array(), 0, length);
             }
     
             private void read(DataInputStream in) throws IOException {
                 this.length = in.readInt();
    -            this.payload = new byte[length];
    -            in.readFully(payload);
    +            this.payload = ByteBuffer.wrap(new byte[length]);
    +            //TODO: Fix this
    --- End diff --
    
    will sync with Arvind to get this done.


> DL should allow ByteBuffer based API and should avoid copying of arrays
> -----------------------------------------------------------------------
>
>                 Key: DL-45
>                 URL: https://issues.apache.org/jira/browse/DL-45
>             Project: DistributedLog
>          Issue Type: Improvement
>          Components: distributedlog-core, distributedlog-protocol
>            Reporter: Arvind Kandhare
>




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

Mime
View raw message