Apache Mesos
Public Member Functions | List of all members
mesos::internal::tests::MockSlave Class Reference

#include <mock_slave.hpp>

Inheritance diagram for mesos::internal::tests::MockSlave:
mesos::internal::slave::Slave ProtobufProcess< Slave > process::Process< Slave > process::ProcessBase process::EventConsumer

Public Member Functions

 MockSlave (const std::string &id, const slave::Flags &flags, mesos::master::detector::MasterDetector *detector, slave::Containerizer *containerizer, Files *files, slave::GarbageCollector *gc, slave::TaskStatusUpdateManager *taskStatusUpdateManager, mesos::slave::ResourceEstimator *resourceEstimator, mesos::slave::QoSController *qosController, SecretGenerator *secretGenerator, const Option< Authorizer * > &authorizer)
 
 MOCK_METHOD6 (runTask, void(const process::UPID &from, const FrameworkInfo &frameworkInfo, const FrameworkID &frameworkId, const process::UPID &pid, const TaskInfo &task, const std::vector< ResourceVersionUUID > &resourceVersionUuids))
 
void unmocked_runTask (const process::UPID &from, const FrameworkInfo &frameworkInfo, const FrameworkID &frameworkId, const process::UPID &pid, const TaskInfo &task, const std::vector< ResourceVersionUUID > &resourceVersionUuids)
 
 MOCK_METHOD6 (_run, void(const process::Future< std::list< bool >> &unschedules, const FrameworkInfo &frameworkInfo, const ExecutorInfo &executorInfo, const Option< TaskInfo > &task, const Option< TaskGroupInfo > &taskGroup, const std::vector< ResourceVersionUUID > &resourceVersionUuids))
 
void unmocked__run (const process::Future< std::list< bool >> &unschedules, const FrameworkInfo &frameworkInfo, const ExecutorInfo &executorInfo, const Option< TaskInfo > &task, const Option< TaskGroupInfo > &taskGroup, const std::vector< ResourceVersionUUID > &resourceVersionUuids)
 
 MOCK_METHOD5 (runTaskGroup, void(const process::UPID &from, const FrameworkInfo &frameworkInfo, const ExecutorInfo &executorInfo, const TaskGroupInfo &taskGroup, const std::vector< ResourceVersionUUID > &resourceVersionUuids))
 
void unmocked_runTaskGroup (const process::UPID &from, const FrameworkInfo &frameworkInfo, const ExecutorInfo &executorInfo, const TaskGroupInfo &taskGroup, const std::vector< ResourceVersionUUID > &resourceVersionUuids)
 
 MOCK_METHOD2 (killTask, void(const process::UPID &from, const KillTaskMessage &killTaskMessage))
 
void unmocked_killTask (const process::UPID &from, const KillTaskMessage &killTaskMessage)
 
 MOCK_METHOD1 (removeFramework, void(slave::Framework *framework))
 
void unmocked_removeFramework (slave::Framework *framework)
 
 MOCK_METHOD1 (__recover, void(const process::Future< Nothing > &future))
 
void unmocked___recover (const process::Future< Nothing > &future)
 
 MOCK_METHOD0 (qosCorrections, void())
 
void unmocked_qosCorrections ()
 
 MOCK_METHOD1 (_qosCorrections, void(const process::Future< std::list< mesos::slave::QoSCorrection >> &correction))
 
 MOCK_METHOD0 (usage, process::Future< ResourceUsage >())
 
process::Future< ResourceUsage > unmocked_usage ()
 
 MOCK_METHOD3 (executorTerminated, void(const FrameworkID &frameworkId, const ExecutorID &executorId, const process::Future< Option< mesos::slave::ContainerTermination >> &termination))
 
void unmocked_executorTerminated (const FrameworkID &frameworkId, const ExecutorID &executorId, const process::Future< Option< mesos::slave::ContainerTermination >> &termination)
 
 MOCK_METHOD3 (shutdownExecutor, void(const process::UPID &from, const FrameworkID &frameworkId, const ExecutorID &executorId))
 
