Skip to content

Commit

Permalink
Improved compile time of by adding cpp files for flag headers.
Browse files Browse the repository at this point in the history
Split the mesos master, slave flags into header + source file to
improve compile time significantly. Should be no functional changes.

Review: https://reviews.apache.org/r/32558
  • Loading branch information
Cody Maloney authored and bmahler committed Apr 10, 2015
1 parent 5028490 commit 743e9e7
Show file tree
Hide file tree
Showing 8 changed files with 769 additions and 806 deletions.
3 changes: 3 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,12 @@ libmesos_no_3rdparty_la_SOURCES = \
files/files.cpp \
hook/manager.cpp \
local/local.cpp \
logging/flags.cpp \
logging/logging.cpp \
master/contender.cpp \
master/constants.cpp \
master/detector.cpp \
master/flags.cpp \
master/http.cpp \
master/master.cpp \
master/metrics.cpp \
Expand All @@ -335,6 +337,7 @@ libmesos_no_3rdparty_la_SOURCES = \
scheduler/scheduler.cpp \
slave/constants.cpp \
slave/gc.cpp \
slave/flags.cpp \
slave/http.cpp \
slave/metrics.cpp \
slave/monitor.cpp \
Expand Down
51 changes: 51 additions & 0 deletions src/logging/flags.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "logging/flags.hpp"


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

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",
"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::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",
"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.");
}
40 changes: 1 addition & 39 deletions src/logging/flags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,45 +31,7 @@ namespace logging {
class Flags : public virtual flags::FlagsBase
{
public:
Flags()
{
add(&Flags::quiet,
"quiet",
"Disable logging to stderr",
false);

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",
"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::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",
"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.");
}
Flags();

bool quiet;
std::string logging_level;
Expand Down
1 change: 1 addition & 0 deletions src/master/allocator/allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <stout/option.hpp>

#include "master/flags.hpp"
#include "messages/messages.hpp"

namespace mesos {
namespace internal {
Expand Down
Loading

0 comments on commit 743e9e7

Please sign in to comment.