Skip to content

Conversation

@erenavsarogullari
Copy link
Member

What changes were proposed in this pull request?

Some Schedulable Entities(Pool and TaskSetManager) variables need refactoring for immutability and access modifiers levels as follows:

  • From var to val (if there is no requirement): This is important to support immutability as much as possible.
    • Sample => Pool: weight, minShare, priority, name and taskSetSchedulingAlgorithm.
  • Access modifiers: Specially, vars access needs to be restricted from other parts of codebase to prevent potential side effects.
    • TaskSetManager: tasksSuccessful, totalResultSize, calculatedTasks etc...

This PR is related with #15604 and has been created seperatedly to keep patch content as isolated and to help the reviewers.

How was this patch tested?

Added new UTs and existing UT coverage.

@erenavsarogullari
Copy link
Member Author

@erenavsarogullari erenavsarogullari changed the title [SPARK-19567] [CORE] [SCHEDULER] Support some Schedulable variables immutability and access [SPARK-19567][CORE][SCHEDULER] Support some Schedulable variables immutability and access Feb 12, 2017
Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

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

I wonder if @squito or @kayousterhout has thoughts on these tweaks? I do like cleaning up and tightening the internal impl if there isn't a downside.

Copy link
Member

Choose a reason for hiding this comment

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

This should be in a companion object, but really, maybe not worth it.

Copy link
Member

Choose a reason for hiding this comment

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

Maintaining these messages with the various options is error-prone. Can you just use its .values and print that?

Copy link
Contributor

Choose a reason for hiding this comment

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

We're not likely to add or remove SchedulingModes with any frequency, if at all, so this isn't likely to cause much opportunity for error -- but I agree with the principle that extracting from .values is a better approach.

Copy link
Member Author

Choose a reason for hiding this comment

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

SchedulingMode possible values are FIFO, FAIR and NONE but NONE is unsupported value. I agree to support for potential values and it can be achieved by adding following logic to SchedulingMode object and can be used required places(2 times here and 1 time at Pool)
def getSupportedValuesAsString(): String = values.filter(_ != NONE).mkString(", ") SchedulingMode.getSupportedValuesAsString() // returns FIFO, FAIR
WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

NONE is only used in tests, and doesn't really need to be used there -- see the commit in my repo that I pointed you to earlier. Technically, removing NONE is a change in the public interface, but the docs say that only FAIR and FIFO are allowed (http://spark.apache.org/docs/latest/job-scheduling.html#configuring-pool-properties), and trying to use NONE will lead you to the "unsupported" failure, so we probably can get rid of it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, TaskSetManager also uses NONE to override schedulingMode (from parent Schedulable trait). However, it does not use schedulingMode. I think if NONE is removed, then FIFO will be used as the default value(e.g. TaskManager), right?

Copy link
Member

Choose a reason for hiding this comment

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

These appear to be pretty much redundant then? if they're just set once to another existing variable's value?

Copy link
Member Author

Choose a reason for hiding this comment

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

Pool extends Schedulable trait and needs to override weight. It is also used for taskToWeightRatio calculation at FairSchedulingAlgorithm level.

Copy link
Member

Choose a reason for hiding this comment

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

This is duplicated

@markhamstra
Copy link
Contributor

@srowen These refactorings of unnecessary vars to vals is something that we've noted in the discussions of a few other PRs as something that could and probably should be done in a separate PR (i.e. this one).

@erenavsarogullari There is another such refactoring that can be rolled into this PR. See the changes that I've made to rootPool in TaskSchedulerImpl, DAGSchedulerSuite and ExternalClusterManagerSuite here: markhamstra@e11fe2a

Copy link
Contributor

@markhamstra markhamstra Feb 13, 2017

Choose a reason for hiding this comment

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

I'd really rather not see this kind of change. Other than the missing string-interpolation s in msg, the prior code was at least as good (and arguably better) than the new style, and making such an inconsequential style change just adds complication to future investigations of the git history.

@erenavsarogullari
Copy link
Member Author

Thanks @markhamstra and @srowen for the quick reviews.
I will address them asap by covering the additional patch suggested by Mark.

@erenavsarogullari
Copy link
Member Author

Hi All,
All comments are addressed and this is ready for re-review.

@markhamstra, if it is suitable, i plan to address removing SchedulingMode.NONE via separated PR. In the light of this, the following new added unit test cases(using NONE) can be removed from this PR:

  • PoolSuite: Pool should throw IllegalArgumentException when schedulingMode is not supported
  • TaskSchedulerImplSuite: TaskScheduler should throw IllegalArgumentException when schedulingMode is not supported

WDYT?

@erenavsarogullari
Copy link
Member Author

erenavsarogullari commented Feb 20, 2017

Hi @markhamstra,
Do you have any comment about this PR and my latest comment?
All feedbacks are welcome. Thanks in advance ;)

@markhamstra
Copy link
Contributor

ok to test

@erenavsarogullari
Copy link
Member Author

Thanks @markhamstra.
I think jenkins needs to be triggered.

@markhamstra
Copy link
Contributor

If Jenkins is listening to me, that should have allowed you to trigger test for this PR.

test this please

@erenavsarogullari
Copy link
Member Author

Thanks @markhamstra.