void unmocked_shutdownExecutor (const process::UPID &from, const FrameworkID &frameworkId, const ExecutorID &executorId)
 
- Public Member Functions inherited from mesos::internal::slave::Slave
 Slave (const std::string &id, const Flags &flags, mesos::master::detector::MasterDetector *detector, Containerizer *containerizer, Files *files, GarbageCollector *gc, TaskStatusUpdateManager *taskStatusUpdateManager, mesos::slave::ResourceEstimator *resourceEstimator, mesos::slave::QoSController *qosController, mesos::SecretGenerator *secretGenerator, const Option< Authorizer * > &authorizer)
 
virtual ~Slave ()
 
void shutdown (const process::UPID &from, const std::string &message)
 
void registered (const process::UPID &from, const SlaveID &slaveId, const MasterSlaveConnection &connection)
 
void reregistered (const process::UPID &from, const SlaveID &slaveId, const std::vector< ReconcileTasksMessage > &reconciliations, const MasterSlaveConnection &connection)
 
void doReliableRegistration (Duration maxBackoff)
 
virtual void runTask (const process::UPID &from, const FrameworkInfo &frameworkInfo, const FrameworkID &frameworkId, const process::UPID &pid, const TaskInfo &task, const std::vector< ResourceVersionUUID > &resourceVersionUuids)
 
void run (const FrameworkInfo &frameworkInfo, ExecutorInfo executorInfo, Option< TaskInfo > task, Option< TaskGroupInfo > taskGroup, const std::vector< ResourceVersionUUID > &resourceVersionUuids, const process::UPID &pid)
 
virtual void _run (const process::Future< std::list< bool >> &unschedules, const FrameworkInfo &frameworkInfo, const ExecutorInfo &executorInfo, const Option< TaskInfo > &task, const Option< TaskGroupInfo > &taskGroup, const std::vector< ResourceVersionUUID > &resourceVersionUuids)
 
virtual void runTaskGroup (const process::UPID &from, const FrameworkInfo &frameworkInfo, const ExecutorInfo &executorInfo, const TaskGroupInfo &taskGroupInfo, const std::vector< ResourceVersionUUID > &resourceVersionUuids)
 
virtual void killTask (const process::UPID &from, const KillTaskMessage &killTaskMessage)
 
virtual void shutdownExecutor (const process::UPID &from, const FrameworkID &frameworkId, const ExecutorID &executorId)
 
void shutdownFramework (const process::UPID &from, const FrameworkID &frameworkId)
 
void schedulerMessage (const SlaveID &slaveId, const FrameworkID &frameworkId, const ExecutorID &executorId, const std::string &data)
 
void updateFramework (const UpdateFrameworkMessage &message)
 
void checkpointResources (std::vector< Resource > checkpointedResources, bool changeTotal)
 
void checkpointResourcesMessage (const std::vector< Resource > &checkpointedResources)
 
void applyOperation (const ApplyOperationMessage &message)
 
void reconcileOperations (const ReconcileOperationsMessage &message)
 
void subscribe (HttpConnection http, const executor::Call::Subscribe &subscribe, Framework *framework, Executor *executor)
 
void registerExecutor (const process::UPID &from, const FrameworkID &frameworkId, const ExecutorID &executorId)
 
void reregisterExecutor (const process::UPID &from, const FrameworkID &frameworkId, const ExecutorID &executorId, const std::vector< TaskInfo > &tasks, const std::vector< StatusUpdate > &updates)
 
void _reregisterExecutor (const process::Future< Nothing > &future, const FrameworkID &frameworkId, const ExecutorID &executorId, const ContainerID &containerId)
 
void executorMessage (const SlaveID &slaveId, const FrameworkID &frameworkId, const ExecutorID &executorId, const std::string &data)
 
void ping (const process::UPID &from, bool connected)
 
void statusUpdate (StatusUpdate update, const Option< process::UPID > &pid)
 
