spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From squito <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-6707] [CORE][MESOS]: Mesos Scheduler sh...
Date Mon, 29 Jun 2015 17:39:13 GMT
Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5563#discussion_r33490121
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
---
    @@ -191,13 +194,29 @@ private[spark] class MesosSchedulerBackend(
             val mem = getResource(o.getResourcesList, "mem")
             val cpus = getResource(o.getResourcesList, "cpus")
             val slaveId = o.getSlaveId.getValue
    -        (mem >= MemoryUtils.calculateTotalMemory(sc) &&
    -          // need at least 1 for executor, 1 for task
    -          cpus >= (mesosExecutorCores + scheduler.CPUS_PER_TASK)) ||
    -          (slaveIdsWithExecutors.contains(slaveId) &&
    -            cpus >= scheduler.CPUS_PER_TASK)
    +        val offerAttributes = (o.getAttributesList map getAttribute).toMap
    +
    +        // check if all constraints are satisfield
    +        //  1. Attribute constraints
    +        //  2. Memory requirements
    +        //  3. CPU requirements - need at least 1 for executor, 1 for task
    +        val meetsConstrains = matchesAttributeRequirements(slaveOfferConstraints, offerAttributes)
    +        val meetsMemoryRequirements = mem >= calculateTotalMemory(sc)
    +        val meetsCPURequirements = cpus >= (mesosExecutorCores + scheduler.CPUS_PER_TASK)
    +
    +        val meetsRequirements = (meetsConstrains && meetsMemoryRequirements &&
meetsCPURequirements) ||
    +        (slaveIdsWithExecutors.contains(slaveId) && cpus >= scheduler.CPUS_PER_TASK)
    --- End diff --
    
    indent this line 2 spaces


---
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


Mime
View raw message