johnyangk commented on a change in pull request #222: [NEMO-350] Implement
Off-heap SerializedMemoryStore & [NEMO-384] Implement
DirectByteBufferInputStream for Off-heap SerializedMemoryStore
URL: https://github.com/apache/incubator-nemo/pull/222#discussion_r297012530
##########
File path:
runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/block/FileBlock.java
##########
@@ -83,11 +96,13 @@ public FileBlock(final String blockId,
*/
private void writeToFile(final Iterable<SerializedPartition<K>>
serializedPartitions)
throws IOException {
- try (FileOutputStream fileOutputStream = new FileOutputStream(filePath,
true)) {
+ try (FileChannel fileOutputChannel = new FileOutputStream(filePath,
true).getChannel()) {
for (final SerializedPartition<K> serializedPartition :
serializedPartitions) {
// Reserve a partition write and get the metadata.
metadata.writePartitionMetadata(serializedPartition.getKey(),
serializedPartition.getLength());
- fileOutputStream.write(serializedPartition.getData(), 0,
serializedPartition.getLength());
+ for (final ByteBuffer buffer: serializedPartition.getBuffer()) {
+ fileOutputChannel.write(buffer);
Review comment:
Sounds very good!
----------------------------------------------------------------
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