Apache Mesos
store.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_STORE_HPP__
18 #define __PROVISIONER_DOCKER_STORE_HPP__
19 
21 
22 #include <process/owned.hpp>
23 
24 #include <stout/hashset.hpp>
25 #include <stout/try.hpp>
26 
27 #include "slave/flags.hpp"
28 
30 
31 namespace mesos {
32 namespace internal {
33 namespace slave {
34 namespace docker {
35 
36 // Forward Declarations.
37 class Puller;
38 class StoreProcess;
39 
40 
41 // Store fetches the Docker images and stores them on disk.
42 class Store : public slave::Store
43 {
44 public:
46  const Flags& flags,
47  SecretResolver* secretResolver = nullptr);
48 
49  // This allows the puller to be mocked for testing.
51  const Flags& flags,
52  const process::Owned<Puller>& puller);
53 
54  virtual ~Store();
55 
57 
58  virtual process::Future<ImageInfo> get(
59  const mesos::Image& image,
60  const std::string& backend);
61 
63  const std::vector<mesos::Image>& excludeImages,
64  const hashset<std::string>& activeLayerPaths);
65 
66 private:
67  explicit Store(process::Owned<StoreProcess> process);
68 
69  Store& operator=(const Store&) = delete; // Not assignable.
70  Store(const Store&) = delete; // Not copyable.
71 
73 };
74 
75 } // namespace docker {
76 } // namespace slave {
77 } // namespace internal {
78 } // namespace mesos {
79 
80 #endif // __PROVISIONER_DOCKER_STORE_HPP__
static Try< process::Owned< slave::Store > > create(const Flags &flags, SecretResolver *secretResolver=nullptr)
virtual process::Future< Nothing > prune(const std::vector< mesos::Image > &excludeImages, const hashset< std::string > &activeLayerPaths)
Definition: try.hpp:34
Definition: store.hpp:60
Definition: flags.hpp:39
virtual process::Future< Nothing > recover()
#define flags
Definition: decoder.hpp:18
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: resolver.hpp:34
Definition: owned.hpp:35