Added Master::teardown() to handle TEARDOWN call.

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


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

Branch: refs/heads/master
Commit: c5ea91ee1260f5a58abd1e5f40c23dbc7f92403f
Parents: bb0d506
Author: Vinod Kone <[email protected]>
Authored: Sat Aug 8 08:19:28 2015 -0700
Committer: Vinod Kone <[email protected]>
Committed: Sat Aug 8 19:38:49 2015 -0700

----------------------------------------------------------------------
 src/master/master.cpp | 14 ++++++++++++--
 src/master/master.hpp |  2 ++
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c5ea91ee/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 5ff0ea1..b481c32 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -1669,7 +1669,7 @@ void Master::receive(
 
   switch (call.type()) {
     case scheduler::Call::TEARDOWN:
-      removeFramework(framework);
+      teardown(framework);
       break;
 
     case scheduler::Call::ACCEPT:
@@ -2276,7 +2276,7 @@ void Master::unregisterFramework(
   Framework* framework = getFramework(frameworkId);
   if (framework != NULL) {
     if (framework->pid == from) {
-      removeFramework(framework);
+      teardown(framework);
     } else {
       LOG(WARNING)
         << "Ignoring unregister framework message for framework " << *framework
@@ -5028,6 +5028,16 @@ void Master::_failoverFramework(Framework* framework)
 }
 
 
+void Master::teardown(Framework* framework)
+{
+  CHECK_NOTNULL(framework);
+
+  LOG(INFO) << "Processing TEARDOWN call for framework " << *framework;
+
+  removeFramework(framework);
+}
+
+
 void Master::removeFramework(Framework* framework)
 {
   CHECK_NOTNULL(framework);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c5ea91ee/src/master/master.hpp
----------------------------------------------------------------------
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 40883ff..28356e4 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -728,6 +728,8 @@ private:
       const scheduler::Call::Subscribe& subscribe,
       const process::Future<bool>& authorized);
 
+  void teardown(Framework* framework);
+
   void accept(
       Framework* framework,
       const scheduler::Call::Accept& accept);

Reply via email to