Apache Mesos
hierarchical.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __MASTER_ALLOCATOR_MESOS_HIERARCHICAL_HPP__
18 #define __MASTER_ALLOCATOR_MESOS_HIERARCHICAL_HPP__
19 
20 #include <set>
21 #include <string>
22 
23 #include <mesos/mesos.hpp>
24 
25 #include <process/future.hpp>
26 #include <process/id.hpp>
27 #include <process/owned.hpp>
28 
29 #include <stout/duration.hpp>
30 #include <stout/hashmap.hpp>
31 #include <stout/hashset.hpp>
32 #include <stout/lambda.hpp>
33 #include <stout/option.hpp>
34 
36 
39 
41 
42 #include "master/constants.hpp"
43 
44 namespace mesos {
45 namespace internal {
46 namespace master {
47 namespace allocator {
48 
49 // We forward declare the hierarchical allocator process so that we
50 // can typedef an instantiation of it with DRF sorters.
51 template <
52  typename RoleSorter,
53  typename FrameworkSorter,
54  typename QuotaRoleSorter>
56 
59 
62 
63 
64 namespace internal {
65 
66 // Forward declarations.
67 class OfferFilter;
68 class InverseOfferFilter;
69 
70 
71 // Implements the basic allocator algorithm - first pick a role by
72 // some criteria, then pick one of their frameworks to allocate to.
74 {
75 public:
77  const std::function<Sorter*()>& roleSorterFactory,
78  const std::function<Sorter*()>& _frameworkSorterFactory,
79  const std::function<Sorter*()>& quotaRoleSorterFactory)
80  : initialized(false),
81  paused(true),
82  metrics(*this),
83  roleSorter(roleSorterFactory()),
84  quotaRoleSorter(quotaRoleSorterFactory()),
85  frameworkSorterFactory(_frameworkSorterFactory) {}
86 
88 
90  {
91  return process::PID<Self>(this);
92  }
93 
94  void initialize(
96  const lambda::function<
97  void(const FrameworkID&,
98  const hashmap<std::string, hashmap<SlaveID, Resources>>&)>&
100  const lambda::function<
101  void(const FrameworkID&,
104  const Option<std::set<std::string>>&
106  bool filterGpuResources = true,
107  const Option<DomainInfo>& domain = None());
108 
109  void recover(
110  const int _expectedAgentCount,
112 
113  void addFramework(
114  const FrameworkID& frameworkId,
115  const FrameworkInfo& frameworkInfo,
116  const hashmap<SlaveID, Resources>& used,
117  bool active,
118  const std::set<std::string>& suppressedRoles);
119 
120  void removeFramework(
121  const FrameworkID& frameworkId);
122 
123  void activateFramework(
124  const FrameworkID& frameworkId);
125 
126  void deactivateFramework(
127  const FrameworkID& frameworkId);
128 
129  void updateFramework(
130  const FrameworkID& frameworkId,
131  const FrameworkInfo& frameworkInfo,
132  const std::set<std::string>& suppressedRoles);
133 
134  void addSlave(
135  const SlaveID& slaveId,
136  const SlaveInfo& slaveInfo,
137  const std::vector<SlaveInfo::Capability>& capabilities,
139  const Resources& total,
140  const hashmap<FrameworkID, Resources>& used);
141 
142  void removeSlave(
143  const SlaveID& slaveId);
144 
145  void updateSlave(
146  const SlaveID& slave,
147  const SlaveInfo& slaveInfo,
148  const Option<Resources>& total = None(),
149  const Option<std::vector<SlaveInfo::Capability>>& capabilities = None());
150 
151  void addResourceProvider(
152  const SlaveID& slave,
153  const Resources& total,
154  const hashmap<FrameworkID, Resources>& used);
155 
156  void deactivateSlave(
157  const SlaveID& slaveId);
158 
159  void activateSlave(
160  const SlaveID& slaveId);
161 
162  void updateWhitelist(
164 
165  void requestResources(
166  const FrameworkID& frameworkId,
167  const std::vector<Request>& requests);
168 
169  void updateAllocation(
170  const FrameworkID& frameworkId,
171  const SlaveID& slaveId,
172  const Resources& offeredResources,
173  const std::vector<ResourceConversion>& conversions);
174 
176  const SlaveID& slaveId,
177  const std::vector<Offer::Operation>& operations);
178 
180  const SlaveID& slaveId,
182 
183  void updateInverseOffer(
184  const SlaveID& slaveId,
185  const FrameworkID& frameworkId,
186  const Option<UnavailableResources>& unavailableResources,
188  const Option<Filters>& filters);
189 
191  hashmap<SlaveID,
194 
195  void recoverResources(
196  const FrameworkID& frameworkId,
197  const SlaveID& slaveId,
198  const Resources& resources,
199  const Option<Filters>& filters);
200 
201  void suppressOffers(
202  const FrameworkID& frameworkId,
203  const std::set<std::string>& roles);
204 
205  void reviveOffers(
206  const FrameworkID& frameworkId,
207  const std::set<std::string>& roles);
208 
209  void setQuota(
210  const std::string& role,
211  const Quota& quota);
212 
213  void removeQuota(
214  const std::string& role);
215 
216  void updateWeights(
217  const std::vector<WeightInfo>& weightInfos);
218 
219 protected:
220  // Useful typedefs for dispatch/delay/defer to self()/this.
223 
224  // Idempotent helpers for pausing and resuming allocation.
225  void pause();
226  void resume();
227 
228  // Allocate any allocatable resources from all known agents.
230 
231  // Allocate resources from the specified agent.
232  process::Future<Nothing> allocate(const SlaveID& slaveId);
233 
234  // Allocate resources from the specified agents. The allocation
235  // is deferred and batched with other allocation requests.
237 
238  // Method that performs allocation work.
239  Nothing _allocate();
240 
241  // Helper for `_allocate()` that allocates resources for offers.
242  void __allocate();
243 
244  // Helper for `_allocate()` that deallocates resources for inverse offers.
245  void deallocate();
246 
247  // Remove an offer filter for the specified role of the framework.
248  void expire(
249  const FrameworkID& frameworkId,
250  const std::string& role,
251  const SlaveID& slaveId,
252  OfferFilter* offerFilter);
253 
254  void _expire(
255  const FrameworkID& frameworkId,
256  const std::string& role,
257  const SlaveID& slaveId,
258  OfferFilter* offerFilter);
259 
260  // Remove an inverse offer filter for the specified framework.
261  void expire(
262  const FrameworkID& frameworkId,
263  const SlaveID& slaveId,
264  InverseOfferFilter* inverseOfferFilter);
265 
266  // Checks whether the slave is whitelisted.
267  bool isWhitelisted(const SlaveID& slaveId) const;
268 
269  // Returns true if there is a resource offer filter for the
270  // specified role of this framework on this slave.
271  bool isFiltered(
272  const FrameworkID& frameworkId,
273  const std::string& role,
274  const SlaveID& slaveId,
275  const Resources& resources) const;
276 
277  // Returns true if there is an inverse offer filter for this framework
278  // on this slave.
279  bool isFiltered(
280  const FrameworkID& frameworkID,
281  const SlaveID& slaveID) const;
282 
283  static bool allocatable(const Resources& resources);
284 
286  bool paused;
287 
288  // Recovery data.
290 
292 
293  lambda::function<
294  void(const FrameworkID&,
295  const hashmap<std::string, hashmap<SlaveID, Resources>>&)>
297 
298  lambda::function<
299  void(const FrameworkID&,
302 
303  friend Metrics;
305 
306  struct Framework
307  {
308  Framework(
309  const FrameworkInfo& frameworkInfo,
310  const std::set<std::string>& suppressedRoles,
311  bool active);
312 
313  std::set<std::string> roles;
314 
315  std::set<std::string> suppressedRoles;
316 
318 
319  // Active offer and inverse offer filters for the framework.
320  // Offer filters are tied to the role the filtered resources
321  // were allocated to.
324 
325  bool active;
326  };
327 
329  {
330  return static_cast<double>(eventCount<process::DispatchEvent>());
331  }
332 
333  double _resources_total(
334  const std::string& resource);
335 
337  const std::string& resource);
338 
339  double _quota_allocated(
340  const std::string& role,
341  const std::string& resource);
342 
343  double _offer_filters_active(
344  const std::string& role);
345 
347 
348  struct Slave
349  {
350  // Total amount of regular *and* oversubscribed resources.
352 
353  // Regular *and* oversubscribed resources that are allocated.
354  //
355  // NOTE: We maintain multiple copies of each shared resource allocated
356  // to a slave, where the number of copies represents the number of times
357  // this shared resource has been allocated to (and has not been recovered
358  // from) a specific framework.
359  //
360  // NOTE: We keep track of slave's allocated resources despite
361  // having that information in sorters. This is because the
362  // information in sorters is not accurate if some framework
363  // hasn't reregistered. See MESOS-2919 for details.
365 
366  // We track the total and allocated resources on the slave, the
367  // available resources are computed as follows:
368  //
369  // available = total - allocated
370  //
371  // Note that it's possible for the slave to be over-allocated!
372  // In this case, allocated > total.
374  {
375  // In order to subtract from the total,
376  // we strip the allocation information.
377  Resources allocated_ = allocated;
378  allocated_.unallocate();
379 
380  return total - allocated_;
381  }
382 
383  bool activated; // Whether to offer resources.
384 
385  // The `SlaveInfo` that was passed to the allocator when the slave was added
386  // or updated. Currently only two fields are used: `hostname` for host
387  // whitelisting and in log messages, and `domain` for region-aware
388  // scheduling.
389  SlaveInfo info;
390 
392 
393  // Represents a scheduled unavailability due to maintenance for a specific
394  // slave, and the responses from frameworks as to whether they will be able
395  // to gracefully handle this unavailability.
396  //
397  // NOTE: We currently implement maintenance in the allocator to be able to
398  // leverage state and features such as the FrameworkSorter and OfferFilter.
399  struct Maintenance
400  {
401  Maintenance(const Unavailability& _unavailability)
402  : unavailability(_unavailability) {}
403 
404  // The start time and optional duration of the event.
405  Unavailability unavailability;
406 
407  // A mapping of frameworks to the inverse offer status associated with
408  // this unavailability.
409  //
410  // NOTE: We currently lose this information during a master fail over
411  // since it is not persisted or replicated. This is ok as the new master's
412  // allocator will send out new inverse offers and re-collect the
413  // information. This is similar to all the outstanding offers from an old
414  // master being invalidated, and new offers being sent out.
416 
417  // Represents the "unit of accounting" for maintenance. When a
418  // `FrameworkID` is present in the hashset it means an inverse offer has
419  // been sent out. When it is not present it means no offer is currently
420  // outstanding.
422  };
423 
424  // When the `maintenance` is set the slave is scheduled to be unavailable at
425  // a given point in time, for an optional duration. This information is used
426  // to send out `InverseOffers`.
428  };
429 
431 
432  // A set of agents that are kept as allocation candidates. Events
433  // may add or remove candidates to the set. When an allocation is
434  // processed, the set of candidates is cleared.
436 
437  // Future for the dispatched allocation that becomes
438  // ready after the allocation run is complete.
440 
441  // We track information about roles that we're aware of in the system.
442  // Specifically, we keep track of the roles when a framework subscribes to
443  // the role, and/or when there are resources allocated to the role
444  // (e.g. some tasks and/or executors are consuming resources under the role).
446 
447  // Configured quota for each role, if any. Setting quota for a role
448  // changes the order that the role's frameworks are offered
449  // resources. Quota comes before fair share, hence setting quota moves
450  // the role's frameworks towards the front of the allocation queue.
451  //
452  // NOTE: We currently associate quota with roles, but this may
453  // change in the future.
455 
456  // Aggregated resource reservations on all agents tied to a
457  // particular role, if any. These are stripped scalar quantities
458  // that contain no meta-data. Used for accounting resource
459  // reservations for quota limit.
460  //
461  // Only roles with non-empty reservations will be stored in the map.
463 
464  // Slaves to send offers for.
466 
467  // Resources (by name) that will be excluded from a role's fair share.
469 
470  // Filter GPU resources based on the `GPU_RESOURCES` framework capability.
472 
473  // The master's domain, if any.
475 
476  // There are two stages of allocation. During the first stage resources
477  // are allocated only to frameworks under roles with quota set. During
478  // the second stage remaining resources that would not be required to
479  // satisfy un-allocated quota are then allocated to frameworks under
480  // roles with no quota set.
481  //
482  // Each stage comprises two levels of sorting, hence "hierarchical".
483  // Level 1 sorts across roles:
484  // Currently, only the allocated portion of the reserved resources are
485  // accounted for fairness calculation.
486  //
487  // TODO(mpark): Reserved resources should be accounted for fairness
488  // calculation whether they are allocated or not, since they model a long or
489  // forever running task. That is, the effect of reserving resources is
490  // equivalent to launching a task in that the resources that make up the
491  // reservation are not available to other roles as non-revocable.
492  //
493  // Level 2 sorts across frameworks within a particular role:
494  // Reserved resources at this level are, and should be accounted for
495  // fairness calculation only if they are allocated. This is because
496  // reserved resources are fairly shared across the frameworks in the role.
497  //
498  // The allocator relies on `Sorter`s to employ a particular sorting
499  // algorithm. Each level has its own sorter and hence may have different
500  // fairness calculations.
501  //
502  // NOTE: The hierarchical allocator considers revocable resources as
503  // regular resources when doing fairness calculations.
504  //
505  // TODO(vinod): Consider using a different fairness algorithm for
506  // revocable resources.
507 
508  // A sorter for active roles. This sorter determines the order in which
509  // roles are allocated resources during Level 1 of the second stage.
510  // The total cluster resources are used as the resource pool.
512 
513  // A dedicated sorter for roles for which quota is set. This sorter
514  // determines the order in which quota'ed roles are allocated resources
515  // during Level 1 of the first stage. Quota'ed roles have resources
516  // allocated up to their allocated quota (the first stage) prior to
517  // non-quota'ed roles (the second stage). Since only non-revocable
518  // resources are available for quota, the total cluster non-revocable
519  // resoures are used as the resource pool.
520  //
521  // NOTE: A role appears in `quotaRoleSorter` if it has a quota (even if
522  // no frameworks are currently registered in that role). In contrast,
523  // `roleSorter` only contains entries for roles with one or more
524  // registered frameworks.
525  //
526  // NOTE: We do not include revocable resources in the quota role sorter,
527  // because the quota role sorter's job is to perform fair sharing between
528  // the quota roles as it pertains to their level of quota satisfaction.
529  // Since revocable resources do not increase a role's level of satisfaction
530  // toward its quota, we choose to exclude them from the quota role sorter.
532 
533  // A collection of sorters, one per active role. Each sorter determines
534  // the order in which frameworks that belong to the same role are allocated
535  // resources inside the role's share. These sorters are used during Level 2
536  // for both the first and the second stages. Since frameworks are sharing
537  // the resources allocated to a role, the role's allocation is used as
538  // the resource pool for each role specific framework sorter.
540 
541  // Factory function for framework sorters.
542  const std::function<Sorter*()> frameworkSorterFactory;
543 
544 private:
545  bool isFrameworkTrackedUnderRole(
546  const FrameworkID& frameworkId,
547  const std::string& role) const;
548 
549  void trackFrameworkUnderRole(
550  const FrameworkID& frameworkId,
551  const std::string& role);
552 
553  void untrackFrameworkUnderRole(
554  const FrameworkID& frameworkId,
555  const std::string& role);
556 
557  // `trackReservations` and `untrackReservations` are helpers
558  // to track role resource reservations. We need to keep
559  // track of reservations to enforce role quota limit
560  // in the presence of unallocated reservations. See MESOS-4527.
561  //
562  // TODO(mzhu): Ideally, we want these helpers to instead track the
563  // reservations as *allocated* in the sorters even when the
564  // reservations have not been allocated yet. This will help to:
565  //
566  // (1) Solve the fairness issue when roles with unallocated
567  // reservations may game the allocator (See MESOS-8299).
568  //
569  // (2) Simplify the quota enforcement logic -- the allocator
570  // would no longer need to track reservations separately.
571  void trackReservations(
572  const hashmap<std::string, Resources>& reservations);
573 
574  void untrackReservations(
575  const hashmap<std::string, Resources>& reservations);
576 
577  // Helper to update the agent's total resources maintained in the allocator
578  // and the role and quota sorters (whose total resources match the agent's
579  // total resources). Returns true iff the stored agent total was changed.
580  bool updateSlaveTotal(const SlaveID& slaveId, const Resources& total);
581 
582  // Helper that returns true if the given agent is located in a
583  // different region than the master. This can only be the case if
584  // the agent and the master are both configured with a fault domain.
585  bool isRemoteSlave(const Slave& slave) const;
586 
587  // Helper to track allocated resources on an agent.
588  void trackAllocatedResources(
589  const SlaveID& slaveId,
590  const FrameworkID& frameworkId,
591  const Resources& allocated);
592 
593  // Helper to untrack resources that are no longer allocated on an agent.
594  void untrackAllocatedResources(
595  const SlaveID& slaveId,
596  const FrameworkID& frameworkId,
597  const Resources& allocated);
598 
599  // Helper that removes all existing offer filters for the given slave
600  // id.
601  void removeFilters(const SlaveID& slaveId);
602 };
603 
604 
605 } // namespace internal {
606 
607 
608 // We map the templatized version of the `HierarchicalAllocatorProcess` to one
609 // that relies on sorter factories in the internal namespace. This allows us
610 // to keep the implementation of the allocator in the implementation file.
611 template <
612  typename RoleSorter,
613  typename FrameworkSorter,
614  typename QuotaRoleSorter>
617 {
618 public:
620  : ProcessBase(process::ID::generate("hierarchical-allocator")),
622  [this]() -> Sorter* {
623  return new RoleSorter(this->self(), "allocator/mesos/roles/");
624  },
625  []() -> Sorter* { return new FrameworkSorter(); },
626  []() -> Sorter* { return new QuotaRoleSorter(); }) {}
627 };
628 
629 } // namespace allocator {
630 } // namespace master {
631 } // namespace internal {
632 } // namespace mesos {
633 
634 #endif // __MASTER_ALLOCATOR_MESOS_HIERARCHICAL_HPP__
Option< process::Future< Nothing > > allocation
Definition: hierarchical.hpp:439
void recoverResources(const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &resources, const Option< Filters > &filters)
HierarchicalAllocatorProcess< DRFSorter, DRFSorter, DRFSorter > HierarchicalDRFAllocatorProcess
Definition: hierarchical.hpp:55
std::string generate(const std::string &prefix="")
Returns &#39;prefix(N)&#39; where N represents the number of instances where the same prefix (wrt...
void addSlave(const SlaveID &slaveId, const SlaveInfo &slaveInfo, const std::vector< SlaveInfo::Capability > &capabilities, const Option< Unavailability > &unavailability, const Resources &total, const hashmap< FrameworkID, Resources > &used)
void setQuota(const std::string &role, const Quota &quota)
Definition: nothing.hpp:16
Definition: option.hpp:28
hashmap< std::string, hashmap< SlaveID, hashset< OfferFilter * > > > offerFilters
Definition: hierarchical.hpp:322
ProcessBase(const std::string &id="")
void _expire(const FrameworkID &frameworkId, const std::string &role, const SlaveID &slaveId, OfferFilter *offerFilter)
void suppressOffers(const FrameworkID &frameworkId, const std::set< std::string > &roles)
hashmap< std::string, process::Owned< Sorter > > frameworkSorters
Definition: hierarchical.hpp:539
void updateAllocation(const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &offeredResources, const std::vector< ResourceConversion > &conversions)
Definition: protobuf_utils.hpp:246
hashmap< SlaveID, hashset< InverseOfferFilter * > > inverseOfferFilters
Definition: hierarchical.hpp:323
Result< ProcessStatus > status(pid_t pid)
Definition: proc.hpp:166
Option< int > expectedAgentCount
Definition: hierarchical.hpp:289
Definition: resources.hpp:79
hashmap< SlaveID, Slave > slaves
Definition: hierarchical.hpp:430
Definition: duration.hpp:32
bool isFiltered(const FrameworkID &frameworkId, const std::string &role, const SlaveID &slaveId, const Resources &resources) const
process::Owned< Sorter > quotaRoleSorter
Definition: hierarchical.hpp:531
MesosAllocator< HierarchicalDRFAllocatorProcess > HierarchicalDRFAllocator
Definition: hierarchical.hpp:61
const std::function< Sorter *()> frameworkSorterFactory
Definition: hierarchical.hpp:542
Definition: hashmap.hpp:38
void requestResources(const FrameworkID &frameworkId, const std::vector< Request > &requests)
void reviveOffers(const FrameworkID &frameworkId, const std::set< std::string > &roles)
Definition: quota.hpp:25
lambda::function< void(const FrameworkID &, const hashmap< std::string, hashmap< SlaveID, Resources >> &)> offerCallback
Definition: hierarchical.hpp:296
Try< Nothing > unavailability(const Unavailability &unavailability)
void updateUnavailability(const SlaveID &slaveId, const Option< Unavailability > &unavailability)
process::Owned< Sorter > roleSorter
Definition: hierarchical.hpp:511
void expire(const FrameworkID &frameworkId, const std::string &role, const SlaveID &slaveId, OfferFilter *offerFilter)
Result< std::vector< Filter< Classifier > > > filters(const std::string &_link, const Handle &parent)
Definition: internal.hpp:776
hashmap< FrameworkID, mesos::allocator::InverseOfferStatus > statuses
Definition: hierarchical.hpp:415
void recover(const int _expectedAgentCount, const hashmap< std::string, Quota > &quotas)
virtual void initialize()
Invoked when a process gets spawned.
Definition: process.hpp:100
Definition: protobuf_utils.hpp:434
Framework(const FrameworkInfo &frameworkInfo, const std::set< std::string > &suppressedRoles, bool active)
hashmap< FrameworkID, Framework > frameworks
Definition: hierarchical.hpp:346
process::Future< hashmap< SlaveID, hashmap< FrameworkID, mesos::allocator::InverseOfferStatus > > > getInverseOfferStatuses()
protobuf::slave::Capabilities capabilities
Definition: hierarchical.hpp:391
HierarchicalAllocatorProcess(const std::function< Sorter *()> &roleSorterFactory, const std::function< Sorter *()> &_frameworkSorterFactory, const std::function< Sorter *()> &quotaRoleSorterFactory)
Definition: hierarchical.hpp:76
std::set< std::string > suppressedRoles
Definition: hierarchical.hpp:315
void addResourceProvider(const SlaveID &slave, const Resources &total, const hashmap< FrameworkID, Resources > &used)
void addFramework(const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const hashmap< SlaveID, Resources > &used, bool active, const std::set< std::string > &suppressedRoles)
void updateWeights(const std::vector< WeightInfo > &weightInfos)
Option< std::set< std::string > > fairnessExcludeResourceNames
Definition: hierarchical.hpp:468
Option< hashset< std::string > > whitelist
Definition: hierarchical.hpp:465
hashmap< std::string, hashset< FrameworkID > > roles
Definition: hierarchical.hpp:445
Option< DomainInfo > domain
Definition: hierarchical.hpp:474
hashset< SlaveID > allocationCandidates
Definition: hierarchical.hpp:435
void updateInverseOffer(const SlaveID &slaveId, const FrameworkID &frameworkId, const Option< UnavailableResources > &unavailableResources, const Option< mesos::allocator::InverseOfferStatus > &status, const Option< Filters > &filters)
process::Future< Nothing > updateAvailable(const SlaveID &slaveId, const std::vector< Offer::Operation > &operations)
Result< Process > process(pid_t pid)
Definition: freebsd.hpp:30
A &quot;process identifier&quot; used to uniquely identify a process when dispatching messages.
Definition: pid.hpp:279
Definition: none.hpp:27
void updateSlave(const SlaveID &slave, const SlaveInfo &slaveInfo, const Option< Resources > &total=None(), const Option< std::vector< SlaveInfo::Capability >> &capabilities=None())
double _quota_allocated(const std::string &role, const std::string &resource)
HierarchicalAllocatorProcess This
Definition: hierarchical.hpp:222
void updateFramework(const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const std::set< std::string > &suppressedRoles)
HierarchicalAllocatorProcess Self
Definition: hierarchical.hpp:221
protobuf::framework::Capabilities capabilities
Definition: hierarchical.hpp:317
Definition: owned.hpp:35
hashmap< std::string, Quota > quotas
Definition: hierarchical.hpp:454
Maintenance(const Unavailability &_unavailability)
Definition: hierarchical.hpp:401
Option< Maintenance > maintenance
Definition: hierarchical.hpp:427
void updateWhitelist(const Option< hashset< std::string >> &whitelist)
virtual ~HierarchicalAllocatorProcess()
Definition: hierarchical.hpp:87
hashmap< std::string, Resources > reservationScalarQuantities
Definition: hierarchical.hpp:462
lambda::function< void(const FrameworkID &, const hashmap< SlaveID, UnavailableResources > &)> inverseOfferCallback
Definition: hierarchical.hpp:301