Apache Mesos
metadata_manager.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 __PROVISIONER_DOCKER_METADATA_MANAGER_HPP__
18 #define __PROVISIONER_DOCKER_METADATA_MANAGER_HPP__
19 
20 #include <list>
21 #include <string>
22 
23 #include <stout/hashmap.hpp>
24 #include <stout/hashset.hpp>
25 #include <stout/json.hpp>
26 #include <stout/option.hpp>
27 #include <stout/protobuf.hpp>
28 #include <stout/try.hpp>
29 
30 #include <process/future.hpp>
31 #include <process/owned.hpp>
32 #include <process/process.hpp>
33 
34 #include <mesos/docker/spec.hpp>
35 
37 
39 
40 #include "slave/flags.hpp"
41 
42 namespace mesos {
43 namespace internal {
44 namespace slave {
45 namespace docker {
46 
47 // Forward Declaration.
48 class MetadataManagerProcess;
49 
59 {
60 public:
62 
64 
69 
81  const ::docker::spec::ImageReference& reference,
82  const std::vector<std::string>& layerIds);
83 
93  const ::docker::spec::ImageReference& reference,
94  bool cached);
95 
107  const std::vector<::docker::spec::ImageReference>& excludedImages);
108 
109 private:
111 
112  MetadataManager(const MetadataManager&); // Not copyable.
113  MetadataManager& operator=(const MetadataManager&); // Not assignable.
114 
116 };
117 
118 
119 } // namespace docker {
120 } // namespace slave {
121 } // namespace internal {
122 } // namespace mesos {
123 
124 #endif // __PROVISIONER_DOCKER_METADATA_MANAGER_HPP__
Definition: check.hpp:33
process::Future< hashset< std::string > > prune(const std::vector<::docker::spec::ImageReference > &excludedImages)
Prune images from the metadata manager by comparing existing images with active images in use...
Definition: flags.hpp:39
Definition: spec.hpp:26
The MetadataManager tracks the Docker images cached by the provisioner that are stored on disk...
Definition: metadata_manager.hpp:58
Definition: attributes.hpp:24
Definition: executor.hpp:48
process::Future< Nothing > recover()
Recover all stored Image and its layer references.
Definition: spec.hpp:35
Definition: parse.hpp:33
static Try< process::Owned< MetadataManager > > create(const Flags &flags)
process::Future< Image > put(const ::docker::spec::ImageReference &reference, const std::vector< std::string > &layerIds)
Create an Image, put it in metadata manager and persist the reference store state to disk...