Apache Mesos
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess Class Reference

#include <hierarchical.hpp>

Inheritance diagram for mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess:
mesos::internal::master::allocator::MesosAllocatorProcess process::Process< MesosAllocatorProcess > process::ProcessBase process::EventConsumer mesos::internal::master::allocator::HierarchicalAllocatorProcess< RoleSorter, FrameworkSorter >

Public Member Functions

 HierarchicalAllocatorProcess (const std::function< Sorter *()> &roleSorterFactory, const std::function< Sorter *()> &_frameworkSorterFactory)
 
 ~HierarchicalAllocatorProcess () override
 
process::PID< HierarchicalAllocatorProcessself () const
 
void initialize (const mesos::allocator::Options &options, 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) override
 
void recover (const int _expectedAgentCount, const hashmap< std::string, Quota > &quotas) override
 
void addFramework (const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const hashmap< SlaveID, Resources > &used, bool active,::mesos::allocator::FrameworkOptions &&frameworkOptions) override
 
void removeFramework (const FrameworkID &frameworkId) override
 
void activateFramework (const FrameworkID &frameworkId) override
 
void deactivateFramework (const FrameworkID &frameworkId) override
 
void updateFramework (const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo,::mesos::allocator::FrameworkOptions &&frameworkOptions) override
 
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) override
 
void removeSlave (const SlaveID &slaveId) override
 
void updateSlave (const SlaveID &slave, const SlaveInfo &slaveInfo, const Option< Resources > &total=None(), const Option< std::vector< SlaveInfo::Capability >> &capabilities=None()) override
 
void addResourceProvider (const SlaveID &slave, const Resources &total, const hashmap< FrameworkID, Resources > &used) override
 
void deactivateSlave (const SlaveID &slaveId) override
 
void activateSlave (const SlaveID &slaveId) override
 
void updateWhitelist (const Option< hashset< std::string >> &whitelist) override
 
void requestResources (const FrameworkID &frameworkId, const std::vector< Request > &requests) override
 
void updateAllocation (const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &offeredResources, const std::vector< ResourceConversion > &conversions) override
 
process::Future< NothingupdateAvailable (const SlaveID &slaveId, const std::vector< Offer::Operation > &operations) override
 
void updateUnavailability (const SlaveID &slaveId, const Option< Unavailability > &unavailability) override
 
void updateInverseOffer (const SlaveID &slaveId, const FrameworkID &frameworkId, const Option< UnavailableResources > &unavailableResources, const Option< mesos::allocator::InverseOfferStatus > &status, const Option< Filters > &filters) override
 
process::Future< hashmap< SlaveID, hashmap< FrameworkID, mesos::allocator::InverseOfferStatus > > > getInverseOfferStatuses () override
 
void transitionOfferedToAllocated (const SlaveID &slaveId, const Resources &resources) override
 
void recoverResources (const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &resources, const Option< Filters > &filters, bool isAllocated) override
 
void suppressOffers (const FrameworkID &frameworkId, const std::set< std::string > &roles) override
 
void reviveOffers (const FrameworkID &frameworkId, const std::set< std::string > &roles) override
 
void updateQuota (const std::string &role, const Quota &quota) override
 
void updateWeights (const std::vector< WeightInfo > &weightInfos) override
 
void pause () override
 
void resume () override
 
- Public Member Functions inherited from mesos::internal::master::allocator::MesosAllocatorProcess
 MesosAllocatorProcess ()
 
 ~MesosAllocatorProcess () override
 
- Public Member Functions inherited from process::Process< MesosAllocatorProcess >
 ~Process () override
 
PID< MesosAllocatorProcess > self () const
 Returns the PID of the process. More...
 
- Public Member Functions inherited from process::ProcessBase
 ProcessBase (const std::string &id="")
 
 ~ProcessBase () override
 
const UPIDself () const
 
- Public Member Functions inherited from process::EventConsumer
virtual ~EventConsumer ()
 

Protected Types

typedef HierarchicalAllocatorProcess Self
 
typedef HierarchicalAllocatorProcess This
 
- Protected Types inherited from process::Process< MesosAllocatorProcess >
typedef MesosAllocatorProcess Self
 
typedef MesosAllocatorProcess This
 
