attilapiros commented on a change in pull request #25299: [SPARK-27651][Core]
Avoid the network when shuffle blocks are fetched from the same host
URL: https://github.com/apache/spark/pull/25299#discussion_r347528759
##########
File path:
core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -393,6 +402,7 @@ class BlockManagerMasterEndpoint(
topologyMapper.getTopologyForHost(idWithoutTopologyInfo.host))
val time = System.currentTimeMillis()
+ executorIdToLocalDirs.get(id.executorId, () => localDirs)
Review comment:
Javadoc of `put` suggest to use the `get` method when the pattern is: "if
cached, return; otherwise create, cache and return":
```java
/**
* Associates {@code value} with {@code key} in this cache. If the cache
previously contained a
* value associated with {@code key}, the old value is replaced by {@code
value}.
*
* <p>Prefer {@link #get(Object, Callable)} when using the conventional
"if cached, return;
* otherwise create, cache and return" pattern.
*
* @since 11.0
*/
void put(K key, V value);
```
----------------------------------------------------------------
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]