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-1469: Scheduler mode should accept lower-case definitions and have... #388

Closed
wants to merge 1 commit into from

Conversation

techaddict
Copy link
Contributor

... nicer error messages

There are two improvements to Scheduler Mode:

  1. Made the built in ones case insensitive (fair/FAIR, fifo/FIFO).
  2. If an invalid mode is given we should print a better error message.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@techaddict
Copy link
Contributor Author

@pwendell can you review this ?

SchedulingMode.withName(conf.get("spark.scheduler.mode", "FIFO").toUpperCase)
} catch {
case e: java.util.NoSuchElementException =>
throw new SparkException("spark scheduler mode not available", e)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good start, but if you look at the JIRA, this exception won't actually echo back to the user the name they provided, which is bad form. I think you should capture the argument the user provided first then echo it back to them:

private val schedulingModeConf = conf.get("spark.scheduler.mode", "FIFO")
val schedulingMode: SchedulingMode = try {
    SchedulingMode.withName(schedulingModeConf).toUpperCase)
  } catch {
   case e: java.util.NoSuchElementException =>
     throw new SparkException(s"unrecognized spark.scheduler.mode: $schedulingModeConf")
  }

Don't even bother re-sending the NoSuchElementException... it doesn't convey anything useful to the user.

…ave nicer error messages

There are  two improvements to Scheduler Mode:
1. Made the built in ones case insensitive (fair/FAIR, fifo/FIFO).
2. If an invalid mode is given we should print a better error message.
@pwendell
Copy link
Contributor

Jenkins, test this please.

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@AmplabJenkins
Copy link

Merged build finished. All automated tests passed.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14177/

@pwendell
Copy link
Contributor

Cool - thanks for this!

@pwendell
Copy link
Contributor

I've merged this.

@asfgit asfgit closed this in e269c24 Apr 16, 2014
asfgit pushed a commit that referenced this pull request Apr 16, 2014
…ave...

... nicer error messages

There are  two improvements to Scheduler Mode:
1. Made the built in ones case insensitive (fair/FAIR, fifo/FIFO).
2. If an invalid mode is given we should print a better error message.

Author: Sandeep <[email protected]>

Closes #388 from techaddict/1469 and squashes the following commits:

a31bbd5 [Sandeep] SPARK-1469: Scheduler mode should accept lower-case definitions and have nicer error messages There are  two improvements to Scheduler Mode: 1. Made the built in ones case insensitive (fair/FAIR, fifo/FIFO). 2. If an invalid mode is given we should print a better error message.
(cherry picked from commit e269c24)

Signed-off-by: Patrick Wendell <[email protected]>
pdeyhim pushed a commit to pdeyhim/spark-1 that referenced this pull request Jun 25, 2014
…ave...

... nicer error messages

There are  two improvements to Scheduler Mode:
1. Made the built in ones case insensitive (fair/FAIR, fifo/FIFO).
2. If an invalid mode is given we should print a better error message.

Author: Sandeep <[email protected]>

Closes apache#388 from techaddict/1469 and squashes the following commits:

a31bbd5 [Sandeep] SPARK-1469: Scheduler mode should accept lower-case definitions and have nicer error messages There are  two improvements to Scheduler Mode: 1. Made the built in ones case insensitive (fair/FAIR, fifo/FIFO). 2. If an invalid mode is given we should print a better error message.
erikerlandson pushed a commit to erikerlandson/spark that referenced this pull request Jul 28, 2017
bzhaoopenstack pushed a commit to bzhaoopenstack/spark that referenced this pull request Sep 11, 2019
Change flavor to boot server in FusionCloud job
RolatZhang pushed a commit to RolatZhang/spark that referenced this pull request Mar 18, 2022
* KE-34191 replace partition Table path

* change pom version
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.

3 participants