- Protected Types inherited from process::ProcessBase
enum  RemoteConnection { RemoteConnection::REUSE, RemoteConnection::RECONNECT }
 Describes the behavior of the link call when the target pid points to a remote process. More...
 
typedef lambda::function< void(const UPID &, const std::string &)> MessageHandler
 Any function which takes a "from" UPID and a message body as arguments. More...
 
typedef lambda::function< Future< http::Response >const http::Request &)> HttpRequestHandler
 Any function which takes a process::http::Request and returns a process::http::Response. More...
 
typedef lambda::function< Future< http::Response > const http::Request &, const Option< http::authentication::Principal > &)> AuthenticatedHttpRequestHandler
 Any function which takes a process::http::Request and an Option<Principal> and returns a process::http::Response. More...
 

Protected Member Functions

process::Future< NothinggenerateOffers ()
 
process::Future< NothinggenerateOffers (const SlaveID &slaveId)
 
process::Future< NothinggenerateOffers (const hashset< SlaveID > &slaveIds)
 
Nothing _generateOffers ()
 
void __generateOffers ()
 
void generateInverseOffers ()
 
void expire (const FrameworkID &frameworkId, const std::string &role, const SlaveID &slaveId, const std::weak_ptr< OfferFilter > &offerFilter)
 
void _expire (const FrameworkID &frameworkId, const std::string &role, const SlaveID &slaveId, const std::weak_ptr< OfferFilter > &offerFilter)
 
void expire (const FrameworkID &frameworkId, const SlaveID &slaveId, const std::weak_ptr< InverseOfferFilter > &inverseOfferFilter)
 
bool isWhitelisted (const SlaveID &slaveId) const
 
bool isFiltered (const Framework &framework, const std::string &role, const Slave &slave, const Resources &resources) const
 
bool isFiltered (const Framework &framework, const Slave &slave) const
 
bool allocatable (const Resources &resources, const std::string &role, const Framework &framework) const
 
double _event_queue_dispatches ()
 
double _resources_total (const std::string &resource)
 
double _resources_offered_or_allocated (const std::string &resource)
 
double _quota_offered_or_allocated (const std::string &role, const std::string &resource)
 
double _offer_filters_active (const std::string &role)
 
- Protected Member Functions inherited from process::ProcessBase
virtual void serve (Event &&event)
 Invoked when an event is serviced. More...
 
void consume (MessageEvent &&event) override
 
void consume (DispatchEvent &&event) override
 
void consume (HttpEvent &&event) override
 
void consume (ExitedEvent &&event) override
 
void consume (TerminateEvent &&event) override
 
virtual void initialize ()
 Invoked when a process gets spawned. More...
 
virtual void finalize ()
 Invoked when a process is terminated. More...
 
virtual void exited (const UPID &)
 Invoked when a linked process has exited. More...
 
virtual void lost (const UPID &)
 Invoked when a linked process can no longer be monitored. More...
 
void send (const UPID &to, const std::string &name, const char *data=nullptr, size_t length=0)
 Sends the message to the specified UPID. More...
 
void send (const UPID &to, std::string &&name)
 
void send (const UPID &to, std::string &&name, std::string &&data)
 
UPID link (const UPID &pid, const RemoteConnection remote=RemoteConnection::REUSE)
 Links with the specified UPID. More...
 
void install (const std::string &name, const MessageHandler &handler)
 Sets up a handler for messages with the specified name. More...
 
template<typename T >
void install (const std::string &name, void(T::*method)(const UPID &, const std::string &))
 Sets up a handler for messages with the specified name. More...
 
void delegate (const std::string &name, const UPID &pid)
 Delegates incoming messages, with the specified name, to the UPID. More...
 
void route (const std::string &name, const Option< std::string > &help, const HttpRequestHandler &handler, const RouteOptions &options=RouteOptions())
 Sets up a handler for HTTP requests with the specified name. More...
 
template<typename T >
void route (const std::string &name, const Option< std::string > &help, Future< http::Response >(T::*method)(const http::Request &), const RouteOptions &options=RouteOptions())
 Sets up a handler for HTTP requests with the specified name. More...
 
void route (const std::string &name, const std::string &realm, const Option< std::string > &help, const AuthenticatedHttpRequestHandler &handler, const RouteOptions &options=RouteOptions())
 
