Skip to content

Commit

Permalink
Fixed wrapping in the flag.cpp files.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmahler committed Apr 13, 2015
1 parent 6623df1 commit b918c63
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 88 deletions.
23 changes: 16 additions & 7 deletions src/logging/flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,39 @@

mesos::internal::logging::Flags::Flags()
{
add(&Flags::quiet, "quiet", "Disable logging to stderr", false);
add(&Flags::quiet,
"quiet",
"Disable logging to stderr",
false);

add(&Flags::logging_level, "logging_level",
add(&Flags::logging_level,
"logging_level",
"Log message at or above this level; possible values: \n"
"'INFO', 'WARNING', 'ERROR'; if quiet flag is used, this \n"
"will affect just the logs from log_dir (if specified)",
"INFO");

add(&Flags::log_dir, "log_dir",
add(&Flags::log_dir,
"log_dir",
"Directory path to put log files (no default, nothing\n"
"is written to disk unless specified;\n"
"does not affect logging to stderr).\n"
"NOTE: 3rd party log messages (e.g. ZooKeeper) are\n"
"only written to stderr!\n");

add(&Flags::logbufsecs, "logbufsecs",
"How many seconds to buffer log messages for", 0);
add(&Flags::logbufsecs,
"logbufsecs",
"How many seconds to buffer log messages for",
0);

add(&Flags::initialize_driver_logging, "initialize_driver_logging",
add(&Flags::initialize_driver_logging,
"initialize_driver_logging",
"Whether to automatically initialize google logging of scheduler\n"
"and/or executor drivers.",
true);

add(&Flags::external_log_file, "external_log_file",
add(&Flags::external_log_file,
"external_log_file",
"Specified the externally managed log file. This file will be\n"
"exposed in the webui and HTTP api. This is useful when using\n"
"stderr logging as the log file is otherwise unknown to Mesos.");
Expand Down
107 changes: 72 additions & 35 deletions src/master/flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,51 @@

mesos::internal::master::Flags::Flags()
{
add(&Flags::version, "version", "Show version and exit.", false);
add(&Flags::version,
"version",
"Show version and exit.",
false);

add(&Flags::hostname, "hostname",
add(&Flags::hostname,
"hostname",
"The hostname the master should advertise in ZooKeeper.\n"
"If left unset, the hostname is resolved from the IP address\n"
"that the master binds to.");

add(&Flags::root_submissions, "root_submissions",
"Can root submit frameworks?", true);
add(&Flags::root_submissions,
"root_submissions",
"Can root submit frameworks?",
true);

add(&Flags::work_dir, "work_dir",
add(&Flags::work_dir,
"work_dir",
"Directory path to store the persistent information stored in the \n"
"Registry. (example: /var/lib/mesos/master)");

// TODO(bmahler): Consider removing 'in_memory' as it was only
// used before 'replicated_log' was implemented.
add(&Flags::registry, "registry",
add(&Flags::registry,
"registry",
"Persistence strategy for the registry;\n"
"available options are 'replicated_log', 'in_memory' (for testing).",
"replicated_log");

// TODO(vinod): Instead of specifying the quorum size consider
// specifying the number of masters or the list of masters.
add(&Flags::quorum, "quorum",
add(&Flags::quorum,
"quorum",
"The size of the quorum of replicas when using 'replicated_log' based\n"
"registry. It is imperative to set this value to be a majority of\n"
"masters i.e., quorum > (number of masters)/2.");

add(&Flags::zk_session_timeout, "zk_session_timeout",
"ZooKeeper session timeout.", ZOOKEEPER_SESSION_TIMEOUT);
add(&Flags::zk_session_timeout,
"zk_session_timeout",
"ZooKeeper session timeout.",
ZOOKEEPER_SESSION_TIMEOUT);

// TODO(bmahler): Set the default to true in 0.20.0.
add(&Flags::registry_strict, "registry_strict",
add(&Flags::registry_strict,
"registry_strict",
"Whether the Master will take actions based on the persistent\n"
"information stored in the Registry. Setting this to false means\n"
"that the Registrar will never reject the admission, readmission,\n"
Expand All @@ -69,23 +81,27 @@ mesos::internal::master::Flags::Flags()
"production yet.",
false);

add(&Flags::registry_fetch_timeout, "registry_fetch_timeout",
add(&Flags::registry_fetch_timeout,
"registry_fetch_timeout",
"Duration of time to wait in order to fetch data from the registry\n"
"after which the operation is considered a failure.",
Seconds(60));

add(&Flags::registry_store_timeout, "registry_store_timeout",
add(&Flags::registry_store_timeout,
"registry_store_timeout",
"Duration of time to wait in order to store data in the registry\n"
"after which the operation is considered a failure.",
Seconds(5));

add(&Flags::log_auto_initialize, "log_auto_initialize",
add(&Flags::log_auto_initialize,
"log_auto_initialize",
"Whether to automatically initialize the replicated log used for the\n"
"registry. If this is set to false, the log has to be manually\n"
"initialized when used for the very first time.",
true);

add(&Flags::slave_reregister_timeout, "slave_reregister_timeout",
add(&Flags::slave_reregister_timeout,
"slave_reregister_timeout",
"The timeout within which all slaves are expected to re-register\n"
"when a new master is elected as the leader. Slaves that do not\n"
"re-register within the timeout will be removed from the registry\n"
Expand All @@ -96,7 +112,8 @@ mesos::internal::master::Flags::Flags()

// TODO(bmahler): Add a 'Percentage' abstraction for flags.
// TODO(bmahler): Add a --production flag for production defaults.
add(&Flags::recovery_slave_removal_limit, "recovery_slave_removal_limit",
add(&Flags::recovery_slave_removal_limit,
"recovery_slave_removal_limit",
"For failovers, limit on the percentage of slaves that can be removed\n"
"from the registry *and* shutdown after the re-registration timeout\n"
"elapses. If the limit is exceeded, the master will fail over rather\n"
Expand All @@ -113,65 +130,78 @@ mesos::internal::master::Flags::Flags()

// TODO(vinod): Add a 'Rate' abstraction in stout and the
// corresponding parser for flags.
add(&Flags::slave_removal_rate_limit, "slave_removal_rate_limit",
add(&Flags::slave_removal_rate_limit,
"slave_removal_rate_limit",
"The maximum rate (e.g., 1/10mins, 2/3hrs, etc) at which slaves will\n"
"be removed from the master when they fail health checks. By default\n"
"slaves will be removed as soon as they fail the health checks.\n"
"The value is of the form <Number of slaves>/<Duration>.");

add(&Flags::webui_dir, "webui_dir",
"Directory path of the webui files/assets", PKGDATADIR "/webui");
add(&Flags::webui_dir,
"webui_dir",
"Directory path of the webui files/assets",
PKGDATADIR "/webui");

add(&Flags::whitelist, "whitelist",
add(&Flags::whitelist,
"whitelist",
"Path to a file with a list of slaves\n"
"(one per line) to advertise offers for.\n"
"Path could be of the form 'file:///path/to/file' or '/path/to/file'.");

add(&Flags::user_sorter, "user_sorter",
add(&Flags::user_sorter,
"user_sorter",
"Policy to use for allocating resources\n"
"between users. May be one of:\n"
" dominant_resource_fairness (drf)",
"drf");

add(&Flags::framework_sorter, "framework_sorter",
add(&Flags::framework_sorter,
"framework_sorter",
"Policy to use for allocating resources\n"
"between a given user's frameworks. Options\n"
"are the same as for user_allocator.",
"drf");

add(&Flags::allocation_interval, "allocation_interval",
add(&Flags::allocation_interval,
"allocation_interval",
"Amount of time to wait between performing\n"
" (batch) allocations (e.g., 500ms, 1sec, etc).",
Seconds(1));

add(&Flags::cluster, "cluster",
add(&Flags::cluster,
"cluster",
"Human readable name for the cluster,\n"
"displayed in the webui.");

// TODO(vinod): Deprecate this in favor of '--acls'.
add(&Flags::roles, "roles",
add(&Flags::roles,
"roles",
"A comma separated list of the allocation\n"
"roles that frameworks in this cluster may\n"
"belong to.");

add(&Flags::weights, "weights",
add(&Flags::weights,
"weights",
"A comma separated list of role/weight pairs\n"
"of the form 'role=weight,role=weight'. Weights\n"
"are used to indicate forms of priority.");

// TODO(adam-mesos): Deprecate --authenticate for --authenticate_frameworks.
add(&Flags::authenticate_frameworks, "authenticate",
add(&Flags::authenticate_frameworks,
"authenticate",
"If authenticate is 'true' only authenticated frameworks are allowed\n"
"to register. If 'false' unauthenticated frameworks are also\n"
"allowed to register.",
false);

add(&Flags::authenticate_slaves, "authenticate_slaves",
add(&Flags::authenticate_slaves,
"authenticate_slaves",
"If 'true' only authenticated slaves are allowed to register.\n"
"If 'false' unauthenticated slaves are also allowed to register.",
false);

add(&Flags::credentials, "credentials",
add(&Flags::credentials,
"credentials",
"Either a path to a text file with a list of credentials,\n"
"each line containing 'principal' and 'secret' separated by "
"whitespace,\n"
Expand All @@ -190,7 +220,8 @@ mesos::internal::master::Flags::Flags()
"Text file Example:\n"
"username secret\n");

add(&Flags::acls, "acls",
add(&Flags::acls,
"acls",
"The value could be a JSON formatted string of ACLs\n"
"or a file path containing the JSON formatted ACLs used\n"
"for authorization. Path could be of the form 'file:///path/to/file'\n"
Expand Down Expand Up @@ -220,7 +251,8 @@ mesos::internal::master::Flags::Flags()
" ]\n"
"}");

add(&Flags::rate_limits, "rate_limits",
add(&Flags::rate_limits,
"rate_limits",
"The value could be a JSON formatted string of rate limits\n"
"or a file path containing the JSON formatted rate limits used\n"
"for framework rate limiting.\n"
Expand All @@ -244,7 +276,8 @@ mesos::internal::master::Flags::Flags()
"}");

#ifdef WITH_NETWORK_ISOLATOR
add(&Flags::max_executors_per_slave, "max_executors_per_slave",
add(&Flags::max_executors_per_slave,
"max_executors_per_slave",
"Maximum number of executors allowed per slave. The network\n"
"monitoring/isolation technique imposes an implicit resource\n"
"acquisition on each executor (# ephemeral ports), as a result\n"
Expand All @@ -253,7 +286,8 @@ mesos::internal::master::Flags::Flags()

// TODO(karya): When we have optimistic offers, this will only
// benefit frameworks that accidentally lose an offer.
add(&Flags::offer_timeout, "offer_timeout",
add(&Flags::offer_timeout,
"offer_timeout",
"Duration of time before an offer is rescinded from a framework.\n"
"This helps fairness when running frameworks that hold on to offers,\n"
"or frameworks that accidentally drop offers.");
Expand All @@ -263,7 +297,8 @@ mesos::internal::master::Flags::Flags()
// sync.
// TODO(karya): Remove the JSON example and add reference to the
// doc file explaining the --modules flag.
add(&Flags::modules, "modules",
add(&Flags::modules,
"modules",
"List of modules to be loaded and be available to the internal\n"
"subsystems.\n"
"\n"
Expand Down Expand Up @@ -304,15 +339,17 @@ mesos::internal::master::Flags::Flags()
" ]\n"
"}");

add(&Flags::authenticators, "authenticators",
add(&Flags::authenticators,
"authenticators",
"Authenticator implementation to use when authenticating frameworks\n"
"and/or slaves. Use the default '" +
DEFAULT_AUTHENTICATOR +
"', or\n"
"load an alternate authenticator module using --modules.",
DEFAULT_AUTHENTICATOR);

add(&Flags::hooks, "hooks",
add(&Flags::hooks,
"hooks",
"A comma separated list of hook modules to be\n"
"installed inside master.");
}
Loading

0 comments on commit b918c63

Please sign in to comment.