Repository: mesos Updated Branches: refs/heads/master 8bab70c69 -> 3af5f5512
Cleaned up some code for managing recovered frameworks. Review: https://reviews.apache.org/r/52214/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c83882d4 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c83882d4 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c83882d4 Branch: refs/heads/master Commit: c83882d457df0d908cf3507f4c11f4b4a78a9cb1 Parents: 8bab70c Author: Neil Conway <neil.con...@gmail.com> Authored: Mon Oct 3 16:45:19 2016 -0700 Committer: Vinod Kone <vinodk...@gmail.com> Committed: Mon Oct 3 16:45:19 2016 -0700 ---------------------------------------------------------------------- src/master/master.cpp | 10 +++------- src/master/master.hpp | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/c83882d4/src/master/master.cpp ---------------------------------------------------------------------- diff --git a/src/master/master.cpp b/src/master/master.cpp index c83ee2f..032571e 100644 --- a/src/master/master.cpp +++ b/src/master/master.cpp @@ -2467,7 +2467,7 @@ void Master::_subscribe( } } - // N.B. Need to add the framework _after_ we add its tasks + // NOTE: Need to add the framework _after_ we add its tasks // (above) so that we can properly determine the resources it's // currently using! addFramework(framework); @@ -6831,9 +6831,7 @@ void Master::addFramework(Framework* framework) frameworks.registered[framework->id()] = framework; // Remove from 'frameworks.recovered' if necessary. - if (frameworks.recovered.contains(framework->id())) { - frameworks.recovered.erase(framework->id()); - } + frameworks.recovered.erase(framework->id()); if (framework->pid.isSome()) { link(framework->pid.get()); @@ -7172,9 +7170,7 @@ void Master::removeFramework(Framework* framework) allocator->removeFramework(framework->id()); // Remove from 'frameworks.recovered' if necessary. - if (frameworks.recovered.contains(framework->id())) { - frameworks.recovered.erase(framework->id()); - } + frameworks.recovered.erase(framework->id()); // The completedFramework buffer now owns the framework pointer. frameworks.completed.push_back(shared_ptr<Framework>(framework)); http://git-wip-us.apache.org/repos/asf/mesos/blob/c83882d4/src/master/master.hpp ---------------------------------------------------------------------- diff --git a/src/master/master.hpp b/src/master/master.hpp index 6d2b4f5..43518b9 100644 --- a/src/master/master.hpp +++ b/src/master/master.hpp @@ -1744,10 +1744,10 @@ private: hashmap<FrameworkID, Framework*> registered; - // 'Recovered' contains 'FrameworkInfo's for frameworks which - // would otherwise be unknown during recovery after master - // failover. + // `recovered` contains 'FrameworkInfo's for frameworks that have + // not yet re-registered after master failover. hashmap<FrameworkID, FrameworkInfo> recovered; + boost::circular_buffer<std::shared_ptr<Framework>> completed; // Principals of frameworks keyed by PID.