mridulm commented on PR #45661:
URL: https://github.com/apache/spark/pull/45661#issuecomment-2020527368

   `ExecutorDiskUtils.getFilePath` and `DiskBlockManager.getFile` determines 
the layout of the files ...
   and given this is specific to an optimization in 
`LocalDiskShuffleExecutorComponents` (which determines the output file), why 
not simply modify `LocalDiskSingleSpillMapOutputWriter.transferMapSpillFile` to 
leverage this layout information and 'host' the final output in the same disk ?
   
   ```
   
     public void transferMapSpillFile(
         File mapSpillFile,
         long[] partitionLengths,
         long[] checksums) throws IOException {
       // The map spill file already has the proper format, and it contains all 
of the partition data.
       // So just transfer it directly to the destination without any merging.
       File parent = ExecutorDiskUtils.getLocalDir(mapSpillFile);
       File outputFile = blockResolver.getDataFile(shuffleId, mapId, 
Some(Array(parent.getAbsolutePath)));
       File tempFile = Utils.tempFileWith(outputFile);
       Files.move(mapSpillFile.toPath(), tempFile.toPath());
       blockResolver
         .writeMetadataFileAndCommit(shuffleId, mapId, partitionLengths, 
checksums, tempFile);
     }
   ```
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to