template<typename T >
void route (const std::string &name, const Option< std::string > &realm, const Option< std::string > &help, Future< http::Response >(T::*method)(const http::Request &, const Option< http::authentication::Principal > &), const RouteOptions &options=RouteOptions())
 Forwards to the correct overload of process::ProcessBase::route(), depending on whether the authentication realm realm is present. More...
 
void provide (const std::string &name, const std::string &path, const std::map< std::string, std::string > &types=mime::types)
 Sets up the default HTTP request handler to provide the static asset(s) at the specified absolute path for the specified name. More...
 
template<typename T >
size_t eventCount ()
 Returns the number of events of the given type currently on the event queue. More...
 

Protected Attributes

bool initialized
 
bool paused
 
mesos::allocator::Options options
 
Option< int > expectedAgentCount
 
lambda::function< void(const FrameworkID &, const hashmap< std::string, hashmap< SlaveID, Resources >> &)> offerCallback
 
lambda::function< void(const FrameworkID &, const hashmap< SlaveID, UnavailableResources > &)> inverseOfferCallback
 
friend Metrics
 
Metrics metrics
 
hashmap< FrameworkID, Frameworkframeworks
 
BoundedHashMap< FrameworkID, process::Owned< FrameworkMetrics > > completedFrameworkMetrics
 
hashmap< SlaveID, Slaveslaves
 
ResourceQuantities totalScalarQuantities
 
RoleTree roleTree
 
hashset< SlaveID > allocationCandidates
 
Option< process::Future< Nothing > > offerGeneration
 
Option< hashset< std::string > > whitelist
 
process::Owned< SorterroleSorter
 
hashmap< std::string, process::Owned< Sorter > > frameworkSorters
 
const std::function< Sorter *()> frameworkSorterFactory
 

Member Typedef Documentation

Constructor & Destructor Documentation

mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::HierarchicalAllocatorProcess ( const std::function< Sorter *()> &  roleSorterFactory,
const std::function< Sorter *()> &  _frameworkSorterFactory 
)
inline
mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::~HierarchicalAllocatorProcess ( )
inlineoverride

Member Function Documentation