I encounter the same problem in my every PR and tech-ops team helps to trigger Jenkins. Problem may be related with Github Jenkins PR Builder plugin.

Also it still looks not triggered.

@kayousterhout
Copy link
Contributor

Jenkins test this please

@kayousterhout
Copy link
Contributor

@erenavsarogullari the reason this was happening on past PRs is that Imran and I weren't on the Jenkins whitelist (which neither of us realized -- and has since been fixed). I think Mark is on the whitelist so this is probably a transient issue... we'll see if my triggering works.

@SparkQA
Copy link

SparkQA commented Feb 21, 2017

Test build #73232 has finished for PR 16905 at commit 589ef36.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@kayousterhout
Copy link
Contributor

@shaneknapp is @markhamstra on the Jenkins whitelist? Wanted to double check since his attempt to trigger the build above didn't work

@shaneknapp
Copy link
Contributor

nope, he's not in the admin list. i'll add him now.

@kayousterhout
Copy link
Contributor

Awesome thanks Shane!

@markhamstra
Copy link
Contributor

Thanks, Shane & Kay!

@erenavsarogullari
Copy link
Member Author

Many thanks @kayousterhout and @markhamstra.
Also minor scala style issue is fixed with new patch.

@kayousterhout
Copy link
Contributor

Jenkins this is OK to test

@erenavsarogullari
Copy link
Member Author

Thanks @kayousterhout. However, it still looks not triggered.

@vanzin
Copy link
Contributor

vanzin commented Feb 22, 2017

retest this please

@SparkQA
Copy link

SparkQA commented Feb 23, 2017

Test build #73299 has finished for PR 16905 at commit a580a2f.

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

@erenavsarogullari
Copy link
Member Author

Hi @markhamstra, @kayousterhout and @squito
This PR is ready for final review and merge if there is no concern.
All feedbacks are welcome. Thanks in advance ;)

Copy link
Contributor

@squito squito left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@kayousterhout kayousterhout Mar 15, 2017

Choose a reason for hiding this comment

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

one quick comment here if Imran didn't already merge: can you un-do these changes to add private? It's not useful / necessary to make test classes private (they're already hidden by the build), and this change will make git blames more confusing in the future.

@erenavsarogullari
Copy link
Member Author

Thanks @kayousterhout and @squito for review this ;)
Last comment is also addressed via last commit: 18657d4.

@kayousterhout
Copy link
Contributor

Jenkins test this please

@erenavsarogullari
Copy link
Member Author

Thanks again @kayousterhout and @squito.
Merge conflict has been fixed and this PR is ready to build on jenkins and merge (if there is no concern).

@kayousterhout
Copy link
Contributor

Jenkins retest this please

@SparkQA
Copy link

SparkQA commented Mar 16, 2017

Test build #74620 has finished for PR 16905 at commit 18657d4.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class FakeSchedulerBackend extends SchedulerBackend

@SparkQA
Copy link

SparkQA commented Mar 16, 2017

Test build #74629 has finished for PR 16905 at commit 479c01d.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class FakeSchedulerBackend extends SchedulerBackend

@squito
Copy link
Contributor

squito commented Mar 16, 2017

reopened https://issues.apache.org/jira/browse/SPARK-7420 for the failure

Jenkins, retest this please

@erenavsarogullari
Copy link
Member Author

Thanks again @kayousterhout and @squito ;)
Jenkins needs to be retriggered.

@squito
Copy link
Contributor

squito commented Mar 16, 2017

@shaneknapp I had to trigger jenkins manually via spark-prs. Every once in a while I encounter a pr for which tests are never triggered via comments. Its pretty rare, so its not a big deal, but I thought I'd point you at this in case you want to take a look.

@SparkQA
Copy link

SparkQA commented Mar 16, 2017

Test build #3600 has finished for PR 16905 at commit 479c01d.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class FakeSchedulerBackend extends SchedulerBackend

@SparkQA
Copy link

SparkQA commented Mar 16, 2017

Test build #3601 has finished for PR 16905 at commit 479c01d.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class FakeSchedulerBackend extends SchedulerBackend

@erenavsarogullari
Copy link
Member Author

Hi @squito,

I think jenkins can be triggered again. Last unrelated build - UT issue looks fixed(https://issues.apache.org/jira/browse/SPARK-19988)

Thanks in advance ;)

@kayousterhout
Copy link
Contributor

Jenkins, this is ok to test

@kayousterhout
Copy link
Contributor

Jenkins test this please

@kayousterhout
Copy link
Contributor

Jenkins add to whitelist

@SparkQA
Copy link

SparkQA commented Mar 23, 2017

Test build #75070 has finished for PR 16905 at commit 479c01d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class FakeSchedulerBackend extends SchedulerBackend

@SparkQA
Copy link

SparkQA commented Mar 23, 2017

Test build #75072 has finished for PR 16905 at commit 479c01d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class FakeSchedulerBackend extends SchedulerBackend

@kayousterhout
Copy link
Contributor

LGTM merged into master

@asfgit asfgit closed this in b7be05a Mar 24, 2017
@erenavsarogullari erenavsarogullari deleted the SPARK-19567 branch March 25, 2017 10:59
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.

8 participants