You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by ksakellis <gi...@git.apache.org> on 2014/12/16 10:04:17 UTC

[GitHub] spark pull request: [SPARK-4857] [CORE] Adds Executor membership e...

GitHub user ksakellis opened a pull request:

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

    [SPARK-4857] [CORE] Adds Executor membership events to SparkListener

    Adds onExecutorAdded and onExecutorRemoved events to the SparkListener. This will allow a client to get notified when an executor has been added/removed and provide additional information such as how many vcores it is consuming.
    
    In addition, this commit adds a SparkListenerAdapter to the Java API that provides default implementations to the SparkListener. This is to get around the fact that default implementations for traits don't work in Java. Having Java clients extend SparkListenerAdapter moving forward will prevent breakage in java when we add new events to SparkListener.

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

    $ git pull https://github.com/ksakellis/spark kostas-spark-4857

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

    https://github.com/apache/spark/pull/3711.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 #3711
    
----
commit b1f715d2c4c169bbc33175ea7984af22a7b941f8
Author: Kostas Sakellis <ko...@cloudera.com>
Date:   2014-12-16T08:55:01Z

    [SPARK-4857] [CORE] Adds Executor membership events to SparkListener
    
    Adds onExecutorAdded and onExecutorRemoved events to the
    SparkListener. This will allow a client to get notified when an
    executor has been added/removed and provide additional information
    such as how many vcores it is consuming.
    
    In addition, this commit adds a SparkListenerAdapter to the
    Java API that provides default implementations to the SparkListener.
    This is to get around the fact that default implementations for
    traits don't work in Java. Having Java clients extend
    SparkListenerAdapter moving forward will prevent breakage in java
    when we add new events to SparkListener.