void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::__generateOffers ( )
protected
double mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::_event_queue_dispatches ( )
inlineprotected
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::_expire ( const FrameworkID &  frameworkId,
const std::string &  role,
const SlaveID &  slaveId,
const std::weak_ptr< OfferFilter > &  offerFilter 
)
protected
Nothing mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::_generateOffers ( )
protected
double mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::_offer_filters_active ( const std::string &  role)
protected
double mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::_quota_offered_or_allocated ( const std::string &  role,
const std::string &  resource 
)
protected
double mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::_resources_offered_or_allocated ( const std::string &  resource)
protected
double mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::_resources_total ( const std::string &  resource)
protected
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::activateFramework ( const FrameworkID &  frameworkId)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::activateSlave ( const SlaveID &  slaveId)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::addFramework ( const FrameworkID &  frameworkId,
const FrameworkInfo &  frameworkInfo,
const hashmap< SlaveID, Resources > &  used,
bool  active,
::mesos::allocator::FrameworkOptions &&  frameworkOptions 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::addResourceProvider ( const SlaveID &  slave,
const Resources total,
const hashmap< FrameworkID, Resources > &  used 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::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 
)
overridevirtual
bool mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::allocatable ( const Resources resources,
const std::string &  role,
const Framework framework 
) const
protected
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::deactivateFramework ( const FrameworkID &  frameworkId)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::deactivateSlave ( const SlaveID &  slaveId)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::expire ( const FrameworkID &  frameworkId,
const std::string &  role,
const SlaveID &  slaveId,
const std::weak_ptr< OfferFilter > &  offerFilter 
)
protected
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::expire ( const FrameworkID &  frameworkId,
const SlaveID &  slaveId,
const std::weak_ptr< InverseOfferFilter > &  inverseOfferFilter 
)
protected
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::generateInverseOffers ( )
protected
process::Future<Nothing> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::generateOffers ( )
protected
process::Future<Nothing> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::generateOffers ( const SlaveID &  slaveId)
protected
process::Future<Nothing> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::generateOffers ( const hashset< SlaveID > &  slaveIds)
protected
process::Future< hashmap<SlaveID, hashmap<FrameworkID, mesos::allocator::InverseOfferStatus> > > mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::getInverseOfferStatuses ( )
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::initialize ( const mesos::allocator::Options options)
overridevirtual
bool mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::isFiltered ( const Framework framework,
const std::string &  role,
const Slave slave,
const Resources resources 
) const
protected
bool mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::isFiltered ( const Framework framework,
const Slave slave 
) const
protected
bool mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::isWhitelisted ( const SlaveID &  slaveId) const
protected
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::pause ( )
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::recover ( const int  _expectedAgentCount,
const hashmap< std::string, Quota > &  quotas 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::recoverResources ( const FrameworkID &  frameworkId,
const SlaveID &  slaveId,
const Resources resources,
const Option< Filters > &  filters,
bool  isAllocated 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::removeFramework ( const FrameworkID &  frameworkId)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::removeSlave ( const SlaveID &  slaveId)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::requestResources ( const FrameworkID &  frameworkId,
const std::vector< Request > &  requests 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::resume ( )
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::reviveOffers ( const FrameworkID &  frameworkId,
const std::set< std::string > &  roles 
)
overridevirtual
process::PID<HierarchicalAllocatorProcess> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::self ( ) const
inline
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::suppressOffers ( const FrameworkID &  frameworkId,
const std::set< std::string > &  roles 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::transitionOfferedToAllocated ( const SlaveID &  slaveId,
const Resources resources 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::updateAllocation ( const FrameworkID &  frameworkId,
const SlaveID &  slaveId,
const Resources offeredResources,
const std::vector< ResourceConversion > &  conversions 
)
overridevirtual
process::Future<Nothing> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::updateAvailable ( const SlaveID &  slaveId,
const std::vector< Offer::Operation > &  operations 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::updateFramework ( const FrameworkID &  frameworkId,
const FrameworkInfo &  frameworkInfo,
::mesos::allocator::FrameworkOptions &&  frameworkOptions 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::updateInverseOffer ( const SlaveID &  slaveId,
const FrameworkID &  frameworkId,
const Option< UnavailableResources > &  unavailableResources,
const Option< mesos::allocator::InverseOfferStatus > &  status,
const Option< Filters > &  filters 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::updateQuota ( const std::string &  role,
const Quota quota 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::updateSlave ( const SlaveID &  slave,
const SlaveInfo &  slaveInfo,
const Option< Resources > &  total = None(),
const Option< std::vector< SlaveInfo::Capability >> &  capabilities = None() 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::updateUnavailability ( const SlaveID &  slaveId,
const Option< Unavailability > &  unavailability 
)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::updateWeights ( const std::vector< WeightInfo > &  weightInfos)
overridevirtual
void mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::updateWhitelist ( const Option< hashset< std::string >> &  whitelist)
overridevirtual

Member Data Documentation

hashset<SlaveID> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::allocationCandidates
protected
BoundedHashMap<FrameworkID, process::Owned<FrameworkMetrics> > mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::completedFrameworkMetrics
protected
Option<int> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::expectedAgentCount
protected
hashmap<FrameworkID, Framework> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::frameworks
protected
const std::function<Sorter*()> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::frameworkSorterFactory
protected
hashmap<std::string, process::Owned<Sorter> > mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::frameworkSorters
protected
bool mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::initialized
protected
lambda::function< void(const FrameworkID&, const hashmap<SlaveID, UnavailableResources>&)> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::inverseOfferCallback
protected
friend mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::Metrics
protected
Metrics mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::metrics
protected
lambda::function< void(const FrameworkID&, const hashmap<std::string, hashmap<SlaveID, Resources>>&)> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::offerCallback
protected
Option<process::Future<Nothing> > mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::offerGeneration
protected
mesos::allocator::Options mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::options
protected
bool mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::paused
protected
process::Owned<Sorter> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::roleSorter
protected
RoleTree mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::roleTree
protected
hashmap<SlaveID, Slave> mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::slaves
protected
ResourceQuantities mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::totalScalarQuantities
protected
Option<hashset<std::string> > mesos::internal::master::allocator::internal::HierarchicalAllocatorProcess::whitelist
protected

The documentation for this class was generated from the following file: