You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ka...@apache.org on 2016/04/07 00:48:38 UTC
[08/11] mesos git commit: Removed unnecessary MasterContender and
MasterDetector definitions.
Removed unnecessary MasterContender and MasterDetector definitions.
MasterContender and MasterDetector are now defined in
include/mesos/master/contender.hpp and detector.hpp.
Review: https://reviews.apache.org/r/44543/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a1d3d6ba
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a1d3d6ba
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a1d3d6ba
Branch: refs/heads/master
Commit: a1d3d6ba0595cd59808d0d3f8653036ecd721a5d
Parents: a529a9e
Author: Anurag Singh <an...@gmail.com>
Authored: Wed Apr 6 15:08:15 2016 -0400
Committer: Kapil Arya <ka...@mesosphere.io>
Committed: Wed Apr 6 18:36:18 2016 -0400
----------------------------------------------------------------------
src/master/contender.hpp | 39 ---------------------------------------
src/master/detector.hpp | 31 -------------------------------
2 files changed, 70 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/a1d3d6ba/src/master/contender.hpp
----------------------------------------------------------------------
diff --git a/src/master/contender.hpp b/src/master/contender.hpp
index 3fd20f8..fd5e595 100644
--- a/src/master/contender.hpp
+++ b/src/master/contender.hpp
@@ -45,45 +45,6 @@ class Master;
class ZooKeeperMasterContenderProcess;
-
-// An abstraction for contending to be a leading master.
-//
-// TODO(benh): Support contending with a v1::MasterInfo.
-class MasterContender
-{
-public:
- // Attempts to create a master contender using the specified
- // mechanism.
- // The mechanism address should be one of:
- // - zk://host1:port1,host2:port2,.../path
- // - zk://username:password@host1:port1,host2:port2,.../path
- // Note that the returned contender still needs to be 'initialize()'d.
- static Try<MasterContender*> create(const Option<std::string>& _mechanism);
-
- // Note that the contender's membership, if obtained, is scheduled
- // to be cancelled during destruction.
- virtual ~MasterContender() = 0;
-
- // Initializes the contender with the MasterInfo of the master it
- // contends on behalf of.
- virtual void initialize(const MasterInfo& masterInfo) = 0;
-
- // Returns a Future<Nothing> once the contender has entered the
- // contest (by obtaining a membership) and an error otherwise.
- // A failed future is returned if this method is called before
- // initialize().
- // The inner Future returns Nothing when the contender is out of
- // the contest (i.e. its membership is lost).
- //
- // This method can be used to contend again after candidacy is
- // obtained (the outer future satisfied), otherwise the future for
- // the pending election is returned.
- // Recontending after candidacy is obtained causes the previous
- // candidacy to be withdrawn.
- virtual process::Future<process::Future<Nothing> > contend() = 0;
-};
-
-
// A basic implementation which assumes only one master is
// contending.
class StandaloneMasterContender : public MasterContender
http://git-wip-us.apache.org/repos/asf/mesos/blob/a1d3d6ba/src/master/detector.hpp
----------------------------------------------------------------------
diff --git a/src/master/detector.hpp b/src/master/detector.hpp
index eb5d2a9..9fbb045 100644
--- a/src/master/detector.hpp
+++ b/src/master/detector.hpp
@@ -43,37 +43,6 @@ class StandaloneMasterDetectorProcess;
class ZooKeeperMasterDetectorProcess;
-// An abstraction of a Master detector which can be used to
-// detect the leading master from a group.
-class MasterDetector
-{
-public:
- // Attempts to create a master detector for the specified mechanism.
- // The mechanism should be one of:
- // - host:port
- // - zk://host1:port1,host2:port2,.../path
- // - zk://username:password@host1:port1,host2:port2,.../path
- static Try<MasterDetector*> create(const Option<std::string>& _mechanism);
- virtual ~MasterDetector() = 0;
-
- // Returns MasterInfo after an election has occurred and the elected
- // master is different than that specified (if any), or NONE if an
- // election occurs and no master is elected (e.g., all masters are
- // lost). A failed future is returned if the detector is unable to
- // detect the leading master due to a non-retryable error.
- // Note that the detector transparently tries to recover from
- // retryable errors.
- // The future is never discarded unless it stays pending when the
- // detector destructs.
- //
- // The 'previous' result (if any) should be passed back if this
- // method is called repeatedly so the detector only returns when it
- // gets a different result.
- virtual process::Future<Option<MasterInfo> > detect(
- const Option<MasterInfo>& previous = None()) = 0;
-};
-
-
// A standalone implementation of the MasterDetector with no external
// discovery mechanism so the user has to manually appoint a leader
// to the detector for it to be detected.