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

#include <health_checker.hpp>

Public Member Functions

 ~HealthChecker ()
 
void pause ()
 
void resume ()
 

Static Public Member Functions

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

Constructor & Destructor Documentation

mesos::internal::checks::HealthChecker::~HealthChecker ( )

Member Function Documentation

static Try<process::Owned<HealthChecker> > mesos::internal::checks::HealthChecker::create ( const HealthCheck &  healthCheck,
const std::string &  launcherDir,
const lambda::function< void(const TaskHealthStatus &)> &  callback,
const TaskID &  taskId,
const Option< pid_t > &  taskPid,
const std::vector< std::string > &  namespaces 
)
static

Attempts to create a HealthChecker object.

In case of success, health checking starts immediately after initialization.

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

Parameters
healthCheckThe protobuf message definition of health check.
launcherDirA directory where Mesos helper binaries are located.
callbackA callback HealthChecker uses to send health 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 health check.
Returns
A HealthChecker object or an error if create fails.
Todo:
A better approach would be to return a stream of updates, e.g., process::Stream<TaskHealthStatus> rather than invoking a callback.
Todo:
Consider leveraging checks::Checker for checking functionality. This class will then focus on interpreting and acting on the result.
static Try<process::Owned<HealthChecker> > mesos::internal::checks::HealthChecker::create ( const HealthCheck &  healthCheck,
const std::string &  launcherDir,
const lambda::function< void(const TaskHealthStatus &)> &  callback,
const TaskID &  taskId,
const ContainerID &  taskContainerId,
const process::http::URL agentURL,
const Option< std::string > &  authorizationHeader 
)
static

Attempts to create a HealthChecker object.

In case of success, health checking starts immediately after initialization.

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

Parameters
healthCheckThe protobuf message definition of health check.
launcherDirA directory where Mesos helper binaries are located.
callbackA callback HealthChecker uses to send health 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 health checker should use to authenticate with the agent operator API.
Returns
A HealthChecker object or an error if create fails.
Todo:
A better approach would be to return a stream of updates, e.g., process::Stream<TaskHealthStatus> rather than invoking a callback.
void mesos::internal::checks::HealthChecker::pause ( )
void mesos::internal::checks::HealthChecker::resume ( )

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