17 #ifndef __POSIX_ISOLATOR_HPP__
18 #define __POSIX_ISOLATOR_HPP__
45 const std::list<mesos::slave::ContainerState>& state,
48 foreach (
const mesos::slave::ContainerState&
run, state) {
55 pids.
put(run.container_id(),
static_cast<pid_t>(run.pid()));
66 const ContainerID& containerId,
67 const mesos::slave::ContainerConfig& containerConfig)
71 " has already been prepared");
82 const ContainerID& containerId,
95 const ContainerID& containerId)
101 return promises[containerId]->future();
105 const ContainerID& containerId,
119 VLOG(1) <<
"Ignoring cleanup request for unknown container "
129 pids.erase(containerId);
154 const ContainerID& containerId)
157 LOG(WARNING) <<
"No resource usage for unknown container '"
158 << containerId <<
"'";
159 return ResourceStatistics();
188 const ContainerID& containerId)
191 LOG(WARNING) <<
"No resource usage for unknown container '"
192 << containerId <<
"'";
193 return ResourceStatistics();
214 #endif // __POSIX_ISOLATOR_HPP__
std::string generate(const std::string &prefix="")
Returns 'prefix(N)' where N represents the number of instances where the same prefix (wrt...
virtual process::Future< Option< mesos::slave::ContainerLaunchInfo > > prepare(const ContainerID &containerId, const mesos::slave::ContainerConfig &containerConfig)
Definition: posix.hpp:65
Definition: isolator.hpp:38
Definition: nothing.hpp:16
ProcessBase(const std::string &id="")
static Try< mesos::slave::Isolator * > create(const Flags &flags)
Definition: posix.hpp:145
Definition: future.hpp:664
PosixCpuIsolatorProcess()
Definition: posix.hpp:172
Definition: posix.hpp:176
Definition: resources.hpp:79
virtual process::Future< ResourceStatistics > usage(const ContainerID &containerId)
Definition: posix.hpp:153
virtual process::Future< Nothing > update(const ContainerID &containerId, const Resources &resources)
Definition: posix.hpp:104
hashmap< ContainerID, process::Owned< process::Promise< mesos::slave::ContainerLimitation > > > promises
Definition: posix.hpp:138
DWORD pid_t
Definition: windows.hpp:187
Try< ResourceStatistics > usage(pid_t pid, bool mem=true, bool cpus=true)
virtual process::Future< Nothing > isolate(const ContainerID &containerId, pid_t pid)
Definition: posix.hpp:81
static Try< mesos::slave::Isolator * > create(const Flags &flags)
Definition: posix.hpp:179
void put(const Key &key, const Value &value)
Definition: hashmap.hpp:104
const T & get() const &
Definition: option.hpp:118
Protocol< PromiseRequest, PromiseResponse > promise
Definition: isolator.hpp:80
static Try error(const E &e)
Definition: try.hpp:42
void run(std::vector< C > &&callbacks, Arguments &&...arguments)
Definition: future.hpp:617
Result< Process > process(pid_t pid)
Definition: freebsd.hpp:30
#define flags
Definition: decoder.hpp:18
bool isError() const
Definition: try.hpp:71
PosixMemIsolatorProcess()
Definition: posix.hpp:206
hashmap< ContainerID, pid_t > pids
Definition: posix.hpp:135
virtual process::Future< mesos::slave::ContainerLimitation > watch(const ContainerID &containerId)
Definition: posix.hpp:94
virtual process::Future< Nothing > cleanup(const ContainerID &containerId)
Definition: posix.hpp:116
virtual process::Future< ResourceStatistics > usage(const ContainerID &containerId)
Definition: posix.hpp:187
virtual process::Future< Nothing > recover(const std::list< mesos::slave::ContainerState > &state, const hashset< ContainerID > &orphans)
Definition: posix.hpp:44
std::string stringify(int flags)
Definition: posix.hpp:142
bool contains(const Key &key) const
Definition: hashmap.hpp:86
const T & get() const
Definition: try.hpp:73
Option< Value > get(const Key &key) const
Definition: hashmap.hpp:112