Apache Mesos
volume_gid_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 __VOLUME_GID_MANAGER_HPP__
18 #define __VOLUME_GID_MANAGER_HPP__
19 
20 #include <process/future.hpp>
21 #include <process/process.hpp>
22 
23 #include <stout/nothing.hpp>
24 #include <stout/try.hpp>
25 
26 #include "slave/flags.hpp"
27 
28 #ifndef __WINDOWS__
30 #endif // __WINDOWS__
31 
32 namespace mesos {
33 namespace internal {
34 namespace slave {
35 
36 // Forward declaration.
37 class VolumeGidManagerProcess;
38 
39 
40 // Manages the allocation of owner group IDs for shared
41 // persistent volumes and SANDBOX_PATH volume of PARENT type.
43 {
44 #ifndef __WINDOWS__
45 public:
47 
49 
50  process::Future<Nothing> recover(bool rebooted) const;
51 
53  const std::string& path,
55 
56  process::Future<Nothing> deallocate(const std::string& path) const;
57 
58 private:
59  explicit VolumeGidManager(
61 
63 #endif // __WINDOWS__
64 };
65 
66 } // namespace slave {
67 } // namespace internal {
68 } // namespace mesos {
69 
70 #endif // __VOLUME_GID_MANAGER_HPP__
Definition: path.hpp:29
process::Future< gid_t > allocate(const std::string &path, VolumeGidInfo::Type type) const
Definition: check.hpp:33
Definition: volume_gid_manager.hpp:42
Definition: flags.hpp:39
Definition: agent.hpp:25
Definition: attributes.hpp:24
Definition: executor.hpp:48
Type
Definition: capabilities.hpp:82
Try< uint32_t > type(const std::string &path)
process::Future< Nothing > recover(bool rebooted) const
process::Future< Nothing > deallocate(const std::string &path) const
Definition: parse.hpp:33
static Try< VolumeGidManager * > create(const Flags &flags)