void _statusUpdate (StatusUpdate update, const Option< process::UPID > &pid, const ExecutorID &executorId, const Option< process::Future< ContainerStatus >> &containerStatus)
 
void __statusUpdate (const Option< process::Future< Nothing >> &future, const StatusUpdate &update, const Option< process::UPID > &pid, const ExecutorID &executorId, const ContainerID &containerId, bool checkpoint)
 
void ___statusUpdate (const process::Future< Nothing > &future, const StatusUpdate &update, const Option< process::UPID > &pid)
 
void forward (StatusUpdate update)
 
void statusUpdateAcknowledgement (const process::UPID &from, const SlaveID &slaveId, const FrameworkID &frameworkId, const TaskID &taskId, const std::string &uuid)
 
void _statusUpdateAcknowledgement (const process::Future< bool > &future, const TaskID &taskId, const FrameworkID &frameworkId, const id::UUID &uuid)
 
void operationStatusAcknowledgement (const process::UPID &from, const AcknowledgeOperationStatusMessage &acknowledgement)
 
void executorLaunched (const FrameworkID &frameworkId, const ExecutorID &executorId, const ContainerID &containerId, const process::Future< Containerizer::LaunchResult > &future)
 
virtual void executorTerminated (const FrameworkID &frameworkId, const ExecutorID &executorId, const process::Future< Option< mesos::slave::ContainerTermination >> &termination)
 
void _checkDiskUsage (const process::Future< double > &usage)
 
void _checkImageDiskUsage (const process::Future< double > &usage)
 
void detected (const process::Future< Option< MasterInfo >> &_master)
 
virtual void initialize ()
 Invoked when a process gets spawned. More...
 
virtual void finalize ()
 Invoked when a process is terminated. More...
 
virtual void exited (const process::UPID &pid)
 Invoked when a linked process has exited. More...
 
void __run (const process::Future< std::list< bool >> &future, const FrameworkInfo &frameworkInfo, const ExecutorInfo &executorInfo, const Option< TaskInfo > &task, const Option< TaskGroupInfo > &taskGroup, const std::vector< ResourceVersionUUID > &resourceVersionUuids)
 
void ___run (const process::Future< Nothing > &future, const FrameworkID &frameworkId, const ExecutorID &executorId, const ContainerID &containerId, const std::list< TaskInfo > &tasks, const std::list< TaskGroupInfo > &taskGroups)
 
process::Future< Secret > generateSecret (const FrameworkID &frameworkId, const ExecutorID &executorId, const ContainerID &containerId)
 
void launchExecutor (const Option< process::Future< Secret >> &future, const FrameworkID &frameworkId, const ExecutorID &executorId, const Option< TaskInfo > &taskInfo)
 
void fileAttached (const process::Future< Nothing > &result, const std::string &path, const std::string &virtualPath)
 
Nothing detachFile (const std::string &path)
 
void pingTimeout (process::Future< Option< MasterInfo >> future)
 
void authenticate ()
 
FrameworkgetFramework (const FrameworkID &frameworkId) const
 
ExecutorgetExecutor (const FrameworkID &frameworkId, const ExecutorID &executorId) const
 
ExecutorgetExecutor (const ContainerID &containerId) const
 
ExecutorInfo getExecutorInfo (const FrameworkInfo &frameworkInfo, const TaskInfo &task) const
 
void registerExecutorTimeout (const FrameworkID &frameworkId, const ExecutorID &executorId, const ContainerID &containerId)
 
void reregisterExecutorTimeout ()
 
Duration age (double usage)
 
void checkDiskUsage ()
 
void checkImageDiskUsage ()
 
process::Future< Nothingrecover (const Try< state::State > &state)
 
process::Future< Nothing_recover ()
 
process::Future< Nothing_recoverContainerizer (const Option< state::SlaveState > &state)
 
virtual void __recover (const process::Future< Nothing > &future)
 
