spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aarondav <>
Subject [GitHub] spark pull request: SPARK-1830 Deploy failover, Make Persistence e...
Date Wed, 01 Oct 2014 18:36:01 GMT
Github user aarondav commented on the pull request:
    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:
    trait PersistenceEngine {
      def persist(name: String, bytes: Array[Byte])
      def unpersist(name: String)
      def readPersistedData(): (Seq[(String, Array[Byte])]
      def close() {}
    And then
    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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message