Github user tbertelsen commented on the pull request:

    https://github.com/apache/spark/pull/5572#issuecomment-105421709
  
    > I think rdd2 will be cached at most W times, which is the number of 
nodes. Because BlockManager is running per node, not per executor, right?
    
    You are right, my mistake.
    
    > Because CacheManager has a lock for fetching partition, I think we should 
not see the situation that all threads will simultaneously try to fetch and 
insert into the local cache.
    
    Great, then we don't have to think about any race conditions.
    
    > I am not sure why coalescing can have a lot help. Once we coalesce rdd2 
to small number of partitions, we still need to fetch them all for each element 
in rdd1, right?
    
    You are right if we don't change anything, i.e., don't even implement idea 
one. The advantage is when we only implement idea 1 but not idea two. In this 
case we will fetch each partition in RDD2 once for each partition in RDD1 (and 
vice versa).So fewer partitions means fewer repeated fetches, but we still need 
enough partitions to exploit the parallelism.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to