void recoverFramework (const state::FrameworkState &state, const hashset< ExecutorID > &executorsToRecheckpoint, const hashmap< ExecutorID, hashset< TaskID >> &tasksToRecheckpoint)
 
void removeExecutor (Framework *framework, Executor *executor)
 
virtual void removeFramework (Framework *framework)
 
process::Future< NothinggarbageCollect (const std::string &path)
 
void signaled (int signal, int uid)
 
virtual void qosCorrections ()
 
virtual void _qosCorrections (const process::Future< std::list< mesos::slave::QoSCorrection >> &correction)
 
virtual process::Future
< ResourceUsage > 
usage ()
 
void shutdownExecutorTimeout (const FrameworkID &frameworkId, const ExecutorID &executorId, const ContainerID &containerId)
 
- Public Member Functions inherited from ProtobufProcess< Slave >
virtual ~ProtobufProcess ()
 
- Public Member Functions inherited from process::Process< Slave >
virtual ~Process ()
 
PID< Slave > self () const
 Returns the PID of the process. More...
 
- Public Member Functions inherited from process::ProcessBase
 ProcessBase (const std::string &id="")
 
virtual ~ProcessBase ()
 
const UPIDself () const
 
- Public Member Functions inherited from process::EventConsumer
virtual ~EventConsumer ()
 

Additional Inherited Members

- Public Types inherited from mesos::internal::slave::Slave
enum  State { RECOVERING, DISCONNECTED, RUNNING, TERMINATING }
 
- Public Attributes inherited from mesos::internal::slave::Slave
enum
mesos::internal::slave::Slave::State 
state
 
struct
mesos::internal::slave::Slave::RecoveryInfo 
recoveryInfo
 
- Protected Types inherited from ProtobufProcess< Slave >
using MessageProperty = P(M::*)() const
 
- Protected Types inherited from process::Process< Slave >
typedef Slave Self
 
typedef Slave 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 inherited from ProtobufProcess< Slave >
void consume (process::MessageEvent &&event) override
 
void send (const process::UPID &to, const google::protobuf::Message &message)
 
void reply (const google::protobuf::Message &message)
 
void install (void(Slave::*method)(const process::UPID &, const M &))
 
void install (void(Slave::*method)(const process::UPID &, M &&))
 
void install (void(Slave::*method)(const process::UPID &))
 
void install (void(Slave::*method)(const process::UPID &, PC...), MessageProperty< M, P >...param)
 
void install (void(Slave::*method)(const M &))
 
void install (void(Slave::*method)(M &&))
 
void install (void(Slave::*method)())
 
void install (void(Slave::*method)(PC...), MessageProperty< M, P >...param)
 
- Protected Member Functions inherited from process::ProcessBase
virtual void serve (Event &&event)
 Invoked when an event is serviced. More...
 
void consume (DispatchEvent &&event) override
 
void consume (HttpEvent &&event) override
 
void consume (ExitedEvent &&event) override
 
void consume (TerminateEvent &&event) override
 
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 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())
 Sets up a handler for HTTP requests with the specified name. 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...
 

Constructor & Destructor Documentation

mesos::internal::tests::MockSlave::MockSlave ( const std::string &  id,
const slave::Flags flags,
mesos::master::detector::MasterDetector detector,
slave::Containerizer containerizer,
Files files,
slave::GarbageCollector gc,
slave::TaskStatusUpdateManager taskStatusUpdateManager,
mesos::slave::ResourceEstimator resourceEstimator,
mesos::slave::QoSController qosController,
SecretGenerator secretGenerator,
const Option< Authorizer * > &  authorizer 
)

Member Function Documentation

