Uh oh!
There was an error while loading. Please reload this page.
[SPARK-19956][Core]Optimize a location order of blocks with topology information - #17300
[SPARK-19956][Core]Optimize a location order of blocks with topology information#17300ConeyLiu wants to merge 4 commits into
Conversation
jerryshao
commented
Mar 22, 2017
The fix LGTM, I think it is nice to have such topology priority. CC @mridulm . |
| val getLocations = PrivateMethod[Seq[BlockManagerId]]('getLocations) | ||
| val locations = blockManager invokePrivate getLocations(BroadcastBlockId(0)) | ||
| assert(locations.map(_.host).toSet | ||
| === Set(localHost, localHost, otherHost, otherHost, otherHost)) |
There was a problem hiding this comment.
Remove toSet and make Set as Seq ?
Making it a Set sort of looses the point of this change (ordering is lost).
Same for topology info below below.
| /** | ||
| * Return a list of locations for the given block, prioritizing the local machine since | ||
| * multiple block managers can share the same host. | ||
| * multiple block managers can share the same host, then try to get the same rack data. |
There was a problem hiding this comment.
How about "then try to get the same rack data" -> "followed by hosts on the same rack" ?
ConeyLiu
commented
Mar 22, 2017
Hi, @jerryshao@mridulm Thanks for your review, I have updated the code. |
| val getLocations = PrivateMethod[Seq[BlockManagerId]]('getLocations) | ||
| val locations = blockManager invokePrivate getLocations(BroadcastBlockId(0)) | ||
| assert(locations.map(_.host).toSet === Set(localHost, localHost, otherHost)) | ||
| assert(locations.map(_.host) === Seq(localHost, localHost, otherHost)) |
There was a problem hiding this comment.
There should also be Seq.
mridulm
left a comment
There was a problem hiding this comment.
Looks good to me, will keep it open in case there are other comments.
+CC @jerryshao , @ConeyLiu
ConeyLiu
commented
Mar 23, 2017
Ok, thanks a lot. |
ConeyLiu
commented
May 4, 2017
Hi, @cloud-fan@zsxwing Can you take a look? Thanks a lot. |
cloud-fan
commented
May 4, 2017
retest this please |
cloud-fan
commented
May 4, 2017
LGTM |
SparkQA
commented
May 4, 2017
Test build #76453 has finished for PR 17300 at commit
|
ConeyLiu
commented
May 5, 2017
retest this please |
mridulm
commented
May 5, 2017
Will merge when tests pass. |
cloud-fan
commented
May 5, 2017
retest this please |
| val (preferredLocs, otherLocs) = locs.partition { loc => blockManagerId.host == loc.host } | ||
| preferredLocs ++ otherLocs | ||
| val (sameRackLocs, differentRackLocs) = otherLocs.partition { | ||
| loc => blockManagerId.topologyInfo == loc.topologyInfo |
There was a problem hiding this comment.
If blockManagerId.topologyInfo is None, we will prefer the locations with empty topologyInfo. It is slightly different with what the shuffling wants to do here.
There was a problem hiding this comment.
Modified, thanks a lot for the good advice.
Thanks both of you for review, I have addressed the comments and modified the test case. Please help calling jenkins for test, because I can't trigger that. Thanks again. Also passed in local test. |
SparkQA
commented
May 5, 2017
Test build #76473 has finished for PR 17300 at commit
|
mridulm
commented
May 5, 2017
retest this please |
1 similar comment
gatorsmile
commented
May 5, 2017
retest this please |
mridulm
commented
May 5, 2017
That is weird, jenkins should have restarted build when I commented ... |
SparkQA
commented
May 5, 2017
Test build #76500 has finished for PR 17300 at commit
|
gatorsmile
commented
May 5, 2017
retest this please |
SparkQA
commented
May 5, 2017
Test build #76502 has finished for PR 17300 at commit
|
viirya
commented
May 6, 2017
LGTM |
ConeyLiu
commented
May 6, 2017
Thanks for your review. |
cloud-fan
commented
May 8, 2017
thanks, merging to master! |
mridulm
commented
May 8, 2017
Thanks for merging @cloud-fan, this PR kept dropping form my list ... |
ConeyLiu
commented
May 8, 2017
… information ## What changes were proposed in this pull request? When call the method getLocations of BlockManager, we only compare the data block host. Random selection for non-local data blocks, this may cause the selected data block to be in a different rack. So in this patch to increase the sort of the rack. ## How was this patch tested? New test case. Please review http://spark.apache.org/contributing.html before opening a pull request. Author: Xianyang Liu <xianyang.liu@intel.com> Closesapache#17300 from ConeyLiu/blockmanager.
What changes were proposed in this pull request?
When call the method getLocations of BlockManager, we only compare the data block host. Random selection for non-local data blocks, this may cause the selected data block to be in a different rack. So in this patch to increase the sort of the rack.
How was this patch tested?
New test case.
Please review http://spark.apache.org/contributing.html before opening a pull request.