DifferentSC commented on issue #213: [NEMO-383] Implement DirectByteBufferOutputStream for Off-heap SerializedMemoryStore URL: https://github.com/apache/incubator-nemo/pull/213#issuecomment-482935562 +1 for adding getByteBuffer(). However, I think there would be some cases where toByteArray() is still necessary. How about implementing both methods and add comments for toByteArray() that it can degrade the performance due to the array copies? 2019년 4월 14일 (일) 오후 4:56, Taegeon Um <[email protected]>님이 작성: > *@taegeonum* commented on this pull request. > ------------------------------ > > In > common/src/main/java/org/apache/nemo/common/DirectByteBufferOutputStream.java > <https://github.com/apache/incubator-nemo/pull/213#discussion_r275144557>: > > > + temp.flip(); > + byteToWrite = temp.remaining(); > + temp.get(byteArray, start, byteToWrite); > + start += byteToWrite; > + } > + // The limit of the last buffer has to be set to the capacity for re-write. > + lastBuf.limit(lastBuf.capacity()); > + > + return byteArray; > + } > + > + /** > + * Closes this output stream and releases resources. > + */ > + @Override > + public void close() { > > Avro also implemented ByteBufferOutputStream, which returns the list of > ByteBuffer. > > https://avro.apache.org/docs/1.5.4/api/java/org/apache/avro/util/ByteBufferOutputStream.html > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/apache/incubator-nemo/pull/213#discussion_r275144557>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AETjDIpO-5R5WKCV4dWdKuoHFGycy8qBks5vgt8lgaJpZM4cuZ5J> > . >
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
