You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by nn...@apache.org on 2015/02/12 21:19:11 UTC

[6/6] mesos git commit: Extracted MesosAllocator into a separate file.

Extracted MesosAllocator into a separate file.

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


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

Branch: refs/heads/master
Commit: b3385f3619b53d83004688984b8f4733eb5c5e12
Parents: 336e4e2
Author: Alexander Rukletsov <al...@mesosphere.io>
Authored: Thu Feb 12 11:44:58 2015 -0800
Committer: Niklas Q. Nielsen <ni...@mesosphere.io>
Committed: Thu Feb 12 11:44:58 2015 -0800

----------------------------------------------------------------------
 src/Makefile.am                             |   1 +
 src/master/allocator/allocator.hpp          | 374 +---------------------
 src/master/allocator/mesos/allocator.hpp    | 383 +++++++++++++++++++++++
 src/master/allocator/mesos/hierarchical.hpp |   2 +-
 src/master/master.cpp                       |   2 +-
 5 files changed, 390 insertions(+), 372 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b3385f36/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index f9efaaa..05ee76d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -509,6 +509,7 @@ libmesos_no_3rdparty_la_SOURCES +=					\
 	master/registrar.hpp						\
 	master/validation.hpp						\
 	master/allocator/allocator.hpp					\
+	master/allocator/mesos/allocator.hpp				\
 	master/allocator/mesos/hierarchical.hpp				\
 	master/allocator/sorter/drf/sorter.hpp				\
 	master/allocator/sorter/sorter.hpp				\

http://git-wip-us.apache.org/repos/asf/mesos/blob/b3385f36/src/master/allocator/allocator.hpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/allocator.hpp b/src/master/allocator/allocator.hpp
index b9d85cc..c2461a3 100644
--- a/src/master/allocator/allocator.hpp
+++ b/src/master/allocator/allocator.hpp
@@ -24,9 +24,6 @@
 
 #include <mesos/resources.hpp>
 
-#include <process/dispatch.hpp>
-#include <process/process.hpp>
-
 #include <stout/hashmap.hpp>
 #include <stout/hashset.hpp>
 #include <stout/lambda.hpp>
@@ -79,10 +76,10 @@ public:
       const FrameworkID& frameworkId) = 0;
 
   // Note that the 'total' resources are passed explicitly because it
-  // includes resources that are dynamically "persisted" on the slave
-  // (e.g. persistent volumes, dynamic reservations, etc).
-  // The slaveInfo resources, on the other hand, correspond directly
-  // to the static --resources flag value on the slave.
+  // includes resources that are dynamically "checkpointed" on the
+  // slave (e.g. persistent volumes, dynamic reservations, etc). The
+  // slaveInfo resources, on the other hand, correspond directly to
+  // the static --resources flag value on the slave.
   virtual void addSlave(
       const SlaveID& slaveId,
       const SlaveInfo& slaveInfo,
@@ -125,369 +122,6 @@ public:
       const FrameworkID& frameworkId) = 0;
 };
 
