Apache Mesos
allocator.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_ALLOCATOR_HPP__
18 #define __MASTER_ALLOCATOR_MESOS_ALLOCATOR_HPP__
19 
21 
22 #include <process/dispatch.hpp>
23 #include <process/future.hpp>
24 #include <process/process.hpp>
25 
26 #include <stout/hashmap.hpp>
27 #include <stout/try.hpp>
28 
29 namespace mesos {
30 namespace internal {
31 namespace master {
32 namespace allocator {
33 
35 
36 // A wrapper for Process-based allocators. It redirects all function
37 // invocations to the underlying AllocatorProcess and manages its
38 // lifetime. We ensure the template parameter AllocatorProcess
39 // implements MesosAllocatorProcess by storing a pointer to it.
40 template <typename AllocatorProcess>
42 {
43 public:
44  // Factory to allow for typed tests.
46 
48 
49  void initialize(
50  const Duration& allocationInterval,
51  const lambda::function<
52  void(const FrameworkID&,
53  const hashmap<std::string, hashmap<SlaveID, Resources>>&)>&
54  offerCallback,
55  const lambda::function<
56  void(const FrameworkID&,
58  inverseOfferCallback,
59  const Option<std::set<std::string>>&
60  fairnessExcludeResourceNames = None(),
61  bool filterGpuResources = true,
62  const Option<DomainInfo>& domain = None());
63 
64  void recover(
65  const int expectedAgentCount,
66  const hashmap<std::string, Quota>& quotas);
67 
68  void addFramework(
69  const FrameworkID& frameworkId,
70  const FrameworkInfo& frameworkInfo,
71  const hashmap<SlaveID, Resources>& used,
72  bool active,
73  const std::set<std::string>& suppressedRoles);
74 
75  void removeFramework(
76  const FrameworkID& frameworkId);
77 
78  void activateFramework(
79  const FrameworkID& frameworkId);
80 
82  const FrameworkID& frameworkId);
83 
84  void updateFramework(
85  const FrameworkID& frameworkId,
86  const FrameworkInfo& frameworkInfo,
87  const std::set<std::string>& suppressedRoles);
88 
89  void addSlave(
90  const SlaveID& slaveId,
91  const SlaveInfo& slaveInfo,
92  const std::vector<SlaveInfo::Capability>& capabilities,
94  const Resources& total,
96 
97  void removeSlave(
98  const SlaveID& slaveId);
99 
100  void updateSlave(
101  const SlaveID& slave,
102  const SlaveInfo& slaveInfo,
103  const Option<Resources>& total = None(),
104  const Option<std::vector<SlaveInfo::Capability>>& capabilities = None());
105 
106  void addResourceProvider(
107  const SlaveID& slave,
108  const Resources& total,
109  const hashmap<FrameworkID, Resources>& used);
110 
111  void activateSlave(
112  const SlaveID& slaveId);
113 
114  void deactivateSlave(
115  const SlaveID& slaveId);
116 
117  void updateWhitelist(
118  const Option<hashset<std::string>>& whitelist);
119 
120  void requestResources(
121  const FrameworkID& frameworkId,
122  const std::vector<Request>& requests);
123 
124  void updateAllocation(
125  const FrameworkID& frameworkId,
126  const SlaveID& slaveId,
127  const Resources& offeredResources,
128  const std::vector<ResourceConversion>& conversions);
129 
131  const SlaveID& slaveId,
132  const std::vector<Offer::Operation>& operations);
133 
135  const SlaveID& slaveId,
136  const Option<Unavailability>& unavailability);
137 
138  void updateInverseOffer(
139  const SlaveID& slaveId,
140  const FrameworkID& frameworkId,
141  const Option<UnavailableResources>& unavailableResources,
143  const Option<Filters>& filters);
144 
146  hashmap<SlaveID,
149 
150  void recoverResources(
151  const FrameworkID& frameworkId,
152  const SlaveID& slaveId,
153  const Resources& resources,
154  const Option<Filters>& filters);
155 
156  void suppressOffers(
157  const FrameworkID& frameworkId,
158  const std::set<std::string>& roles);
159 
160  void reviveOffers(
161  const FrameworkID& frameworkId,
162  const std::set<std::string>& roles);
163 
164  void setQuota(
165  const std::string& role,
166  const Quota& quota);
167 
168  void removeQuota(
169  const std::string& role);
170 
171  void updateWeights(
172  const std::vector<WeightInfo>& weightInfos);
173 
174 private:
175  MesosAllocator();
176  MesosAllocator(const MesosAllocator&); // Not copyable.
177  MesosAllocator& operator=(const MesosAllocator&); // Not assignable.
178 
179  MesosAllocatorProcess* process;
180 };
181 
182 
183 // The basic interface for all Process-based allocators.
184 class MesosAllocatorProcess : public process::Process<MesosAllocatorProcess>
185 {
186 public:
188 
190 
191  // Explicitly unhide 'initialize' to silence a compiler warning
192  // from clang, since we overload below.
194 
195  virtual void initialize(
196  const Duration& allocationInterval,
197  const lambda::function<
198  void(const FrameworkID&,
199  const hashmap<std::string, hashmap<SlaveID, Resources>>&)>&
200  offerCallback,
201  const lambda::function<
202  void(const FrameworkID&,
204  inverseOfferCallback,
205  const Option<std::set<std::string>>&
206  fairnessExcludeResourceNames = None(),
207  bool filterGpuResources = true,
208  const Option<DomainInfo>& domain = None()) = 0;
209 
210  virtual void recover(
211  const int expectedAgentCount,
212  const hashmap<std::string, Quota>& quotas) = 0;
213 
214  virtual void addFramework(
215  const FrameworkID& frameworkId,
216  const FrameworkInfo& frameworkInfo,
217  const hashmap<SlaveID, Resources>& used,
218  bool active,
219  const std::set<std::string>& suppressedRoles) = 0;
220 
221  virtual void removeFramework(
222  const FrameworkID& frameworkId) = 0;
223 
224  virtual void activateFramework(
225  const FrameworkID& frameworkId) = 0;
226 
227  virtual void deactivateFramework(
228  const FrameworkID& frameworkId) = 0;
229 
230  virtual void updateFramework(
231  const FrameworkID& frameworkId,
232  const FrameworkInfo& frameworkInfo,
233  const std::set<std::string>& suppressedRoles) = 0;
234 
235  virtual void addSlave(
236  const SlaveID& slaveId,
237  const SlaveInfo& slaveInfo,
238  const std::vector<SlaveInfo::Capability>& capabilities,
240  const Resources& total,
241  const hashmap<FrameworkID, Resources>& used) = 0;
242 
243  virtual void removeSlave(
244  const SlaveID& slaveId) = 0;
245 
246  virtual void updateSlave(
247  const SlaveID& slave,
248  const SlaveInfo& slaveInfo,
249  const Option<Resources>& total = None(),
250  const Option<std::vector<SlaveInfo::Capability>>&
251  capabilities = None()) = 0;
252 
253  virtual void addResourceProvider(
254  const SlaveID& slave,
255  const Resources& total,
256  const hashmap<FrameworkID, Resources>& used) = 0;
257 
258  virtual void activateSlave(
259  const SlaveID& slaveId) = 0;
260 
261  virtual void deactivateSlave(
262  const SlaveID& slaveId) = 0;
263 
264  virtual void updateWhitelist(
265  const Option<hashset<std::string>>& whitelist) = 0;
266 
267  virtual void requestResources(
268  const FrameworkID& frameworkId,
269  const std::vector<Request>& requests) = 0;
270 
271  virtual void updateAllocation(
272  const FrameworkID& frameworkId,
273  const SlaveID& slaveId,
274  const Resources& offeredResources,
275  const std::vector<ResourceConversion>& conversions) = 0;
276 
278  const SlaveID& slaveId,
279  const std::vector<Offer::Operation>& operations) = 0;
280 
281  virtual void updateUnavailability(
282  const SlaveID& slaveId,
284 
285  virtual void updateInverseOffer(
286  const SlaveID& slaveId,
287  const FrameworkID& frameworkId,
288  const Option<UnavailableResources>& unavailableResources,
290  const Option<Filters>& filters = None()) = 0;
291 
292  virtual process::Future<
293  hashmap<SlaveID,
296 
297  virtual void recoverResources(
298  const FrameworkID& frameworkId,
299  const SlaveID& slaveId,
300  const Resources& resources,
301  const Option<Filters>& filters) = 0;
302 
303  virtual void suppressOffers(
304  const FrameworkID& frameworkId,
305  const std::set<std::string>& roles) = 0;
306 
307  virtual void reviveOffers(
308  const FrameworkID& frameworkId,
309  const std::set<std::string>& roles) = 0;
310 
311  virtual void setQuota(
312  const std::string& role,
313  const Quota& quota) = 0;
314 
315  virtual void removeQuota(
316  const std::string& role) = 0;
317 
318  virtual void updateWeights(
319  const std::vector<WeightInfo>& weightInfos) = 0;
320 };
321 
322 
323 template <typename AllocatorProcess>
326 {
327  mesos::allocator::Allocator* allocator =
329  return CHECK_NOTNULL(allocator);
330 }
331 
332 
333 template <typename AllocatorProcess>
335 {
336  process = new AllocatorProcess();
338 }
339 
340 
341 template <typename AllocatorProcess>
343 {
346  delete process;
347 }
348 
349 
350 template <typename AllocatorProcess>
352  const Duration& allocationInterval,
353  const lambda::function<
354  void(const FrameworkID&,
355  const hashmap<std::string, hashmap<SlaveID, Resources>>&)>&
356  offerCallback,
357  const lambda::function<
358  void(const FrameworkID&,
360  inverseOfferCallback,
361  const Option<std::set<std::string>>& fairnessExcludeResourceNames,
362  bool filterGpuResources,
363  const Option<DomainInfo>& domain)
364 {
366  process,
368  allocationInterval,
369  offerCallback,
370  inverseOfferCallback,
371  fairnessExcludeResourceNames,
372  filterGpuResources,
373  domain);
374 }
375 
376 
377 template <typename AllocatorProcess>
379  const int expectedAgentCount,
380  const hashmap<std::string, Quota>& quotas)
381 {
383  process,
385  expectedAgentCount,
386  quotas);
387 }
388 
389 
390 template <typename AllocatorProcess>
392  const FrameworkID& frameworkId,
393  const FrameworkInfo& frameworkInfo,
394  const hashmap<SlaveID, Resources>& used,
395  bool active,
396  const std::set<std::string>& suppressedRoles)
397 {
399  process,
401  frameworkId,
402  frameworkInfo,
403  used,
404  active,
405  suppressedRoles);
406 }
407 
408 
409 template <typename AllocatorProcess>
411  const FrameworkID& frameworkId)
412 {
414  process,
416  frameworkId);
417 }
418 
419 
420 template <typename AllocatorProcess>
422  const FrameworkID& frameworkId)
423 {
425  process,
427  frameworkId);
428 }
429 
430 
431 template <typename AllocatorProcess>
433  const FrameworkID& frameworkId)
434 {
436  process,
438  frameworkId);
439 }
440 
441 
442 template <typename AllocatorProcess>
444  const FrameworkID& frameworkId,
445  const FrameworkInfo& frameworkInfo,
446  const std::set<std::string>& suppressedRoles)
447 {
449  process,
451  frameworkId,
452  frameworkInfo,
453  suppressedRoles);
454 }
455 
456 
457 template <typename AllocatorProcess>
459  const SlaveID& slaveId,
460  const SlaveInfo& slaveInfo,
461  const std::vector<SlaveInfo::Capability>& capabilities,
463  const Resources& total,
465 {
467  process,
469  slaveId,
470  slaveInfo,
471  capabilities,
472  unavailability,
473  total,
474  used);
475 }
476 
477 
478 template <typename AllocatorProcess>
480  const SlaveID& slaveId)
481 {
483  process,
485  slaveId);
486 }
487 
488 
489 template <typename AllocatorProcess>
491  const SlaveID& slaveId,
492  const SlaveInfo& slaveInfo,
493  const Option<Resources>& total,
494  const Option<std::vector<SlaveInfo::Capability>>& capabilities)
495 {
497  process,
499  slaveId,
500  slaveInfo,
501  total,
502  capabilities);
503 }
504 
505 template <typename AllocatorProcess>
507  const SlaveID& slave,
508  const Resources& total,
510 {
512  process,
514  slave,
515  total,
516  used);
517 }
518 
519 
520 template <typename AllocatorProcess>
522  const SlaveID& slaveId)
523 {
525  process,
527  slaveId);
528 }
529 
530 
531 template <typename AllocatorProcess>
533  const SlaveID& slaveId)
534 {
536  process,
538  slaveId);
539 }
540 
541 
542 template <typename AllocatorProcess>
544  const Option<hashset<std::string>>& whitelist)
545 {
547  process,
549  whitelist);
550 }
551 
552 
553 template <typename AllocatorProcess>
555  const FrameworkID& frameworkId,
556  const std::vector<Request>& requests)
557 {
559  process,
561  frameworkId,
562  requests);
563 }
564 
565 
566 template <typename AllocatorProcess>
568  const FrameworkID& frameworkId,
569  const SlaveID& slaveId,
570  const Resources& offeredResources,
571  const std::vector<ResourceConversion>& conversions)
572 {
574  process,
576  frameworkId,
577  slaveId,
578  offeredResources,
579  conversions);
580 }
581 
582 
583 template <typename AllocatorProcess>
586  const SlaveID& slaveId,
587  const std::vector<Offer::Operation>& operations)
588 {
589  return process::dispatch(
590  process,
592  slaveId,
593  operations);
594 }
595 
596 
597 template <typename AllocatorProcess>
599  const SlaveID& slaveId,
601 {
602  return process::dispatch(
603  process,
605  slaveId,
606  unavailability);
607 }
608 
609 
610 template <typename AllocatorProcess>
612  const SlaveID& slaveId,
613  const FrameworkID& frameworkId,
614  const Option<UnavailableResources>& unavailableResources,
616  const Option<Filters>& filters)
617 {
618  return process::dispatch(
619  process,
621  slaveId,
622  frameworkId,
623  unavailableResources,
624  status,
625  filters);
626 }
627 
628 
629 template <typename AllocatorProcess>
630 inline process::Future<
631  hashmap<SlaveID,
634 {
635  return process::dispatch(
636  process,
638 }
639 
640 
641 template <typename AllocatorProcess>
643  const FrameworkID& frameworkId,
644  const SlaveID& slaveId,
645  const Resources& resources,
646  const Option<Filters>& filters)
647 {
649  process,
651  frameworkId,
652  slaveId,
653  resources,
654  filters);
655 }
656 
657 
658 template <typename AllocatorProcess>
660  const FrameworkID& frameworkId,
661  const std::set<std::string>& roles)
662 {
664  process,
666  frameworkId,
667  roles);
668 }
669 
670 
671 template <typename AllocatorProcess>
673  const FrameworkID& frameworkId,
674  const std::set<std::string>& roles)
675 {
677  process,
679  frameworkId,
680  roles);
681 }
682 
683 
684 template <typename AllocatorProcess>
686  const std::string& role,
687  const Quota& quota)
688 {
690  process,
692  role,
693  quota);
694 }
695 
696 
697 template <typename AllocatorProcess>
699  const std::string& role)
700 {
702  process,
704  role);
705 }
706 
707 
708 template <typename AllocatorProcess>
710  const std::vector<WeightInfo>& weightInfos)
711 {
713  process,
715  weightInfos);
716 }
717 
718 } // namespace allocator {
719 } // namespace master {
720 } // namespace internal {
721 } // namespace mesos {
722 
723 #endif // __MASTER_ALLOCATOR_MESOS_ALLOCATOR_HPP__
virtual void deactivateSlave(const SlaveID &slaveId)=0
void activateFramework(const FrameworkID &frameworkId)
Activates a framework in the Mesos cluster.
Definition: allocator.hpp:421
virtual ~MesosAllocatorProcess()
Definition: allocator.hpp:189
virtual void requestResources(const FrameworkID &frameworkId, const std::vector< Request > &requests)=0
void setQuota(const std::string &role, const Quota &quota)
Informs the allocator to set quota for the given role.
Definition: allocator.hpp:685
virtual void updateInverseOffer(const SlaveID &slaveId, const FrameworkID &frameworkId, const Option< UnavailableResources > &unavailableResources, const Option< mesos::allocator::InverseOfferStatus > &status, const Option< Filters > &filters=None())=0
Definition: option.hpp:28
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)
Adds or re-adds an agent to the Mesos cluster.
Definition: allocator.hpp:458
void removeFramework(const FrameworkID &frameworkId)
Removes a framework from the Mesos cluster.
Definition: allocator.hpp:410
virtual void addResourceProvider(const SlaveID &slave, const Resources &total, const hashmap< FrameworkID, Resources > &used)=0
virtual void recover(const int expectedAgentCount, const hashmap< std::string, Quota > &quotas)=0
Definition: try.hpp:34
virtual void deactivateFramework(const FrameworkID &frameworkId)=0
void updateAllocation(const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &offeredResources, const std::vector< ResourceConversion > &conversions)
Updates allocation by applying offer operations.
Definition: allocator.hpp:567
void updateInverseOffer(const SlaveID &slaveId, const FrameworkID &frameworkId, const Option< UnavailableResources > &unavailableResources, const Option< mesos::allocator::InverseOfferStatus > &status, const Option< Filters > &filters)
Definition: allocator.hpp:611
void requestResources(const FrameworkID &frameworkId, const std::vector< Request > &requests)
Requests resources for a framework.
Definition: allocator.hpp:554
Result< ProcessStatus > status(pid_t pid)
Definition: proc.hpp:166
void addFramework(const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const hashmap< SlaveID, Resources > &used, bool active, const std::set< std::string > &suppressedRoles)
Adds a framework to the Mesos cluster.
Definition: allocator.hpp:391
virtual void setQuota(const std::string &role, const Quota &quota)=0
Definition: resources.hpp:79
void updateFramework(const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const std::set< std::string > &suppressedRoles)
Updates capabilities of a framework in the Mesos cluster.
Definition: allocator.hpp:443
virtual 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)=0
virtual void activateFramework(const FrameworkID &frameworkId)=0
static Try< mesos::allocator::Allocator * > create()
Definition: allocator.hpp:325
UPID spawn(ProcessBase *process, bool manage=false)
Spawn a new process.
void updateWeights(const std::vector< WeightInfo > &weightInfos)
Updates the weight associated with one or more roles.
Definition: allocator.hpp:709
Definition: duration.hpp:32
void updateWhitelist(const Option< hashset< std::string >> &whitelist)
Updates the list of trusted agents.
Definition: allocator.hpp:543
void terminate(const UPID &pid, bool inject=true)
Sends a TerminateEvent to the given process.
void suppressOffers(const FrameworkID &frameworkId, const std::set< std::string > &roles)
Suppresses offers.
Definition: allocator.hpp:659
void deactivateSlave(const SlaveID &slaveId)
Deactivates an agent.
Definition: allocator.hpp:532
void reviveOffers(const FrameworkID &frameworkId, const std::set< std::string > &roles)
Revives offers to this framework for the specified roles.
Definition: allocator.hpp:672
Definition: hashmap.hpp:38
void dispatch(const PID< T > &pid, void(T::*method)())
Definition: dispatch.hpp:174
virtual void suppressOffers(const FrameworkID &frameworkId, const std::set< std::string > &roles)=0
virtual process::Future< hashmap< SlaveID, hashmap< FrameworkID, mesos::allocator::InverseOfferStatus > > > getInverseOfferStatuses()=0
Definition: quota.hpp:25
Try< Nothing > unavailability(const Unavailability &unavailability)
Result< std::vector< Filter< Classifier > > > filters(const std::string &_link, const Handle &parent)
Definition: internal.hpp:776
virtual void activateSlave(const SlaveID &slaveId)=0
virtual void removeSlave(const SlaveID &slaveId)=0
virtual void initialize()
Invoked when a process gets spawned.
Definition: process.hpp:100
~MesosAllocator()
Definition: allocator.hpp:342
virtual void updateUnavailability(const SlaveID &slaveId, const Option< Unavailability > &unavailability)=0
virtual process::Future< Nothing > updateAvailable(const SlaveID &slaveId, const std::vector< Offer::Operation > &operations)=0
void recoverResources(const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &resources, const Option< Filters > &filters)
Recovers resources.
Definition: allocator.hpp:642
void updateUnavailability(const SlaveID &slaveId, const Option< Unavailability > &unavailability)
Updates unavailability for an agent.
Definition: allocator.hpp:598
virtual void reviveOffers(const FrameworkID &frameworkId, const std::set< std::string > &roles)=0
void addResourceProvider(const SlaveID &slave, const Resources &total, const hashmap< FrameworkID, Resources > &used)
Add resources from a local resource provider to an agent.
Definition: allocator.hpp:506
virtual void updateWeights(const std::vector< WeightInfo > &weightInfos)=0
virtual void updateFramework(const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const std::set< std::string > &suppressedRoles)=0
bool wait(const UPID &pid, const Duration &duration=Seconds(-1))
Wait for the process to exit for no more than the specified seconds.
virtual void updateWhitelist(const Option< hashset< std::string >> &whitelist)=0
void removeQuota(const std::string &role)
Informs the allocator to remove quota for the given role.
Definition: allocator.hpp:698
Basic model of an allocator: resources are allocated to a framework in the form of offers...
Definition: allocator.hpp:55
void removeSlave(const SlaveID &slaveId)
Removes an agent from the Mesos cluster.
Definition: allocator.hpp:479
Result< Process > process(pid_t pid)
Definition: freebsd.hpp:30
Definition: none.hpp:27
virtual void removeFramework(const FrameworkID &frameworkId)=0
void activateSlave(const SlaveID &slaveId)
Activates an agent.
Definition: allocator.hpp:521
virtual void updateSlave(const SlaveID &slave, const SlaveInfo &slaveInfo, const Option< Resources > &total=None(), const Option< std::vector< SlaveInfo::Capability >> &capabilities=None())=0
virtual void removeQuota(const std::string &role)=0
void initialize(const Duration &allocationInterval, const lambda::function< void(const FrameworkID &, const hashmap< std::string, hashmap< SlaveID, Resources >> &)> &offerCallback, const lambda::function< void(const FrameworkID &, const hashmap< SlaveID, UnavailableResources > &)> &inverseOfferCallback, const Option< std::set< std::string >> &fairnessExcludeResourceNames=None(), bool filterGpuResources=true, const Option< DomainInfo > &domain=None())
Initializes the allocator when the master starts up.
Definition: allocator.hpp:351
virtual void recoverResources(const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &resources, const Option< Filters > &filters)=0
void recover(const int expectedAgentCount, const hashmap< std::string, Quota > &quotas)
Informs the allocator of the recovered state from the master.
Definition: allocator.hpp:378
void deactivateFramework(const FrameworkID &frameworkId)
Deactivates a framework in the Mesos cluster.
Definition: allocator.hpp:432
virtual void addFramework(const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const hashmap< SlaveID, Resources > &used, bool active, const std::set< std::string > &suppressedRoles)=0
virtual void updateAllocation(const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &offeredResources, const std::vector< ResourceConversion > &conversions)=0
Definition: process.hpp:493
void updateSlave(const SlaveID &slave, const SlaveInfo &slaveInfo, const Option< Resources > &total=None(), const Option< std::vector< SlaveInfo::Capability >> &capabilities=None())
Updates an agent.
Definition: allocator.hpp:490
process::Future< Nothing > updateAvailable(const SlaveID &slaveId, const std::vector< Offer::Operation > &operations)
Updates available resources on an agent based on a sequence of offer operations.
Definition: allocator.hpp:585
process::Future< hashmap< SlaveID, hashmap< FrameworkID, mesos::allocator::InverseOfferStatus > > > getInverseOfferStatuses()
Retrieves the status of all inverse offers maintained by the allocator.
Definition: allocator.hpp:633