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 
74  process::Future<Image> put(const Image& image);
75 
85  const ::docker::spec::ImageReference& reference,
86  bool cached);
87 
99  const std::vector<::docker::spec::ImageReference>& excludedImages);
100 
101 private:
103 
104  MetadataManager(const MetadataManager&); // Not copyable.
105  MetadataManager& operator=(const MetadataManager&); // Not assignable.
106 
108 };
109 
110 
111 } // namespace docker {
112 } // namespace slave {
113 } // namespace internal {
114 } // namespace mesos {
115 
116 #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: agent.hpp:25
process::Future< Image > put(const Image &image)
Put the image in metadata manager and persist the reference store state to disk.
The MetadataManager tracks the Docker images cached by the provisioner that are stored on disk...
Definition: metadata_manager.hpp:58
URI image(const std::string &repository, const std::string &reference, const std::string &registry, const Option< std::string > &scheme=None(), const Option< int > &port=None())
Definition: docker.hpp:30
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)