File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed
core/src/main/scala/org/apache/spark/shuffle Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -246,19 +246,6 @@ private[spark] class IndexShuffleBlockResolver(
246246 out.close()
247247 }
248248
249- if (indexFile.exists()) {
250- indexFile.delete()
251- }
252- if (dataFile.exists()) {
253- dataFile.delete()
254- }
255- if (! indexTmp.renameTo(indexFile)) {
256- throw new IOException (" fail to rename file " + indexTmp + " to " + indexFile)
257- }
258- if (dataTmp != null && dataTmp.exists() && ! dataTmp.renameTo(dataFile)) {
259- throw new IOException (" fail to rename file " + dataTmp + " to " + dataFile)
260- }
261-
262249 if (digestEnable) {
263250 digestFile = getDigestFile(shuffleId, mapId)
264251 digestTmp = Utils .tempFileWith(digestFile)
@@ -270,12 +257,25 @@ private[spark] class IndexShuffleBlockResolver(
270257 } {
271258 out.close()
272259 }
273- if (digestFile.exists()) {
274- digestFile.delete()
275- }
276- if (! digestTmp.renameTo(digestFile)) {
277- throw new IOException (" fail to rename file " + digestTmp + " to " + digestFile)
278- }
260+ }
261+
262+ if (indexFile.exists()) {
263+ indexFile.delete()
264+ }
265+ if (digestEnable && digestFile.exists()) {
266+ digestFile.delete()
267+ }
268+ if (dataFile.exists()) {
269+ dataFile.delete()
270+ }
271+ if (! indexTmp.renameTo(indexFile)) {
272+ throw new IOException (" fail to rename file " + indexTmp + " to " + indexFile)
273+ }
274+ if (digestEnable && ! digestTmp.renameTo(digestFile)) {
275+ throw new IOException (" fail to rename file " + digestTmp + " to " + digestFile)
276+ }
277+ if (dataTmp != null && dataTmp.exists() && ! dataTmp.renameTo(dataFile)) {
278+ throw new IOException (" fail to rename file " + dataTmp + " to " + dataFile)
279279 }
280280 }
281281 }
You can’t perform that action at this time.
0 commit comments