Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-4754] Refactor SparkContext into ExecutorAllocationClient #3614

Closed
wants to merge 3 commits into from

Conversation

andrewor14
Copy link
Contributor

This is such that the ExecutorAllocationManager does not take in the SparkContext with all of its dependencies as an argument. This prevents future developers of this class to tie down this class further with the SparkContext, which has really become quite a monstrous object.

cc'ing @pwendell who originally suggested this, and @JoshRosen who may have thoughts about the trait mix-in style of SparkContext.

This is such that the ExecutorAllocationManager does not take in
the SparkContext with all of its dependencies as an argument. This
prevents future developers of this class to tie down this class
further with the SparkContext, which has really become quite a
monstrous object.
@SparkQA
Copy link

SparkQA commented Dec 5, 2014

Test build #24168 has started for PR 3614 at commit 347a348.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Dec 5, 2014

Test build #24168 has finished for PR 3614 at commit 347a348.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationClient

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24168/
Test PASSed.

…ion-sc

Conflicts:
	core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
@SparkQA
Copy link

SparkQA commented Dec 10, 2014

Test build #24286 has started for PR 3614 at commit 59baf6c.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Dec 10, 2014

Test build #24286 has finished for PR 3614 at commit 59baf6c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationClient

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24286/
Test PASSed.

…ion-sc

Conflicts:
	core/src/main/scala/org/apache/spark/SparkContext.scala
@SparkQA
Copy link

SparkQA commented Dec 10, 2014

Test build #24329 has started for PR 3614 at commit 187070d.

  • This patch merges cleanly.

@JoshRosen
Copy link
Contributor

+1; this looks like a good refactoring. I like how the new ExecutorAllocationManager constructor makes its dependencies more explicit, which should help us to avoid an entire category of "implicit initialization order dependencies" bugs that we've hit in the past with classes that accept partially-constructed SparkContexts in their constructors.

I think the mixin trait shouldn't be an issue here; I think that the problems that I ran into with this pattern were related to the closure cleaner and additional levels of $outer indirection, but that shouldn't be an issue here.

private[spark] trait ExecutorAllocationClient {

/**
* Request an additional number of executors from the cluster manager.
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, one comment here: it might be nice to document the meaning of the return type. It looks like the scaladoc in CoarseGrainedSchedulerBackend already does this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I left that out accidentally

@SparkQA
Copy link

SparkQA commented Dec 11, 2014

Test build #24329 timed out for PR 3614 at commit 187070d after a configured wait of 120m.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24329/
Test FAILed.

@andrewor14
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Dec 11, 2014

Test build #24373 has started for PR 3614 at commit 187070d.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Dec 11, 2014

Test build #24373 has finished for PR 3614 at commit 187070d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationClient

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24373/
Test PASSed.

@ksakellis
Copy link

Just curious here, but is the eventual goal to pull this functionality(adding/removing executors) out of the SparkContext object?

@andrewor14
Copy link
Contributor Author

No, this is literally just refactoring for better code style

@JoshRosen
Copy link
Contributor

@andrewor14 This looks good to me. Any blockers to merging this?

@andrewor14
Copy link
Contributor Author

Nope, I'll merge this into master and 1.2 now thanks (after fixing the comments)

@asfgit asfgit closed this in 9804a75 Dec 19, 2014
asfgit pushed a commit that referenced this pull request Dec 19, 2014
This is such that the `ExecutorAllocationManager` does not take in the `SparkContext` with all of its dependencies as an argument. This prevents future developers of this class to tie down this class further with the `SparkContext`, which has really become quite a monstrous object.

cc'ing pwendell who originally suggested this, and JoshRosen who may have thoughts about the trait mix-in style of `SparkContext`.

Author: Andrew Or <andrew@databricks.com>

Closes #3614 from andrewor14/dynamic-allocation-sc and squashes the following commits:

187070d [Andrew Or] Merge branch 'master' of github.com:apache/spark into dynamic-allocation-sc
59baf6c [Andrew Or] Merge branch 'master' of github.com:apache/spark into dynamic-allocation-sc
347a348 [Andrew Or] Refactor SparkContext into ExecutorAllocationClient

(cherry picked from commit 9804a75)
Signed-off-by: Andrew Or <andrew@databricks.com>

Conflicts:
	core/src/main/scala/org/apache/spark/SparkContext.scala
@andrewor14 andrewor14 deleted the dynamic-allocation-sc branch December 19, 2014 01:42
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