Apache Mesos
copy.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_BACKENDS_COPY_HPP__
18 #define __PROVISIONER_BACKENDS_COPY_HPP__
19 
21 
22 namespace mesos {
23 namespace internal {
24 namespace slave {
25 
26 // Forward declaration.
27 class CopyBackendProcess;
28 
29 
30 // The backend implementation that copies the layers to the target.
31 // NOTE: Using this backend currently has a few implications:
32 // 1) The disk space used by the provisioned rootfs is not counted
33 // towards either the usage by the executor/task or the store
34 // cache, which can interfere with the slave hosts's disk space
35 // allocation.
36 // 2) The task can write unrestrictedly into the provisioned rootfs
37 // which is not accounted for (in terms of disk usage) either.
38 class CopyBackend : public Backend
39 {
40 public:
41  ~CopyBackend() override;
42 
43  // CopyBackend doesn't use any flag.
45 
46  // Provisions a rootfs given the layers' paths and target rootfs
47  // path.
49  const std::vector<std::string>& layers,
50  const std::string& rootfs,
51  const std::string& backendDir) override;
52 
54  const std::string& rootfs,
55  const std::string& backendDir) override;
56 
57 private:
59 
60  CopyBackend(const CopyBackend&); // Not copyable.
61  CopyBackend& operator=(const CopyBackend&); // Not assignable.
62 
64 };
65 
66 } // namespace slave {
67 } // namespace internal {
68 } // namespace mesos {
69 
70 #endif // __PROVISIONER_BACKENDS_COPY_HPP__
Definition: check.hpp:33
process::Future< Nothing > provision(const std::vector< std::string > &layers, const std::string &rootfs, const std::string &backendDir) override
static Try< process::Owned< Backend > > create(const Flags &)
Definition: flags.hpp:39
Definition: backend.hpp:36
process::Future< bool > destroy(const std::string &rootfs, const std::string &backendDir) override
Definition: spec.hpp:30
Definition: attributes.hpp:24
Definition: executor.hpp:48