17 #ifndef __MESOS_ALLOCATOR_ALLOCATOR_HPP__ 18 #define __MESOS_ALLOCATOR_ALLOCATOR_HPP__ 24 #include <mesos/allocator/allocator.pb.h> 25 #include <mesos/scheduler/scheduler.pb.h> 86 class OfferConstraintsFilterImpl;
111 scheduler::OfferConstraints&& constraints);
130 bool isAgentExcluded(
131 const std::string& role,
132 const SlaveInfo& agentInfo)
const;
137 std::unique_ptr<internal::OfferConstraintsFilterImpl> impl;
186 const std::string&
name,
187 const std::string& roleSorter,
188 const std::string& frameworkSorter);
210 const lambda::function<
211 void(
const FrameworkID&,
214 const lambda::function<
215 void(
const FrameworkID&,
217 inverseOfferCallback) = 0;
233 const int expectedAgentCount,
250 virtual void addFramework(
251 const FrameworkID& frameworkId,
252 const FrameworkInfo& frameworkInfo,
262 virtual void removeFramework(
263 const FrameworkID& frameworkId) = 0;
269 virtual void activateFramework(
270 const FrameworkID& frameworkId) = 0;
276 virtual void deactivateFramework(
277 const FrameworkID& frameworkId) = 0;
286 virtual void updateFramework(
287 const FrameworkID& frameworkId,
288 const FrameworkInfo& frameworkInfo,
311 virtual void addSlave(
312 const SlaveID& slaveId,
313 const SlaveInfo& slaveInfo,
314 const std::vector<SlaveInfo::Capability>& capabilities,
323 virtual void removeSlave(
324 const SlaveID& slaveId) = 0;
335 virtual void updateSlave(
336 const SlaveID& slave,
337 const SlaveInfo& slaveInfo,
339 const Option<std::vector<SlaveInfo::Capability>>&
340 capabilities =
None()) = 0;
350 virtual void addResourceProvider(
351 const SlaveID& slave,
359 virtual void activateSlave(
360 const SlaveID& slaveId) = 0;
370 virtual void deactivateSlave(
371 const SlaveID& slaveId) = 0;
381 virtual void updateWhitelist(
391 virtual void requestResources(
392 const FrameworkID& frameworkId,
393 const std::vector<Request>& requests) = 0;
405 virtual void updateAllocation(
406 const FrameworkID& frameworkId,
407 const SlaveID& slaveId,
409 const std::vector<ResourceConversion>& conversions) = 0;
419 const SlaveID& slaveId,
420 const std::vector<Offer::Operation>& operations) = 0;
430 virtual void updateUnavailability(
431 const SlaveID& slaveId,
452 virtual void updateInverseOffer(
453 const SlaveID& slaveId,
454 const FrameworkID& frameworkId,
465 getInverseOfferStatuses() = 0;
471 virtual void transitionOfferedToAllocated(
472 const SlaveID& slaveId,
const Resources& resources) = 0;
489 virtual void recoverResources(
490 const FrameworkID& frameworkId,
491 const SlaveID& slaveId,
494 bool isAllocated) = 0;
503 virtual void suppressOffers(
504 const FrameworkID& frameworkId,
505 const std::set<std::string>& roles) = 0;
514 virtual void reviveOffers(
515 const FrameworkID& frameworkId,
516 const std::set<std::string>& roles) = 0;
527 virtual void updateQuota(
528 const std::string& role,
529 const Quota& quota) = 0;
536 virtual void updateWeights(
537 const std::vector<WeightInfo>& weightInfos) = 0;
542 virtual void pause() = 0;
547 virtual void resume() = 0;
553 #endif // __MESOS_MASTER_ALLOCATOR_HPP__ Allocator()
Definition: allocator.hpp:190
Protocol< RecoverRequest, RecoverResponse > recover
Option<::mesos::Authorizer * > authorizer
Definition: allocator.hpp:77
Per-framework allocator-specific options that are not part of FrameworkInfo.
Definition: allocator.hpp:147
Definition: option.hpp:29
Option< std::vector< ResourceQuantities > > minAllocatableResources
Definition: allocator.hpp:67
double agentRecoveryFactor
Definition: allocator.hpp:81
Definition: allocator.hpp:98
OfferConstraintsFilter offerConstraintsFilter
The internal representation of framework's offer constraints.
Definition: allocator.hpp:157
virtual ~Allocator()
Definition: allocator.hpp:192
Result< ProcessStatus > status(pid_t pid)
Definition: proc.hpp:166
Definition: resources.hpp:83
constexpr double DEFAULT_ALLOCATOR_AGENT_RECOVERY_FACTOR
Definition: allocator.hpp:47
Pass in configuration to the allocator.
Definition: allocator.hpp:53
Bytes maxMem
Definition: allocator.hpp:102
Definition: duration.hpp:32
Definition: hashmap.hpp:38
Option< DomainInfo > domain
Definition: allocator.hpp:64
Try< Nothing > unavailability(const Unavailability &unavailability)
Try< Bytes > used(const std::string &path="/")
Definition: fs.hpp:43
Try< Nothing > initialize(const Flags &flags)
Initialized state for support of systemd functions in this file.
Result< std::vector< Filter< Classifier > > > filters(const std::string &_link, const Handle &parent)
Definition: internal.hpp:769
Definition: duration.hpp:221
Definition: duration.hpp:207
Definition: allocator.hpp:100
bool filterGpuResources
Definition: allocator.hpp:61
Definition: allocator.hpp:91
Basic model of an allocator: resources are allocated to a framework in the form of offers...
Definition: allocator.hpp:172
constexpr Duration DEFAULT_ALLOCATOR_RECOVERY_TIMEOUT
Definition: allocator.hpp:46
std::set< std::string > suppressedRoles
The set of roles for which the allocator should not generate offers.
Definition: allocator.hpp:152
Definition: attributes.hpp:24
int maxProgramSize
Definition: allocator.hpp:103
Option< std::string > readonlyHttpAuthenticationRealm
Definition: allocator.hpp:74
Try< Nothing > create(const std::string &hierarchy, const std::string &cgroup, bool recursive=false)
size_t maxCompletedFrameworks
Definition: allocator.hpp:69
Option< std::set< std::string > > fairnessExcludeResourceNames
Definition: allocator.hpp:58
bool publishPerFrameworkMetrics
Definition: allocator.hpp:71
constexpr const char * name
Definition: shell.hpp:41
Duration allocationInterval
Definition: allocator.hpp:55
Duration recoveryTimeout
Definition: allocator.hpp:80
RE2Limits re2Limits
Definition: allocator.hpp:106