attilapiros commented on a change in pull request #24499: [SPARK-27677][Core] 
Serve local disk persisted blocks by the external service after releasing 
executor by dynamic allocation
URL: https://github.com/apache/spark/pull/24499#discussion_r286867541
 
 

 ##########
 File path: 
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java
 ##########
 @@ -298,6 +315,17 @@ private ManagedBuffer getSortBasedShuffleBlockData(
     }
   }
 
+  public ManagedBuffer getDiskPersistedRddBlockData(
+      ExecutorShuffleInfo executor, int rddId, int splitIndex) {
+    File file = getFile(executor.localDirs, executor.subDirsPerLocalDir,
+      "rdd_" + rddId + "_" + splitIndex);
+    ManagedBuffer res = null;
+    if (file.exists()) {
+      res = new FileSegmentManagedBuffer(conf, file, 0, file.length());
 
 Review comment:
   Yes, that was my initial idea. 
   
   And both cases are tested:
   - `ExternalShuffleIntegrationSuite#testFetchCorruptRddBlock` tests the 
illegal size, as when the file length is saved into val earlier still it can be 
deleted after the `exists()` check (or as `FileSigmentManagedBuffer` does not 
opens the file the file still can be deleted after the instance is constructed)
   - `BlockManagerSuite#SPARK-25888: serving of removed file not detected by 
shuffle service`: where the 0 length file is tested (file removed right after 
`exist()` check)
   
   I will revert the inlining but I still think the best to keep both tests.
   

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


With regards,
Apache Git Services

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

Reply via email to