Apache Mesos
Public Member Functions | Public Attributes | List of all members
mesos::internal::tests::TestAllocator< T > Class Template Reference

#include <allocator.hpp>

Inheritance diagram for mesos::internal::tests::TestAllocator< T >:
mesos::allocator::Allocator

Public Member Functions

 TestAllocator ()
 
 ~TestAllocator () override
 
 MOCK_METHOD3 (initialize, void(const Options &options, const lambda::function< void(const FrameworkID &, const hashmap< std::string, hashmap< SlaveID, Resources >> &)> &, const lambda::function< void(const FrameworkID &, const hashmap< SlaveID, UnavailableResources > &)> &))
 
 MOCK_METHOD2 (recover, void(const int expectedAgentCount, const hashmap< std::string, Quota > &))
 
 MOCK_METHOD5 (addFramework_, void(const FrameworkID &, const FrameworkInfo &, const hashmap< SlaveID, Resources > &, bool active,::mesos::allocator::FrameworkOptions &))
 
void addFramework (const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const hashmap< SlaveID, Resources > &used, bool active,::mesos::allocator::FrameworkOptions &&options) override
 
 MOCK_METHOD1 (removeFramework, void(const FrameworkID &))
 
 MOCK_METHOD1 (activateFramework, void(const FrameworkID &))
 
 MOCK_METHOD1 (deactivateFramework, void(const FrameworkID &))
 
 MOCK_METHOD3 (updateFramework_, void(const FrameworkID &, const FrameworkInfo &,::mesos::allocator::FrameworkOptions &))
 
void updateFramework (const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo,::mesos::allocator::FrameworkOptions &&options) override
 
 MOCK_METHOD6 (addSlave, void(const SlaveID &, const SlaveInfo &, const std::vector< SlaveInfo::Capability > &, const Option< Unavailability > &, const Resources &, const hashmap< FrameworkID, Resources > &))
 
 MOCK_METHOD1 (removeSlave, void(const SlaveID &))
 
 MOCK_METHOD4 (updateSlave, void(const SlaveID &, const SlaveInfo &, const Option< Resources > &, const Option< std::vector< SlaveInfo::Capability >> &))
 
 MOCK_METHOD3 (addResourceProvider, void(const SlaveID &, const Resources &, const hashmap< FrameworkID, Resources > &))
 
 MOCK_METHOD1 (activateSlave, void(const SlaveID &))
 
 MOCK_METHOD1 (deactivateSlave, void(const SlaveID &))
 
 MOCK_METHOD1 (updateWhitelist, void(const Option< hashset< std::string >> &))
 
 MOCK_METHOD2 (requestResources, void(const FrameworkID &, const std::vector< Request > &))
 
 MOCK_METHOD4 (updateAllocation, void(const FrameworkID &, const SlaveID &, const Resources &, const std::vector< ResourceConversion > &))
 
 MOCK_METHOD2 (updateAvailable, process::Future< Nothing >(const SlaveID &, const std::vector< Offer::Operation > &))
 
 MOCK_METHOD2 (updateUnavailability, void(const SlaveID &, const Option< Unavailability > &))
 
 MOCK_METHOD5 (updateInverseOffer, void(const SlaveID &, const FrameworkID &, const Option< UnavailableResources > &, const Option< mesos::allocator::InverseOfferStatus > &, const Option< Filters > &))
 
 MOCK_METHOD0 (getInverseOfferStatuses, process::Future< hashmap< SlaveID, hashmap< FrameworkID, mesos::allocator::InverseOfferStatus >>>())
 
 MOCK_METHOD2 (transitionOfferedToAllocated, void(const SlaveID &, const Resources &))
 
 MOCK_METHOD5 (recoverResources, void(const FrameworkID &, const SlaveID &, const Resources &, const Option< Filters > &filters, bool isAllocated))
 
 MOCK_METHOD2 (suppressOffers, void(const FrameworkID &, const std::set< std::string > &))
 
 MOCK_METHOD2 (reviveOffers, void(const FrameworkID &, const std::set< std::string > &))
 
 MOCK_METHOD2 (updateQuota, void(const std::string &, const Quota &))
 
 MOCK_METHOD1 (updateWeights, void(const std::vector< WeightInfo > &))
 
 MOCK_METHOD0 (pause, void())
 
 MOCK_METHOD0 (resume, void())
 
