This is an automated email from the ASF dual-hosted git repository.

mzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 24ae038a2b1a205894bd074a798923c3eb04a5a1
Author: Meng Zhu <[email protected]>
AuthorDate: Mon Sep 23 14:30:10 2019 -0700

    Kept SlaveID in the Slave struct in the allocator.
    
    Review: https://reviews.apache.org/r/71546
---
 src/master/allocator/mesos/hierarchical.hpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/master/allocator/mesos/hierarchical.hpp 
b/src/master/allocator/mesos/hierarchical.hpp
index 2648f66..c2f5378 100644
--- a/src/master/allocator/mesos/hierarchical.hpp
+++ b/src/master/allocator/mesos/hierarchical.hpp
@@ -306,7 +306,8 @@ public:
       bool _activated,
       const Resources& _total,
       const hashmap<FrameworkID, Resources>& _allocated)
-    : info(_info),
+    : id(_info.id()),
+      info(_info),
       capabilities(_capabilities),
       activated(_activated),
       totalAllocated(Resources::sum(_allocated)),
@@ -316,6 +317,7 @@ public:
       shared(_total.shared()),
       hasGpu_(_total.gpus().getOrElse(0) > 0)
   {
+    CHECK(_info.has_id());
     updateAvailable();
   }
 
@@ -379,6 +381,8 @@ public:
     updateAvailable();
   }
 
+  const SlaveID id;
+
   // The `SlaveInfo` that was passed to the allocator when the slave was added
   // or updated. Currently only two fields are used: `hostname` for host
   // whitelisting and in log messages, and `domain` for region-aware

Reply via email to