Repository: mesos
Updated Branches:
  refs/heads/master c320ab3b2 -> d0d5f5c46


Added pause/resume methods to `OfferOperationStatusUpdateManager`.

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


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

Branch: refs/heads/master
Commit: 07630ccfaefccb500d13f8940d9d3f397bdef32b
Parents: c320ab3
Author: Gaston Kleiman <gas...@mesosphere.io>
Authored: Tue Dec 12 16:18:12 2017 -0800
Committer: Greg Mann <gregorywm...@gmail.com>
Committed: Tue Dec 12 16:55:31 2017 -0800

----------------------------------------------------------------------
 src/status_update_manager/offer_operation.cpp | 22 ++++++++++++++++++++++
 src/status_update_manager/offer_operation.hpp | 10 ++++++++++
 2 files changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/07630ccf/src/status_update_manager/offer_operation.cpp
----------------------------------------------------------------------
diff --git a/src/status_update_manager/offer_operation.cpp 
b/src/status_update_manager/offer_operation.cpp
index f66690e..984969e 100644
--- a/src/status_update_manager/offer_operation.cpp
+++ b/src/status_update_manager/offer_operation.cpp
@@ -126,5 +126,27 @@ void OfferOperationStatusUpdateManager::cleanup(const 
FrameworkID& frameworkId)
       frameworkId);
 }
 
+
+void OfferOperationStatusUpdateManager::pause()
+{
+  dispatch(
+      process.get(),
+      &StatusUpdateManagerProcess<
+          UUID,
+          OfferOperationStatusUpdateRecord,
+          OfferOperationStatusUpdate>::pause);
+}
+
+
+void OfferOperationStatusUpdateManager::resume()
+{
+  dispatch(
+      process.get(),
+      &StatusUpdateManagerProcess<
+          UUID,
+          OfferOperationStatusUpdateRecord,
+          OfferOperationStatusUpdate>::resume);
+}
+
 } // namespace internal {
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/07630ccf/src/status_update_manager/offer_operation.hpp
----------------------------------------------------------------------
diff --git a/src/status_update_manager/offer_operation.hpp 
b/src/status_update_manager/offer_operation.hpp
index 8751f0b..e7c2b0c 100644
--- a/src/status_update_manager/offer_operation.hpp
+++ b/src/status_update_manager/offer_operation.hpp
@@ -44,7 +44,11 @@ typedef StatusUpdateManagerProcess<
 class OfferOperationStatusUpdateManager
 {
 public:
+  // NOTE: Unless first paused, the status update manager will forward updates
+  // as soon as possible; for example, during recovery or as soon as the first
+  // status update is processed.
   OfferOperationStatusUpdateManager();
+
   ~OfferOperationStatusUpdateManager();
 
   OfferOperationStatusUpdateManager(
@@ -107,6 +111,12 @@ public:
   // responsible for garbage collection after this method has returned.
   void cleanup(const FrameworkID& frameworkId);
 
+  // Stop forwarding status updates until `resume()` is called.
+  void pause();
+
+  // Resume forwarding status updates until `pause()` is called.
+  void resume();
+
 private:
   process::Owned<
       StatusUpdateManagerProcess<

Reply via email to