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