You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by an...@apache.org on 2016/02/12 23:57:33 UTC

spark git commit: [SPARK-5095] Fix style in mesos coarse grained scheduler code

Repository: spark
Updated Branches:
  refs/heads/master 42d656814 -> 38bc6018e


[SPARK-5095] Fix style in mesos coarse grained scheduler code

andrewor14 This addressed your style comments from #10993

Author: Michael Gummelt <mg...@mesosphere.io>

Closes #11187 from mgummelt/fix_mesos_style.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/38bc6018
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/38bc6018
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/38bc6018

Branch: refs/heads/master
Commit: 38bc6018e922877fdf43c90b24cc0438262eb157
Parents: 42d6568
Author: Michael Gummelt <mg...@mesosphere.io>
Authored: Fri Feb 12 14:57:31 2016 -0800
Committer: Andrew Or <an...@databricks.com>
Committed: Fri Feb 12 14:57:31 2016 -0800

----------------------------------------------------------------------
 .../cluster/mesos/CoarseMesosSchedulerBackend.scala     | 10 ++++++----
 .../mesos/CoarseMesosSchedulerBackendSuite.scala        | 12 ++++++------
 2 files changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/38bc6018/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala b/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
index 98699e0..f803cc7 100644
--- a/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
+++ b/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
@@ -124,6 +124,7 @@ private[spark] class CoarseMesosSchedulerBackend(
     }
   }
 
+  // This method is factored out for testability
   protected def getShuffleClient(): MesosExternalShuffleClient = {
     new MesosExternalShuffleClient(
       SparkTransportConf.fromSparkConf(conf, "shuffle"),
@@ -518,10 +519,11 @@ private[spark] class CoarseMesosSchedulerBackend(
    * Called when a slave is lost or a Mesos task finished. Updates local view on
    * what tasks are running. It also notifies the driver that an executor was removed.
    */
-  private def executorTerminated(d: SchedulerDriver,
-                                 slaveId: String,
-                                 taskId: String,
-                                 reason: String): Unit = {
+  private def executorTerminated(
+      d: SchedulerDriver,
+      slaveId: String,
+      taskId: String,
+      reason: String): Unit = {
     stateLock.synchronized {
       removeExecutor(taskId, SlaveLost(reason))
       slaves(slaveId).taskIDs.remove(taskId)

http://git-wip-us.apache.org/repos/asf/spark/blob/38bc6018/core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackendSuite.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackendSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackendSuite.scala
index e542aa0..5e01d95 100644
--- a/core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackendSuite.scala
+++ b/core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackendSuite.scala
@@ -41,12 +41,12 @@ class CoarseMesosSchedulerBackendSuite extends SparkFunSuite
     with MockitoSugar
     with BeforeAndAfter {
 
-  var sparkConf: SparkConf = _
-  var driver: SchedulerDriver = _
-  var taskScheduler: TaskSchedulerImpl = _
-  var backend: CoarseMesosSchedulerBackend = _
-  var externalShuffleClient: MesosExternalShuffleClient = _
-  var driverEndpoint: RpcEndpointRef = _
+  private var sparkConf: SparkConf = _
+  private var driver: SchedulerDriver = _
+  private var taskScheduler: TaskSchedulerImpl = _
+  private var backend: CoarseMesosSchedulerBackend = _
+  private var externalShuffleClient: MesosExternalShuffleClient = _
+  private var driverEndpoint: RpcEndpointRef = _
 
   test("mesos supports killing and limiting executors") {
     setBackend()


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