Apache Mesos
Public Member Functions | Protected Member Functions | List of all members
mesos::internal::master::quota::UpdateQuota Class Reference

Sets quota for a role. More...

#include <quota.hpp>

Inheritance diagram for mesos::internal::master::quota::UpdateQuota:
mesos::internal::master::RegistryOperation process::Promise< bool >

Public Member Functions

 UpdateQuota (const mesos::quota::QuotaInfo &quotaInfo)
 
- Public Member Functions inherited from mesos::internal::master::RegistryOperation
 RegistryOperation ()
 
virtual ~RegistryOperation ()
 
Try< bool > operator() (Registry *registry, hashset< SlaveID > *slaveIDs)
 
bool set ()
 
- Public Member Functions inherited from process::Promise< bool >
 Promise ()
 
 Promise (const bool &t)
 
 Promise (Promise< bool > &&that)
 
virtual ~Promise ()
 
bool discard ()
 
bool set (const bool &_t)
 
bool set (bool &&_t)
 
bool set (const Future< bool > &future)
 
bool associate (const Future< bool > &future)
 
bool fail (const std::string &message)
 
Future< bool > future () const
 

Protected Member Functions

Try< bool > perform (Registry *registry, hashset< SlaveID > *slaveIDs)
 

Detailed Description

Sets quota for a role.

No assumptions are made here: the role may be unknown to the master, or quota can be already set for the role. If there is no quota stored for the role, a new entry is created, otherwise an existing one is updated. This operation always mutates the registry.

TODO(alexr): Introduce equality operator in Registry::Quota or QuotaInfo to avoid mutation in case of update to an equal value. However, even if we return false (i.e. no mutation), the current implementation of the registrar will still save the object again.

Constructor & Destructor Documentation

mesos::internal::master::quota::UpdateQuota::UpdateQuota ( const mesos::quota::QuotaInfo &  quotaInfo)
explicit

Member Function Documentation

Try<bool> mesos::internal::master::quota::UpdateQuota::perform ( Registry *  registry,
hashset< SlaveID > *  slaveIDs 
)
protectedvirtual

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