[#825][part-3] feat(spark): Get the ShuffleServer corresponding to the partition from ShuffleManager - #1141
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1141 +/- ##
============================================
+ Coverage 53.94% 54.83% +0.89%
+ Complexity 2655 2653 -2
============================================
Files 396 378 -18
Lines 23057 20797 -2260
Branches 1971 1976 +5
============================================
- Hits 12437 11405 -1032
+ Misses 9854 8694 -1160
+ Partials 766 698 -68
... and 23 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
3743d7f to
59eaf77
Compare
d41d93f to
2b2cac0
Compare
|
@leixm Could you help review this pr first? |
Sure. |
| RssShuffleHandle<K, V, C> rssHandle, | ||
| ShuffleHandleInfo shuffleHandleInfo, | ||
| TaskContext context, | ||
| ShuffleManagerClient shuffleManagerClient) { |
There was a problem hiding this comment.
@yl09099 Why change this constructor to add TaskContext and ShuffleManagerClient?
There was a problem hiding this comment.
Is it possible to put shuffleHandleInfo into rssHandle? This will make the code cleaner. @yl09099
There was a problem hiding this comment.
@yl09099 Why change this constructor to add TaskContext and ShuffleManagerClient?
TaskContext
ShuffleManagerClient has been removed, from which TaskContext's later PR needs to obtain information such as Stage AttemptNumber.
There was a problem hiding this comment.
Is it possible to put shuffleHandleInfo into rssHandle? This will make the code cleaner. @yl09099
To put shuffleHandleInfo object into the broadcast on the Driver side, if you want to put shuffleHandleInfo into rssHandle, you need to build RPC interface through the Driver's broadcast object to put in, here I think it is a waste of performance.
| this.hadoopConf = hadoopConf; | ||
| this.readMetrics = readMetrics; | ||
| this.partitionToShuffleServers = rssShuffleHandle.getPartitionToServers(); | ||
| this.partitionToShuffleServers = allPartitionToServers; |
There was a problem hiding this comment.
Here too, can we put the information maintained by ShuffleManagerService into rssShuffleHandle, so that it is transparent to RssShuffleReader and RssShuffleWriter.
34cb050 to
6bfbbc2
Compare
3e12c99 to
d076845
Compare
| } | ||
|
|
||
| private ShuffleManagerClient createShuffleManagerClient(String host, int port) { | ||
| // host is passed from spark.driver.bindAddress, which would be set when SparkContext is |
There was a problem hiding this comment.
Host can be inferred from `spark.driver.bindAddress`
There was a problem hiding this comment.
Host can be inferred from `spark.driver.bindAddress`
Have been modified.
3c50aa8 to
21ffc28
Compare
| * Mapping between ShuffleId and ShuffleServer list. ShuffleServer list is dynamically allocated. | ||
| * ShuffleServer is not obtained from RssShuffleHandle, but from this mapping. | ||
| */ | ||
| private Map<Integer, ShuffleHandleInfo> shuffleIdToShuffleHandleInfo = Maps.newConcurrentMap(); |
There was a problem hiding this comment.
Should we use JavaUtils.newConcurrentMap?
There was a problem hiding this comment.
Should we use
JavaUtils.newConcurrentMap?
Have been modified.
| @@ -107,6 +114,14 @@ public class RssShuffleManager extends RssShuffleManagerBase { | |||
| private final Map<Integer, Integer> shuffleIdToNumMapTasks = Maps.newConcurrentMap(); | |||
| failedTaskIds, | ||
| poolSize, | ||
| keepAliveTime); | ||
| this.shuffleIdToShuffleHandleInfo = Maps.newConcurrentMap(); |
|
LGTM, some minor comments. Let @leixm take an another look. |
21ffc28 to
448c4c2
Compare
|
Is this ready to merge? @jerqi . |
448c4c2 to
87ee4d4
Compare
|
LGTM, waiting for UTs. |
6790789 to
fd22e82
Compare
… to the partition from ShuffleManager.
fd22e82 to
4a57f5c
Compare
What changes were proposed in this pull request?
ShuffleReader and ShuffleWriter get the ShuffleServer corresponding to the partition from ShuffleManager
Ⅰ. Overall objective:
Ⅱ. Implementation logic diagram:
Ⅲ. As shown in the picture above:
2, the Task of Stage starts, solid steps, in accordance with the green by ShuffleManager Client RPC interface gets to be written for shuffleIdToShuffleHandleInfo ShuffleServer list;
Why are the changes needed?
Fix: #825
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing UT.