File tree Expand file tree Collapse file tree
core/src/main/java/org/apache/spark/shuffle/sort/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .shuffle .sort .io ;
1919
20+ import java .util .Optional ;
21+
2022import com .google .common .annotations .VisibleForTesting ;
2123
22- import java .util .Optional ;
2324import org .apache .spark .SparkConf ;
2425import org .apache .spark .SparkEnv ;
2526import org .apache .spark .shuffle .api .ShuffleExecutorComponents ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments