Skip to content

Conversation

@tmagrino
Copy link
Contributor

What changes were proposed in this pull request?

Previously, the TaskLocation implementation would not allow for executor ids which include underscores. This tweaks the string split used to get the hostname and executor id, allowing for underscores in the executor id.

This addresses the JIRA found here: https://issues.apache.org/jira/browse/SPARK-16148

This is moved over from a previous PR against branch-1.6: #13857

How was this patch tested?

Ran existing unit tests for core and streaming. Manually ran a simple streaming job with an executor whose id contained underscores and confirmed that the job ran successfully.

This is my original work and I license the work to the project under the project's open source license.

@srowen
Copy link
Member

srowen commented Jun 23, 2016

Jenkins test this please

@SparkQA
Copy link

SparkQA commented Jun 23, 2016

Test build #61098 has finished for PR 13858 at commit b497dc9.

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

@tmagrino
Copy link
Contributor Author

CCing some people who were involved in previous commits for this part of the code, @tdas @zsxwing. Does this look good?

@zsxwing
Copy link
Member

zsxwing commented Jun 28, 2016

@tmagrino could you add a simple test here:

assert(TaskLocation("executor_host1_3") === ExecutorCacheTaskLocation("host1", "3"))
?

@srowen
Copy link
Member

srowen commented Jun 28, 2016

I had an outstanding comment from the previous PR too: #13857 (comment)

@tmagrino
Copy link
Contributor Author

My apologies @srowen, I missed the comment somehow! I refactored a little bit to make it more obvious what's going on there (using stripPrefix as you suggested).

tmagrino added 3 commits June 28, 2016 01:19
Also updated the comment to indicate the string format which includes
the executor id.
@srowen
Copy link
Member

srowen commented Jun 28, 2016

You can always revert the commits in question and push, which become new commits, but that's fine. They're all squashed in the end. You can also manually squash and force-push if you like.

@tmagrino
Copy link
Contributor Author

I opted to force push a cleaned up version, thanks!

if (splits.length != 3) {
val hostAndExecutorId = str.stripPrefix(executorLocationTag)
val splits = hostAndExecutorId.split("_", 2)
if (splits.length != 2) {
Copy link
Member

Choose a reason for hiding this comment

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

Not important, but you could just use require here.

new ExecutorCacheTaskLocation(splits(1), splits(2))
val hostAndExecutorId = str.stripPrefix(executorLocationTag)
val splits = hostAndExecutorId.split("_", 2)
require(splits.length == 2, "Illegal executor location format: " + str)
Copy link
Member

Choose a reason for hiding this comment

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

You can use string interpolation here but not worth changing if that's the only thing left

@srowen
Copy link
Member

srowen commented Jun 28, 2016

Jenkins test this please

@SparkQA
Copy link

SparkQA commented Jun 28, 2016

Test build #61371 has finished for PR 13858 at commit ee4708d.

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

@zsxwing
Copy link
Member

zsxwing commented Jun 28, 2016

LGTM. Merging to master, 2.0 and 1.6. Thanks!

@asfgit asfgit closed this in ae14f36 Jun 28, 2016
asfgit pushed a commit that referenced this pull request Jun 28, 2016
… Executor ID

## What changes were proposed in this pull request?

Previously, the TaskLocation implementation would not allow for executor ids which include underscores.  This tweaks the string split used to get the hostname and executor id, allowing for underscores in the executor id.

This addresses the JIRA found here: https://issues.apache.org/jira/browse/SPARK-16148

This is moved over from a previous PR against branch-1.6: #13857

## How was this patch tested?

Ran existing unit tests for core and streaming.  Manually ran a simple streaming job with an executor whose id contained underscores and confirmed that the job ran successfully.

This is my original work and I license the work to the project under the project's open source license.

Author: Tom Magrino <[email protected]>

Closes #13858 from tmagrino/fixtasklocation.

(cherry picked from commit ae14f36)
Signed-off-by: Shixiong Zhu <[email protected]>
asfgit pushed a commit that referenced this pull request Jun 28, 2016
… Executor ID

## What changes were proposed in this pull request?

Previously, the TaskLocation implementation would not allow for executor ids which include underscores.  This tweaks the string split used to get the hostname and executor id, allowing for underscores in the executor id.

This addresses the JIRA found here: https://issues.apache.org/jira/browse/SPARK-16148

This is moved over from a previous PR against branch-1.6: #13857

## How was this patch tested?

Ran existing unit tests for core and streaming.  Manually ran a simple streaming job with an executor whose id contained underscores and confirmed that the job ran successfully.

This is my original work and I license the work to the project under the project's open source license.

Author: Tom Magrino <[email protected]>

Closes #13858 from tmagrino/fixtasklocation.

(cherry picked from commit ae14f36)
Signed-off-by: Shixiong Zhu <[email protected]>
zzcclp pushed a commit to zzcclp/spark that referenced this pull request Jun 29, 2016
… Executor ID

## What changes were proposed in this pull request?

Previously, the TaskLocation implementation would not allow for executor ids which include underscores.  This tweaks the string split used to get the hostname and executor id, allowing for underscores in the executor id.

This addresses the JIRA found here: https://issues.apache.org/jira/browse/SPARK-16148

This is moved over from a previous PR against branch-1.6: apache#13857

## How was this patch tested?

Ran existing unit tests for core and streaming.  Manually ran a simple streaming job with an executor whose id contained underscores and confirmed that the job ran successfully.

This is my original work and I license the work to the project under the project's open source license.

Author: Tom Magrino <[email protected]>

Closes apache#13858 from tmagrino/fixtasklocation.

(cherry picked from commit ae14f36)
Signed-off-by: Shixiong Zhu <[email protected]>
(cherry picked from commit 0cb06c9)
val hostAndExecutorId = str.stripPrefix(executorLocationTag)
val splits = hostAndExecutorId.split("_", 2)
require(splits.length == 2, "Illegal executor location format: " + str)
val Array(host, executorId) = splits
Copy link
Contributor

Choose a reason for hiding this comment

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

it's usually better to just do splits(0) and splits(1) rather than using pattern matching here.

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.

5 participants