- Public Member Functions inherited from mesos::allocator::Allocator
 Allocator ()
 
virtual ~Allocator ()
 
virtual void initialize (const 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)=0
 Initializes the allocator when the master starts up. More...
 
virtual void recover (const int expectedAgentCount, const hashmap< std::string, Quota > &quotas)=0
 Informs the allocator of the recovered state from the master. More...
 
virtual void addFramework (const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, const hashmap< SlaveID, Resources > &used, bool active, FrameworkOptions &&options)=0
 Adds a framework to the Mesos cluster. More...
 
virtual void removeFramework (const FrameworkID &frameworkId)=0
 Removes a framework from the Mesos cluster. More...
 
virtual void activateFramework (const FrameworkID &frameworkId)=0
 Activates a framework in the Mesos cluster. More...
 
virtual void deactivateFramework (const FrameworkID &frameworkId)=0
 Deactivates a framework in the Mesos cluster. More...
 
virtual void updateFramework (const FrameworkID &frameworkId, const FrameworkInfo &frameworkInfo, FrameworkOptions &&options)=0
 Updates FrameworkInfo and FrameworkOptions. More...
 
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. More...
 
virtual void removeSlave (const SlaveID &slaveId)=0
 Removes an agent from the Mesos cluster. More...
 
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. More...
 
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. More...
 
virtual void activateSlave (const SlaveID &slaveId)=0
 Activates an agent. More...
 
virtual void deactivateSlave (const SlaveID &slaveId)=0
 Deactivates an agent. More...
 
virtual void updateWhitelist (const Option< hashset< std::string >> &whitelist)=0
 Updates the list of trusted agents. More...
 
virtual void requestResources (const FrameworkID &frameworkId, const std::vector< Request > &requests)=0
 Requests resources for a framework. More...
 
virtual void updateAllocation (const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &offeredResources, const std::vector< ResourceConversion > &conversions)=0
 Updates allocation by applying offer operations. More...
 
virtual process::Future< NothingupdateAvailable (const SlaveID &slaveId, const std::vector< Offer::Operation > &operations)=0
 Updates available resources on an agent based on a sequence of offer operations. More...
 
virtual void updateUnavailability (const SlaveID &slaveId, const Option< Unavailability > &unavailability)=0
 Updates unavailability for an agent. More...
 
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. More...
 
virtual process::Future< hashmap< SlaveID, hashmap< FrameworkID, mesos::allocator::InverseOfferStatus > > > getInverseOfferStatuses ()=0
 Retrieves the status of all inverse offers maintained by the allocator. More...
 
virtual void transitionOfferedToAllocated (const SlaveID &slaveId, const Resources &resources)=0
 This method should be invoked when the offered resources has become actually allocated. More...
 
virtual void recoverResources (const FrameworkID &frameworkId, const SlaveID &slaveId, const Resources &resources, const Option< Filters > &filters, bool isAllocated)=0
 Recovers resources. More...
 
virtual void suppressOffers (const FrameworkID &frameworkId, const std::set< std::string > &roles)=0
 Suppresses offers. More...
 
virtual void reviveOffers (const FrameworkID &frameworkId, const std::set< std::string > &roles)=0
 Revives offers to this framework for the specified roles. More...
 
virtual void updateQuota (const std::string &role, const Quota &quota)=0
 Informs the allocator to update quota for the given role. More...
 
virtual void updateWeights (const std::vector< WeightInfo > &weightInfos)=0
 Updates the weight associated with one or more roles. More...
 
virtual void pause ()=0
 Idempotent helper to pause allocations. More...
 
virtual void resume ()=0
 Idempotent helper to resume allocations. More...
 

Public Attributes

process::Owned< mesos::allocator::Allocatorreal
 

Additional Inherited Members

- Static Public Member Functions inherited from mesos::allocator::Allocator
static Try< Allocator * > create (const std::string &name, const std::string &roleSorter, const std::string &frameworkSorter)
 Attempts either to create a built-in DRF allocator or to load an allocator instance from a module using the given name. More...
 

Constructor & Destructor Documentation

template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::TestAllocator ( )
inline
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::~TestAllocator ( )
inlineoverride

