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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

GitHub user ScrapCodes opened a pull request:

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

    SPARK-1830 Deploy failover, Make Persistence engine and LeaderAgent Pluggable

    

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

    $ git pull https://github.com/ScrapCodes/spark-1 deploy-failover-pluggable

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

    https://github.com/apache/spark/pull/771.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 #771
    
----
commit edf795ec2a79b66aecf3cdf1c7f07f5817f3c266
Author: Prashant Sharma <pr...@imaginea.com>
Date:   2014-05-14T12:16:01Z

    SPARK-1830 Deploy failover, Make Persistence engine and LeaderAgent Pluggable.

----


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45209507
  
     Merged build triggered. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-59919143
  
      [QA tests have started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/21990/consoleFull) for   PR 771 at commit [`d2a1c62`](https://github.com/apache/spark/commit/d2a1c622ddc8e05d18bc5e18da671a56da4937f1).
     * 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-59927776
  
      [QA tests have finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/21990/consoleFull) for   PR 771 at commit [`d2a1c62`](https://github.com/apache/spark/commit/d2a1c622ddc8e05d18bc5e18da671a56da4937f1).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ApplicationInfo(`
      * `class DriverInfo(`
      * `trait LeaderElectionAgent `
      * `trait LeaderElectable `
      * `trait PersistenceEngine `
      * `abstract class StandaloneRecoveryModeFactory(conf: SparkConf) `
      * `class WorkerInfo(`



---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r19162159
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/ApplicationInfo.scala ---
    @@ -24,9 +24,11 @@ import scala.collection.mutable.ArrayBuffer
     
     import akka.actor.ActorRef
     
    +import org.apache.spark.annotation.DeveloperApi
     import org.apache.spark.deploy.ApplicationDescription
     
    -private[spark] class ApplicationInfo(
    +@DeveloperApi
    --- End diff --
    
    I think we can make these private[spark] again



---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-60055292
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22030/
    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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-59026836
  
    I just read your proposal, somehow this update was missed by me. Forgive me for a late reply, your proposal appears to be good. I will take a stab at it soon and report back.


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r17858945
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/RecoveryModeFactory.scala ---
    @@ -0,0 +1,47 @@
    +/*
    + * 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.deploy.master
    +
    +import org.apache.spark.SparkConf
    +import org.apache.spark.annotation.DeveloperApi
    +import org.apache.spark.serializer.JavaSerializer
    +
    +@DeveloperApi
    +abstract class StandaloneRecoveryModeFactory(conf: SparkConf) {
    +  def createPersistenceEngine(): PersistenceEngine
    +
    +  def createLeaderElectionAgent(master: LeaderElectable): LeaderElectionAgent
    +}
    +
    +private[spark] class FileSystemRecoveryModeFactory(conf: SparkConf)
    --- End diff --
    
    Maybe add a comment here explaining that the election agent is still a no-op for this recovery mode.


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-57271768
  
    Because they were private spark. It is very inconvenient for someone to write his/her own recovery mode with all that private spark. + This felt like developer facing API so putting those annotations seemed appropriate. What is you opinion on 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r18204443
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/FileSystemPersistenceEngine.scala ---
    @@ -79,11 +80,9 @@ private[spark] class FileSystemPersistenceEngine(
         val created = file.createNewFile()
         if (!created) { throw new IllegalStateException("Could not create file: " + file) }
     
    -    val serializer = serialization.findSerializerFor(value)
    -    val serialized = serializer.toBinary(value)
    -
    +    val serialized = serializer.serialize(value)
         val out = new FileOutputStream(file)
    -    out.write(serialized)
    +    out.write(serialized.array())
    --- End diff --
    
    I did not understand, what you meant here.


---
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-1830 Deploy failover, Make Persistence e...

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

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


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-59444653
  
    @ScrapCodes I'm not sure if you're done with the refactoring, but one critical piece is that our *Info objects must remain `private[spark]`. Currently readPersistedData being implemented by the child means that each implementation has to understand how the data is stored, and moreover has to be able to see the *Info 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43535796
  
    @ScrapCodes, I definitely like the idea. I think we need to update the API a little before it's ready to be publicly accessible, though. First, LeaderElectionAgent and PersistenceEngine should be `@DeveloperApi` and not `private[spark]`. 
    
    Second, LeaderElectionAgent should be refactored to not be an Actor (there is a TODO since the Curator refactor, I think it just needs to be done before we can finalize this API). This should be pretty straightforward to do, I would just add a trait like
    ```scala
    trait LeaderElectable {
      def electedLeader()
      def revokedLeadership()
    }
    ```
    
    which Master implements by simply calling `self ! ElectedLeader`, for instance, to ensure we maintain the thread safety of the actor without leaking the actor abstraction.


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-60048629
  
      [QA tests have started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22028/consoleFull) for   PR 771 at commit [`fef35ec`](https://github.com/apache/spark/commit/fef35ec46bf7343eba1d2700889c7708b37423ef).
     * 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-59358035
  
      [QA tests have finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/21804/consoleFull) for   PR 771 at commit [`f05a910`](https://github.com/apache/spark/commit/f05a910f3571a786e57492d3d213ce1229df7c51).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ApplicationInfo(`
      * `class DriverInfo(`
      * `trait LeaderElectionAgent `
      * `trait LeaderElectable `
      * `trait PersistenceEngine `
      * `abstract class StandaloneRecoveryModeFactory(conf: SparkConf) `
      * `class WorkerInfo(`



---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-57428783
  
      [QA tests have started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/21098/consoleFull) for   PR 771 at commit [`022cb8e`](https://github.com/apache/spark/commit/022cb8e531b2f7ffbda117cd41ac8f82cc5118fe).
     * 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r17858933
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/FileSystemPersistenceEngine.scala ---
    @@ -79,11 +80,9 @@ private[spark] class FileSystemPersistenceEngine(
         val created = file.createNewFile()
         if (!created) { throw new IllegalStateException("Could not create file: " + file) }
     
    -    val serializer = serialization.findSerializerFor(value)
    -    val serialized = serializer.toBinary(value)
    -
    +    val serialized = serializer.serialize(value)
         val out = new FileOutputStream(file)
    -    out.write(serialized)
    +    out.write(serialized.array())
    --- End diff --
    
    Perhaps we could use serializeStream() instead to avoid relying on a ByteBuffer's array()?


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-57513660
  
    I talked with @JoshRosen for a second opinion, and we came to the realization that fundamentally, the PersistenceEngine is just a persisted KV-store, which maps String names to serialized Array[Byte]. The current API that uses Application/Driver/WorkerInfos is nice for the Master's type safety purposes, but not good for extensibility. Note, for instance, that ApplicationInfo contains an ActorRef to the driver!
    
    The proposal we came up with is to simplify PersistenceEngine to this API:
    ```scala
    @DevelperApi
    trait PersistenceEngine {
      def persist(name: String, bytes: Array[Byte])
      def unpersist(name: String)
      def readPersistedData(): (Seq[(String, Array[Byte])]
      def close() {}
    }
    ```
    
    And then
    ```
    private[spark]
    class MasterFailoverAgent(persistenceEngine: PersistenceEngine, leaderElectionAgent: LeaderElectionAgent) {
      def addApplication(app: ApplicationInfo) {
        persist(name, serialize(app))
      }
      ...
      def readPersistedData(): (Seq[ApplicationInfo], Seq[DriverInfo], Seq[WorkerInfo])
      def stop() {} 
    }
    ```
    
    Then the Master would invoke the StandaloneRecoveryModeFactory to get the PersistenceEngine and LeaderElectionAgent, and then create a MasterFailoverAgent to wrap them (or the StandaloneRecoveryModeFactory could have a `final def` that does this).
    
    This is very close to what you suggested earlier with the FailoverAgent -- the only difference is that it keeps this API as a construct of the Master, built out of the much simpler APIs that the user has to implement in StandaloneRecoveryModeFactory.
    
    What are your thoughts?


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-59493430
  
    @aarondav So you are asking for another `read()` method, which end users can override. So that we can have a default implementation for `readPersistedData` ?


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-59927785
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/21990/
    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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-60352360
  
      [Test build #22127 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22127/consoleFull) for   PR 771 at commit [`29ba440`](https://github.com/apache/spark/commit/29ba440ead3d5880125e0d5a010ee876606511fd).
     * 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-1830 Deploy failover, Make Persistence e...

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

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


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r17858937
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala ---
    @@ -129,23 +129,25 @@ private[spark] class Master(
         masterMetricsSystem.start()
         applicationMetricsSystem.start()
     
    -    persistenceEngine = RECOVERY_MODE match {
    +    val (persistenceEngine_, leaderElectionAgent_) = RECOVERY_MODE match {
           case "ZOOKEEPER" =>
             logInfo("Persisting recovery state to ZooKeeper")
    -        new ZooKeeperPersistenceEngine(SerializationExtension(context.system), conf)
    +        val zkFactory = new ZooKeeperRecoveryModeFactory(conf)
    +        (zkFactory.createPersistenceEngine(), zkFactory.createLeaderElectionAgent(this))
           case "FILESYSTEM" =>
             logInfo("Persisting recovery state to directory: " + RECOVERY_DIR)
    --- End diff --
    
    Can remove RECOVERY_DIR from this file if you change this log statement. Could log the actual directory within FileSystemPersistenceAgent.


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43178406
  
     Merged build triggered. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43076339
  
    
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14979/


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-57434816
  
      [QA tests have finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/21098/consoleFull) for   PR 771 at commit [`022cb8e`](https://github.com/apache/spark/commit/022cb8e531b2f7ffbda117cd41ac8f82cc5118fe).
     * This patch **passes** unit tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ApplicationInfo(`
      * `class DriverInfo(`
      * `trait LeaderElectionAgent `
      * `trait LeaderElectable `
      * `trait PersistenceEngine `
      * `abstract class StandaloneRecoveryModeFactory(conf: SparkConf) `
      * `class WorkerInfo(`



---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45212705
  
    Merged build finished. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-60049581
  
      [QA tests have started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22030/consoleFull) for   PR 771 at commit [`29ba440`](https://github.com/apache/spark/commit/29ba440ead3d5880125e0d5a010ee876606511fd).
     * 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43178416
  
    Merged build started. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence 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/771#discussion_r19163523
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/RecoveryModeFactory.scala ---
    @@ -0,0 +1,75 @@
    +/*
    + * 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.deploy.master
    +
    +import org.apache.spark.{Logging, SparkConf}
    +import org.apache.spark.annotation.DeveloperApi
    +import org.apache.spark.serializer.JavaSerializer
    +
    +/**
    + * ::DeveloperApi::
    + *
    + * Implementation of this class can be plugged in as recovery mode alternative for Spark's
    + * Standalone mode.
    + *
    + * @param conf SparkConf
    + */
    +@DeveloperApi
    +abstract class StandaloneRecoveryModeFactory(conf: SparkConf) {
    +
    +  /**
    +   * PersistenceEngine defines how the persistent data(Information about worker, driver etc..)
    +   * is handled for recovery.
    +   *
    +   * @return
    +   */
    +  def createPersistenceEngine(): PersistenceEngine
    +
    +  /**
    +   * Create an instance of LeaderAgent that decides who gets elected as master.
    +   * @param master
    +   * @return
    +   */
    +  def createLeaderElectionAgent(master: LeaderElectable): LeaderElectionAgent
    +}
    +
    +/**
    + * LeaderAgent in this case is a no-op. Since leader is forever leader as the actual
    + * recovery is made by restoring from filesystem.
    + *
    + * @param conf SparkConf
    --- End diff --
    
    And here.


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-59533468
  
    Yeah, that sounds good, as long as the API that they have to implement doesn't require them to import any of the *Info 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r19197267
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/PersistenceEngine.scala ---
    @@ -26,35 +30,58 @@ package org.apache.spark.deploy.master
      * we might not have yet deleted apps or workers that finished (so their liveness must be verified
      * during recovery).
      */
    -private[spark] trait PersistenceEngine {
    -  def addApplication(app: ApplicationInfo)
    +@DeveloperApi
    +trait PersistenceEngine {
    +
    +  def persist(name: String, obj: Object)
    +
    +  def unpersist(name: String)
    +
    +  def read[T: ClassTag](name: String): Seq[T]
    --- End diff --
    
    I kept ClassTag so that if someone extends this method he can control how read behaves based on Whether its ApplicationInfo/WorkerInfo/ etc... . Such a thing would be impossible otherwise - since we are making other methods as final. I am not sure if that would be absolutely necessary.  Thoughts? 


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r19162145
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala ---
    @@ -732,8 +740,7 @@ private[spark] class Master(
             msg = URLEncoder.encode(msg, "UTF-8")
             app.desc.appUiUrl = notFoundBasePath + s"?msg=$msg&exception=$exception&title=$title"
             false
    -    }
    -  }
    +    }  }
    --- End diff --
    
    nit: two lines


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-62524905
  
    Did I miss something ?


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45305178
  
    Merged build finished. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-60358025
  
      [Test build #22127 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22127/consoleFull) for   PR 771 at commit [`29ba440`](https://github.com/apache/spark/commit/29ba440ead3d5880125e0d5a010ee876606511fd).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `trait LeaderElectionAgent `
      * `trait LeaderElectable `
      * `trait PersistenceEngine `
      * `abstract class StandaloneRecoveryModeFactory(conf: SparkConf) `



---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45310507
  
    Merged build finished. All automated tests 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.
---

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence 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/771#discussion_r19163448
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/RecoveryModeFactory.scala ---
    @@ -0,0 +1,75 @@
    +/*
    + * 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.deploy.master
    +
    +import org.apache.spark.{Logging, SparkConf}
    +import org.apache.spark.annotation.DeveloperApi
    +import org.apache.spark.serializer.JavaSerializer
    +
    +/**
    + * ::DeveloperApi::
    + *
    + * Implementation of this class can be plugged in as recovery mode alternative for Spark's
    + * Standalone mode.
    + *
    + * @param conf SparkConf
    --- End diff --
    
    I don't think we need this line.


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-60358029
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22127/
    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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-57342697
  
    Gotcha, yeah, it's needed for the PersistenceEngine in particular -- no way to open up that API without also getting the *Infos. 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-62583568
  
    LGTM, merging into master. Thanks!


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-60352013
  
    Jenkins, retest 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45212574
  
    Merged build started. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-60055285
  
      [QA tests have finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22030/consoleFull) for   PR 771 at commit [`29ba440`](https://github.com/apache/spark/commit/29ba440ead3d5880125e0d5a010ee876606511fd).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `trait LeaderElectionAgent `
      * `trait LeaderElectable `
      * `trait PersistenceEngine `
      * `abstract class StandaloneRecoveryModeFactory(conf: SparkConf) `



---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-56289862
  
    @aarondav could you give feedback one way or the other on 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r19162314
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/PersistenceEngine.scala ---
    @@ -26,35 +30,58 @@ package org.apache.spark.deploy.master
      * we might not have yet deleted apps or workers that finished (so their liveness must be verified
      * during recovery).
      */
    -private[spark] trait PersistenceEngine {
    -  def addApplication(app: ApplicationInfo)
    +@DeveloperApi
    +trait PersistenceEngine {
    +
    +  def persist(name: String, obj: Object)
    +
    +  def unpersist(name: String)
    +
    +  def read[T: ClassTag](name: String): Seq[T]
     
    -  def removeApplication(app: ApplicationInfo)
    +  def addApplication(app: ApplicationInfo): Unit = {
    --- End diff --
    
    maybe make these final so no one tries to override them (since the *Info classes will be private to spark)


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45308174
  
    Merged build started. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43076338
  
    Merged build finished. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-57147681
  
      [QA tests have finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/20970/consoleFull) for   PR 771 at commit [`575334f`](https://github.com/apache/spark/commit/575334f0112d67145ae738990b56d724562b8f00).
     * This patch **passes** unit tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ApplicationInfo(`
      * `class DriverInfo(`
      * `trait LeaderElectionAgent `
      * `trait LeaderElectable `
      * `trait PersistenceEngine `
      * `abstract class StandaloneRecoveryModeFactory(conf: SparkConf) `
      * `class WorkerInfo(`



---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45249308
  
    That does sound reasonable, especially since the LeaderElectionAgent relies on the behavior of the PersistenceEngine in order to actually enable recovery.


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-54020889
  
    Hey @aarondav, Do you think its worth having in its current condition ? I can rebase it ofcourse. I was actually unsure of changing it further.   


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43178109
  
    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.
---

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r19162275
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/PersistenceEngine.scala ---
    @@ -26,35 +30,58 @@ package org.apache.spark.deploy.master
      * we might not have yet deleted apps or workers that finished (so their liveness must be verified
      * during recovery).
      */
    -private[spark] trait PersistenceEngine {
    -  def addApplication(app: ApplicationInfo)
    +@DeveloperApi
    +trait PersistenceEngine {
    +
    +  def persist(name: String, obj: Object)
    --- End diff --
    
    Please add documentation to these three methods to make the requirements clear.


---
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-1830 Deploy failover, Make Persistence e...

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

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


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r18229263
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/FileSystemPersistenceEngine.scala ---
    @@ -79,11 +80,9 @@ private[spark] class FileSystemPersistenceEngine(
         val created = file.createNewFile()
         if (!created) { throw new IllegalStateException("Could not create file: " + file) }
     
    -    val serializer = serialization.findSerializerFor(value)
    -    val serialized = serializer.toBinary(value)
    -
    +    val serialized = serializer.serialize(value)
         val out = new FileOutputStream(file)
    -    out.write(serialized)
    +    out.write(serialized.array())
    --- End diff --
    
    I was just suggesting that we could do
    
    ```scala
    val out = serializer.serializeStream(new FileOutputStream(file))
    out.writeObject(value)
    out.close()
    ```
    
    It's a very minor point about ByteBuffers not always having a valid array().


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45303242
  
     Merged build triggered. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45310508
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15498/


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-56397426
  
    Hey @ScrapCodes, very sorry for not getting back to you earlier. I really like the current design and I think we should merge this soon. I just had a couple minor comments and after the rebase it's looking very good to me. Thanks!


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-56397543
  
    We might consider documenting the recovery mode factory configuration option, though, to allow users to find it.


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45305092
  
    Merged build started. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-60048869
  
      [QA tests have finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22028/consoleFull) for   PR 771 at commit [`fef35ec`](https://github.com/apache/spark/commit/fef35ec46bf7343eba1d2700889c7708b37423ef).
     * This patch **fails to build**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `trait LeaderElectionAgent `
      * `trait LeaderElectable `
      * `trait PersistenceEngine `
      * `abstract class StandaloneRecoveryModeFactory(conf: SparkConf) `



---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43181484
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15021/


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r12807670
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala ---
    @@ -143,6 +146,9 @@ private[spark] class Master(
         leaderElectionAgent = RECOVERY_MODE match {
             case "ZOOKEEPER" =>
               context.actorOf(Props(classOf[ZooKeeperLeaderElectionAgent], self, masterUrl, conf))
    +        case "CUSTOM" =>
    +          val clazz = Class.forName(conf.get("spark.deploy.recoveryMode.leaderAgentActor"))
    +          context.actorOf(Props(clazz, self, masterUrl, conf))
    --- End diff --
    
    It may be a good idea to abstract out the creation of the persistenceEngine and leaderElectionAgent into something like
    ```scala
    abstract class StandaloneRecoveryModeFactory(conf: SparkConf) {
      def createPersistenceEngine(): PersistenceEngine
      def createLeaderElectionAgent(master: LeaderElectable, masterUrl: String): LeaderElectionAgent
    }
    ```
    
    with 2 subclasses, `FileSystemRecoveryModeFactory` and `ZooKeeperRecoveryModeFactory` (maybe the name "RecoveryModeFactory" is not so good).
    
    The advantage of this approach is that we formalize the arguments needed for constructing the 2 APIs, and centralize the creation of everything necessary for one recovery mode. Thoughts?


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43072939
  
     Merged build triggered. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43181483
  
    Merged build finished. All automated tests 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.
---

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence 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/771#discussion_r19163324
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/PersistenceEngine.scala ---
    @@ -26,35 +30,58 @@ package org.apache.spark.deploy.master
      * we might not have yet deleted apps or workers that finished (so their liveness must be verified
      * during recovery).
      */
    -private[spark] trait PersistenceEngine {
    -  def addApplication(app: ApplicationInfo)
    +@DeveloperApi
    +trait PersistenceEngine {
    +
    +  def persist(name: String, obj: Object)
    +
    +  def unpersist(name: String)
    +
    +  def read[T: ClassTag](name: String): Seq[T]
    --- End diff --
    
    Why does this need to accept a `ClassTag`?  Is this so that we can allocate unboxed primitive arrays?


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r19162135
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/ZooKeeperPersistenceEngine.scala ---
    @@ -19,72 +19,54 @@ package org.apache.spark.deploy.master
     
     import scala.collection.JavaConversions._
     
    -import akka.serialization.Serialization
     import org.apache.curator.framework.CuratorFramework
     import org.apache.zookeeper.CreateMode
     
     import org.apache.spark.{Logging, SparkConf}
    +import org.apache.spark.serializer.Serializer
    +import java.nio.ByteBuffer
     
    -class ZooKeeperPersistenceEngine(serialization: Serialization, conf: SparkConf)
    +import scala.reflect.ClassTag
    +
    +
    +private[spark] class ZooKeeperPersistenceEngine(val serialization: Serializer, conf: SparkConf)
       extends PersistenceEngine
       with Logging
     {
       val WORKING_DIR = conf.get("spark.deploy.zookeeper.dir", "/spark") + "/master_status"
       val zk: CuratorFramework = SparkCuratorUtil.newClient(conf)
     
    -  SparkCuratorUtil.mkdir(zk, WORKING_DIR)
    -
    -  override def addApplication(app: ApplicationInfo) {
    -    serializeIntoFile(WORKING_DIR + "/app_" + app.id, app)
    -  }
    +  val serializer = serialization.newInstance()
     
    -  override def removeApplication(app: ApplicationInfo) {
    -    zk.delete().forPath(WORKING_DIR + "/app_" + app.id)
    -  }
    +  SparkCuratorUtil.mkdir(zk, WORKING_DIR)
     
    -  override def addDriver(driver: DriverInfo) {
    -    serializeIntoFile(WORKING_DIR + "/driver_" + driver.id, driver)
    -  }
     
    -  override def removeDriver(driver: DriverInfo) {
    -    zk.delete().forPath(WORKING_DIR + "/driver_" + driver.id)
    +  override def persist(name: String, obj: Object): Unit = {
    +    serializeIntoFile(WORKING_DIR + "/" + name, obj)
       }
     
    -  override def addWorker(worker: WorkerInfo) {
    -    serializeIntoFile(WORKING_DIR + "/worker_" + worker.id, worker)
    +  override def unpersist(name: String): Unit = {
    +    zk.delete().forPath(WORKING_DIR + "/" + name)
       }
     
    -  override def removeWorker(worker: WorkerInfo) {
    -    zk.delete().forPath(WORKING_DIR + "/worker_" + worker.id)
    +  override def read[T: ClassTag](name: String) = {
    --- End diff --
    
    let's rename this "prefix"


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-59358046
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/21804/
    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-1830 Deploy failover, Make Persistence 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/771#discussion_r19163509
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/RecoveryModeFactory.scala ---
    @@ -0,0 +1,75 @@
    +/*
    + * 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.deploy.master
    +
    +import org.apache.spark.{Logging, SparkConf}
    +import org.apache.spark.annotation.DeveloperApi
    +import org.apache.spark.serializer.JavaSerializer
    +
    +/**
    + * ::DeveloperApi::
    + *
    + * Implementation of this class can be plugged in as recovery mode alternative for Spark's
    + * Standalone mode.
    + *
    + * @param conf SparkConf
    + */
    +@DeveloperApi
    +abstract class StandaloneRecoveryModeFactory(conf: SparkConf) {
    +
    +  /**
    +   * PersistenceEngine defines how the persistent data(Information about worker, driver etc..)
    +   * is handled for recovery.
    +   *
    +   * @return
    --- End diff --
    
    Similarly, we can get rid of this `@return`; we don't need to use scaladoc to document the return value here and the blank documentation is ugly looking.


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45305179
  
    
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15496/


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45305638
  
     Merged build triggered. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-59350133
  
      [QA tests have started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/21804/consoleFull) for   PR 771 at commit [`f05a910`](https://github.com/apache/spark/commit/f05a910f3571a786e57492d3d213ce1229df7c51).
     * 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-1830 Deploy failover, Make Persistence 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/771#discussion_r19163518
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/RecoveryModeFactory.scala ---
    @@ -0,0 +1,75 @@
    +/*
    + * 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.deploy.master
    +
    +import org.apache.spark.{Logging, SparkConf}
    +import org.apache.spark.annotation.DeveloperApi
    +import org.apache.spark.serializer.JavaSerializer
    +
    +/**
    + * ::DeveloperApi::
    + *
    + * Implementation of this class can be plugged in as recovery mode alternative for Spark's
    + * Standalone mode.
    + *
    + * @param conf SparkConf
    + */
    +@DeveloperApi
    +abstract class StandaloneRecoveryModeFactory(conf: SparkConf) {
    +
    +  /**
    +   * PersistenceEngine defines how the persistent data(Information about worker, driver etc..)
    +   * is handled for recovery.
    +   *
    +   * @return
    +   */
    +  def createPersistenceEngine(): PersistenceEngine
    +
    +  /**
    +   * Create an instance of LeaderAgent that decides who gets elected as master.
    +   * @param master
    --- End diff --
    
    Same here.


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43488669
  
    @aarondav Mind taking a look ?


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-60048872
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22028/
    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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45209583
  
    @aarondav I am not 100% sure about the idea but for a moment I felt may be we could club Persistenceengine and leader agent together into one and call it FailoverAgent ? I am not supporting it but it sort of occurred to me so thought of sharing it.


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence 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/771#discussion_r19163070
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/PersistenceEngine.scala ---
    @@ -26,35 +30,58 @@ package org.apache.spark.deploy.master
      * we might not have yet deleted apps or workers that finished (so their liveness must be verified
      * during recovery).
      */
    -private[spark] trait PersistenceEngine {
    -  def addApplication(app: ApplicationInfo)
    +@DeveloperApi
    +trait PersistenceEngine {
    +
    +  def persist(name: String, obj: Object)
    +
    +  def unpersist(name: String)
    +
    +  def read[T: ClassTag](name: String): Seq[T]
     
    -  def removeApplication(app: ApplicationInfo)
    +  def addApplication(app: ApplicationInfo): Unit = {
    --- End diff --
    
    I agree; only the `persist()`, `unpersist()`, `read()`, and `close()`methods are designed for extensibility; everything else should be `final`.


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-57208538
  
    Why did you have to "@DeveloperApi" the Application/Driver/WorkerInfo 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#discussion_r17858944
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/RecoveryModeFactory.scala ---
    @@ -0,0 +1,47 @@
    +/*
    + * 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.deploy.master
    +
    +import org.apache.spark.SparkConf
    +import org.apache.spark.annotation.DeveloperApi
    +import org.apache.spark.serializer.JavaSerializer
    +
    +@DeveloperApi
    +abstract class StandaloneRecoveryModeFactory(conf: SparkConf) {
    --- End diff --
    
    Could you add a class comment to this? Do note that user implementations will be instantiated with the conf as the sole constructor parameter.


---
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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-43072957
  
    Merged build started. 


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

[GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-57141645
  
      [QA tests have started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/20970/consoleFull) for   PR 771 at commit [`575334f`](https://github.com/apache/spark/commit/575334f0112d67145ae738990b56d724562b8f00).
     * 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-1830 Deploy failover, Make Persistence e...

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

    https://github.com/apache/spark/pull/771#issuecomment-45212707
  
    
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15479/


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