Apache Mesos
composing.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 __COMPOSING_CONTAINERIZER_HPP__
18 #define __COMPOSING_CONTAINERIZER_HPP__
19 
20 #include <map>
21 
22 #include <mesos/mesos.hpp>
23 #include <mesos/resources.hpp>
24 
25 #include <process/future.hpp>
26 #include <process/http.hpp>
27 #include <process/process.hpp>
28 
29 #include <stout/hashset.hpp>
30 #include <stout/option.hpp>
31 #include <stout/try.hpp>
32 
34 
35 namespace mesos {
36 namespace internal {
37 namespace slave {
38 
39 // Forward declaration.
40 class ComposingContainerizerProcess;
41 
42 
44 {
45 public:
47  const std::vector<Containerizer*>& containerizers);
48 
50  const std::vector<Containerizer*>& containerizers);
51 
52  ~ComposingContainerizer() override;
53 
55  const Option<state::SlaveState>& state) override;
56 
58  const ContainerID& containerId,
59  const mesos::slave::ContainerConfig& containerConfig,
60  const std::map<std::string, std::string>& environment,
61  const Option<std::string>& pidCheckpointPath) override;
62 
64  const ContainerID& containerId) override;
65 
67  const ContainerID& containerId,
68  const Resources& resourceRequests,
69  const google::protobuf::Map<
70  std::string, Value::Scalar>& resourceLimits = {}) override;
71 
73  const ContainerID& containerId) override;
74 
76  const ContainerID& containerId) override;
77 
79  const ContainerID& containerId) override;
80 
82  const ContainerID& containerId) override;
83 
85  const ContainerID& containerId,
86  int signal) override;
87 
89 
90  process::Future<Nothing> remove(const ContainerID& containerId) override;
91 
93  const std::vector<Image>& excludedImages) override;
94 
95 private:
96  ComposingContainerizerProcess* process;
97 };
98 
99 } // namespace slave {
100 } // namespace internal {
101 } // namespace mesos {
102 
103 #endif // __COMPOSING_CONTAINERIZER_HPP__
Definition: option.hpp:29
process::Future< Nothing > pruneImages(const std::vector< Image > &excludedImages) override
Definition: check.hpp:33
process::Future< Nothing > update(const ContainerID &containerId, const Resources &resourceRequests, const google::protobuf::Map< std::string, Value::Scalar > &resourceLimits={}) override
process::Future< hashset< ContainerID > > containers() override
ComposingContainerizer(const std::vector< Containerizer * > &containerizers)
Definition: resources.hpp:83
process::Future< ContainerStatus > status(const ContainerID &containerId) override
Environment * environment
Definition: containerizer.hpp:64
process::Future< Option< mesos::slave::ContainerTermination > > destroy(const ContainerID &containerId) override
static Try< ComposingContainerizer * > create(const std::vector< Containerizer * > &containerizers)
Definition: agent.hpp:25
process::Future< bool > kill(const ContainerID &containerId, int signal) override
process::Future< ResourceStatistics > usage(const ContainerID &containerId) override
Definition: attributes.hpp:24
Definition: executor.hpp:48
process::Future< Option< mesos::slave::ContainerTermination > > wait(const ContainerID &containerId) override
process::Future< process::http::Connection > attach(const ContainerID &containerId) override
process::Future< Nothing > recover(const Option< state::SlaveState > &state) override
process::Future< Containerizer::LaunchResult > launch(const ContainerID &containerId, const mesos::slave::ContainerConfig &containerConfig, const std::map< std::string, std::string > &environment, const Option< std::string > &pidCheckpointPath) override