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/18 14:22:24 UTC

[04/11] mesos git commit: Removed stale contender/detector files.

Removed stale contender/detector files.

Also updated Makefile.am to move contender/detector module library
declarations into the existing list.

Review: https://reviews.apache.org/r/45900


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

Branch: refs/heads/master
Commit: a4e11f8186a15a8159ba0eb46335595843e053ba
Parents: 5c1782b
Author: Kapil Arya <ka...@mesosphere.io>
Authored: Thu Apr 7 18:21:08 2016 -0400
Committer: Kapil Arya <ka...@mesosphere.io>
Committed: Sun Apr 17 23:38:26 2016 -0400

----------------------------------------------------------------------
 src/Makefile.am                    |  4 +-
 src/master/contender/contender.hpp | 89 ------------------------------
 src/master/detector/detector.hpp   | 98 ---------------------------------
 3 files changed, 2 insertions(+), 189 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a4e11f81/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index ec85526..6b21790 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1813,6 +1813,8 @@ MESOS_TEST_MODULES =		\
   libtesthook.la		\
   libtesthttpauthenticator.la	\
   libtestisolator.la		\
+  libtestmastercontender.la	\
+  libtestmasterdetector.la	\
   libtestqos_controller.la	\
   libtestresource_estimator.la
 
@@ -1855,13 +1857,11 @@ libtestcontainer_logger_la_CPPFLAGS = $(MESOS_CPPFLAGS)
 libtestcontainer_logger_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS)
 
 # Library containing the test contender module.
-noinst_LTLIBRARIES += libtestmastercontender.la
 libtestmastercontender_la_SOURCES = examples/test_master_contender_module.cpp
 libtestmastercontender_la_CPPFLAGS = $(MESOS_CPPFLAGS)
 libtestmastercontender_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS)
 
 # Library containing the test detector module.
-noinst_LTLIBRARIES += libtestmasterdetector.la
 libtestmasterdetector_la_SOURCES = examples/test_master_detector_module.cpp
 libtestmasterdetector_la_CPPFLAGS = $(MESOS_CPPFLAGS)
 libtestmasterdetector_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/mesos/blob/a4e11f81/src/master/contender/contender.hpp
----------------------------------------------------------------------
diff --git a/src/master/contender/contender.hpp b/src/master/contender/contender.hpp
deleted file mode 100644
index ba05551..0000000
--- a/src/master/contender/contender.hpp
+++ /dev/null
@@ -1,89 +0,0 @@
-// 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.
-
-#ifndef __MASTER_CONTENDER_HPP__
-#define __MASTER_CONTENDER_HPP__
-
-#include <mesos/master/contender.hpp>
-
-#include <process/defer.hpp>
-#include <process/future.hpp>
-#include <process/owned.hpp>
-#include <process/pid.hpp>
-
-#include <stout/lambda.hpp>
-#include <stout/nothing.hpp>
-
-#include "messages/messages.hpp"
-
-#include "zookeeper/contender.hpp"
-#include "zookeeper/group.hpp"
-#include "zookeeper/url.hpp"
-
-namespace mesos {
-namespace internal {
-
-extern const Duration MASTER_CONTENDER_ZK_SESSION_TIMEOUT;
-
-class ZooKeeperMasterContenderProcess;
-
-// A basic implementation which assumes only one master is
-// contending.
-class StandaloneMasterContender : public MasterContender
-{
-public:
-  StandaloneMasterContender()
-    : initialized(false),
-      promise(NULL) {}
-
-  virtual ~StandaloneMasterContender();
-
-  // MasterContender implementation.
-  virtual void initialize(const MasterInfo& masterInfo);
-
-  // In this basic implementation the outer Future directly returns
-  // and inner Future stays pending because there is only one
-  // contender in the contest.
-  virtual process::Future<process::Future<Nothing> > contend();
-
-private:
-  bool initialized;
-  process::Promise<Nothing>* promise;
-};
-
-
-class ZooKeeperMasterContender : public MasterContender
-{
-public:
-  // Creates a contender that uses ZooKeeper to determine (i.e.,
-  // elect) a leading master.
-  explicit ZooKeeperMasterContender(const zookeeper::URL& url);
-  explicit ZooKeeperMasterContender(process::Owned<zookeeper::Group> group);
-
-  virtual ~ZooKeeperMasterContender();
-
-  // MasterContender implementation.
-  virtual void initialize(const MasterInfo& masterInfo);
-  virtual process::Future<process::Future<Nothing> > contend();
-
-private:
-  ZooKeeperMasterContenderProcess* process;
-};
-
-} // namespace internal {
-} // namespace mesos {
-
-#endif // __MASTER_CONTENDER_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/a4e11f81/src/master/detector/detector.hpp
----------------------------------------------------------------------
diff --git a/src/master/detector/detector.hpp b/src/master/detector/detector.hpp
deleted file mode 100644
index 8400265..0000000
--- a/src/master/detector/detector.hpp
+++ /dev/null
@@ -1,98 +0,0 @@
-// 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.
-
-#ifndef __MASTER_DETECTOR_HPP__
-#define __MASTER_DETECTOR_HPP__
-
-#include <string>
-
-#include <process/future.hpp>
-#include <process/owned.hpp>
-
-#include <stout/option.hpp>
-#include <stout/stringify.hpp>
-#include <stout/try.hpp>
-
-#include "messages/messages.hpp"
-
-#include "zookeeper/detector.hpp"
-#include "zookeeper/group.hpp"
-#include "zookeeper/url.hpp"
-
-namespace mesos {
-namespace internal {
-
-extern const Duration MASTER_DETECTOR_ZK_SESSION_TIMEOUT;
-
-// Forward declarations.
-class StandaloneMasterDetectorProcess;
-class ZooKeeperMasterDetectorProcess;
-
-// 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.
-class StandaloneMasterDetector : public MasterDetector
-{
-public:
-  StandaloneMasterDetector();
-  // Use this constructor if the leader is known beforehand so it is
-  // unnecessary to call 'appoint()' separately.
-  explicit StandaloneMasterDetector(const MasterInfo& leader);
-
-  // Same as above but takes UPID as the parameter.
-  explicit StandaloneMasterDetector(const process::UPID& leader);
-
-  virtual ~StandaloneMasterDetector();
-
-  // Appoint the leading master so it can be *detected*.
-  void appoint(const Option<MasterInfo>& leader);
-
-  // Same as above but takes 'UPID' as the parameter.
-  void appoint(const process::UPID& leader);
-
-  virtual process::Future<Option<MasterInfo> > detect(
-      const Option<MasterInfo>& previous = None());
-
-private:
-  StandaloneMasterDetectorProcess* process;
-};
-
-
-class ZooKeeperMasterDetector : public MasterDetector
-{
-public:
-  // Creates a detector which uses ZooKeeper to determine (i.e.,
-  // elect) a leading master.
-  explicit ZooKeeperMasterDetector(const zookeeper::URL& url);
-  // Used for testing purposes.
-  explicit ZooKeeperMasterDetector(process::Owned<zookeeper::Group> group);
-  virtual ~ZooKeeperMasterDetector();
-
-  // MasterDetector implementation.
-  // The detector transparently tries to recover from retryable
-  // errors until the group session expires, in which case the Future
-  // returns None.
-  virtual process::Future<Option<MasterInfo> > detect(
-      const Option<MasterInfo>& previous = None());
-
-private:
-  ZooKeeperMasterDetectorProcess* process;
-};
-
-} // namespace internal {
-} // namespace mesos {
-
-#endif // __MASTER_DETECTOR_HPP__