You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2015/08/28 04:34:30 UTC
[3/3] mesos git commit: mesos: Fixed style issues around control
structures.
mesos: Fixed style issues around control structures.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c3bd1a05
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c3bd1a05
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c3bd1a05
Branch: refs/heads/master
Commit: c3bd1a056578b37d50bc6624f9c37daf8b430496
Parents: da6e3ed
Author: Michael Park <mp...@apache.org>
Authored: Thu Aug 27 22:17:56 2015 -0400
Committer: Michael Park <mp...@apache.org>
Committed: Thu Aug 27 22:21:42 2015 -0400
----------------------------------------------------------------------
src/authentication/cram_md5/authenticator.cpp | 2 +-
src/common/http.cpp | 6 +++---
src/common/resources.cpp | 4 ++--
src/files/files.cpp | 4 ++--
src/linux/routing/queueing/internal.hpp | 4 ++--
.../containerizer/isolators/network/port_mapping.cpp | 10 +++++-----
src/slave/slave.cpp | 4 ++--
src/tests/containerizer/memory_test_helper.cpp | 2 +-
src/v1/resources.cpp | 4 ++--
9 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/c3bd1a05/src/authentication/cram_md5/authenticator.cpp
----------------------------------------------------------------------
diff --git a/src/authentication/cram_md5/authenticator.cpp b/src/authentication/cram_md5/authenticator.cpp
index 6632b23..f751ee1 100644
--- a/src/authentication/cram_md5/authenticator.cpp
+++ b/src/authentication/cram_md5/authenticator.cpp
@@ -454,7 +454,7 @@ void load(const std::map<string, string>& secrets)
void load(const Credentials& credentials)
{
std::map<string, string> secrets;
- foreach(const Credential& credential, credentials.credentials()) {
+ foreach (const Credential& credential, credentials.credentials()) {
secrets[credential.principal()] = credential.secret();
}
load(secrets);
http://git-wip-us.apache.org/repos/asf/mesos/blob/c3bd1a05/src/common/http.cpp
----------------------------------------------------------------------
diff --git a/src/common/http.cpp b/src/common/http.cpp
index 5705365..9c0d31e 100644
--- a/src/common/http.cpp
+++ b/src/common/http.cpp
@@ -229,8 +229,8 @@ JSON::Object model(const CommandInfo& command)
if (command.has_environment()) {
JSON::Object environment;
JSON::Array variables;
- foreach(const Environment_Variable& variable,
- command.environment().variables()) {
+ foreach (const Environment_Variable& variable,
+ command.environment().variables()) {
JSON::Object variableObject;
variableObject.values["name"] = variable.name();
variableObject.values["value"] = variable.value();
@@ -241,7 +241,7 @@ JSON::Object model(const CommandInfo& command)
}
JSON::Array uris;
- foreach(const CommandInfo_URI& uri, command.uris()) {
+ foreach (const CommandInfo_URI& uri, command.uris()) {
JSON::Object uriObject;
uriObject.values["value"] = uri.value();
uriObject.values["executable"] = uri.executable();
http://git-wip-us.apache.org/repos/asf/mesos/blob/c3bd1a05/src/common/resources.cpp
----------------------------------------------------------------------
diff --git a/src/common/resources.cpp b/src/common/resources.cpp
index 9cf9ec9..abfc6f3 100644
--- a/src/common/resources.cpp
+++ b/src/common/resources.cpp
@@ -960,7 +960,7 @@ Resources Resources::scalars() const
set<string> Resources::names() const
{
set<string> result;
- foreach(const Resource& resource, resources) {
+ foreach (const Resource& resource, resources) {
result.insert(resource.name());
}
@@ -971,7 +971,7 @@ set<string> Resources::names() const
map<string, Value_Type> Resources::types() const
{
map<string, Value_Type> result;
- foreach(const Resource& resource, resources) {
+ foreach (const Resource& resource, resources) {
result[resource.name()] = resource.type();
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/c3bd1a05/src/files/files.cpp
----------------------------------------------------------------------
diff --git a/src/files/files.cpp b/src/files/files.cpp
index a94a5ee..b2134aa 100644
--- a/src/files/files.cpp
+++ b/src/files/files.cpp
@@ -234,7 +234,7 @@ Future<Response> FilesProcess::browse(const Request& request)
}
JSON::Array listing;
- foreachvalue(const JSON::Object& file, files) {
+ foreachvalue (const JSON::Object& file, files) {
listing.values.push_back(file);
}
@@ -459,7 +459,7 @@ const string FilesProcess::DEBUG_HELP = HELP(
Future<Response> FilesProcess::debug(const Request& request)
{
JSON::Object object;
- foreachpair(const string& name, const string& path, paths) {
+ foreachpair (const string& name, const string& path, paths) {
object.values[name] = path;
}
return OK(object, request.query.get("jsonp"));
http://git-wip-us.apache.org/repos/asf/mesos/blob/c3bd1a05/src/linux/routing/queueing/internal.hpp
----------------------------------------------------------------------
diff --git a/src/linux/routing/queueing/internal.hpp b/src/linux/routing/queueing/internal.hpp
index 9143c2a..c2eda7a 100644
--- a/src/linux/routing/queueing/internal.hpp
+++ b/src/linux/routing/queueing/internal.hpp
@@ -318,8 +318,8 @@ inline Result<hashmap<std::string, uint64_t>> statistics(
// NOTE: We use '<=' here because RTNL_TC_STATS_MAX is set to be the
// value of the last enum entry.
- for(size_t i = 0; i <= static_cast<size_t>(RTNL_TC_STATS_MAX); i++) {
- if(rtnl_tc_stat2str(static_cast<rtnl_tc_stat>(i), name, sizeof(name))) {
+ for (size_t i = 0; i <= static_cast<size_t>(RTNL_TC_STATS_MAX); i++) {
+ if (rtnl_tc_stat2str(static_cast<rtnl_tc_stat>(i), name, sizeof(name))) {
results[name] = rtnl_tc_get_stat(
TC_CAST(qdisc.get().get()),
static_cast<rtnl_tc_stat>(i));
http://git-wip-us.apache.org/repos/asf/mesos/blob/c3bd1a05/src/slave/containerizer/isolators/network/port_mapping.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/isolators/network/port_mapping.cpp b/src/slave/containerizer/isolators/network/port_mapping.cpp
index 05d045c..34ba229 100644
--- a/src/slave/containerizer/isolators/network/port_mapping.cpp
+++ b/src/slave/containerizer/isolators/network/port_mapping.cpp
@@ -1404,7 +1404,7 @@ Try<Isolator*> PortMappingIsolatorProcess::create(const Flags& flags)
// TODO(cwang): Make sure DEFAULT_FLOWS is large enough so that
// it's unlikely to run out of free flow IDs.
- for(uint16_t i = CONTAINER_MIN_FLOWID; i < fq_codel::DEFAULT_FLOWS; i++) {
+ for (uint16_t i = CONTAINER_MIN_FLOWID; i < fq_codel::DEFAULT_FLOWS; i++) {
freeFlowIds.insert(i);
}
}
@@ -1536,7 +1536,7 @@ Try<Isolator*> PortMappingIsolatorProcess::create(const Flags& flags)
// We first create the bind mount directory if it does not exist.
Try<Nothing> mkdir = os::mkdir(PORT_MAPPING_BIND_MOUNT_ROOT());
- if(mkdir.isError()) {
+ if (mkdir.isError()) {
return Error(
"Failed to create the bind mount root directory at " +
PORT_MAPPING_BIND_MOUNT_ROOT() + ": " + mkdir.error());
@@ -1596,7 +1596,7 @@ Try<Isolator*> PortMappingIsolatorProcess::create(const Flags& flags)
// recover container IDs for orphan containers (i.e., not known by
// the slave). This is introduced in 0.23.0.
mkdir = os::mkdir(PORT_MAPPING_BIND_MOUNT_SYMLINK_ROOT());
- if(mkdir.isError()) {
+ if (mkdir.isError()) {
return Error(
"Failed to create the bind mount root directory at " +
PORT_MAPPING_BIND_MOUNT_SYMLINK_ROOT() + ": " + mkdir.error());
@@ -2722,7 +2722,7 @@ Future<ResourceStatistics> PortMappingIsolatorProcess::usage(
Info* info = CHECK_NOTNULL(infos[containerId]);
- if(info->pid.isNone()) {
+ if (info->pid.isNone()) {
return result;
}
@@ -2936,7 +2936,7 @@ Try<Nothing> PortMappingIsolatorProcess::_cleanup(
// this function returns.
Owned<Info> info(CHECK_NOTNULL(_info));
- if(!info->pid.isSome()) {
+ if (!info->pid.isSome()) {
LOG(WARNING) << "The container has not been isolated";
return Nothing();
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/c3bd1a05/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 2a99abc..8cfad7b 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -854,7 +854,7 @@ void Slave::registered(
masterPingTimeout = DEFAULT_MASTER_PING_TIMEOUT();
}
- switch(state) {
+ switch (state) {
case DISCONNECTED: {
LOG(INFO) << "Registered with master " << master.get()
<< "; given slave ID " << slaveId;
@@ -954,7 +954,7 @@ void Slave::reregistered(
masterPingTimeout = DEFAULT_MASTER_PING_TIMEOUT();
}
- switch(state) {
+ switch (state) {
case DISCONNECTED:
LOG(INFO) << "Re-registered with master " << master.get();
state = RUNNING;
http://git-wip-us.apache.org/repos/asf/mesos/blob/c3bd1a05/src/tests/containerizer/memory_test_helper.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/memory_test_helper.cpp b/src/tests/containerizer/memory_test_helper.cpp
index 04dcc4b..8109a43 100644
--- a/src/tests/containerizer/memory_test_helper.cpp
+++ b/src/tests/containerizer/memory_test_helper.cpp
@@ -298,7 +298,7 @@ int MemoryTestHelperMain::execute()
cout << STARTED << flush;
string line;
- while(cin.good()) {
+ while (cin.good()) {
getline(cin, line);
vector<string> tokens = strings::tokenize(line, " ");
http://git-wip-us.apache.org/repos/asf/mesos/blob/c3bd1a05/src/v1/resources.cpp
----------------------------------------------------------------------
diff --git a/src/v1/resources.cpp b/src/v1/resources.cpp
index c830cac..dc86890 100644
--- a/src/v1/resources.cpp
+++ b/src/v1/resources.cpp
@@ -961,7 +961,7 @@ Resources Resources::scalars() const
set<string> Resources::names() const
{
set<string> result;
- foreach(const Resource& resource, resources) {
+ foreach (const Resource& resource, resources) {
result.insert(resource.name());
}
@@ -972,7 +972,7 @@ set<string> Resources::names() const
map<string, Value_Type> Resources::types() const
{
map<string, Value_Type> result;
- foreach(const Resource& resource, resources) {
+ foreach (const Resource& resource, resources) {
result[resource.name()] = resource.type();
}