vanzin 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_r286685058
##########
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:
I think I suggested inlining `file.length()`, but if the situation you're
trying to avoid happens (file is deleted) then this may be a problem (since
length will be 0).
Computing the length before the `exists()` check seems safer.
----------------------------------------------------------------
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]