Apache Mesos
flags.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 __SCHED_FLAGS_HPP__
18 #define __SCHED_FLAGS_HPP__
19 
20 #include <stout/flags.hpp>
21 
22 #include "common/parse.hpp"
23 
24 #include "logging/flags.hpp"
25 
26 #include "messages/messages.hpp"
27 
28 #include "sched/constants.hpp"
29 
30 namespace mesos {
31 namespace internal {
32 namespace scheduler {
33 
34 class Flags : public virtual logging::Flags
35 {
36 public:
38  {
40  "authentication_backoff_factor",
41  "Scheduler driver authentication retries are exponentially backed\n"
42  "off based on 'b', the authentication backoff factor (e.g., 1st retry\n"
43  "uses a random value between `[0, b * 2^1]`, 2nd retry between\n"
44  "`[0, b * 2^2]`, 3rd retry between `[0, b * 2^3]`, etc up to a\n"
47 
49  "registration_backoff_factor",
50  "Scheduler driver (re-)registration retries are exponentially backed\n"
51  "off based on 'b', the registration backoff factor (e.g., 1st retry\n"
52  "uses a random value between [0, b], 2nd retry between [0, b * 2^1],\n"
53  "3rd retry between [0, b * 2^2]...) up to a maximum of (framework\n"
54  "failover timeout/10, if failover timeout is specified) or " +
55  stringify(REGISTRATION_RETRY_INTERVAL_MAX) + ", whichever is smaller",
57 
58  // This help message for --modules flag is the same for
59  // {master,slave,sched,tests}/flags.[ch]pp and should always be kept in
60  // in sync.
61  // TODO(karya): Remove the JSON example and add reference to the
62  // doc file explaining the --modules flag.
64  "modules",
65  "List of modules to be loaded and be available to the internal\n"
66  "subsystems.\n"
67  "\n"
68  "Use --modules=filepath to specify the list of modules via a\n"
69  "file containing a JSON formatted string. 'filepath' can be\n"
70  "of the form 'file:///path/to/file' or '/path/to/file'.\n"
71  "\n"
72  "Use --modules=\"{...}\" to specify the list of modules inline.\n"
73  "\n"
74  "Example:\n"
75  "{\n"
76  " \"libraries\": [\n"
77  " {\n"
78  " \"file\": \"/path/to/libfoo.so\",\n"
79  " \"modules\": [\n"
80  " {\n"
81  " \"name\": \"org_apache_mesos_bar\",\n"
82  " \"parameters\": [\n"
83  " {\n"
84  " \"key\": \"X\",\n"
85  " \"value\": \"Y\"\n"
86  " }\n"
87  " ]\n"
88  " },\n"
89  " {\n"
90  " \"name\": \"org_apache_mesos_baz\"\n"
91  " }\n"
92  " ]\n"
93  " },\n"
94  " {\n"
95  " \"name\": \"qux\",\n"
96  " \"modules\": [\n"
97  " {\n"
98  " \"name\": \"org_apache_mesos_norf\"\n"
99  " }\n"
100  " ]\n"
101  " }\n"
102  " ]\n"
103  "}");
104 
105  // This help message for --modules_dir flag is the same for
106  // {master,slave,sched,tests}/flags.[ch]pp and should always be kept in
107  // sync.
109  "modules_dir",
110  "Directory path of the module manifest files.\n"
111  "The manifest files are processed in alphabetical order.\n"
112  "(See --modules for more information on module manifest files).\n"
113  "Cannot be used in conjunction with --modules.\n");
114 
116  "authenticatee",
117  "Authenticatee implementation to use when authenticating against the\n"
118  "master. Use the default '" + std::string(DEFAULT_AUTHENTICATEE) + "'\n"
119  "or load an alternate authenticatee module using MESOS_MODULES.",
121 
123  "authentication_timeout",
124  "Timeout after which authentication will be retried.",
126  }
127 
132  std::string authenticatee;
134 };
135 
136 } // namespace scheduler {
137 } // namespace internal {
138 } // namespace mesos {
139 
140 #endif // __SCHED_FLAGS_HPP__
constexpr Duration DEFAULT_AUTHENTICATION_TIMEOUT
Definition: constants.hpp:53
Definition: flags.hpp:29
Flags()
Definition: flags.hpp:37
constexpr char DEFAULT_AUTHENTICATEE[]
Definition: constants.hpp:50
Option< Modules > modules
Definition: flags.hpp:130
Definition: duration.hpp:32
constexpr Duration AUTHENTICATION_RETRY_INTERVAL_MAX
Definition: constants.hpp:43
Definition: spec.hpp:30
Duration authentication_timeout
Definition: flags.hpp:133
Duration authentication_backoff_factor
Definition: flags.hpp:128
constexpr Duration DEFAULT_REGISTRATION_BACKOFF_FACTOR
Definition: constants.hpp:35
constexpr Duration REGISTRATION_RETRY_INTERVAL_MAX
Definition: constants.hpp:39
Definition: attributes.hpp:24
void add(T1 Flags::*t1, const Name &name, const Option< Name > &alias, const std::string &help, const T2 *t2, F validate)
Definition: flags.hpp:333
std::string authenticatee
Definition: flags.hpp:132
Duration registration_backoff_factor
Definition: flags.hpp:129
constexpr Duration DEFAULT_AUTHENTICATION_BACKOFF_FACTOR
Definition: constants.hpp:47
std::string stringify(int flags)
Option< std::string > modulesDir
Definition: flags.hpp:131
Definition: flags.hpp:34