You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by dragos <gi...@git.apache.org> on 2015/09/08 14:06:51 UTC

[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

GitHub user dragos opened a pull request:

    https://github.com/apache/spark/pull/8653

    [SPARK-6350][Mesos] Fine-grained mode scheduler respects mesosExecutor.cores

    This is a regression introduced in #4960, this commit fixes it and adds a test.
    
    @tnachen @andrewor14 please review, this should be an easy one.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dragos/spark issue/mesos/fine-grained-maxExecutorCores

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/8653.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #8653
    
----
commit 5cd93439168bf3f95c53cbcdab288f03d4960c24
Author: Iulian Dragos <ja...@gmail.com>
Date:   2015-09-08T12:02:29Z

    Make the fine-grained mode scheduler respect
    spark.mesos.mesosExecutor.cores when launching Mesos executors (regression)

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by dragos <gi...@git.apache.org>.
Github user dragos commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138534010
  
    I'm working on another fix for SPARK-7874, and will remove some of the duplication in tests, but I wanted to keep this PR as simple as possible (in line with the trivial fix).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138536284
  
      [Test build #42132 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/42132/consoleFull) for   PR 8653 at commit [`5cd9343`](https://github.com/apache/spark/commit/5cd93439168bf3f95c53cbcdab288f03d4960c24).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138590518
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138835690
  
     Merged build triggered.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138885947
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138533670
  
    Merged build started.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by dragos <gi...@git.apache.org>.
Github user dragos commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-139136203
  
    Any committer wants to have a final look? It's a one-liner, but #8671 depends on this (currently I have an ignored test in there, pending this fix). /cc @andrewor14 (@srowen too, in case you have bandwidth..)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138885844
  
      [Test build #42197 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/42197/console) for   PR 8653 at commit [`03e8d0a`](https://github.com/apache/spark/commit/03e8d0a620301c0bfd2bbf21415f7d794da19603).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by tnachen <gi...@git.apache.org>.
Github user tnachen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8653#discussion_r39019047
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackendSuite.scala ---
    @@ -42,6 +42,38 @@ import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSui
     
     class MesosSchedulerBackendSuite extends SparkFunSuite with LocalSparkContext with MockitoSugar {
     
    +  test("Use configured mesosExecutor.cores for ExecutorInfo") {
    +    val mesosExecutorCores = 3
    +    val conf = new SparkConf
    +    conf.set("spark.mesos.mesosExecutor.cores", mesosExecutorCores.toString)
    +
    +    val listenerBus = mock[LiveListenerBus]
    +    listenerBus.post(
    +      SparkListenerExecutorAdded(anyLong, "s1", new ExecutorInfo("host1", 2, Map.empty)))
    +
    +    val sc = mock[SparkContext]
    +    when(sc.getSparkHome()).thenReturn(Option("/spark-home"))
    +
    +    when(sc.conf).thenReturn(conf)
    +    when(sc.executorEnvs).thenReturn(new mutable.HashMap[String, String])
    +    when(sc.executorMemory).thenReturn(100)
    +    when(sc.listenerBus).thenReturn(listenerBus)
    +    val taskScheduler = mock[TaskSchedulerImpl]
    +    when(taskScheduler.CPUS_PER_TASK).thenReturn(2)
    +
    +    val mesosSchedulerBackend = new MesosSchedulerBackend(taskScheduler, sc, "master")
    +
    +    val resources = Arrays.asList(
    +      mesosSchedulerBackend.createResource("cpus", 4),
    +      mesosSchedulerBackend.createResource("mem", 1024))
    +    // uri is null.
    +    val (executorInfo, _) = mesosSchedulerBackend.createExecutorInfo(resources, "test-id")
    +    val executorResources = executorInfo.getResourcesList
    +    val cpus = executorResources.asScala.find(_.getName == "cpus").get.getScalar.getValue
    --- End diff --
    
    I don't think it's really preferred, it's just how it's written in the first place. I suggest if you think it makes sense either keep it for now or change it everywhere else.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-139331580
  
    LGTM merging into master 1.5 thanks @dragos.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138590344
  
      [Test build #42132 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/42132/console) for   PR 8653 at commit [`5cd9343`](https://github.com/apache/spark/commit/5cd93439168bf3f95c53cbcdab288f03d4960c24).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/8653


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138835760
  
    Merged build started.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138885949
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/42197/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138590521
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/42132/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by tnachen <gi...@git.apache.org>.
Github user tnachen commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138819813
  
    Good catch! Indeed a regression... this PR LGTM @andrewor14 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by tnachen <gi...@git.apache.org>.
Github user tnachen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8653#discussion_r39018501
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackendSuite.scala ---
    @@ -42,6 +42,38 @@ import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSui
     
     class MesosSchedulerBackendSuite extends SparkFunSuite with LocalSparkContext with MockitoSugar {
     
    +  test("Use configured mesosExecutor.cores for ExecutorInfo") {
    +    val mesosExecutorCores = 3
    +    val conf = new SparkConf
    +    conf.set("spark.mesos.mesosExecutor.cores", mesosExecutorCores.toString)
    +
    +    val listenerBus = mock[LiveListenerBus]
    +    listenerBus.post(
    +      SparkListenerExecutorAdded(anyLong, "s1", new ExecutorInfo("host1", 2, Map.empty)))
    +
    +    val sc = mock[SparkContext]
    +    when(sc.getSparkHome()).thenReturn(Option("/spark-home"))
    +
    +    when(sc.conf).thenReturn(conf)
    +    when(sc.executorEnvs).thenReturn(new mutable.HashMap[String, String])
    +    when(sc.executorMemory).thenReturn(100)
    +    when(sc.listenerBus).thenReturn(listenerBus)
    +    val taskScheduler = mock[TaskSchedulerImpl]
    +    when(taskScheduler.CPUS_PER_TASK).thenReturn(2)
    +
    +    val mesosSchedulerBackend = new MesosSchedulerBackend(taskScheduler, sc, "master")
    +
    +    val resources = Arrays.asList(
    +      mesosSchedulerBackend.createResource("cpus", 4),
    +      mesosSchedulerBackend.createResource("mem", 1024))
    +    // uri is null.
    +    val (executorInfo, _) = mesosSchedulerBackend.createExecutorInfo(resources, "test-id")
    +    val executorResources = executorInfo.getResourcesList
    +    val cpus = executorResources.asScala.find(_.getName == "cpus").get.getScalar.getValue
    --- End diff --
    
    I just mean _.getName.equals("cpus") :) Not a big deal, just like to be consistent


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by tnachen <gi...@git.apache.org>.
Github user tnachen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8653#discussion_r39016695
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackendSuite.scala ---
    @@ -42,6 +42,38 @@ import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSui
     
     class MesosSchedulerBackendSuite extends SparkFunSuite with LocalSparkContext with MockitoSugar {
     
    +  test("Use configured mesosExecutor.cores for ExecutorInfo") {
    +    val mesosExecutorCores = 3
    +    val conf = new SparkConf
    +    conf.set("spark.mesos.mesosExecutor.cores", mesosExecutorCores.toString)
    +
    +    val listenerBus = mock[LiveListenerBus]
    +    listenerBus.post(
    +      SparkListenerExecutorAdded(anyLong, "s1", new ExecutorInfo("host1", 2, Map.empty)))
    +
    +    val sc = mock[SparkContext]
    +    when(sc.getSparkHome()).thenReturn(Option("/spark-home"))
    +
    +    when(sc.conf).thenReturn(conf)
    +    when(sc.executorEnvs).thenReturn(new mutable.HashMap[String, String])
    +    when(sc.executorMemory).thenReturn(100)
    +    when(sc.listenerBus).thenReturn(listenerBus)
    +    val taskScheduler = mock[TaskSchedulerImpl]
    +    when(taskScheduler.CPUS_PER_TASK).thenReturn(2)
    +
    +    val mesosSchedulerBackend = new MesosSchedulerBackend(taskScheduler, sc, "master")
    +
    +    val resources = Arrays.asList(
    +      mesosSchedulerBackend.createResource("cpus", 4),
    +      mesosSchedulerBackend.createResource("mem", 1024))
    +    // uri is null.
    +    val (executorInfo, _) = mesosSchedulerBackend.createExecutorInfo(resources, "test-id")
    +    val executorResources = executorInfo.getResourcesList
    +    val cpus = executorResources.asScala.find(_.getName == "cpus").get.getScalar.getValue
    --- End diff --
    
    I would prefer we use the same matching logic (equals) just to be consistent.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by dragos <gi...@git.apache.org>.
Github user dragos commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138813725
  
    /cc @skyluc, @nraychaudhuri 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by dragos <gi...@git.apache.org>.
Github user dragos commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8653#discussion_r39018872
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackendSuite.scala ---
    @@ -42,6 +42,38 @@ import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSui
     
     class MesosSchedulerBackendSuite extends SparkFunSuite with LocalSparkContext with MockitoSugar {
     
    +  test("Use configured mesosExecutor.cores for ExecutorInfo") {
    +    val mesosExecutorCores = 3
    +    val conf = new SparkConf
    +    conf.set("spark.mesos.mesosExecutor.cores", mesosExecutorCores.toString)
    +
    +    val listenerBus = mock[LiveListenerBus]
    +    listenerBus.post(
    +      SparkListenerExecutorAdded(anyLong, "s1", new ExecutorInfo("host1", 2, Map.empty)))
    +
    +    val sc = mock[SparkContext]
    +    when(sc.getSparkHome()).thenReturn(Option("/spark-home"))
    +
    +    when(sc.conf).thenReturn(conf)
    +    when(sc.executorEnvs).thenReturn(new mutable.HashMap[String, String])
    +    when(sc.executorMemory).thenReturn(100)
    +    when(sc.listenerBus).thenReturn(listenerBus)
    +    val taskScheduler = mock[TaskSchedulerImpl]
    +    when(taskScheduler.CPUS_PER_TASK).thenReturn(2)
    +
    +    val mesosSchedulerBackend = new MesosSchedulerBackend(taskScheduler, sc, "master")
    +
    +    val resources = Arrays.asList(
    +      mesosSchedulerBackend.createResource("cpus", 4),
    +      mesosSchedulerBackend.createResource("mem", 1024))
    +    // uri is null.
    +    val (executorInfo, _) = mesosSchedulerBackend.createExecutorInfo(resources, "test-id")
    +    val executorResources = executorInfo.getResourcesList
    +    val cpus = executorResources.asScala.find(_.getName == "cpus").get.getScalar.getValue
    --- End diff --
    
    Oh, I see. I can do that. Do you know why `equals` is preferred? `==` is safe w.r.t. to nulls, so we assume `getName` (and all other getters, like `getContainerPath`) never return `null`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138841033
  
      [Test build #42197 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/42197/consoleFull) for   PR 8653 at commit [`03e8d0a`](https://github.com/apache/spark/commit/03e8d0a620301c0bfd2bbf21415f7d794da19603).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by dragos <gi...@git.apache.org>.
Github user dragos commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8653#discussion_r39017281
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackendSuite.scala ---
    @@ -42,6 +42,38 @@ import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSui
     
     class MesosSchedulerBackendSuite extends SparkFunSuite with LocalSparkContext with MockitoSugar {
     
    +  test("Use configured mesosExecutor.cores for ExecutorInfo") {
    +    val mesosExecutorCores = 3
    +    val conf = new SparkConf
    +    conf.set("spark.mesos.mesosExecutor.cores", mesosExecutorCores.toString)
    +
    +    val listenerBus = mock[LiveListenerBus]
    +    listenerBus.post(
    +      SparkListenerExecutorAdded(anyLong, "s1", new ExecutorInfo("host1", 2, Map.empty)))
    +
    +    val sc = mock[SparkContext]
    +    when(sc.getSparkHome()).thenReturn(Option("/spark-home"))
    +
    +    when(sc.conf).thenReturn(conf)
    +    when(sc.executorEnvs).thenReturn(new mutable.HashMap[String, String])
    +    when(sc.executorMemory).thenReturn(100)
    +    when(sc.listenerBus).thenReturn(listenerBus)
    +    val taskScheduler = mock[TaskSchedulerImpl]
    +    when(taskScheduler.CPUS_PER_TASK).thenReturn(2)
    +
    +    val mesosSchedulerBackend = new MesosSchedulerBackend(taskScheduler, sc, "master")
    +
    +    val resources = Arrays.asList(
    +      mesosSchedulerBackend.createResource("cpus", 4),
    +      mesosSchedulerBackend.createResource("mem", 1024))
    +    // uri is null.
    +    val (executorInfo, _) = mesosSchedulerBackend.createExecutorInfo(resources, "test-id")
    +    val executorResources = executorInfo.getResourcesList
    +    val cpus = executorResources.asScala.find(_.getName == "cpus").get.getScalar.getValue
    --- End diff --
    
    You mean in the assertion below? Not sure what you mean (I think `===` offers a more detailed error message, but I am ok changing it to `==` if that's what you mean).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-6350][Mesos] Fine-grained mode schedule...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/8653#issuecomment-138533603
  
     Merged build triggered.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org