Skip to content

Conversation

@sharkdtu
Copy link
Contributor

What changes were proposed in this pull request?

Currently, BlockRDD.getPreferredLocations only get hosts info of blocks, which results in subsequent schedule level is not better than 'NODE_LOCAL'. We can just make a small changes, the schedule level can be improved to 'PROCESS_LOCAL'

How was this patch tested?

manual test

@jerryshao
Copy link
Contributor

Would you please add a UT for it.

@jerryshao
Copy link
Contributor

ok to test.

val blockManagers = new HashMap[BlockId, Seq[String]]
for (i <- 0 until blockIds.length) {
blockManagers(blockIds(i)) = blockLocations(i).map(_.host)
blockManagers(blockIds(i)) = blockLocations(i).map(b => s"executor_${b.host}_${b.executorId}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of this method should be updated, blockIdsToHosts seems doesn't reflect your change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blockIdsToLocations ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's OK.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also you'd better using ExecutorCacheTaskLocation#toString here instead of manually writing the location hint, which will be more robust.

@SparkQA
Copy link

SparkQA commented Jul 5, 2018

Test build #92634 has finished for PR 21658 at commit 666fb4c.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jerryshao
Copy link
Contributor

Please add the UTs as I mentioned before.

val blockManagers = new HashMap[BlockId, Seq[String]]
for (i <- 0 until blockIds.length) {
blockManagers(blockIds(i)) = blockLocations(i).map(_.host)
blockManagers(blockIds(i)) = blockLocations(i).map(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

blockLoations(i).map { loc =>
   xxx
}

@SparkQA
Copy link

SparkQA commented Jul 6, 2018

Test build #92679 has finished for PR 21658 at commit adf39a5.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jul 9, 2018

Test build #92727 has finished for PR 21658 at commit 4750260.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jerryshao
Copy link
Contributor

Hi @sharkdtu , did you also verify this in your cluster, to see if the locality is correct or not?

@sharkdtu
Copy link
Contributor Author

@jerryshao Yeah, I hava verified it in our cluster, and the locality is 'PROCESS_LOCAL'.

Copy link
Contributor

@jerryshao jerryshao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@SparkQA
Copy link

SparkQA commented Jul 10, 2018

Test build #92793 has finished for PR 21658 at commit 380f242.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jerryshao
Copy link
Contributor

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Jul 10, 2018

Test build #92798 has finished for PR 21658 at commit 380f242.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jerryshao
Copy link
Contributor

LGTM, merging to master branch.

@asfgit asfgit closed this in 6fe3286 Jul 10, 2018
@jiangxb1987
Copy link
Contributor

a late LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants