jerryshao commented on a change in pull request #28525:
URL: https://github.com/apache/spark/pull/28525#discussion_r427968659



##########
File path: 
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java
##########
@@ -320,12 +318,25 @@ private ManagedBuffer getSortBasedShuffleBlockData(
       ShuffleIndexInformation shuffleIndexInformation = 
shuffleIndexCache.get(indexFile);
       ShuffleIndexRecord shuffleIndexRecord = shuffleIndexInformation.getIndex(
         startReduceId, endReduceId);
-      return new FileSegmentManagedBuffer(
-        conf,
-        ExecutorDiskUtils.getFile(executor.localDirs, 
executor.subDirsPerLocalDir,
+      if (shuffleIndexInformation.isHasDigest()) {
+        File dataFile = ExecutorDiskUtils.getFile(executor.localDirs, 
executor.subDirsPerLocalDir,
+          "shuffle_" + shuffleId + "_" + mapId + "_0.data");
+        return new DigestFileSegmentManagedBuffer(
+          conf,
+          dataFile,
+          shuffleIndexRecord.getOffset(),
+          shuffleIndexRecord.getLength(),
+          shuffleIndexRecord.getDigest().orElse(DigestUtils.getDigest(

Review comment:
       IIUC, if we calculate digest on the fly for continuous shuffle read, I 
think we could guarantee the end-to-end consistency.




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



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

Reply via email to