17 #ifndef __POSIX_ISOLATOR_HPP__ 18 #define __POSIX_ISOLATOR_HPP__ 45 const std::vector<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)
override 71 " has already been prepared");
82 const ContainerID& containerId,
95 const ContainerID& containerId)
override 101 return promises[containerId]->future();
105 const ContainerID& containerId,
107 const google::protobuf::Map<
108 std::string, Value::Scalar>& resourceLimits = {})
override 121 VLOG(1) <<
"Ignoring cleanup request for unknown container " 131 pids.erase(containerId);
156 const ContainerID& containerId)
override 159 LOG(WARNING) <<
"No resource usage for unknown container '" 160 << containerId <<
"'";
161 return ResourceStatistics();
190 const ContainerID& containerId)
override 193 LOG(WARNING) <<
"No resource usage for unknown container '" 194 << containerId <<
"'";
195 return ResourceStatistics();
216 #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< ResourceStatistics > usage(const ContainerID &containerId)
Definition: isolator.hpp:133
Definition: isolator.hpp:38
Definition: nothing.hpp:16
ProcessBase(const std::string &id="")
T & get()&
Definition: try.hpp:80
static Try< mesos::slave::Isolator * > create(const Flags &flags)
Definition: posix.hpp:147
Definition: future.hpp:668
PosixCpuIsolatorProcess()
Definition: posix.hpp:174
Definition: posix.hpp:178
process::Future< Option< mesos::slave::ContainerLaunchInfo > > prepare(const ContainerID &containerId, const mesos::slave::ContainerConfig &containerConfig) override
Definition: posix.hpp:65
Definition: resources.hpp:83
process::Future< ResourceStatistics > usage(const ContainerID &containerId) override
Definition: posix.hpp:189
hashmap< ContainerID, process::Owned< process::Promise< mesos::slave::ContainerLimitation > > > promises
Definition: posix.hpp:140
DWORD pid_t
Definition: windows.hpp:181
Try< ResourceStatistics > usage(pid_t pid, bool mem=true, bool cpus=true)
process::Future< Nothing > update(const ContainerID &containerId, const Resources &resourceRequests, const google::protobuf::Map< std::string, Value::Scalar > &resourceLimits={}) override
Definition: posix.hpp:104
process::Future< Nothing > recover(const std::vector< mesos::slave::ContainerState > &state, const hashset< ContainerID > &orphans) override
Definition: posix.hpp:44
static Try< mesos::slave::Isolator * > create(const Flags &flags)
Definition: posix.hpp:181
Protocol< PromiseRequest, PromiseResponse > promise
Definition: isolator.hpp:82
process::Future< mesos::slave::ContainerLimitation > watch(const ContainerID &containerId) override
Definition: posix.hpp:94
static Try error(const E &e)
Definition: try.hpp:43
process::Future< Nothing > isolate(const ContainerID &containerId, pid_t pid) override
Definition: posix.hpp:81
void run(std::vector< C > &&callbacks, Arguments &&...arguments)
Definition: future.hpp:621
void put(const Key &key, Value &&value)
Definition: hashmap.hpp:104
Result< Process > process(pid_t pid)
Definition: freebsd.hpp:30
Definition: attributes.hpp:24
bool isError() const
Definition: try.hpp:78
PosixMemIsolatorProcess()
Definition: posix.hpp:208
Definition: executor.hpp:48
hashmap< ContainerID, pid_t > pids
Definition: posix.hpp:137
std::string stringify(int flags)
process::Future< Nothing > cleanup(const ContainerID &containerId) override
Definition: posix.hpp:118
process::Future< ResourceStatistics > usage(const ContainerID &containerId) override
Definition: posix.hpp:155
Definition: posix.hpp:144
bool contains(const Key &key) const
Definition: hashmap.hpp:86