17 #ifndef __CGROUPS_ISOLATOR_SUBSYSTEM_HPP__ 18 #define __CGROUPS_ISOLATOR_SUBSYSTEM_HPP__ 39 class SubsystemProcess;
58 const std::string&
name,
75 std::string
name()
const;
85 const ContainerID& containerId,
86 const std::string&
cgroup);
97 const ContainerID& containerId,
98 const std::string& cgroup,
99 const mesos::slave::ContainerConfig& containerConfig);
110 const ContainerID& containerId,
111 const std::string& cgroup,
123 const ContainerID& containerId,
124 const std::string& cgroup);
136 const ContainerID& containerId,
137 const std::string& cgroup,
139 const google::protobuf::Map<
140 std::string, Value::Scalar>& resourceLimits = {});
152 const ContainerID& containerId,
153 const std::string& cgroup);
164 const ContainerID& containerId,
165 const std::string& cgroup);
180 const ContainerID& containerId,
181 const std::string& cgroup);
195 virtual std::string
name()
const = 0;
198 const ContainerID& containerId,
199 const std::string&
cgroup);
202 const ContainerID& containerId,
203 const std::string& cgroup,
204 const mesos::slave::ContainerConfig& containerConfig);
207 const ContainerID& containerId,
208 const std::string& cgroup,
212 const ContainerID& containerId,
213 const std::string& cgroup);
216 const ContainerID& containerId,
217 const std::string& cgroup,
219 const google::protobuf::Map<
220 std::string, Value::Scalar>& resourceLimits = {});
223 const ContainerID& containerId,
224 const std::string& cgroup);
227 const ContainerID& containerId,
228 const std::string& cgroup);
231 const ContainerID& containerId,
232 const std::string& cgroup);
252 #endif // __CGROUPS_ISOLATOR_SUBSYSTEM_HPP__
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...
process::Future< Nothing > prepare(const ContainerID &containerId, const std::string &cgroup, const mesos::slave::ContainerConfig &containerConfig)
Prepare the cgroups subsystem for the associated container.
process::Future< mesos::slave::ContainerLimitation > watch(const ContainerID &containerId, const std::string &cgroup)
Watch the container and report if any resource constraint impacts it.
const Flags flags
Flags used to launch the agent.
Definition: subsystem.hpp:240
Definition: resources.hpp:83
process::Future< Nothing > isolate(const ContainerID &containerId, const std::string &cgroup, pid_t pid)
Isolate the associated container to cgroups subsystem.
process::Future< Nothing > cleanup(const ContainerID &containerId, const std::string &cgroup)
Clean up the cgroups subsystem for the associated container.
std::string name() const
The cgroups subsystem name of this Subsystem object.
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. ...
DWORD pid_t
Definition: windows.hpp:181
process::Future< Nothing > recover(const ContainerID &containerId, const std::string &cgroup)
Recover the cgroups subsystem for the associated container.
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...
Subsystem(const Subsystem &)=delete
Result< std::string > cgroup(pid_t pid)
Definition: subsystem.hpp:190
Subsystem & operator=(const Subsystem &)=delete
Definition: attributes.hpp:24
An abstraction for cgroups subsystem.
Definition: subsystem.hpp:44
Definition: executor.hpp:48
const std::string hierarchy
The hierarchy path of cgroups subsystem.
Definition: subsystem.hpp:245
process::Future< ResourceStatistics > usage(const ContainerID &containerId, const std::string &cgroup)
Gather resource usage statistics of the cgroups subsystem for the associated container.
Result< std::string > hierarchy(const std::string &subsystems)
Definition: process.hpp:505
~SubsystemProcess() override
Definition: subsystem.hpp:193