Apache Mesos
mem.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __WINDOWS_MEM_ISOLATOR_HPP__
18 #define __WINDOWS_MEM_ISOLATOR_HPP__
19 
20 #include <vector>
21 
22 #include <process/future.hpp>
23 #include <process/id.hpp>
24 
25 #include <stout/bytes.hpp>
26 #include <stout/hashmap.hpp>
27 #include <stout/hashset.hpp>
28 #include <stout/nothing.hpp>
29 #include <stout/try.hpp>
30 #include <stout/windows.hpp>
31 
32 #include "slave/flags.hpp"
33 
35 
36 namespace mesos {
37 namespace internal {
38 namespace slave {
39 
41 {
42 public:
44 
45  bool supportsNesting() override;
46  bool supportsStandalone() override;
47 
49  const std::vector<mesos::slave::ContainerState>& state,
50  const hashset<ContainerID>& orphans) override;
51 
53  const ContainerID& containerId,
54  const mesos::slave::ContainerConfig& containerConfig) override;
55 
57  const ContainerID& containerId, pid_t pid) override;
58 
60  const ContainerID& containerId, const Resources& resources) override;
61 
63  const ContainerID& containerId) override;
64 
65  process::Future<Nothing> cleanup(const ContainerID& containerId) override;
66 
67 private:
68  struct Info
69  {
70  Option<pid_t> pid;
71  Option<Bytes> limit;
72  };
73 
75 
77  : ProcessBase(process::ID::generate("windows-mem-isolator"))
78  {}
79 };
80 
81 } // namespace slave {
82 } // namespace internal {
83 } // namespace mesos {
84 
85 #endif // __WINDOWS_MEM_ISOLATOR_HPP__
std::string generate(const std::string &prefix="")
Returns &#39;prefix(N)&#39; where N represents the number of instances where the same prefix (wrt...
ProcessBase(const std::string &id="")
Definition: check.hpp:33
process::Future< Nothing > isolate(const ContainerID &containerId, pid_t pid) override
process::Future< Option< mesos::slave::ContainerLaunchInfo > > prepare(const ContainerID &containerId, const mesos::slave::ContainerConfig &containerConfig) override
process::Future< Nothing > update(const ContainerID &containerId, const Resources &resources) override
Definition: resources.hpp:79
static Try< mesos::slave::Isolator * > create(const Flags &flags)
Definition: flags.hpp:39
process::Future< ResourceStatistics > usage(const ContainerID &containerId) override
process::Future< Nothing > cleanup(const ContainerID &containerId) override
DWORD pid_t
Definition: windows.hpp:181
process::Future< Nothing > recover(const std::vector< mesos::slave::ContainerState > &state, const hashset< ContainerID > &orphans) override
Definition: spec.hpp:30
Definition: attributes.hpp:24
Definition: parse.hpp:33