mesos::internal::tests::MockSlave::MOCK_METHOD0 ( qosCorrections  ,
void()   
)
mesos::internal::tests::MockSlave::MOCK_METHOD0 ( usage  ,
process::Future< ResourceUsage >  () 
)
mesos::internal::tests::MockSlave::MOCK_METHOD1 ( removeFramework  ,
void(slave::Framework *framework)   
)
mesos::internal::tests::MockSlave::MOCK_METHOD1 ( __recover  ,
void(const process::Future< Nothing > &future)   
)
mesos::internal::tests::MockSlave::MOCK_METHOD1 ( _qosCorrections  ,
void(const process::Future< std::list< mesos::slave::QoSCorrection >> &correction)   
)
mesos::internal::tests::MockSlave::MOCK_METHOD2 ( killTask  ,
void(const process::UPID &from, const KillTaskMessage &killTaskMessage)   
)
mesos::internal::tests::MockSlave::MOCK_METHOD3 ( executorTerminated  ,
void(const FrameworkID &frameworkId, const ExecutorID &executorId, const process::Future< Option< mesos::slave::ContainerTermination >> &termination)   
)
mesos::internal::tests::MockSlave::MOCK_METHOD3 ( shutdownExecutor  ,
void(const process::UPID &from, const FrameworkID &frameworkId, const ExecutorID &executorId)   
)
mesos::internal::tests::MockSlave::MOCK_METHOD5 ( runTaskGroup  ,
void(const process::UPID &from, const FrameworkInfo &frameworkInfo, const ExecutorInfo &executorInfo, const TaskGroupInfo &taskGroup, const std::vector< ResourceVersionUUID > &resourceVersionUuids)   
)
mesos::internal::tests::MockSlave::MOCK_METHOD6 ( runTask  ,
void(const process::UPID &from, const FrameworkInfo &frameworkInfo, const FrameworkID &frameworkId, const process::UPID &pid, const TaskInfo &task, const std::vector< ResourceVersionUUID > &resourceVersionUuids)   
)
mesos::internal::tests::MockSlave::MOCK_METHOD6 ( _run  ,
void(const process::Future< std::list< bool >> &unschedules, const FrameworkInfo &frameworkInfo, const ExecutorInfo &executorInfo, const Option< TaskInfo > &task, const Option< TaskGroupInfo > &taskGroup, const std::vector< ResourceVersionUUID > &resourceVersionUuids)   
)
void mesos::internal::tests::MockSlave::unmocked___recover ( const process::Future< Nothing > &  future)
void mesos::internal::tests::MockSlave::unmocked__run ( const process::Future< std::list< bool >> &  unschedules,
const FrameworkInfo &  frameworkInfo,
const ExecutorInfo &  executorInfo,
const Option< TaskInfo > &  task,
const Option< TaskGroupInfo > &  taskGroup,
const std::vector< ResourceVersionUUID > &  resourceVersionUuids 
)
void mesos::internal::tests::MockSlave::unmocked_executorTerminated ( const FrameworkID &  frameworkId,
const ExecutorID &  executorId,
const process::Future< Option< mesos::slave::ContainerTermination >> &  termination 
)
void mesos::internal::tests::MockSlave::unmocked_killTask ( const process::UPID from,
const KillTaskMessage &  killTaskMessage 
)
void mesos::internal::tests::MockSlave::unmocked_qosCorrections ( )
void mesos::internal::tests::MockSlave::unmocked_removeFramework ( slave::Framework framework)
void mesos::internal::tests::MockSlave::unmocked_runTask ( const process::UPID from,
const FrameworkInfo &  frameworkInfo,
const FrameworkID &  frameworkId,
const process::UPID pid,
const TaskInfo &  task,
const std::vector< ResourceVersionUUID > &  resourceVersionUuids 
)
void mesos::internal::tests::MockSlave::unmocked_runTaskGroup ( const process::UPID from,
const FrameworkInfo &  frameworkInfo,
const ExecutorInfo &  executorInfo,
const TaskGroupInfo &  taskGroup,
const std::vector< ResourceVersionUUID > &  resourceVersionUuids 
)
void mesos::internal::tests::MockSlave::unmocked_shutdownExecutor ( const process::UPID from,
const FrameworkID &  frameworkId,
const ExecutorID &  executorId 
)
process::Future<ResourceUsage> mesos::internal::tests::MockSlave::unmocked_usage ( )

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