Apache Mesos
Public Member Functions | Static Public Member Functions | List of all members
mesos::internal::checks::Checker Class Reference

#include <checker.hpp>

Public Member Functions

 ~Checker ()
 
 Checker (const Checker &)=delete
 
Checkeroperator= (const Checker &)=delete
 
void pause ()
 
void resume ()
 

Static Public Member Functions

static Try< process::Owned
< Checker > > 
create (const CheckInfo &check, const std::string &launcherDir, const lambda::function< void(const CheckStatusInfo &)> &callback, const TaskID &taskId, const Option< pid_t > &taskPid, const std::vector< std::string > &namespaces)
 Attempts to create a Checker object. More...
 
static Try< process::Owned
< Checker > > 
create (const CheckInfo &check, const std::string &launcherDir, const lambda::function< void(const CheckStatusInfo &)> &callback, const TaskID &taskId, const ContainerID &taskContainerId, const process::http::URL &agentURL, const Option< std::string > &authorizationHeader)
 Attempts to create a Checker object. More...
 

Constructor & Destructor Documentation

mesos::internal::checks::Checker::~Checker ( )
mesos::internal::checks::Checker::Checker ( const Checker )
delete

Member Function Documentation

static Try<process::Owned<Checker> > mesos::internal::checks::Checker::create ( const CheckInfo &  check,
const std::string &  launcherDir,
const lambda::function< void(const CheckStatusInfo &)> &  callback,
const TaskID &  taskId,
const Option< pid_t > &  taskPid,
const std::vector< std::string > &  namespaces 
)
static

Attempts to create a Checker object.

In case of success, checking starts immediately after initialization.

If the check is a COMMAND check, the checker will fork a process, enter the task's namespaces, and execute the command.

Parameters
checkThe protobuf message definition of a check.
launcherDirA directory where Mesos helper binaries are located. Executor must have access to this directory for TCP checks.
callbackA callback Checker uses to send check status updates to its owner (usually an executor).
taskIdThe TaskID of the target task.
taskPidThe target task's pid used to enter the specified namespaces.
namespacesThe namespaces to enter prior to performing the check.
Returns
A Checker object or an error if create fails.
Todo:
A better approach would be to return a stream of updates, e.g., process::Stream<CheckStatusInfo> rather than invoking a callback.
static Try<process::Owned<Checker> > mesos::internal::checks::Checker::create ( const CheckInfo &  check,
const std::string &  launcherDir,
const lambda::function< void(const CheckStatusInfo &)> &  callback,
const TaskID &  taskId,
const ContainerID &  taskContainerId,
const process::http::URL agentURL,
const Option< std::string > &  authorizationHeader 
)
static

Attempts to create a Checker object.

In case of success, checking starts immediately after initialization.

If the check is a COMMAND check, the checker will delegate the execution of the check to the Mesos agent via the LaunchNestedContainerSession API call.

Parameters
checkThe protobuf message definition of a check.
launcherDirA directory where Mesos helper binaries are located. Executor must have access to this directory for TCP checks.
callbackA callback Checker uses to send check status updates to its owner (usually an executor).
taskIdThe TaskID of the target task.
taskContainerIdThe ContainerID of the target task.
agentURLThe URL of the agent.
authorizationHeaderThe authorization header the checker should use to authenticate with the agent operator API.
Returns
A Checker object or an error if create fails.
Todo:
A better approach would be to return a stream of updates, e.g., process::Stream<CheckStatusInfo> rather than invoking a callback.
Checker& mesos::internal::checks::Checker::operator= ( const Checker )
delete
void mesos::internal::checks::Checker::pause ( )
void mesos::internal::checks::Checker::resume ( )

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