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  virtual ~ComposingContainerizer();
53 
55  const Option<state::SlaveState>& state);
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);
62 
64  const ContainerID& containerId);
65 
67  const ContainerID& containerId,
68  const Resources& resources);
69 
71  const ContainerID& containerId);
72 
74  const ContainerID& containerId);
75 
77  const ContainerID& containerId);
78 
80  const ContainerID& containerId);
81 
83  const ContainerID& containerId,
84  int signal);
85 
87 
88  virtual process::Future<Nothing> remove(const ContainerID& containerId);
89 
91  const std::vector<Image>& excludedImages);
92 
93 private:
94  ComposingContainerizerProcess* process;
95 };
96 
97 } // namespace slave {
98 } // namespace internal {
99 } // namespace mesos {
100 
101 #endif // __COMPOSING_CONTAINERIZER_HPP__
virtual process::Future< hashset< ContainerID > > containers()
Definition: option.hpp:28
virtual process::Future< ResourceStatistics > usage(const ContainerID &containerId)
Definition: check.hpp:33
ComposingContainerizer(const std::vector< Containerizer * > &containerizers)
Definition: resources.hpp:79
virtual process::Future< bool > kill(const ContainerID &containerId, int signal)
virtual process::Future< Nothing > update(const ContainerID &containerId, const Resources &resources)
Environment * environment
Definition: containerizer.hpp:57
virtual process::Future< Option< mesos::slave::ContainerTermination > > wait(const ContainerID &containerId)
static Try< ComposingContainerizer * > create(const std::vector< Containerizer * > &containerizers)
virtual process::Future< Nothing > recover(const Option< state::SlaveState > &state)
virtual 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)
Definition: spec.hpp:30
virtual process::Future< ContainerStatus > status(const ContainerID &containerId)
Definition: attributes.hpp:24
Definition: executor.hpp:47
virtual process::Future< Nothing > pruneImages(const std::vector< Image > &excludedImages)
static Try< Resources > resources(const Flags &flags)
virtual process::Future< Option< mesos::slave::ContainerTermination > > destroy(const ContainerID &containerId)
virtual process::Future< process::http::Connection > attach(const ContainerID &containerId)