----


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-67130472
  
      [Test build #24494 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24494/consoleFull) for   PR 3711 at commit [`b1f715d`](https://github.com/apache/spark/commit/b1f715d2c4c169bbc33175ea7984af22a7b941f8).
     * This patch merges cleanly.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-67991815
  
    Hi @ksakellis,
    
    This PR has some nice additions and looks pretty good overall.  In particular, I like the addition of the `SparkListenerAdapter` class, since it's a nice way of shielding Java users from binary incompatbility when we add things to SparkListener (this isn't an issue for Scala implementors of SparkListener, since they inherit default implementations from the trait).  Good call on making it non-abstract, by the way.
    
    I have one main piece of feedback:  I think we need to add these new events to JSONProtocol / JSONProtocolSuite so that they're properly persisted in the event log.  I think there's a bunch of examples of this in the code, so this should be fairly straightforward.  You may end up having to write JSON serializers for ExecutorInfo.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22139204
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/ExecutorInfo.scala ---
    @@ -0,0 +1,29 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.scheduler.cluster
    +
    +import org.apache.spark.annotation.DeveloperApi
    +
    +/**
    + * :: DeveloperApi ::
    + * Stores information about an executor to pass from the scheduler to SparkListeners.
    + */
    +@DeveloperApi
    +class ExecutorInfo(
    +   val executorHost: String,
    +   val totalCores: Int
    +)
    --- End diff --
    
    Why do we need this class? Why not just store it in the events themselves?


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68781542
  
      [Test build #25061 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25061/consoleFull) for   PR 3711 at commit [`7b64ea0`](https://github.com/apache/spark/commit/7b64ea01b9e531c82b3148d3b6ac7e69471fe496).
     * This patch merges cleanly.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22779931
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala ---
    @@ -213,6 +216,7 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val actorSyste
               totalCoreCount.addAndGet(-executorInfo.totalCores)
               totalRegisteredExecutors.addAndGet(-1)
               scheduler.executorLost(executorId, SlaveLost(reason))
    +          listenerBus.post(SparkListenerExecutorRemoved(executorId))
    --- End diff --
    
    Any reason why we are doing this here instead of in "executorLost" method of DAGScheduler.scala ? (similarly for SparkListenerExecutorAdded event above)


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22495870
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala ---
    @@ -106,6 +108,7 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val actorSyste
                   logDebug(s"Decremented number of pending executors ($numPendingExecutors left)")
                 }
               }
    +          listenerBus.post(SparkListenerExecutorAdded(executorId, data))
    --- End diff --
    
    Don't we need to do the equivalent in `MesosSchedulerBackend`?


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69110079
  
    Left a few relatively minor comments. Otherwise this LGTM.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22679008
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala ---
    @@ -160,7 +160,7 @@ class EventLoggingListenerSuite extends FunSuite with BeforeAndAfter with Loggin
        */
       private def testApplicationEventLogging(compressionCodec: Option[String] = None) {
         val conf = getLoggingConf(testDirPath, compressionCodec)
    -    val sc = new SparkContext("local", "test", conf)
    +    val sc = new SparkContext("local-cluster[2,2,512]", "test", conf)
    --- End diff --
    
    Instead of making this into an integration test (the `local-cluster` mode is pretty expensive) could you modify `LocalBackend` to send an executor added event? Then you can still test with `local` mode, and also there will be less of an overall difference between the local and the cluster modes.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22366788
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala ---
    @@ -84,6 +86,14 @@ case class SparkListenerBlockManagerRemoved(time: Long, blockManagerId: BlockMan
     @DeveloperApi
     case class SparkListenerUnpersistRDD(rddId: Int) extends SparkListenerEvent
     
    +@DeveloperApi
    +case class SparkListenerExecutorAdded(executorId: String, executorInfo : ExecutorInfo)
    --- End diff --
    
    We could adopt a "no new case classes" policy but we loose consistency. I'm not sure what is more important in this API. 


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69538284
  
    LGTM - just had a minor comment that can also be addressed on merge. Jenkins, test this please.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22195578
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/ExecutorInfo.scala ---
    @@ -0,0 +1,29 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.scheduler.cluster
    +
    +import org.apache.spark.annotation.DeveloperApi
    +
    +/**
    + * :: DeveloperApi ::
    + * Stores information about an executor to pass from the scheduler to SparkListeners.
    + */
    +@DeveloperApi
    +class ExecutorInfo(
    +   val executorHost: String,
    +   val totalCores: Int
    +)
    --- End diff --
    
    This was so that we can keep the ExeuctorInfo for the internal akka message and the SparkListener in sync. The parent class, ExecutorInfo, contains all the info we want to share with the SparkListener and others and the ExecutorData child class add additional information like the akka address that should not be exposed. Adding this info to the events themselves is possible but we will lead to duplication. 


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22624632
  
    --- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala ---
    @@ -362,6 +378,10 @@ private[spark] object JsonProtocol {
         ("Disk Size" -> blockStatus.diskSize)
       }
     
    +  def executorInfoToJson(executorDetails: ExecutorDetails): JValue = {
    --- End diff --
    
    these should be `executorDetailsToJson`


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-67143165
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24496/
    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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22237608
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala ---
    @@ -84,6 +86,14 @@ case class SparkListenerBlockManagerRemoved(time: Long, blockManagerId: BlockMan
     @DeveloperApi
     case class SparkListenerUnpersistRDD(rddId: Int) extends SparkListenerEvent
     
    +@DeveloperApi
    +case class SparkListenerExecutorAdded(executorId: String, executorInfo : ExecutorInfo)
    +  extends SparkListenerEvent
    +
    +@DeveloperApi
    +case class SparkListenerExecutorRemoved(executorId: String, executorInfo : ExecutorInfo)
    --- End diff --
    
    To re-iterate a style comment from Andrew: our style is to not place spaces before `:`, so this should be `executorInfo: ExecutorInfo`.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22777939
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala ---
    @@ -344,12 +354,20 @@ private[spark] class MesosSchedulerBackend(
     
       override def frameworkMessage(d: SchedulerDriver, e: ExecutorID, s: SlaveID, b: Array[Byte]) {}
     
    +  /**
    +   * Remove executor associated with slaveId in a thread safe manner.
    +   */
    +  private def removeExecutor(slaveId: String) = {
    +    synchronized {
    --- End diff --
    
    Gotcha, can you just add a TODO in the comment saying to review the sychronization?


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22231382
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala ---
    @@ -109,7 +119,8 @@ private[spark] case object SparkListenerShutdown extends SparkListenerEvent
     /**
      * :: DeveloperApi ::
      * Interface for listening to events from the Spark scheduler. Note that this is an internal
    - * interface which might change in different Spark releases.
    + * interface which might change in different Spark releases. Java clients should extend
    + * {@link SparkListenerAdapter}
    --- End diff --
    
    Do you think that we should add a more explicit note regarding binary compatibility?  Doesn't have to be part of this PR necessarily.


---
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-4857] [CORE] Adds Executor membership e...

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

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


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68790195
  
      [Test build #25061 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25061/consoleFull) for   PR 3711 at commit [`7b64ea0`](https://github.com/apache/spark/commit/7b64ea01b9e531c82b3148d3b6ac7e69471fe496).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `public class SparkListenerAdapter implements SparkListener `
      * `case class SparkListenerExecutorAdded(executorId: String, executorDetails: ExecutorDetails)`
      * `case class SparkListenerExecutorRemoved(executorId: String, executorDetails: ExecutorDetails)`
      * `class ExecutorDetails(`



---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22624112
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/ExecutorDetails.scala ---
    @@ -0,0 +1,29 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.scheduler.cluster
    +
    +import org.apache.spark.annotation.DeveloperApi
    +
    +/**
    + * :: DeveloperApi ::
    + * Stores information about an executor to pass from the scheduler to SparkListeners.
    + */
    +@DeveloperApi
    +class ExecutorDetails(
    --- End diff --
    
    There's already an `ExecutorInfo` somewhere else. @ksakellis actually renamed this class to `ExecutorDetails` because of the naming conflict.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68788875
  
    Yes it is. Not sure why I changed the #of cores between the two commits in the unit test - weird. Anyways. it has been fixed.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69623494
  
    Actually, why not add these in the DAG Scheduler per @nitin2goyal's suggestion.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22627136
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala ---
    @@ -84,6 +85,14 @@ case class SparkListenerBlockManagerRemoved(time: Long, blockManagerId: BlockMan
     @DeveloperApi
     case class SparkListenerUnpersistRDD(rddId: Int) extends SparkListenerEvent
     
    +@DeveloperApi
    +case class SparkListenerExecutorAdded(executorId: String, executorDetails: ExecutorDetails)
    +  extends SparkListenerEvent
    +
    +@DeveloperApi
    +case class SparkListenerExecutorRemoved(executorId: String, executorDetails: ExecutorDetails)
    --- End diff --
    
    It's just kind of weird that you can't remove an executor without having full information about it. I think it's reasonable to expect the caller to listen for both the add and remove events.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69804537
  
    @pwendell @nitin2goyal I had previously thought of adding it to the DAGScheduler - this would avoid the duplicated code between the CoarseGrainedSchedulerBackend and MesosSchedulerBackend. The reason I did not go with this approach is two fold:
    a)  Not enough information is available in the the DAGScheduler (don't know the core count). This is more minor and can be added to the callbacks.
    b) More importantly, the code path from CoarseGrainedScheduler.resourceOffers->TaskSchedulerImpl.resourceOffers->DAGScheduler.executorAdded happens *before* the executor actually registers with the scheduler backed. I wanted the events to be published *after* the executor registers via the Akka event.
    
    The consequence is that the events are generated at a lower level but I think they are more accurate. Thoughts? I'd really like to get this merged so that it can unblock: https://github.com/apache/spark/pull/3486 (Yarn links in UI) which i think is pretty important for usability. 


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69543929
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25406/
    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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22624199
  
    --- Diff: core/src/main/java/org/apache/spark/SparkListenerAdapter.java ---
    @@ -0,0 +1,97 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark;
    +
    +import org.apache.spark.scheduler.SparkListener;
    +import org.apache.spark.scheduler.SparkListenerApplicationEnd;
    +import org.apache.spark.scheduler.SparkListenerApplicationStart;
    +import org.apache.spark.scheduler.SparkListenerBlockManagerAdded;
    +import org.apache.spark.scheduler.SparkListenerBlockManagerRemoved;
    +import org.apache.spark.scheduler.SparkListenerEnvironmentUpdate;
    +import org.apache.spark.scheduler.SparkListenerExecutorAdded;
    +import org.apache.spark.scheduler.SparkListenerExecutorMetricsUpdate;
    +import org.apache.spark.scheduler.SparkListenerExecutorRemoved;
    +import org.apache.spark.scheduler.SparkListenerJobEnd;
    +import org.apache.spark.scheduler.SparkListenerJobStart;
    +import org.apache.spark.scheduler.SparkListenerStageCompleted;
    +import org.apache.spark.scheduler.SparkListenerStageSubmitted;
    +import org.apache.spark.scheduler.SparkListenerTaskEnd;
    +import org.apache.spark.scheduler.SparkListenerTaskGettingResult;
    +import org.apache.spark.scheduler.SparkListenerTaskStart;
    +import org.apache.spark.scheduler.SparkListenerUnpersistRDD;
    +
    +/**
    + * Java clients should extend this class instead of implementing
    + * SparkListener directly. This is to prevent java clients
    + * from breaking when new events are added to the SparkListener
    + * trait.
    + *
    + * This is a concrete class instead of abstract to enforce
    + * new events get added to both the SparkListener and this adapter
    + * in lockstep.
    + */
    +public class SparkListenerAdapter implements SparkListener {
    --- End diff --
    
    +1 on `JavaSparkListener`. It's weird for the user to extend an "adapter"


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22680915
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala ---
    @@ -160,7 +160,7 @@ class EventLoggingListenerSuite extends FunSuite with BeforeAndAfter with Loggin
        */
       private def testApplicationEventLogging(compressionCodec: Option[String] = None) {
         val conf = getLoggingConf(testDirPath, compressionCodec)
    -    val sc = new SparkContext("local", "test", conf)
    +    val sc = new SparkContext("local-cluster[2,2,512]", "test", conf)
    --- End diff --
    
    Yes we can, but then that is not really testing much is it. The point of this test was to test that we are getting the onExecutorAdded event when an executor is added to the cluster. Modifying the LocalBacked to publish these events will greatly(in my opinion) reduce the usefulness of the test. We'd only be testing some of the SparkListener plumbing and not the actual creation of the events. 


---
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-4857] [CORE] Adds Executor membership e...

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

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


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68798867
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25065/
    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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68798860
  
      [Test build #25065 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25065/consoleFull) for   PR 3711 at commit [`776d743`](https://github.com/apache/spark/commit/776d743c16cf3506b5c26983836c90066c365ee7).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `public class SparkListenerAdapter implements SparkListener `
      * `case class SparkListenerExecutorAdded(executorId: String, executorDetails: ExecutorDetails)`
      * `case class SparkListenerExecutorRemoved(executorId: String, executorDetails: ExecutorDetails)`
      * `class ExecutorDetails(`



---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68796368
  
    I had some minor comments around naming, but overall this looks good.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22366699
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/ExecutorInfo.scala ---
    @@ -0,0 +1,29 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.scheduler.cluster
    +
    +import org.apache.spark.annotation.DeveloperApi
    +
    +/**
    + * :: DeveloperApi ::
    + * Stores information about an executor to pass from the scheduler to SparkListeners.
    + */
    +@DeveloperApi
    +class ExecutorInfo(
    +   val executorHost: String,
    +   val totalCores: Int
    +)
    --- End diff --
    
    @JoshRosen yes, we should probably make it a trait/interface instead of a class. I'll try and pick a better name than ExecutorInfo. I was trying to follow the TaskInfo pattern but yes it might be confusing since there is another class named ExecutorInfo.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22237639
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/SparkListenerWithClusterSuite.scala ---
    @@ -0,0 +1,62 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.scheduler
    +
    +import org.apache.spark.scheduler.cluster.ExecutorInfo
    +import org.apache.spark.{SparkContext, LocalSparkContext}
    +
    +import org.scalatest.{FunSuite, BeforeAndAfter, BeforeAndAfterAll}
    +
    +import scala.collection.mutable
    +
    +/**
    + * Unit tests for SparkListener that require a local cluster.
    + */
    +class SparkListenerWithClusterSuite extends FunSuite with LocalSparkContext
    +  with BeforeAndAfter with BeforeAndAfterAll {
    +
    +  /** Length of time to wait while draining listener events. */
    +  val WAIT_TIMEOUT_MILLIS = 10000
    +
    +  before {
    +    sc = new SparkContext("local-cluster[2,1,512]", "SparkListenerSuite")
    +  }
    +
    +  test("SparkListener sends executor added message") {
    +    val listener = new SaveExecutorInfo
    +    sc.addSparkListener(listener)
    +
    +    val rdd1 = sc.parallelize(1 to 100, 4)
    +    val rdd2 = rdd1.map(_.toString)
    +    rdd2.setName("Target RDD")
    +    rdd2.count()
    +
    +    assert(sc.listenerBus.waitUntilEmpty(WAIT_TIMEOUT_MILLIS))
    +    assert(listener.addedExecutorInfos.size == 2)
    +    assert(listener.addedExecutorInfos("0").totalCores == 1)
    +    assert(listener.addedExecutorInfos("1").totalCores == 1)
    +  }
    +
    +  private class SaveExecutorInfo extends SparkListener {
    +    val addedExecutorInfos = mutable.Map[String, ExecutorInfo]()
    +
    +    override def onExecutorAdded(executor : SparkListenerExecutorAdded) {
    --- End diff --
    
    Same "no space before `:`" style nit here, too, as long as you're updating things.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22624324
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala ---
    @@ -84,6 +85,14 @@ case class SparkListenerBlockManagerRemoved(time: Long, blockManagerId: BlockMan
     @DeveloperApi
     case class SparkListenerUnpersistRDD(rddId: Int) extends SparkListenerEvent
     
    +@DeveloperApi
    +case class SparkListenerExecutorAdded(executorId: String, executorDetails: ExecutorDetails)
    +  extends SparkListenerEvent
    +
    +@DeveloperApi
    +case class SparkListenerExecutorRemoved(executorId: String, executorDetails: ExecutorDetails)
    --- End diff --
    
    does the executor removed event need to contain executor details? The listener already listens for executor added events, which contain the same details


---
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-4857] [CORE] Adds Executor membership e...

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

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


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22231531
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/ExecutorInfo.scala ---
    @@ -0,0 +1,29 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.scheduler.cluster
    +
    +import org.apache.spark.annotation.DeveloperApi
    +
    +/**
    + * :: DeveloperApi ::
    + * Stores information about an executor to pass from the scheduler to SparkListeners.
    + */
    +@DeveloperApi
    +class ExecutorInfo(
    +   val executorHost: String,
    +   val totalCores: Int
    +)
    --- End diff --
    
    Do you think that this should be a trait/interface rather than a class?


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22681441
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala ---
    @@ -344,12 +354,20 @@ private[spark] class MesosSchedulerBackend(
     
       override def frameworkMessage(d: SchedulerDriver, e: ExecutorID, s: SlaveID, b: Array[Byte]) {}
     
    +  /**
    +   * Remove executor associated with slaveId in a thread safe manner.
    +   */
    +  private def removeExecutor(slaveId: String) = {
    +    synchronized {
    --- End diff --
    
    Yes, it is non-consistent. The synchronized block was just carried over from the previous code. We could probably use SynchronizedSet to prevent concurrentmodification exceptions. There is a synchronized {} in statusUpdate to try to ensure atomicity modifying slaveIdsWithExecutors and taskIdToSlaveId but that isn't enough since slaveIdsWithExecutors is modified in a number of places.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68778757
  
    @JoshRosen I actually couldn't make ExecutorInfo (now ExecutorDetails) a trait because the json protocol stuff requires a concrete object to deserialize events. The other option is to keep ExecutorDetails a trait and create a third object as a concrete implementation but that seemed to add unnecessary complexity. 


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22495242
  
    --- Diff: core/src/main/java/org/apache/spark/SparkListenerAdapter.java ---
    @@ -0,0 +1,97 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark;
    +
    +import org.apache.spark.scheduler.SparkListener;
    +import org.apache.spark.scheduler.SparkListenerApplicationEnd;
    +import org.apache.spark.scheduler.SparkListenerApplicationStart;
    +import org.apache.spark.scheduler.SparkListenerBlockManagerAdded;
    +import org.apache.spark.scheduler.SparkListenerBlockManagerRemoved;
    +import org.apache.spark.scheduler.SparkListenerEnvironmentUpdate;
    +import org.apache.spark.scheduler.SparkListenerExecutorAdded;
    +import org.apache.spark.scheduler.SparkListenerExecutorMetricsUpdate;
    +import org.apache.spark.scheduler.SparkListenerExecutorRemoved;
    +import org.apache.spark.scheduler.SparkListenerJobEnd;
    +import org.apache.spark.scheduler.SparkListenerJobStart;
    +import org.apache.spark.scheduler.SparkListenerStageCompleted;
    +import org.apache.spark.scheduler.SparkListenerStageSubmitted;
    +import org.apache.spark.scheduler.SparkListenerTaskEnd;
    +import org.apache.spark.scheduler.SparkListenerTaskGettingResult;
    +import org.apache.spark.scheduler.SparkListenerTaskStart;
    +import org.apache.spark.scheduler.SparkListenerUnpersistRDD;
    +
    +/**
    + * Java clients should extend this class instead of implementing
    + * SparkListener directly. This is to prevent java clients
    + * from breaking when new events are added to the SparkListener
    + * trait.
    + *
    + * This is a concrete class instead of abstract to enforce
    + * new events get added to both the SparkListener and this adapter
    + * in lockstep.
    + */
    +public class SparkListenerAdapter implements SparkListener {
    --- End diff --
    
    What about calling this `JavaSparkListener` - that's what we've tended to use in the past for things that were supposed to be "drop in" substitutes for Scala 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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22624775
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala ---
    @@ -84,6 +85,14 @@ case class SparkListenerBlockManagerRemoved(time: Long, blockManagerId: BlockMan
     @DeveloperApi
     case class SparkListenerUnpersistRDD(rddId: Int) extends SparkListenerEvent
     
    +@DeveloperApi
    +case class SparkListenerExecutorAdded(executorId: String, executorDetails: ExecutorDetails)
    +  extends SparkListenerEvent
    +
    +@DeveloperApi
    +case class SparkListenerExecutorRemoved(executorId: String, executorDetails: ExecutorDetails)
    --- End diff --
    
    This makes the event more self describing. Otherwise you'd need to also listen on the executorAdded event, have a hashmap then look it up in the executor removed method to find the details. 
    
    That being said, I don't really feel that strongly so we can remove the executorDetails structure if you are concerned. 


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69538514
  
      [Test build #25406 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25406/consoleFull) for   PR 3711 at commit [`946d2c5`](https://github.com/apache/spark/commit/946d2c52f0e1db32c4a041b2f62e8b0a71fd9fec).
     * This patch merges cleanly.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22231341
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala ---
    @@ -84,6 +86,14 @@ case class SparkListenerBlockManagerRemoved(time: Long, blockManagerId: BlockMan
     @DeveloperApi
     case class SparkListenerUnpersistRDD(rddId: Int) extends SparkListenerEvent
     
    +@DeveloperApi
    +case class SparkListenerExecutorAdded(executorId: String, executorInfo : ExecutorInfo)
    --- End diff --
    
    I'm on the fence about whether this should be a case class or a regular class.  If it's a case class, then Scala users can pattern-match on it, but we risk introducing binary incompatibilities if we ever need to add new fields to this event.  If we had to re-do the SparkListener API, I'd probably opt to not use case classes for this reason.  In light of this, do you think we should we adopt a "no new cases classes" policy for new listener events?


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69216849
  
    Ok, latest changes look fine to me. Any other comments @pwendell @JoshRosen?


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22679665
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala ---
    @@ -344,12 +354,20 @@ private[spark] class MesosSchedulerBackend(
     
       override def frameworkMessage(d: SchedulerDriver, e: ExecutorID, s: SlaveID, b: Array[Byte]) {}
     
    +  /**
    +   * Remove executor associated with slaveId in a thread safe manner.
    +   */
    +  private def removeExecutor(slaveId: String) = {
    +    synchronized {
    --- End diff --
    
    Can you explain a bit what this synchronization is trying to protect? I did a small audit of this class and I found the synchronization is a bit all over the place. For instance we don't seem to hold any locks when adding to `slaveIdsWithExecutors` but we do hold a lock when removing from it. Seems a bit odd.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22624645
  
    --- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala ---
    @@ -745,6 +780,11 @@ private[spark] object JsonProtocol {
         BlockStatus(storageLevel, memorySize, diskSize, tachyonSize)
       }
     
    +  def executorInfoFromJson(json: JValue): ExecutorDetails = {
    --- End diff --
    
    `executorDetailsFromJson`


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68789356
  
      [Test build #25065 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25065/consoleFull) for   PR 3711 at commit [`776d743`](https://github.com/apache/spark/commit/776d743c16cf3506b5c26983836c90066c365ee7).
     * This patch merges cleanly.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22237848
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/ExecutorInfo.scala ---
    @@ -0,0 +1,29 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.scheduler.cluster
    +
    +import org.apache.spark.annotation.DeveloperApi
    +
    +/**
    + * :: DeveloperApi ::
    + * Stores information about an executor to pass from the scheduler to SparkListeners.
    + */
    +@DeveloperApi
    +class ExecutorInfo(
    +   val executorHost: String,
    +   val totalCores: Int
    +)
    --- End diff --
    
    Actually, I'll second @andrewor14's comment from the other PR: I think that the ExecutorInfo name might be potentially confusing since we already have an internal ExecutorInfo class.  So, if you think of a better name maybe we could change it.
    
    @andrewor14 Regarding whether we should have a separate class or not, you could imagine that the web UI might want to store some information on executors for later display / lookup.  By storing the executor info outside of the message, we can just store the ExecutorInfo class.  If the fields were part of the event, then we'd have to store the events themselves or re-pack the data into some new class that would be essentially the same as this.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-67133566
  
      [Test build #24496 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24496/consoleFull) for   PR 3711 at commit [`ab2575f`](https://github.com/apache/spark/commit/ab2575fa917c59c3ae7c18342dccf009507e22a4).
     * This patch merges cleanly.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69126633
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25188/
    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-4857] [CORE] Adds Executor membership e...

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

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


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22495998
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/ExecutorDetails.scala ---
    @@ -0,0 +1,29 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.scheduler.cluster
    +
    +import org.apache.spark.annotation.DeveloperApi
    +
    +/**
    + * :: DeveloperApi ::
    + * Stores information about an executor to pass from the scheduler to SparkListeners.
    + */
    +@DeveloperApi
    +class ExecutorDetails(
    --- End diff --
    
    Should this be `ExecutorInfo`, consistent with `TaskInfo` and `StageInfo`, etc?


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22811962
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala ---
    @@ -213,6 +216,7 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val actorSyste
               totalCoreCount.addAndGet(-executorInfo.totalCores)
               totalRegisteredExecutors.addAndGet(-1)
               scheduler.executorLost(executorId, SlaveLost(reason))
    +          listenerBus.post(SparkListenerExecutorRemoved(executorId))
    --- End diff --
    
    @ksakellis that seems like a good idea actually.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68779123
  
      [Test build #25060 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25060/consoleFull) for   PR 3711 at commit [`6e06a79`](https://github.com/apache/spark/commit/6e06a79c8511ea71182e131ac2a3924aa60f1153).
     * This patch merges cleanly.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69126629
  
      [Test build #25188 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25188/consoleFull) for   PR 3711 at commit [`946d2c5`](https://github.com/apache/spark/commit/946d2c52f0e1db32c4a041b2f62e8b0a71fd9fec).
     * 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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22231207
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala ---
    @@ -19,6 +19,8 @@ package org.apache.spark.scheduler
     
     import java.util.Properties
     
    +import org.apache.spark.scheduler.cluster.ExecutorInfo
    --- End diff --
    
    I hate to nitpick about this, but I think that this should be grouped with the other Spark imports in the next section.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22832694
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala ---
    @@ -344,12 +354,20 @@ private[spark] class MesosSchedulerBackend(
     
       override def frameworkMessage(d: SchedulerDriver, e: ExecutorID, s: SlaveID, b: Array[Byte]) {}
     
    +  /**
    +   * Remove executor associated with slaveId in a thread safe manner.
    +   */
    +  private def removeExecutor(slaveId: String) = {
    +    synchronized {
    --- End diff --
    
    In MesosSchedulerBackend there shouldn't be any need for synchornization. Mesos scheduler driver is built on libprocess and it gurantees one thread executing a message at a time.
    Coarse mesos scheduler backend needs to synchronize since the instance is shared.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-67130479
  
      [Test build #24494 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24494/consoleFull) for   PR 3711 at commit [`b1f715d`](https://github.com/apache/spark/commit/b1f715d2c4c169bbc33175ea7984af22a7b941f8).
     * This patch **fails RAT tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `public class SparkListenerAdapter implements SparkListener `
      * `case class SparkListenerExecutorAdded(executorId: String, executorInfo : ExecutorInfo)`
      * `case class SparkListenerExecutorRemoved(executorId: String, executorInfo : ExecutorInfo)`
      * `class ExecutorInfo(`



---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68787217
  
      [Test build #25060 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25060/consoleFull) for   PR 3711 at commit [`6e06a79`](https://github.com/apache/spark/commit/6e06a79c8511ea71182e131ac2a3924aa60f1153).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `public class SparkListenerAdapter implements SparkListener `
      * `case class SparkListenerExecutorAdded(executorId: String, executorDetails: ExecutorDetails)`
      * `case class SparkListenerExecutorRemoved(executorId: String, executorDetails: ExecutorDetails)`
      * `class ExecutorDetails(`



---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-68787824
  
    This looks like a legitimate test failure.  Ther AMPLab webserver is having some issues today, so here's a different link to reach the same test result: https://hadrian.ist.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25060/testReport/


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-67143159
  
      [Test build #24496 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24496/consoleFull) for   PR 3711 at commit [`ab2575f`](https://github.com/apache/spark/commit/ab2575fa917c59c3ae7c18342dccf009507e22a4).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `public class SparkListenerAdapter implements SparkListener `
      * `case class SparkListenerExecutorAdded(executorId: String, executorInfo : ExecutorInfo)`
      * `case class SparkListenerExecutorRemoved(executorId: String, executorInfo : ExecutorInfo)`
      * `class ExecutorInfo(`



---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69543920
  
      [Test build #25406 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25406/consoleFull) for   PR 3711 at commit [`946d2c5`](https://github.com/apache/spark/commit/946d2c52f0e1db32c4a041b2f62e8b0a71fd9fec).
     * 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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#discussion_r22633647
  
    --- Diff: core/src/main/java/org/apache/spark/SparkListenerAdapter.java ---
    @@ -0,0 +1,97 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark;
    +
    +import org.apache.spark.scheduler.SparkListener;
    +import org.apache.spark.scheduler.SparkListenerApplicationEnd;
    +import org.apache.spark.scheduler.SparkListenerApplicationStart;
    +import org.apache.spark.scheduler.SparkListenerBlockManagerAdded;
    +import org.apache.spark.scheduler.SparkListenerBlockManagerRemoved;
    +import org.apache.spark.scheduler.SparkListenerEnvironmentUpdate;
    +import org.apache.spark.scheduler.SparkListenerExecutorAdded;
    +import org.apache.spark.scheduler.SparkListenerExecutorMetricsUpdate;
    +import org.apache.spark.scheduler.SparkListenerExecutorRemoved;
    +import org.apache.spark.scheduler.SparkListenerJobEnd;
    +import org.apache.spark.scheduler.SparkListenerJobStart;
    +import org.apache.spark.scheduler.SparkListenerStageCompleted;
    +import org.apache.spark.scheduler.SparkListenerStageSubmitted;
    +import org.apache.spark.scheduler.SparkListenerTaskEnd;
    +import org.apache.spark.scheduler.SparkListenerTaskGettingResult;
    +import org.apache.spark.scheduler.SparkListenerTaskStart;
    +import org.apache.spark.scheduler.SparkListenerUnpersistRDD;
    +
    +/**
    + * Java clients should extend this class instead of implementing
    + * SparkListener directly. This is to prevent java clients
    + * from breaking when new events are added to the SparkListener
    + * trait.
    + *
    + * This is a concrete class instead of abstract to enforce
    + * new events get added to both the SparkListener and this adapter
    + * in lockstep.
    + */
    +public class SparkListenerAdapter implements SparkListener {
    --- End diff --
    
    Just for completeness (since I suggested the original name), listener/adapter is used extensively in the Java API (see `java.awt.event`, for example). An adapter is just a default implementation of a listener in Java-ese.


---
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-4857] [CORE] Adds Executor membership e...

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

    https://github.com/apache/spark/pull/3711#issuecomment-69120909
  
      [Test build #25188 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25188/consoleFull) for   PR 3711 at commit [`946d2c5`](https://github.com/apache/spark/commit/946d2c52f0e1db32c4a041b2f62e8b0a71fd9fec).
     * This patch merges cleanly.


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