|
Apache Mesos
|
An abstraction for cgroups subsystem. More...
#include <subsystem.hpp>
Public Member Functions | |
| Subsystem (const Subsystem &)=delete | |
| Subsystem & | operator= (const Subsystem &)=delete |
| ~Subsystem () | |
| std::string | name () const |
The cgroups subsystem name of this Subsystem object. More... | |
| process::Future< Nothing > | recover (const ContainerID &containerId, const std::string &cgroup) |
| Recover the cgroups subsystem for the associated container. More... | |
| process::Future< Nothing > | prepare (const ContainerID &containerId, const std::string &cgroup, const mesos::slave::ContainerConfig &containerConfig) |
| Prepare the cgroups subsystem for the associated container. More... | |
| process::Future< Nothing > | isolate (const ContainerID &containerId, const std::string &cgroup, pid_t pid) |
| Isolate the associated container to cgroups subsystem. More... | |
| process::Future< mesos::slave::ContainerLimitation > | watch (const ContainerID &containerId, const std::string &cgroup) |
| Watch the container and report if any resource constraint impacts it. More... | |
| process::Future< Nothing > | update (const ContainerID &containerId, const std::string &cgroup, const Resources &resourceRequests, const google::protobuf::Map< std::string, Value::Scalar > &resourceLimits={}) |
| Update resources allocated to the associated container in this cgroups subsystem. More... | |
| process::Future< ResourceStatistics > | usage (const ContainerID &containerId, const std::string &cgroup) |
| Gather resource usage statistics of the cgroups subsystem for the associated container. More... | |
| process::Future< ContainerStatus > | status (const ContainerID &containerId, const std::string &cgroup) |
| Get the run-time status of cgroups subsystem specific properties associated with the container. More... | |
| process::Future< Nothing > | cleanup (const ContainerID &containerId, const std::string &cgroup) |
| Clean up the cgroups subsystem for the associated container. More... | |
Static Public Member Functions | |
| static Try< process::Owned< Subsystem > > | create (const Flags &flags, const std::string &name, const std::string &hierarchy) |
Attempts to create a specific Subsystem object that will contain specific information associated with container. More... | |
An abstraction for cgroups subsystem.
|
delete |
| mesos::internal::slave::Subsystem::~Subsystem | ( | ) |
| process::Future<Nothing> mesos::internal::slave::Subsystem::cleanup | ( | const ContainerID & | containerId, |
| const std::string & | cgroup | ||
| ) |
Clean up the cgroups subsystem for the associated container.
It will be called when destruction to ensure everything be cleanup. Similar to the isolator cleanup, it's likely that the cleanup for the subsystem is called for unknown containers (see MESOS-6059). We should ignore the cleanup request if the container is unknown to the subsystem.
| containerId | The target containerId. |
| cgroup | The target cgroup. |
cleanup fails.
|
static |
Attempts to create a specific Subsystem object that will contain specific information associated with container.
| flags | Flags used to launch the agent. |
| name | The name of cgroups subsystem. |
| hierarchy | The hierarchy path of cgroups subsystem. |
Subsystem object or an error if create fails. | process::Future<Nothing> mesos::internal::slave::Subsystem::isolate | ( | const ContainerID & | containerId, |
| const std::string & | cgroup, | ||
| pid_t | pid | ||
| ) |
Isolate the associated container to cgroups subsystem.
| containerId | The target containerId. |
| cgroup | The target cgroup. |
| pid | The process id of container. |
isolate fails. | std::string mesos::internal::slave::Subsystem::name | ( | ) | const |
The cgroups subsystem name of this Subsystem object.
| process::Future<Nothing> mesos::internal::slave::Subsystem::prepare | ( | const ContainerID & | containerId, |
| const std::string & | cgroup, | ||
| const mesos::slave::ContainerConfig & | containerConfig | ||
| ) |
Prepare the cgroups subsystem for the associated container.
| containerId | The target containerId. |
| cgroup | The target cgroup. |
| containerConfig | The container configuration. |
prepare fails. | process::Future<Nothing> mesos::internal::slave::Subsystem::recover | ( | const ContainerID & | containerId, |
| const std::string & | cgroup | ||
| ) |
Recover the cgroups subsystem for the associated container.
| containerId | The target containerId. |
| cgroup | The target cgroup. |
recover fails. | process::Future<ContainerStatus> mesos::internal::slave::Subsystem::status | ( | const ContainerID & | containerId, |
| const std::string & | cgroup | ||
| ) |
Get the run-time status of cgroups subsystem specific properties associated with the container.
| containerId | The target containerId. |
| cgroup | The target cgroup. |
| process::Future<Nothing> mesos::internal::slave::Subsystem::update | ( | const ContainerID & | containerId, |
| const std::string & | cgroup, | ||
| const Resources & | resourceRequests, | ||
| const google::protobuf::Map< std::string, Value::Scalar > & | resourceLimits = {} |
||
| ) |
Update resources allocated to the associated container in this cgroups subsystem.
| containerId | The target containerId. |
| cgroup | The target cgroup. |
| resources | The resources need to update. |
update fails. | process::Future<ResourceStatistics> mesos::internal::slave::Subsystem::usage | ( | const ContainerID & | containerId, |
| const std::string & | cgroup | ||
| ) |
Gather resource usage statistics of the cgroups subsystem for the associated container.
| containerId | The target containerId. |
| cgroup | The target cgroup. |
| process::Future<mesos::slave::ContainerLimitation> mesos::internal::slave::Subsystem::watch | ( | const ContainerID & | containerId, |
| const std::string & | cgroup | ||
| ) |
Watch the container and report if any resource constraint impacts it.
| containerId | The target containerId. |
| cgroup | The target cgroup. |
watch fails.
1.8.11