17 #ifndef __MESOS_ALLOCATOR_ALLOCATOR_HPP__
18 #define __MESOS_ALLOCATOR_ALLOCATOR_HPP__
24 #include <mesos/allocator/allocator.pb.h>
87 const lambda::function<
88 void(
const FrameworkID&,
91 const lambda::function<
92 void(
const FrameworkID&,
95 const Option<std::set<std::string>>&
96 fairnessExcludeResourceNames =
None(),
97 bool filterGpuResources =
true,
114 const int expectedAgentCount,
132 const FrameworkID& frameworkId,
133 const FrameworkInfo& frameworkInfo,
136 const std::set<std::string>& suppressedRoles) = 0;
144 const FrameworkID& frameworkId) = 0;
151 const FrameworkID& frameworkId) = 0;
158 const FrameworkID& frameworkId) = 0;
171 const FrameworkID& frameworkId,
172 const FrameworkInfo& frameworkInfo,
173 const std::set<std::string>& suppressedRoles) = 0;
191 const SlaveID& slaveId,
192 const SlaveInfo& slaveInfo,
193 const std::vector<SlaveInfo::Capability>& capabilities,
203 const SlaveID& slaveId) = 0;
215 const SlaveID& slave,
216 const SlaveInfo& slaveInfo,
218 const Option<std::vector<SlaveInfo::Capability>>&
219 capabilities =
None()) = 0;
230 const SlaveID& slave,
239 const SlaveID& slaveId) = 0;
250 const SlaveID& slaveId) = 0;
271 const FrameworkID& frameworkId,
272 const std::vector<Request>& requests) = 0;
285 const FrameworkID& frameworkId,
286 const SlaveID& slaveId,
288 const std::vector<ResourceConversion>& conversions) = 0;
298 const SlaveID& slaveId,
299 const std::vector<Offer::Operation>& operations) = 0;
310 const SlaveID& slaveId,
332 const SlaveID& slaveId,
333 const FrameworkID& frameworkId,
360 const FrameworkID& frameworkId,
361 const SlaveID& slaveId,
373 const FrameworkID& frameworkId,
374 const std::set<std::string>& roles) = 0;
384 const FrameworkID& frameworkId,
385 const std::set<std::string>& roles) = 0;
406 const std::string& role,
407 const Quota& quota) = 0;
424 const std::string& role) = 0;
432 const std::vector<WeightInfo>& weightInfos) = 0;
438 #endif // __MESOS_MASTER_ALLOCATOR_HPP__
Allocator()
Definition: allocator.hpp:67
virtual void recoverResources(const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &resources, const Option< Filters > &filters)=0
Recovers resources.
virtual void removeQuota(const std::string &role)=0
Informs the allocator to remove quota for the given role.
virtual void addResourceProvider(const SlaveID &slave, const Resources &total, const hashmap< FrameworkID, Resources > &used)=0
Add resources from a local resource provider to an agent.
Definition: option.hpp:28
virtual ~Allocator()
Definition: allocator.hpp:69
virtual void activateSlave(const SlaveID &slaveId)=0
Activates an agent.
virtual void updateAllocation(const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &offeredResources, const std::vector< ResourceConversion > &conversions)=0
Updates allocation by applying offer operations.
Result< ProcessStatus > status(pid_t pid)
Definition: proc.hpp:166
virtual 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())=0
Initializes the allocator when the master starts up.
Definition: resources.hpp:79
virtual void reviveOffers(const FrameworkID &frameworkId, const std::set< std::string > &roles)=0
Revives offers to this framework for the specified roles.
virtual process::Future< hashmap< SlaveID, hashmap< FrameworkID, mesos::allocator::InverseOfferStatus > > > getInverseOfferStatuses()=0
Retrieves the status of all inverse offers maintained by the allocator.
Definition: duration.hpp:32
virtual void deactivateFramework(const FrameworkID &frameworkId)=0
Deactivates a framework in the Mesos cluster.
virtual void addFramework(const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const hashmap< SlaveID, Resources > &used, bool active, const std::set< std::string > &suppressedRoles)=0
Adds a framework to the Mesos cluster.
Definition: hashmap.hpp:38
virtual void updateWeights(const std::vector< WeightInfo > &weightInfos)=0
Updates the weight associated with one or more roles.
virtual void removeSlave(const SlaveID &slaveId)=0
Removes an agent from the Mesos cluster.
Try< Nothing > unavailability(const Unavailability &unavailability)
virtual void activateFramework(const FrameworkID &frameworkId)=0
Activates a framework in the Mesos cluster.
Result< std::vector< Filter< Classifier > > > filters(const std::string &_link, const Handle &parent)
Definition: internal.hpp:776
virtual void updateFramework(const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const std::set< std::string > &suppressedRoles)=0
Updates capabilities of a framework in the Mesos cluster.
virtual void setQuota(const std::string &role, const Quota "a)=0
Informs the allocator to set quota for the given role.
virtual void removeFramework(const FrameworkID &frameworkId)=0
Removes a framework from the Mesos cluster.
virtual void updateUnavailability(const SlaveID &slaveId, const Option< Unavailability > &unavailability)=0
Updates unavailability for an agent.
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
Adds or re-adds an agent to the Mesos cluster.
Basic model of an allocator: resources are allocated to a framework in the form of offers...
Definition: allocator.hpp:55
virtual void deactivateSlave(const SlaveID &slaveId)=0
Deactivates an agent.
static Try< Allocator * > create(const std::string &name)
Attempts either to create a built-in DRF allocator or to load an allocator instance from a module usi...
virtual void updateWhitelist(const Option< hashset< std::string >> &whitelist)=0
Updates the list of trusted agents.
virtual void requestResources(const FrameworkID &frameworkId, const std::vector< Request > &requests)=0
Requests resources for a framework.
virtual void recover(const int expectedAgentCount, const hashmap< std::string, Quota > "as)=0
Informs the allocator of the recovered state from the master.
virtual void suppressOffers(const FrameworkID &frameworkId, const std::set< std::string > &roles)=0
Suppresses offers.
virtual process::Future< Nothing > updateAvailable(const SlaveID &slaveId, const std::vector< Offer::Operation > &operations)=0
Updates available resources on an agent based on a sequence of offer operations.
constexpr const char * name
Definition: shell.hpp:41
virtual void updateInverseOffer(const SlaveID &slaveId, const FrameworkID &frameworkId, const Option< UnavailableResources > &unavailableResources, const Option< InverseOfferStatus > &status, const Option< Filters > &filters=None())=0
Updates inverse offer.
virtual void updateSlave(const SlaveID &slave, const SlaveInfo &slaveInfo, const Option< Resources > &total=None(), const Option< std::vector< SlaveInfo::Capability >> &capabilities=None())=0
Updates an agent.