nemo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-nemo] sanha commented on a change in pull request #205: [NEMO-366] DirectByteArrayOutputStream bug in SerializedPartition
Date Mon, 25 Mar 2019 03:44:06 GMT
sanha commented on a change in pull request #205: [NEMO-366] DirectByteArrayOutputStream bug
in SerializedPartition
URL: https://github.com/apache/incubator-nemo/pull/205#discussion_r268480918
 
 

 ##########
 File path: runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/DataUtil.java
 ##########
 @@ -119,8 +119,8 @@ private static void serializePartition(final EncoderFactory encoderFactory,
         // We need to close wrappedStream on here, because DirectByteArrayOutputStream:getBufDirectly()
returns
         // inner buffer directly, which can be an unfinished(not flushed) buffer.
         wrappedStream.close();
-        final byte[] serializedBytes = bytesOutputStream.getBufDirectly();
-        final int actualLength = bytesOutputStream.getCount();
+        final byte[] serializedBytes = bytesOutputStream.toByteArray();
 
 Review comment:
   This will incur an array copy for the whole bytes.
   Isn't there any other options (or any refactoring plan)?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message