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  "registration_backoff_factor",
41  "Scheduler driver (re-)registration retries are exponentially backed\n"
42  "off based on 'b', the registration backoff factor (e.g., 1st retry\n"
43  "uses a random value between [0, b], 2nd retry between [0, b * 2^1],\n"
44  "3rd retry between [0, b * 2^2]...) up to a maximum of (framework\n"
45  "failover timeout/10, if failover timeout is specified) or " +
46  stringify(REGISTRATION_RETRY_INTERVAL_MAX) + ", whichever is smaller",
48 
49  // This help message for --modules flag is the same for
50  // {master,slave,sched,tests}/flags.[ch]pp and should always be kept in
51  // in sync.
52  // TODO(karya): Remove the JSON example and add reference to the
53  // doc file explaining the --modules flag.
55  "modules",
56  "List of modules to be loaded and be available to the internal\n"
57  "subsystems.\n"
58  "\n"
59  "Use --modules=filepath to specify the list of modules via a\n"
60  "file containing a JSON formatted string. 'filepath' can be\n"
61  "of the form 'file:///path/to/file' or '/path/to/file'.\n"
62  "\n"
63  "Use --modules=\"{...}\" to specify the list of modules inline.\n"
64  "\n"
65  "Example:\n"
66  "{\n"
67  " \"libraries\": [\n"
68  " {\n"
69  " \"file\": \"/path/to/libfoo.so\",\n"
70  " \"modules\": [\n"
71  " {\n"
72  " \"name\": \"org_apache_mesos_bar\",\n"
73  " \"parameters\": [\n"
74  " {\n"
75  " \"key\": \"X\",\n"
76  " \"value\": \"Y\"\n"
77  " }\n"
78  " ]\n"
79  " },\n"
80  " {\n"
81  " \"name\": \"org_apache_mesos_baz\"\n"
82  " }\n"
83  " ]\n"
84  " },\n"
85  " {\n"
86  " \"name\": \"qux\",\n"
87  " \"modules\": [\n"
88  " {\n"
89  " \"name\": \"org_apache_mesos_norf\"\n"
90  " }\n"
91  " ]\n"
92  " }\n"
93  " ]\n"
94  "}");
95 
96  // This help message for --modules_dir flag is the same for
97  // {master,slave,sched,tests}/flags.[ch]pp and should always be kept in
98  // sync.
100  "modules_dir",
101  "Directory path of the module manifest files.\n"
102  "The manifest files are processed in alphabetical order.\n"
103  "(See --modules for more information on module manifest files).\n"
104  "Cannot be used in conjunction with --modules.\n");
105 
107  "authenticatee",
108  "Authenticatee implementation to use when authenticating against the\n"
109  "master. Use the default '" + std::string(DEFAULT_AUTHENTICATEE) + "'\n"
110  "or load an alternate authenticatee module using MESOS_MODULES.",
112 
114  "authentication_backoff_factor",
115  "The scheduler will time out its authentication with the master based\n"
116  "on exponential backoff. The timeout will be randomly chosen within\n"
117  "the range `[min, min + factor*2^n]` where `n` is the number of\n"
118  "failed attempts. To tune these parameters, set the\n"
119  "`--authentication_timeout_[min|max|factor]` flags.\n",
121 
123  "authentication_timeout_min",
124  flags::DeprecatedName("authentication_timeout"),
125  "The minimum amount of time the scheduler waits before retrying\n"
126  "authenticating with the master. See `authentication_backoff_factor`\n"
127  "for more details. NOTE: since authentication retry cancels the\n"
128  "previous authentication request, one should consider what is the\n"
129  "normal authentication delay when setting this flag to prevent\n"
130  "premature retry",
132 
134  "authentication_timeout_max",
135  "The maximum amount of time the scheduler waits before retrying\n"
136  "authenticating with the master. See `authentication_backoff_factor`\n"
137  "for more details",
139  }
140 
145  std::string authenticatee;
148 };
149 
150 } // namespace scheduler {
151 } // namespace internal {
152 } // namespace mesos {
153 
154 #endif // __SCHED_FLAGS_HPP__
Definition: flags.hpp:29
Flags()
Definition: flags.hpp:37
constexpr char DEFAULT_AUTHENTICATEE[]
Definition: constants.hpp:42
constexpr Duration DEFAULT_AUTHENTICATION_TIMEOUT_MAX
Definition: constants.hpp:54
Option< Modules > modules
Definition: flags.hpp:143
Definition: duration.hpp:32
constexpr Duration DEFAULT_AUTHENTICATION_TIMEOUT_MIN
Definition: constants.hpp:50
Duration authentication_timeout_min
Definition: flags.hpp:146
Definition: agent.hpp:25
Duration authentication_backoff_factor
Definition: flags.hpp:141
constexpr Duration DEFAULT_REGISTRATION_BACKOFF_FACTOR
Definition: constants.hpp:35
Name DeprecatedName(const std::string &name)
Definition: flag.hpp:52
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:145
Duration authentication_timeout_max
Definition: flags.hpp:147
Duration registration_backoff_factor
Definition: flags.hpp:142
constexpr Duration DEFAULT_AUTHENTICATION_BACKOFF_FACTOR
Definition: constants.hpp:46
std::string stringify(int flags)
Option< std::string > modulesDir
Definition: flags.hpp:144
Definition: flags.hpp:34