You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2013/04/30 03:31:16 UTC
svn commit: r1477441 - in /incubator/mesos/trunk/src: Makefile.am
master/master.cpp master/master.hpp master/slaves_manager.cpp
master/slaves_manager.hpp
Author: bmahler
Date: Tue Apr 30 01:31:15 2013
New Revision: 1477441
URL: http://svn.apache.org/r1477441
Log:
Removed the unused SlavesManager and SlaveRegistrar code, to be added
later with MESOS-295.
Review: https://reviews.apache.org/r/10171
Removed:
incubator/mesos/trunk/src/master/slaves_manager.cpp
incubator/mesos/trunk/src/master/slaves_manager.hpp
Modified:
incubator/mesos/trunk/src/Makefile.am
incubator/mesos/trunk/src/master/master.cpp
incubator/mesos/trunk/src/master/master.hpp
Modified: incubator/mesos/trunk/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/Makefile.am?rev=1477441&r1=1477440&r2=1477441&view=diff
==============================================================================
--- incubator/mesos/trunk/src/Makefile.am (original)
+++ incubator/mesos/trunk/src/Makefile.am Tue Apr 30 01:31:15 2013
@@ -162,7 +162,6 @@ libmesos_no_third_party_la_SOURCES =
master/drf_sorter.cpp \
master/http.cpp \
master/master.cpp \
- master/slaves_manager.cpp \
slave/constants.cpp \
slave/gc.cpp \
slave/monitor.cpp \
@@ -222,7 +221,7 @@ libmesos_no_third_party_la_SOURCES += co
master/allocator.hpp \
master/constants.hpp master/drf_sorter.hpp master/flags.hpp \
master/hierarchical_allocator_process.hpp master/http.hpp \
- master/master.hpp master/slaves_manager.hpp master/sorter.hpp \
+ master/master.hpp master/sorter.hpp \
messages/messages.hpp slave/constants.hpp \
slave/flags.hpp slave/gc.hpp slave/monitor.hpp slave/http.hpp \
slave/isolator.hpp \
Modified: incubator/mesos/trunk/src/master/master.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master/master.cpp?rev=1477441&r1=1477440&r2=1477441&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/master.cpp (original)
+++ incubator/mesos/trunk/src/master/master.cpp Tue Apr 30 01:31:15 2013
@@ -44,7 +44,6 @@
#include "master/allocator.hpp"
#include "master/flags.hpp"
#include "master/master.hpp"
-#include "master/slaves_manager.hpp"
namespace params = std::tr1::placeholders;
@@ -190,80 +189,6 @@ private:
};
-// Performs slave registration asynchronously. There are two means of
-// doing this, one first tries to add this slave to the slaves
-// manager, while the other one simply tells the master to add the
-// slave.
-struct SlaveRegistrar
-{
- static bool run(Slave* slave, const PID<Master>& master)
- {
- // TODO(benh): Do a reverse lookup to ensure IP maps to
- // hostname, or check credentials of this slave.
- dispatch(master, &Master::addSlave, slave, false);
- return true;
- }
-
- static bool run(Slave* slave,
- const PID<Master>& master,
- const PID<SlavesManager>& slavesManager)
- {
- Future<bool> added = dispatch(slavesManager, &SlavesManager::add,
- slave->info.hostname(), slave->pid.port);
- added.await();
- if (!added.isReady() || !added.get()) {
- LOG(WARNING) << "Could not register slave on "<< slave->info.hostname()
- << " because failed to add it to the slaves maanger";
- // TODO(benh): This could be because our acknowledgement to the
- // slave was dropped, so they retried, and now we should
- // probably send another acknowledgement.
- delete slave;
- return false;
- }
-
- return run(slave, master);
- }
-};
-
-
-// Performs slave re-registration asynchronously as above.
-struct SlaveReregistrar
-{
- static bool run(Slave* slave,
- const vector<ExecutorInfo>& executorInfos,
- const vector<Task>& tasks,
- const PID<Master>& master)
- {
- // TODO(benh): Do a reverse lookup to ensure IP maps to
- // hostname, or check credentials of this slave.
- dispatch(master, &Master::readdSlave, slave, executorInfos, tasks);
- return true;
- }
-
- static bool run(Slave* slave,
- const vector<ExecutorInfo>& executorInfos,
- const vector<Task>& tasks,
- const PID<Master>& master,
- const PID<SlavesManager>& slavesManager)
- {
- Future<bool> added = dispatch(slavesManager, &SlavesManager::add,
- slave->info.hostname(), slave->pid.port);
- added.await();
- if (!added.isReady() || !added.get()) {
- LOG(WARNING) << "Could not register slave on " << slave->info.hostname()
- << " because failed to add it to the slaves manager";
- // TODO(benh): This could be because our acknowledgement to the
- // slave was dropped, so they retried, and now we should
- // probably send another acknowledgement.
- delete slave;
- return false;
- }
-
- return run(slave, executorInfos, tasks, master);
- }
-};
-
-
Master::Master(Allocator* _allocator, Files* _files)
: ProcessBase("master"),
flags(),
@@ -294,11 +219,6 @@ Master::~Master()
CHECK(offers.size() == 0);
- terminate(slavesManager);
- wait(slavesManager);
-
- delete slavesManager;
-
terminate(whitelistWatcher);
wait(whitelistWatcher);
@@ -325,10 +245,6 @@ void Master::initialize()
LOG(INFO) << "Master ID: " << info.id();
- // Setup slave manager.
- slavesManager = new SlavesManager(flags, self());
- spawn(slavesManager);
-
// Initialize the allocator.
allocator->initialize(flags, self());
Modified: incubator/mesos/trunk/src/master/master.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master/master.hpp?rev=1477441&r1=1477440&r2=1477441&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/master.hpp (original)
+++ incubator/mesos/trunk/src/master/master.hpp Tue Apr 30 01:31:15 2013
@@ -62,7 +62,6 @@ using namespace process; // Included to
// Forward declarations.
class Allocator;
-class SlavesManager;
class SlaveObserver;
class WhitelistWatcher;
@@ -221,7 +220,6 @@ private:
bool elected;
Allocator* allocator;
- SlavesManager* slavesManager;
WhitelistWatcher* whitelistWatcher;
Files* files;