-
-class MesosAllocatorProcess;
-
-// A wrapper for Process-based allocators. It redirects all function
-// invocations to the underlying AllocatorProcess and manages its
-// lifetime. We ensure the template parameter AllocatorProcess
-// implements MesosAllocatorProcess by storing a pointer to it.
-//
-// TODO(alexr): Move this class (together with the implementation)
-// into a separate file.
-template <typename AllocatorProcess>
-class MesosAllocator : public Allocator
-{
-public:
-  MesosAllocator();
-
-  ~MesosAllocator();
-
-  void initialize(
-      const Flags& flags,
-      const lambda::function<
-          void(const FrameworkID&,
-               const hashmap<SlaveID, Resources>&)>& offerCallback,
-      const hashmap<std::string, RoleInfo>& roles);
-
-  void addFramework(
-      const FrameworkID& frameworkId,
-      const FrameworkInfo& frameworkInfo,
-      const Resources& used);
-
-  void removeFramework(
-      const FrameworkID& frameworkId);
-
-  // Offers are sent only to activated frameworks.
-  void activateFramework(
-      const FrameworkID& frameworkId);
-
-  void deactivateFramework(
-      const FrameworkID& frameworkId);
-
-  // Note that the 'total' resources are passed explicitly because it
-  // includes resources that are dynamically "checkpointed" on the
-  // slave (e.g. persistent volumes, dynamic reservations, etc). The
-  // slaveInfo resources, on the other hand, correspond directly to
-  // the static --resources flag value on the slave.
-  void addSlave(
-      const SlaveID& slaveId,
-      const SlaveInfo& slaveInfo,
-      const Resources& total,
-      const hashmap<FrameworkID, Resources>& used);
-
-  void removeSlave(
-      const SlaveID& slaveId);
-
-  // Offers are sent only for activated slaves.
-  void activateSlave(
-      const SlaveID& slaveId);
-
-  void deactivateSlave(
-      const SlaveID& slaveId);
-
-  void updateWhitelist(
-      const Option<hashset<std::string> >& whitelist);
-
-  void requestResources(
-      const FrameworkID& frameworkId,
-      const std::vector<Request>& requests);
-
-  void updateAllocation(
-      const FrameworkID& frameworkId,
-      const SlaveID& slaveId,
-      const std::vector<Offer::Operation>& operations);
-
-  // Informs the allocator to recover resources that are considered
-  // used by the framework.
-  void recoverResources(
-      const FrameworkID& frameworkId,
-      const SlaveID& slaveId,
-      const Resources& resources,
-      const Option<Filters>& filters);
-
-  // Whenever a framework that has filtered resources wants to revive
-  // offers for those resources the master invokes this callback.
-  void reviveOffers(
-      const FrameworkID& frameworkId);
-
-private:
-  MesosAllocator(const MesosAllocator&); // Not copyable.
-  MesosAllocator& operator=(const MesosAllocator&); // Not assignable.
-
-  MesosAllocatorProcess* process;
-};
-
-
-// The basic interface for all Process-based allocators.
-class MesosAllocatorProcess : public process::Process<MesosAllocatorProcess>
-{
-public:
-  MesosAllocatorProcess() {}
-
-  virtual ~MesosAllocatorProcess() {}
-
-  // Explicitly unhide 'initialize' to silence a compiler warning
-  // from clang, since we overload below.
-  using process::ProcessBase::initialize;
-
-  virtual void initialize(
-      const Flags& flags,
-      const lambda::function<
-          void(const FrameworkID&,
-               const hashmap<SlaveID, Resources>&)>& offerCallback,
-      const hashmap<std::string, RoleInfo>& roles) = 0;
-
-  virtual void addFramework(
-      const FrameworkID& frameworkId,
-      const FrameworkInfo& frameworkInfo,
-      const Resources& used) = 0;
-
-  virtual void removeFramework(
-      const FrameworkID& frameworkId) = 0;
-
-  virtual void activateFramework(
-      const FrameworkID& frameworkId) = 0;
-
-  virtual void deactivateFramework(
-      const FrameworkID& frameworkId) = 0;
-
-  virtual void addSlave(
-      const SlaveID& slaveId,
-      const SlaveInfo& slaveInfo,
-      const Resources& total,
-      const hashmap<FrameworkID, Resources>& used) = 0;
-
-  virtual void removeSlave(
-      const SlaveID& slaveId) = 0;
-
-  virtual void activateSlave(
-      const SlaveID& slaveId) = 0;
-
-  virtual void deactivateSlave(
-      const SlaveID& slaveId) = 0;
-
-  virtual void updateWhitelist(
-      const Option<hashset<std::string> >& whitelist) = 0;
-
-  virtual void requestResources(
-      const FrameworkID& frameworkId,
-      const std::vector<Request>& requests) = 0;
-
-  virtual void updateAllocation(
-      const FrameworkID& frameworkId,
-      const SlaveID& slaveId,
-      const std::vector<Offer::Operation>& operations) = 0;
-
-  virtual void recoverResources(
-      const FrameworkID& frameworkId,
-      const SlaveID& slaveId,
-      const Resources& resources,
-      const Option<Filters>& filters) = 0;
-
-  virtual void reviveOffers(
-      const FrameworkID& frameworkId) = 0;
-};
-
-
-template <typename AllocatorProcess>
-MesosAllocator<AllocatorProcess>::MesosAllocator()
-{
-  process = new AllocatorProcess();
-  process::spawn(process);
-}
-
-
-template <typename AllocatorProcess>
-MesosAllocator<AllocatorProcess>::~MesosAllocator()
-{
-  process::terminate(process);
-  process::wait(process);
-  delete process;
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::initialize(
-    const Flags& flags,
-    const lambda::function<
-        void(const FrameworkID&,
-             const hashmap<SlaveID, Resources>&)>& offerCallback,
-    const hashmap<std::string, RoleInfo>& roles)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::initialize,
-      flags,
-      offerCallback,
-      roles);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::addFramework(
-    const FrameworkID& frameworkId,
-    const FrameworkInfo& frameworkInfo,
-    const Resources& used)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::addFramework,
-      frameworkId,
-      frameworkInfo,
-      used);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::removeFramework(
-    const FrameworkID& frameworkId)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::removeFramework,
-      frameworkId);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::activateFramework(
-    const FrameworkID& frameworkId)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::activateFramework,
-      frameworkId);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::deactivateFramework(
-    const FrameworkID& frameworkId)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::deactivateFramework,
-      frameworkId);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::addSlave(
-    const SlaveID& slaveId,
-    const SlaveInfo& slaveInfo,
-    const Resources& total,
-    const hashmap<FrameworkID, Resources>& used)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::addSlave,
-      slaveId,
-      slaveInfo,
-      total,
-      used);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::removeSlave(
-    const SlaveID& slaveId)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::removeSlave,
-      slaveId);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::activateSlave(
-    const SlaveID& slaveId)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::activateSlave,
-      slaveId);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::deactivateSlave(
-    const SlaveID& slaveId)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::deactivateSlave,
-      slaveId);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::updateWhitelist(
-    const Option<hashset<std::string> >& whitelist)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::updateWhitelist,
-      whitelist);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::requestResources(
-    const FrameworkID& frameworkId,
-    const std::vector<Request>& requests)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::requestResources,
-      frameworkId,
-      requests);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::updateAllocation(
-    const FrameworkID& frameworkId,
-    const SlaveID& slaveId,
-    const std::vector<Offer::Operation>& operations)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::updateAllocation,
-      frameworkId,
-      slaveId,
-      operations);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::recoverResources(
-    const FrameworkID& frameworkId,
-    const SlaveID& slaveId,
-    const Resources& resources,
-    const Option<Filters>& filters)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::recoverResources,
-      frameworkId,
-      slaveId,
-      resources,
-      filters);
-}
-
-
-template <typename AllocatorProcess>
-inline void MesosAllocator<AllocatorProcess>::reviveOffers(
-    const FrameworkID& frameworkId)
-{
-  process::dispatch(
-      process,
-      &MesosAllocatorProcess::reviveOffers,
-      frameworkId);
-}
-
 } // namespace allocator {
 } // namespace master {
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b3385f36/src/master/allocator/mesos/allocator.hpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/allocator.hpp b/src/master/allocator/mesos/allocator.hpp
new file mode 100644
index 0000000..99b40a0
--- /dev/null
+++ b/src/master/allocator/mesos/allocator.hpp
@@ -0,0 +1,383 @@
+/**
+ * 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_ALLOCATOR_MESOS_ALLOCATOR_HPP__
+#define __MASTER_ALLOCATOR_MESOS_ALLOCATOR_HPP__
+
+#include <process/dispatch.hpp>
+#include <process/process.hpp>
+
+#include "master/allocator/allocator.hpp"
+
+namespace mesos {
+namespace master {
+namespace allocator {
+
+class MesosAllocatorProcess;
+
+// A wrapper for Process-based allocators. It redirects all function
+// invocations to the underlying AllocatorProcess and manages its
+// lifetime. We ensure the template parameter AllocatorProcess
+// implements MesosAllocatorProcess by storing a pointer to it.
+template <typename AllocatorProcess>
+class MesosAllocator : public Allocator
+{
+public:
+  MesosAllocator();
+
+  ~MesosAllocator();
+
+  void initialize(
+      const Flags& flags,
+      const lambda::function<
+          void(const FrameworkID&,
+               const hashmap<SlaveID, Resources>&)>& offerCallback,
+      const hashmap<std::string, RoleInfo>& roles);
+
+  void addFramework(
+      const FrameworkID& frameworkId,
+      const FrameworkInfo& frameworkInfo,
+      const Resources& used);
+
+  void removeFramework(
+      const FrameworkID& frameworkId);
+
+  void activateFramework(
+      const FrameworkID& frameworkId);
+
+  void deactivateFramework(
+      const FrameworkID& frameworkId);
+
+  void addSlave(
+      const SlaveID& slaveId,
+      const SlaveInfo& slaveInfo,
+      const Resources& total,
+      const hashmap<FrameworkID, Resources>& used);
+
+  void removeSlave(
+      const SlaveID& slaveId);
+
+  void activateSlave(
+      const SlaveID& slaveId);
+
+  void deactivateSlave(
+      const SlaveID& slaveId);
+
+  void updateWhitelist(
+      const Option<hashset<std::string> >& whitelist);
+
+  void requestResources(
+      const FrameworkID& frameworkId,
+      const std::vector<Request>& requests);
+
+  void updateAllocation(
+      const FrameworkID& frameworkId,
+      const SlaveID& slaveId,
+      const std::vector<Offer::Operation>& operations);
+
+  void recoverResources(
+      const FrameworkID& frameworkId,
+      const SlaveID& slaveId,
+      const Resources& resources,
+      const Option<Filters>& filters);
+
+  void reviveOffers(
+      const FrameworkID& frameworkId);
+
+private:
+  MesosAllocator(const MesosAllocator&); // Not copyable.
+  MesosAllocator& operator=(const MesosAllocator&); // Not assignable.
+
+  MesosAllocatorProcess* process;
+};
+
+
+// The basic interface for all Process-based allocators.
+class MesosAllocatorProcess : public process::Process<MesosAllocatorProcess>
+{
+public:
+  MesosAllocatorProcess() {}
+
+  virtual ~MesosAllocatorProcess() {}
+
+  // Explicitly unhide 'initialize' to silence a compiler warning
+  // from clang, since we overload below.
+  using process::ProcessBase::initialize;
+
+  virtual void initialize(
+      const Flags& flags,
+      const lambda::function<
+          void(const FrameworkID&,
+               const hashmap<SlaveID, Resources>&)>& offerCallback,
+      const hashmap<std::string, RoleInfo>& roles) = 0;
+
+  virtual void addFramework(
+      const FrameworkID& frameworkId,
+      const FrameworkInfo& frameworkInfo,
+      const Resources& used) = 0;
+
+  virtual void removeFramework(
+      const FrameworkID& frameworkId) = 0;
+
+  virtual void activateFramework(
+      const FrameworkID& frameworkId) = 0;
+
+  virtual void deactivateFramework(
+      const FrameworkID& frameworkId) = 0;
+
+  virtual void addSlave(
+      const SlaveID& slaveId,
+      const SlaveInfo& slaveInfo,
+      const Resources& total,
+      const hashmap<FrameworkID, Resources>& used) = 0;
+
+  virtual void removeSlave(
+      const SlaveID& slaveId) = 0;
+
+  virtual void activateSlave(
+      const SlaveID& slaveId) = 0;
+
+  virtual void deactivateSlave(
+      const SlaveID& slaveId) = 0;
+
+  virtual void updateWhitelist(
+      const Option<hashset<std::string> >& whitelist) = 0;
+
+  virtual void requestResources(
+      const FrameworkID& frameworkId,
+      const std::vector<Request>& requests) = 0;
+
+  virtual void updateAllocation(
+      const FrameworkID& frameworkId,
+      const SlaveID& slaveId,
+      const std::vector<Offer::Operation>& operations) = 0;
+
+  virtual void recoverResources(
+      const FrameworkID& frameworkId,
+      const SlaveID& slaveId,
+      const Resources& resources,
+      const Option<Filters>& filters) = 0;
+
+  virtual void reviveOffers(
+      const FrameworkID& frameworkId) = 0;
+};
+
+
+template <typename AllocatorProcess>
+MesosAllocator<AllocatorProcess>::MesosAllocator()
+{
+  process = new AllocatorProcess();
+  process::spawn(process);
+}
+
+
+template <typename AllocatorProcess>
+MesosAllocator<AllocatorProcess>::~MesosAllocator()
+{
+  process::terminate(process);
+  process::wait(process);
+  delete process;
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::initialize(
+    const Flags& flags,
+    const lambda::function<
+        void(const FrameworkID&,
+             const hashmap<SlaveID, Resources>&)>& offerCallback,
+    const hashmap<std::string, RoleInfo>& roles)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::initialize,
+      flags,
+      offerCallback,
+      roles);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::addFramework(
+    const FrameworkID& frameworkId,
+    const FrameworkInfo& frameworkInfo,
+    const Resources& used)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::addFramework,
+      frameworkId,
+      frameworkInfo,
+      used);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::removeFramework(
+    const FrameworkID& frameworkId)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::removeFramework,
+      frameworkId);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::activateFramework(
+    const FrameworkID& frameworkId)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::activateFramework,
+      frameworkId);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::deactivateFramework(
+    const FrameworkID& frameworkId)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::deactivateFramework,
+      frameworkId);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::addSlave(
+    const SlaveID& slaveId,
+    const SlaveInfo& slaveInfo,
+    const Resources& total,
+    const hashmap<FrameworkID, Resources>& used)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::addSlave,
+      slaveId,
+      slaveInfo,
+      total,
+      used);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::removeSlave(
+    const SlaveID& slaveId)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::removeSlave,
+      slaveId);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::activateSlave(
+    const SlaveID& slaveId)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::activateSlave,
+      slaveId);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::deactivateSlave(
+    const SlaveID& slaveId)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::deactivateSlave,
+      slaveId);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::updateWhitelist(
+    const Option<hashset<std::string> >& whitelist)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::updateWhitelist,
+      whitelist);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::requestResources(
+    const FrameworkID& frameworkId,
+    const std::vector<Request>& requests)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::requestResources,
+      frameworkId,
+      requests);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::updateAllocation(
+    const FrameworkID& frameworkId,
+    const SlaveID& slaveId,
+    const std::vector<Offer::Operation>& operations)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::updateAllocation,
+      frameworkId,
+      slaveId,
+      operations);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::recoverResources(
+    const FrameworkID& frameworkId,
+    const SlaveID& slaveId,
+    const Resources& resources,
+    const Option<Filters>& filters)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::recoverResources,
+      frameworkId,
+      slaveId,
+      resources,
+      filters);
+}
+
+
+template <typename AllocatorProcess>
+inline void MesosAllocator<AllocatorProcess>::reviveOffers(
+    const FrameworkID& frameworkId)
+{
+  process::dispatch(
+      process,
+      &MesosAllocatorProcess::reviveOffers,
+      frameworkId);
+}
+
+} // namespace allocator {
+} // namespace master {
+} // namespace mesos {
+
+#endif // __MASTER_ALLOCATOR_MESOS_ALLOCATOR_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/b3385f36/src/master/allocator/mesos/hierarchical.hpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.hpp b/src/master/allocator/mesos/hierarchical.hpp
index 8ddf4f9..2680d62 100644
--- a/src/master/allocator/mesos/hierarchical.hpp
+++ b/src/master/allocator/mesos/hierarchical.hpp
@@ -35,7 +35,7 @@
 #include <stout/stopwatch.hpp>
 #include <stout/stringify.hpp>
 
-#include "master/allocator/allocator.hpp"
+#include "master/allocator/mesos/allocator.hpp"
 #include "master/allocator/sorter/drf/sorter.hpp"
 
 namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b3385f36/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index a567a34..f10a3cf 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -583,7 +583,7 @@ void Master::initialize()
       defer(self(), &Master::offer, lambda::_1, lambda::_2),
       roleInfos);
 
-  // Parse the whitelist. Passing allocator::updateWhitelist()
+  // Parse the whitelist. Passing Allocator::updateWhitelist()
   // callback is safe because we shut down the whitelistWatcher in
   // Master::finalize(), while allocator lifetime is greater than
   // masters. Therefore there is no risk of calling into an allocator