Member Function Documentation

template<typename T = master::allocator::HierarchicalDRFAllocator>
void mesos::internal::tests::TestAllocator< T >::addFramework ( const FrameworkID &  frameworkId,
const FrameworkInfo &  frameworkInfo,
const hashmap< SlaveID, Resources > &  used,
bool  active,
::mesos::allocator::FrameworkOptions &&  options 
)
inlineoverride
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD0 ( getInverseOfferStatuses  ,
process::Future< hashmap< SlaveID, hashmap< FrameworkID, mesos::allocator::InverseOfferStatus >>>  () 
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD0 ( pause  ,
void()   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD0 ( resume  ,
void()   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD1 ( removeFramework  ,
void(const FrameworkID &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD1 ( activateFramework  ,
void(const FrameworkID &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD1 ( deactivateFramework  ,
void(const FrameworkID &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD1 ( removeSlave  ,
void(const SlaveID &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD1 ( activateSlave  ,
void(const SlaveID &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD1 ( deactivateSlave  ,
void(const SlaveID &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD1 ( updateWhitelist  ,
void(const Option< hashset< std::string >> &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD1 ( updateWeights  ,
void(const std::vector< WeightInfo > &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD2 ( recover  ,
void(const int expectedAgentCount, const hashmap< std::string, Quota > &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD2 ( requestResources  ,
void(const FrameworkID &, const std::vector< Request > &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD2 ( updateAvailable  ,
process::Future< Nothing const SlaveID &, const std::vector< Offer::Operation > & 
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD2 ( updateUnavailability  ,
void(const SlaveID &, const Option< Unavailability > &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD2 ( transitionOfferedToAllocated  ,
void(const SlaveID &, const Resources &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD2 ( suppressOffers  ,
void(const FrameworkID &, const std::set< std::string > &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD2 ( reviveOffers  ,
void(const FrameworkID &, const std::set< std::string > &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD2 ( updateQuota  ,
void(const std::string &, const Quota &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD3 ( initialize  ,
void(const Options &options, const lambda::function< void(const FrameworkID &, const hashmap< std::string, hashmap< SlaveID, Resources >> &)> &, const lambda::function< void(const FrameworkID &, const hashmap< SlaveID, UnavailableResources > &)> &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD3 ( updateFramework_  ,
void(const FrameworkID &, const FrameworkInfo &,::mesos::allocator::FrameworkOptions &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD3 ( addResourceProvider  ,
void(const SlaveID &, const Resources &, const hashmap< FrameworkID, Resources > &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD4 ( updateSlave  ,
void(const SlaveID &, const SlaveInfo &, const Option< Resources > &, const Option< std::vector< SlaveInfo::Capability >> &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD4 ( updateAllocation  ,
void(const FrameworkID &, const SlaveID &, const Resources &, const std::vector< ResourceConversion > &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD5 ( addFramework_  ,
void(const FrameworkID &, const FrameworkInfo &, const hashmap< SlaveID, Resources > &, bool active,::mesos::allocator::FrameworkOptions &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD5 ( updateInverseOffer  ,
void(const SlaveID &, const FrameworkID &, const Option< UnavailableResources > &, const Option< mesos::allocator::InverseOfferStatus > &, const Option< Filters > &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD5 ( recoverResources  ,
void(const FrameworkID &, const SlaveID &, const Resources &, const Option< Filters > &filters, bool isAllocated)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
mesos::internal::tests::TestAllocator< T >::MOCK_METHOD6 ( addSlave  ,
void(const SlaveID &, const SlaveInfo &, const std::vector< SlaveInfo::Capability > &, const Option< Unavailability > &, const Resources &, const hashmap< FrameworkID, Resources > &)   
)
template<typename T = master::allocator::HierarchicalDRFAllocator>
void mesos::internal::tests::TestAllocator< T >::updateFramework ( const FrameworkID &  frameworkId,
const FrameworkInfo &  frameworkInfo,
::mesos::allocator::FrameworkOptions &&  options 
)
inlineoverride

Member Data Documentation

template<typename T = master::allocator::HierarchicalDRFAllocator>
process::Owned<mesos::allocator::Allocator> mesos::internal::tests::TestAllocator< T >::real

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