Skip to content

Commit fc798b7

Browse files
committed
Address other comments
1 parent 91d7062 commit fc798b7

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

core/src/main/java/org/apache/spark/shuffle/sort/io/LocalDiskShuffleExecutorComponents.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717

1818
package org.apache.spark.shuffle.sort.io;
1919

20+
import java.util.Optional;
21+
2022
import com.google.common.annotations.VisibleForTesting;
2123

22-
import java.util.Optional;
2324
import org.apache.spark.SparkConf;
2425
import org.apache.spark.SparkEnv;
2526
import org.apache.spark.shuffle.api.ShuffleExecutorComponents;

core/src/main/java/org/apache/spark/shuffle/sort/io/LocalDiskShuffleMapOutputWriter.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ private void cleanUp() throws IOException {
138138

139139
private void initStream() throws IOException {
140140
if (outputFileStream == null) {
141-
// This file needs to opened in append mode in order to work around a Linux kernel bug that
142-
// affects transferTo; see SPARK-3948 for more details.
143141
outputFileStream = new FileOutputStream(outputTempFile, true);
144142
}
145143
if (outputBufferedFileStream == null) {
@@ -148,11 +146,10 @@ private void initStream() throws IOException {
148146
}
149147

150148
private void initChannel() throws IOException {
151-
if (outputFileStream == null) {
152-
outputFileStream = new FileOutputStream(outputTempFile, true);
153-
}
149+
// This file needs to opened in append mode in order to work around a Linux kernel bug that
150+
// affects transferTo; see SPARK-3948 for more details.
154151
if (outputFileChannel == null) {
155-
outputFileChannel = outputFileStream.getChannel();
152+
outputFileChannel = new FileOutputStream(outputTempFile, true).getChannel();
156153
}
157154
}
158155

0 commit comments

Comments
 (0)