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 2016/02/04 03:13:27 UTC

[1/3] mesos git commit: Cleaned up usage of qualified identifiers in mesos.

Repository: mesos
Updated Branches:
  refs/heads/master 0b0a3dc54 -> c7217c66e


Cleaned up usage of qualified identifiers in mesos.

For example, avoid using `std::string` in a `.cpp` file that already has
a using declaration: `using std::string`.

Review: https://reviews.apache.org/r/42615/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c7217c66
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c7217c66
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c7217c66

Branch: refs/heads/master
Commit: c7217c66eb6230c979f7d35ba17e0190338d2d0c
Parents: cd3d5cb
Author: Neil Conway <ne...@gmail.com>
Authored: Wed Feb 3 16:49:10 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Feb 3 18:12:58 2016 -0800

----------------------------------------------------------------------
 .../http/basic_authenticator_factory.cpp        |  2 +-
 src/cli/execute.cpp                             |  5 ++--
 src/common/http.cpp                             |  8 +++----
 src/common/protobuf_utils.cpp                   |  6 ++---
 src/docker/docker.cpp                           |  4 ++--
 src/examples/balloon_framework.cpp              |  4 ++--
 src/examples/test_container_logger_module.cpp   |  2 --
 src/examples/test_http_authenticator_module.cpp |  2 --
 src/examples/test_qos_controller_module.cpp     |  2 --
 src/files/files.cpp                             |  8 +++----
 src/health-check/main.cpp                       |  4 ++--
 src/hook/manager.cpp                            |  2 +-
 src/launcher/fetcher.cpp                        |  2 +-
 src/linux/routing/queueing/fq_codel.cpp         |  4 ++--
 src/linux/routing/queueing/ingress.cpp          |  2 +-
 src/linux/systemd.cpp                           |  6 ++---
 src/local/local.cpp                             |  2 +-
 src/log/tool/initialize.cpp                     |  2 --
 src/log/tool/read.cpp                           |  4 +---
 src/log/tool/replica.cpp                        |  3 ---
 src/master/allocator/mesos/hierarchical.cpp     |  2 +-
 src/master/allocator/sorter/drf/sorter.cpp      |  4 ++--
 src/master/main.cpp                             |  4 ++--
 src/master/maintenance.cpp                      |  1 -
 src/master/master.cpp                           |  8 +++----
 src/module/manager.cpp                          |  2 +-
 src/slave/containerizer/docker.cpp              |  4 ++--
 src/slave/containerizer/fetcher.cpp             |  2 +-
 .../containerizer/mesos/linux_launcher.cpp      |  4 ++--
 .../mesos/provisioner/docker/paths.cpp          |  4 ++--
 .../provisioner/docker/registry_client.cpp      |  4 ++--
 .../mesos/provisioner/docker/store.cpp          |  6 ++---
 src/slave/paths.cpp                             |  2 +-
 src/slave/qos_controllers/load.cpp              | 14 +++++------
 src/slave/state.cpp                             |  4 ++--
 src/tests/attributes_tests.cpp                  |  3 ---
 src/tests/common/http_tests.cpp                 |  1 -
 .../containerizer/cgroups_isolator_tests.cpp    |  6 -----
 src/tests/containerizer/cgroups_tests.cpp       | 25 ++++++++++----------
 .../external_containerizer_test.cpp             |  6 ++---
 .../containerizer/provisioner_docker_tests.cpp  |  3 +--
 src/tests/credentials_tests.cpp                 |  2 +-
 src/tests/fetcher_cache_tests.cpp               |  4 ++--
 src/tests/gc_tests.cpp                          |  6 ++---
 src/tests/hierarchical_allocator_tests.cpp      |  2 +-
 src/tests/hook_tests.cpp                        |  2 --
 src/tests/http_authentication_tests.cpp         |  2 --
 src/tests/master_quota_tests.cpp                |  6 ++---
 src/tests/mesos.cpp                             |  6 ++---
 src/tests/monitor_tests.cpp                     |  1 -
 src/tests/registrar_tests.cpp                   | 10 ++++----
 src/tests/registrar_zookeeper_tests.cpp         |  2 --
 src/tests/scheduler_driver_tests.cpp            |  2 --
 src/tests/slave_tests.cpp                       |  4 ++--
 src/tests/values_tests.cpp                      |  3 ---
 src/uri/fetchers/curl.cpp                       |  2 +-
 src/watcher/whitelist_watcher.cpp               |  2 +-
 src/zookeeper/detector.cpp                      |  2 --
 58 files changed, 100 insertions(+), 141 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/authentication/http/basic_authenticator_factory.cpp
----------------------------------------------------------------------
diff --git a/src/authentication/http/basic_authenticator_factory.cpp b/src/authentication/http/basic_authenticator_factory.cpp
index 6eb1c5b..62f8516 100644
--- a/src/authentication/http/basic_authenticator_factory.cpp
+++ b/src/authentication/http/basic_authenticator_factory.cpp
@@ -61,7 +61,7 @@ Try<Authenticator*> BasicAuthenticatorFactory::create(
 
 
 Try<Authenticator*> BasicAuthenticatorFactory::create(
-    const hashmap<std::string, std::string>& credentials)
+    const hashmap<string, string>& credentials)
 {
   Authenticator* authenticator = new BasicAuthenticator("mesos", credentials);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/cli/execute.cpp
----------------------------------------------------------------------
diff --git a/src/cli/execute.cpp b/src/cli/execute.cpp
index 0add775..4b2244c 100644
--- a/src/cli/execute.cpp
+++ b/src/cli/execute.cpp
@@ -198,9 +198,8 @@ public:
         commandInfo->set_value(command);
         if (environment.isSome()) {
           Environment* environment_ = commandInfo->mutable_environment();
-          foreachpair (const std::string& name,
-                       const std::string& value,
-                       environment.get()) {
+          foreachpair (
+              const string& name, const string& value, environment.get()) {
             Environment_Variable* environmentVariable =
               environment_->add_variables();
             environmentVariable->set_name(name);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/common/http.cpp
----------------------------------------------------------------------
diff --git a/src/common/http.cpp b/src/common/http.cpp
index b7e71eb..a56c3f1 100644
--- a/src/common/http.cpp
+++ b/src/common/http.cpp
@@ -519,12 +519,12 @@ void json(JSON::ObjectWriter* writer, const NetworkInfo& info)
 
 void json(JSON::ObjectWriter* writer, const Resources& resources)
 {
-  hashmap<std::string, double> scalars = {{"cpus", 0}, {"mem", 0}, {"disk", 0}};
-  hashmap<std::string, Value::Ranges> ranges;
-  hashmap<std::string, Value::Set> sets;
+  hashmap<string, double> scalars = {{"cpus", 0}, {"mem", 0}, {"disk", 0}};
+  hashmap<string, Value::Ranges> ranges;
+  hashmap<string, Value::Set> sets;
 
   foreach (const Resource& resource, resources) {
-    std::string name =
+    string name =
       resource.name() + (Resources::isRevocable(resource) ? "_revocable" : "");
     switch (resource.type()) {
       case Value::SCALAR:

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/common/protobuf_utils.cpp
----------------------------------------------------------------------
diff --git a/src/common/protobuf_utils.cpp b/src/common/protobuf_utils.cpp
index 53324ab..e5a8efc 100644
--- a/src/common/protobuf_utils.cpp
+++ b/src/common/protobuf_utils.cpp
@@ -261,7 +261,7 @@ MasterInfo createMasterInfo(const UPID& pid)
 }
 
 
-Label createLabel(const std::string& key, const std::string& value)
+Label createLabel(const string& key, const string& value)
 {
   Label label;
   label.set_key(key);
@@ -281,7 +281,7 @@ namespace slave {
 
 ContainerLimitation createContainerLimitation(
     const Resources& resources,
-    const std::string& message,
+    const string& message,
     const TaskStatus::Reason& reason)
 {
   ContainerLimitation limitation;
@@ -298,7 +298,7 @@ ContainerState createContainerState(
     const ExecutorInfo& executorInfo,
     const ContainerID& container_id,
     pid_t pid,
-    const std::string& directory)
+    const string& directory)
 {
   ContainerState state;
   state.mutable_executor_info()->CopyFrom(executorInfo);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/docker/docker.cpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index a831726..b4b8d3e 100755
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -382,8 +382,8 @@ Try<Docker::Image> Docker::Image::create(const JSON::Object& json)
           return Error("Expecting environment value to be type string");
         }
 
-        const std::vector<std::string> tokens =
-            strings::tokenize(value.as<JSON::String>().value, "=");
+        const vector<string> tokens =
+          strings::tokenize(value.as<JSON::String>().value, "=");
 
         if (tokens.size() != 2) {
           return Error("Unexpected Env format for 'ContainerConfig.Env'");

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/examples/balloon_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/balloon_framework.cpp b/src/examples/balloon_framework.cpp
index 3c17676..16eea37 100644
--- a/src/examples/balloon_framework.cpp
+++ b/src/examples/balloon_framework.cpp
@@ -148,7 +148,7 @@ public:
   virtual void frameworkMessage(SchedulerDriver* driver,
                                 const ExecutorID& executorId,
                                 const SlaveID& slaveId,
-                                const std::string& data)
+                                const string& data)
   {
     std::cout << "Framework message: " << data << std::endl;
   }
@@ -166,7 +166,7 @@ public:
     std::cout << "Executor lost" << std::endl;
   }
 
-  virtual void error(SchedulerDriver* driver, const std::string& message)
+  virtual void error(SchedulerDriver* driver, const string& message)
   {
     std::cout << "Error message: " << message << std::endl;
   }

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/examples/test_container_logger_module.cpp
----------------------------------------------------------------------
diff --git a/src/examples/test_container_logger_module.cpp b/src/examples/test_container_logger_module.cpp
index 6b1f4db..76dd494 100644
--- a/src/examples/test_container_logger_module.cpp
+++ b/src/examples/test_container_logger_module.cpp
@@ -14,8 +14,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <string>
-
 #include <mesos/mesos.hpp>
 #include <mesos/module.hpp>
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/examples/test_http_authenticator_module.cpp
----------------------------------------------------------------------
diff --git a/src/examples/test_http_authenticator_module.cpp b/src/examples/test_http_authenticator_module.cpp
index acf51a6..459b704 100644
--- a/src/examples/test_http_authenticator_module.cpp
+++ b/src/examples/test_http_authenticator_module.cpp
@@ -14,8 +14,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <string>
-
 #include <mesos/authentication/http/basic_authenticator_factory.hpp>
 
 #include <mesos/mesos.hpp>

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/examples/test_qos_controller_module.cpp
----------------------------------------------------------------------
diff --git a/src/examples/test_qos_controller_module.cpp b/src/examples/test_qos_controller_module.cpp
index f8aa1d7..f382fc4 100644
--- a/src/examples/test_qos_controller_module.cpp
+++ b/src/examples/test_qos_controller_module.cpp
@@ -14,8 +14,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <string>
-
 #include <mesos/mesos.hpp>
 #include <mesos/module.hpp>
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/files/files.cpp
----------------------------------------------------------------------
diff --git a/src/files/files.cpp b/src/files/files.cpp
index dd64976..514add4 100644
--- a/src/files/files.cpp
+++ b/src/files/files.cpp
@@ -116,10 +116,10 @@ private:
   // Returns the internal virtual path mapping.
   Future<Response> debug(const Request& request);
 
-  const static std::string BROWSE_HELP;
-  const static std::string READ_HELP;
-  const static std::string DOWNLOAD_HELP;
-  const static std::string DEBUG_HELP;
+  const static string BROWSE_HELP;
+  const static string READ_HELP;
+  const static string DOWNLOAD_HELP;
+  const static string DEBUG_HELP;
 
   hashmap<string, string> paths;
 };

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/health-check/main.cpp
----------------------------------------------------------------------
diff --git a/src/health-check/main.cpp b/src/health-check/main.cpp
index 0beaed5..36955dd 100644
--- a/src/health-check/main.cpp
+++ b/src/health-check/main.cpp
@@ -287,9 +287,9 @@ public:
         "Task ID that this health check process is checking");
   }
 
-  Option<std::string> health_check_json;
+  Option<string> health_check_json;
   Option<UPID> executor;
-  Option<std::string> task_id;
+  Option<string> task_id;
 };
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/hook/manager.cpp
----------------------------------------------------------------------
diff --git a/src/hook/manager.cpp b/src/hook/manager.cpp
index 6ee9303..704b166 100644
--- a/src/hook/manager.cpp
+++ b/src/hook/manager.cpp
@@ -75,7 +75,7 @@ Try<Nothing> HookManager::initialize(const string& hookList)
 }
 
 
-Try<Nothing> HookManager::unload(const std::string& hookName)
+Try<Nothing> HookManager::unload(const string& hookName)
 {
   synchronized (mutex) {
     if (!availableHooks.contains(hookName)) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/launcher/fetcher.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/fetcher.cpp b/src/launcher/fetcher.cpp
index 902e927..f85b118 100644
--- a/src/launcher/fetcher.cpp
+++ b/src/launcher/fetcher.cpp
@@ -417,7 +417,7 @@ int main(int argc, char* argv[])
 
   logging::initialize(argv[0], flags, true); // Catch signals.
 
-  const Option<std::string> jsonFetcherInfo = os::getenv("MESOS_FETCHER_INFO");
+  const Option<string> jsonFetcherInfo = os::getenv("MESOS_FETCHER_INFO");
   CHECK_SOME(jsonFetcherInfo)
     << "Missing MESOS_FETCHER_INFO environment variable";
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/linux/routing/queueing/fq_codel.cpp
----------------------------------------------------------------------
diff --git a/src/linux/routing/queueing/fq_codel.cpp b/src/linux/routing/queueing/fq_codel.cpp
index d840e38..26860d1 100644
--- a/src/linux/routing/queueing/fq_codel.cpp
+++ b/src/linux/routing/queueing/fq_codel.cpp
@@ -122,8 +122,8 @@ Try<bool> remove(const string& link, const Handle& parent)
 }
 
 
-Result<hashmap<std::string, uint64_t>> statistics(
-    const std::string& link,
+Result<hashmap<string, uint64_t>> statistics(
+    const string& link,
     const Handle& parent)
 {
   return internal::statistics(link, parent, KIND);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/linux/routing/queueing/ingress.cpp
----------------------------------------------------------------------
diff --git a/src/linux/routing/queueing/ingress.cpp b/src/linux/routing/queueing/ingress.cpp
index c25a939..010840c 100644
--- a/src/linux/routing/queueing/ingress.cpp
+++ b/src/linux/routing/queueing/ingress.cpp
@@ -107,7 +107,7 @@ Try<bool> remove(const string& link)
 }
 
 
-Result<hashmap<std::string, uint64_t>> statistics(const std::string& link)
+Result<hashmap<string, uint64_t>> statistics(const string& link)
 {
   return internal::statistics(link, INGRESS_ROOT, KIND);
 }

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/linux/systemd.cpp
----------------------------------------------------------------------
diff --git a/src/linux/systemd.cpp b/src/linux/systemd.cpp
index d3f4a63..5034308 100644
--- a/src/linux/systemd.cpp
+++ b/src/linux/systemd.cpp
@@ -160,7 +160,7 @@ Path hierarchy()
 
 Try<Nothing> daemonReload()
 {
-  Try<std::string> daemonReload = os::shell("systemctl daemon-reload");
+  Try<string> daemonReload = os::shell("systemctl daemon-reload");
   if (daemonReload.isError()) {
     return Error("Failed to reload systemd daemon: " + daemonReload.error());
   }
@@ -196,9 +196,9 @@ Try<Nothing> create(const Path& path, const string& data)
 }
 
 
-Try<Nothing> start(const std::string& name)
+Try<Nothing> start(const string& name)
 {
-  Try<std::string> start = os::shell("systemctl start " + name);
+  Try<string> start = os::shell("systemctl start " + name);
 
   if (start.isError()) {
     return Error(

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/local/local.cpp
----------------------------------------------------------------------
diff --git a/src/local/local.cpp b/src/local/local.cpp
index 582d4a1..2688f9d 100644
--- a/src/local/local.cpp
+++ b/src/local/local.cpp
@@ -219,7 +219,7 @@ PID<Master> launch(const Flags& flags, Allocator* _allocator)
     if (authorizerNames.size() > 1) {
       EXIT(EXIT_FAILURE) << "Multiple authorizers not supported";
     }
-    std::string authorizerName = authorizerNames[0];
+    string authorizerName = authorizerNames[0];
 
     // NOTE: The flag --authorizers overrides the flag --acls, i.e. if
     // a non default authorizer is requested, it will be used and

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/log/tool/initialize.cpp
----------------------------------------------------------------------
diff --git a/src/log/tool/initialize.cpp b/src/log/tool/initialize.cpp
index c9706d1..bd1e9ef 100644
--- a/src/log/tool/initialize.cpp
+++ b/src/log/tool/initialize.cpp
@@ -26,8 +26,6 @@
 
 using namespace process;
 
-using std::string;
-
 namespace mesos {
 namespace internal {
 namespace log {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/log/tool/read.cpp
----------------------------------------------------------------------
diff --git a/src/log/tool/read.cpp b/src/log/tool/read.cpp
index 9abf5a8..b9e90e4 100644
--- a/src/log/tool/read.cpp
+++ b/src/log/tool/read.cpp
@@ -22,7 +22,6 @@
 #include <process/timeout.hpp>
 
 #include <stout/error.hpp>
-#include <stout/stringify.hpp>
 
 #include "log/replica.hpp"
 #include "log/tool/read.hpp"
@@ -34,7 +33,6 @@ using namespace process;
 using std::cout;
 using std::endl;
 using std::list;
-using std::string;
 
 namespace mesos {
 namespace internal {
@@ -144,7 +142,7 @@ Try<Nothing> Read::execute(int argc, char** argv)
   LOG(INFO) << "Attempting to read the log from "
             << from.get() << " to " << to.get() << endl;
 
-  Future<list<Action> > actions = replica.read(from.get(), to.get());
+  Future<list<Action>> actions = replica.read(from.get(), to.get());
   if (timeout.isSome()) {
     actions.await(timeout.get().remaining());
   } else {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/log/tool/replica.cpp
----------------------------------------------------------------------
diff --git a/src/log/tool/replica.cpp b/src/log/tool/replica.cpp
index 8baf797..4941582 100644
--- a/src/log/tool/replica.cpp
+++ b/src/log/tool/replica.cpp
@@ -29,9 +29,6 @@
 
 using namespace process;
 
-using std::endl;
-using std::string;
-
 namespace mesos {
 namespace internal {
 namespace log {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/master/allocator/mesos/hierarchical.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index 1a07d69..a9d2c23 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1157,7 +1157,7 @@ void HierarchicalAllocatorProcess::allocate(
   // its quota.
   //
   // NOTE: Revocable resources are excluded in `quotaRoleSorter`.
-  auto getQuotaRoleAllocatedResources = [this](const std::string& role) {
+  auto getQuotaRoleAllocatedResources = [this](const string& role) {
     CHECK(quotas.contains(role));
 
     // Strip the reservation and persistent volume info.

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/master/allocator/sorter/drf/sorter.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/sorter/drf/sorter.cpp b/src/master/allocator/sorter/drf/sorter.cpp
index db47d64..18797e4 100644
--- a/src/master/allocator/sorter/drf/sorter.cpp
+++ b/src/master/allocator/sorter/drf/sorter.cpp
@@ -168,13 +168,13 @@ const Resources& DRFSorter::allocationScalars(const string& name)
 }
 
 
-hashmap<std::string, Resources> DRFSorter::allocation(const SlaveID& slaveId)
+hashmap<string, Resources> DRFSorter::allocation(const SlaveID& slaveId)
 {
   // TODO(jmlvanre): We can index the allocation by slaveId to make this faster.
   // It is a tradeoff between speed vs. memory. For now we use existing data
   // structures.
 
-  hashmap<std::string, Resources> result;
+  hashmap<string, Resources> result;
 
   foreachpair (const string& name, const Allocation& allocation, allocations) {
     if (allocation.resources.contains(slaveId)) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/master/main.cpp
----------------------------------------------------------------------
diff --git a/src/master/main.cpp b/src/master/main.cpp
index 7ebca78..4263110 100644
--- a/src/master/main.cpp
+++ b/src/master/main.cpp
@@ -247,7 +247,7 @@ int main(int argc, char** argv)
   }
 
   // Create an instance of allocator.
-  const std::string allocatorName = flags.allocator;
+  const string allocatorName = flags.allocator;
   Try<Allocator*> allocator = Allocator::create(allocatorName);
 
   if (allocator.isError()) {
@@ -355,7 +355,7 @@ int main(int argc, char** argv)
   if (authorizerNames.size() > 1) {
     EXIT(EXIT_FAILURE) << "Multiple authorizers not supported";
   }
-  std::string authorizerName = authorizerNames[0];
+  string authorizerName = authorizerNames[0];
 
   // NOTE: The flag --authorizers overrides the flag --acls, i.e. if
   // a non default authorizer is requested, it will be used and

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/master/maintenance.cpp
----------------------------------------------------------------------
diff --git a/src/master/maintenance.cpp b/src/master/maintenance.cpp
index df7cd6c..7da61c7 100644
--- a/src/master/maintenance.cpp
+++ b/src/master/maintenance.cpp
@@ -25,7 +25,6 @@
 #include <stout/ip.hpp>
 #include <stout/nothing.hpp>
 #include <stout/stringify.hpp>
-#include <stout/strings.hpp>
 
 #include "master/maintenance.hpp"
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 08d0a86..e1ca81d 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -638,7 +638,7 @@ void Master::initialize()
     }
 
     roleWhitelist = hashset<string>();
-    foreach (const std::string& role, roles.get()) {
+    foreach (const string& role, roles.get()) {
       roleWhitelist.get().insert(role);
     }
 
@@ -654,7 +654,7 @@ void Master::initialize()
   if (flags.weights.isSome()) {
     vector<string> tokens = strings::tokenize(flags.weights.get(), ",");
 
-    foreach (const std::string& token, tokens) {
+    foreach (const string& token, tokens) {
       vector<string> pair = strings::tokenize(token, "=");
       if (pair.size() != 2) {
         EXIT(1) << "Invalid weight: '" << token << "'. --weights should"
@@ -1384,7 +1384,7 @@ void Master::visit(const ExitedEvent& event)
 
 void Master::throttled(
     const MessageEvent& event,
-    const Option<std::string>& principal)
+    const Option<string>& principal)
 {
   // We already know a RateLimiter is used to throttle this event so
   // here we only need to determine which.
@@ -4992,7 +4992,7 @@ void Master::reconcile(
 void Master::reconcileTasks(
     const UPID& from,
     const FrameworkID& frameworkId,
-    const std::vector<TaskStatus>& statuses)
+    const vector<TaskStatus>& statuses)
 {
   Framework* framework = getFramework(frameworkId);
   if (framework == NULL) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/module/manager.cpp
----------------------------------------------------------------------
diff --git a/src/module/manager.cpp b/src/module/manager.cpp
index a53f71b..6ae9950 100644
--- a/src/module/manager.cpp
+++ b/src/module/manager.cpp
@@ -224,7 +224,7 @@ Try<Nothing> ModuleManager::load(const Modules& modules)
         }
 
         // Check for possible duplicate module names.
-        const std::string moduleName = module.name();
+        const string moduleName = module.name();
         if (moduleBases.contains(moduleName)) {
           return Error("Error loading duplicate module '" + moduleName + "'");
         }

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index 2887cb4..19daf7d 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -272,7 +272,7 @@ DockerContainerizerProcess::Container::create(
 
   Option<ContainerInfo> containerInfo = None();
   Option<CommandInfo> commandInfo = None();
-  Option<std::map<string, string>> environment = None();
+  Option<map<string, string>> environment = None();
   bool launchesExecutorContainer = false;
   if (taskInfo.isSome() && flags.docker_mesos_image.isSome()) {
     // Override the container and command to launch an executor
@@ -1505,7 +1505,7 @@ void DockerContainerizerProcess::destroy(
     // received run task due to a failed containerizer update.
     // We also kill the executor first since container->status below
     // is waiting for the executor to finish.
-    Try<std::list<os::ProcessTree>> kill =
+    Try<list<os::ProcessTree>> kill =
       os::killtree(container->executorPid.get(), SIGTERM);
 
     if (kill.isError()) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/slave/containerizer/fetcher.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/fetcher.cpp b/src/slave/containerizer/fetcher.cpp
index f7e3f7d..dbf968d 100644
--- a/src/slave/containerizer/fetcher.cpp
+++ b/src/slave/containerizer/fetcher.cpp
@@ -198,7 +198,7 @@ Result<string> Fetcher::uriToLocalPath(
 }
 
 
-bool Fetcher::isNetUri(const std::string& uri)
+bool Fetcher::isNetUri(const string& uri)
 {
   return strings::startsWith(uri, "http://")  ||
          strings::startsWith(uri, "https://") ||

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/slave/containerizer/mesos/linux_launcher.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/linux_launcher.cpp b/src/slave/containerizer/mesos/linux_launcher.cpp
index 61801ff..c2e252e 100644
--- a/src/slave/containerizer/mesos/linux_launcher.cpp
+++ b/src/slave/containerizer/mesos/linux_launcher.cpp
@@ -172,7 +172,7 @@ Try<Launcher*> LinuxLauncher::create(const Flags& flags)
       freezerHierarchy.get(),
       systemd::exists() ?
         Some(systemd::hierarchy()) :
-        Option<std::string>::none());
+        Option<string>::none());
 }
 
 
@@ -190,7 +190,7 @@ bool LinuxLauncher::available()
 
 
 Future<hashset<ContainerID>> LinuxLauncher::recover(
-    const std::list<ContainerState>& states)
+    const list<ContainerState>& states)
 {
   hashset<string> recovered;
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/slave/containerizer/mesos/provisioner/docker/paths.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/docker/paths.cpp b/src/slave/containerizer/mesos/provisioner/docker/paths.cpp
index 9c5c249..82d92a2 100644
--- a/src/slave/containerizer/mesos/provisioner/docker/paths.cpp
+++ b/src/slave/containerizer/mesos/provisioner/docker/paths.cpp
@@ -94,8 +94,8 @@ string getImageLayerPath(
 
 
 string getImageLayerManifestPath(
-    const std::string& storeDir,
-    const std::string& layerId)
+    const string& storeDir,
+    const string& layerId)
 {
   return path::join(getImageLayerPath(storeDir, layerId), "json");
 }

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp b/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp
index b74c760..10c28f5 100644
--- a/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp
+++ b/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp
@@ -109,9 +109,9 @@ private:
       int fd,
       Pipe::Reader reader);
 
-  std::string getRepositoryPath(const Image::Name& imageName) const;
+  string getRepositoryPath(const Image::Name& imageName) const;
 
-  std::string getAPIVersion() const;
+  string getAPIVersion() const;
 
   const http::URL registryServer_;
   Owned<TokenManager> tokenManager_;

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/slave/containerizer/mesos/provisioner/docker/store.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/docker/store.cpp b/src/slave/containerizer/mesos/provisioner/docker/store.cpp
index 71caeca..251973c 100644
--- a/src/slave/containerizer/mesos/provisioner/docker/store.cpp
+++ b/src/slave/containerizer/mesos/provisioner/docker/store.cpp
@@ -71,11 +71,11 @@ private:
   Future<ImageInfo> __get(const Image& image);
 
   Future<vector<string>> moveLayers(
-      const std::list<pair<string, string>>& layerPaths);
+      const list<pair<string, string>>& layerPaths);
 
   Future<Image> storeImage(
       const Image::Name& name,
-      const std::vector<std::string>& layerIds);
+      const vector<string>& layerIds);
 
   Future<Nothing> moveLayer(
       const pair<string, string>& layerPath);
@@ -83,7 +83,7 @@ private:
   const Flags flags;
   Owned<MetadataManager> metadataManager;
   Owned<Puller> puller;
-  hashmap<std::string, Owned<Promise<Image>>> pulling;
+  hashmap<string, Owned<Promise<Image>>> pulling;
 };
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/slave/paths.cpp
----------------------------------------------------------------------
diff --git a/src/slave/paths.cpp b/src/slave/paths.cpp
index 77e86a0..6d9dad5 100644
--- a/src/slave/paths.cpp
+++ b/src/slave/paths.cpp
@@ -393,7 +393,7 @@ string getPersistentVolumePath(
 
 
 string getPersistentVolumePath(
-    const std::string& rootDir,
+    const string& rootDir,
     const Resource& volume)
 {
   CHECK(volume.has_role());

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/slave/qos_controllers/load.cpp
----------------------------------------------------------------------
diff --git a/src/slave/qos_controllers/load.cpp b/src/slave/qos_controllers/load.cpp
index 52520d6..dd44f92 100644
--- a/src/slave/qos_controllers/load.cpp
+++ b/src/slave/qos_controllers/load.cpp
@@ -15,7 +15,6 @@
 // limitations under the License.
 
 #include <list>
-#include <string>
 
 #include <mesos/module/qos_controller.hpp>
 
@@ -39,7 +38,6 @@ using namespace mesos;
 using namespace process;
 
 using std::list;
-using std::string;
 
 using mesos::modules::Module;
 
@@ -64,17 +62,17 @@ public:
       loadThreshold5Min(_loadThreshold5Min),
       loadThreshold15Min(_loadThreshold15Min) {}
 
-  Future<std::list<QoSCorrection>> corrections()
+  Future<list<QoSCorrection>> corrections()
   {
     return usage().then(defer(self(), &Self::_corrections, lambda::_1));
   }
 
-  Future<std::list<QoSCorrection>> _corrections(const ResourceUsage& usage)
+  Future<list<QoSCorrection>> _corrections(const ResourceUsage& usage)
   {
     Try<os::Load> load = loadAverage();
     if (load.isError()) {
       LOG(ERROR) << "Failed to fetch system load: " + load.error();
-      return std::list<QoSCorrection>();
+      return list<QoSCorrection>();
     }
 
     bool overloaded = false;
@@ -96,7 +94,7 @@ public:
     }
 
     if (overloaded) {
-      std::list<QoSCorrection> corrections;
+      list<QoSCorrection> corrections;
 
       for (const ResourceUsage::Executor& executor : usage.executors()) {
         // Set kill correction for all revocable executors.
@@ -116,7 +114,7 @@ public:
       return corrections;
     }
 
-    return std::list<QoSCorrection>();
+    return list<QoSCorrection>();
   }
 
 private:
@@ -156,7 +154,7 @@ Try<Nothing> LoadQoSController::initialize(
 }
 
 
-process::Future<std::list<QoSCorrection>> LoadQoSController::corrections()
+process::Future<list<QoSCorrection>> LoadQoSController::corrections()
 {
   if (process.get() == NULL) {
     return Failure("Load QoS Controller is not initialized");

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/slave/state.cpp
----------------------------------------------------------------------
diff --git a/src/slave/state.cpp b/src/slave/state.cpp
index fae7738..94b6959 100644
--- a/src/slave/state.cpp
+++ b/src/slave/state.cpp
@@ -92,7 +92,7 @@ Result<State> recover(const string& rootDir, bool strict)
     }
   }
 
-  const std::string& latest = paths::getLatestSlavePath(rootDir);
+  const string& latest = paths::getLatestSlavePath(rootDir);
 
   // Check if the "latest" symlink to a slave directory exists.
   if (!os::exists(latest)) {
@@ -688,7 +688,7 @@ Try<TaskState> TaskState::recover(
 
 
 Try<ResourcesState> ResourcesState::recover(
-    const std::string& rootDir,
+    const string& rootDir,
     bool strict)
 {
   ResourcesState state;

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/attributes_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/attributes_tests.cpp b/src/tests/attributes_tests.cpp
index 3f3dde1..cb71be5 100644
--- a/src/tests/attributes_tests.cpp
+++ b/src/tests/attributes_tests.cpp
@@ -15,14 +15,11 @@
 // limitations under the License.
 
 #include <sstream>
-#include <string>
 
 #include <gtest/gtest.h>
 
 #include <mesos/attributes.hpp>
 
-using std::string;
-
 namespace mesos {
 namespace internal {
 namespace tests {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/common/http_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/common/http_tests.cpp b/src/tests/common/http_tests.cpp
index 0ea0634..d1bafeb 100644
--- a/src/tests/common/http_tests.cpp
+++ b/src/tests/common/http_tests.cpp
@@ -23,7 +23,6 @@
 
 #include <stout/gtest.hpp>
 #include <stout/json.hpp>
-#include <stout/stringify.hpp>
 
 #include "common/http.hpp"
 #include "common/protobuf_utils.hpp"

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/containerizer/cgroups_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/cgroups_isolator_tests.cpp b/src/tests/containerizer/cgroups_isolator_tests.cpp
index 0d24809..c4e467c 100644
--- a/src/tests/containerizer/cgroups_isolator_tests.cpp
+++ b/src/tests/containerizer/cgroups_isolator_tests.cpp
@@ -19,16 +19,10 @@
 
 #include <gtest/gtest.h>
 
-#include <stout/foreach.hpp>
-#include <stout/proc.hpp>
-#include <stout/stringify.hpp>
-
 #include "slave/containerizer/mesos/containerizer.hpp"
 
 #include "tests/script.hpp"
 
-using std::map;
-
 namespace mesos {
 namespace internal {
 namespace tests {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/containerizer/cgroups_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/cgroups_tests.cpp b/src/tests/containerizer/cgroups_tests.cpp
index 5e15d44..acaed9b 100644
--- a/src/tests/containerizer/cgroups_tests.cpp
+++ b/src/tests/containerizer/cgroups_tests.cpp
@@ -63,6 +63,7 @@ using cgroups::memory::pressure::Counter;
 
 using std::set;
 using std::string;
+using std::vector;
 
 namespace mesos {
 namespace internal {
@@ -97,7 +98,7 @@ public:
   {
     CgroupsTest::SetUpTestCase();
 
-    Try<set<string> > hierarchies = cgroups::hierarchies();
+    Try<set<string>> hierarchies = cgroups::hierarchies();
     ASSERT_SOME(hierarchies);
     ASSERT_TRUE(hierarchies->empty())
       << "-------------------------------------------------------------\n"
@@ -162,7 +163,7 @@ protected:
           << "-------------------------------------------------------------";
       }
 
-      Try<std::vector<string> > cgroups = cgroups::get(hierarchy);
+      Try<vector<string>> cgroups = cgroups::get(hierarchy);
       CHECK_SOME(cgroups);
 
       foreach (const string& cgroup, cgroups.get()) {
@@ -180,7 +181,7 @@ protected:
     foreach (const string& subsystem, strings::tokenize(subsystems, ",")) {
       string hierarchy = path::join(baseHierarchy, subsystem);
 
-      Try<std::vector<string> > cgroups = cgroups::get(hierarchy);
+      Try<vector<string>> cgroups = cgroups::get(hierarchy);
       CHECK_SOME(cgroups);
 
       foreach (const string& cgroup, cgroups.get()) {
@@ -245,7 +246,7 @@ TEST_F(CgroupsAnyHierarchyWithCpuMemoryTest, ROOT_CGROUPS_Busy)
 
 TEST_F(CgroupsAnyHierarchyTest, ROOT_CGROUPS_Subsystems)
 {
-  Try<set<string> > names = cgroups::subsystems();
+  Try<set<string>> names = cgroups::subsystems();
   ASSERT_SOME(names);
 
   Option<string> cpu;
@@ -267,7 +268,7 @@ TEST_F(CgroupsAnyHierarchyWithCpuMemoryTest, ROOT_CGROUPS_SubsystemsHierarchy)
 {
   string cpuHierarchy = path::join(baseHierarchy, "cpu");
 
-  Try<set<string> > names = cgroups::subsystems(cpuHierarchy);
+  Try<set<string>> names = cgroups::subsystems(cpuHierarchy);
   ASSERT_SOME(names);
 
   Option<string> cpu;
@@ -371,7 +372,7 @@ TEST_F(CgroupsAnyHierarchyTest, ROOT_CGROUPS_Get)
   ASSERT_SOME(cgroups::create(hierarchy, "mesos_test1"));
   ASSERT_SOME(cgroups::create(hierarchy, "mesos_test2"));
 
-  Try<std::vector<string>> cgroups = cgroups::get(hierarchy);
+  Try<vector<string>> cgroups = cgroups::get(hierarchy);
   ASSERT_SOME(cgroups);
 
   EXPECT_NE(cgroups->end(),
@@ -401,7 +402,7 @@ TEST_F(CgroupsAnyHierarchyTest, ROOT_CGROUPS_NestedCgroups)
 
   ASSERT_SOME(cgroups::create(hierarchy, cgroup2));
 
-  Try<std::vector<string>> cgroups =
+  Try<vector<string>> cgroups =
     cgroups::get(hierarchy, TEST_CGROUPS_ROOT);
   ASSERT_SOME(cgroups);
 
@@ -481,7 +482,7 @@ TEST_F(CgroupsAnyHierarchyTest, ROOT_CGROUPS_Write)
                      "cgroup.procs",
                      stringify(pid)));
 
-  Try<set<pid_t> > pids = cgroups::processes(hierarchy, TEST_CGROUPS_ROOT);
+  Try<set<pid_t>> pids = cgroups::processes(hierarchy, TEST_CGROUPS_ROOT);
   ASSERT_SOME(pids);
 
   EXPECT_NE(0u, pids->count(pid));
@@ -525,7 +526,7 @@ TEST_F(CgroupsAnyHierarchyWithCpuAcctMemoryTest, ROOT_CGROUPS_Stat)
 {
   EXPECT_ERROR(cgroups::stat(baseHierarchy, TEST_CGROUPS_ROOT, "invalid"));
 
-  Try<hashmap<string, uint64_t> > result =
+  Try<hashmap<string, uint64_t>> result =
     cgroups::stat(
         path::join(baseHierarchy, "cpuacct"), "/", "cpuacct.stat");
   ASSERT_SOME(result);
@@ -830,7 +831,7 @@ TEST_F(CgroupsAnyHierarchyWithFreezerTest, ROOT_CGROUPS_AssignThreads)
   ASSERT_SOME(cgroups::create(hierarchy, TEST_CGROUPS_ROOT));
 
   // Check the test cgroup is initially empty.
-  Try<set<pid_t> > cgroupThreads =
+  Try<set<pid_t>> cgroupThreads =
     cgroups::threads(hierarchy, TEST_CGROUPS_ROOT);
   EXPECT_SOME(cgroupThreads);
   EXPECT_EQ(0u, cgroupThreads->size());
@@ -840,7 +841,7 @@ TEST_F(CgroupsAnyHierarchyWithFreezerTest, ROOT_CGROUPS_AssignThreads)
 
   // Get our threads (may be more than the numThreads we created if
   // other threads are running).
-  Try<set<pid_t> > threads = proc::threads(::getpid());
+  Try<set<pid_t>> threads = proc::threads(::getpid());
   ASSERT_SOME(threads);
 
   // Check the test cgroup now only contains all child threads.
@@ -1061,7 +1062,7 @@ protected:
 
   void listen()
   {
-    const std::vector<Level> levels = {
+    const vector<Level> levels = {
       Level::LOW,
       Level::MEDIUM,
       Level::CRITICAL

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/containerizer/external_containerizer_test.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/external_containerizer_test.cpp b/src/tests/containerizer/external_containerizer_test.cpp
index da52860..8e1dbe3 100644
--- a/src/tests/containerizer/external_containerizer_test.cpp
+++ b/src/tests/containerizer/external_containerizer_test.cpp
@@ -79,8 +79,8 @@ public:
           const ContainerID&,
           const TaskInfo&,
           const ExecutorInfo&,
-          const std::string&,
-          const Option<std::string>&,
+          const string&,
+          const Option<string>&,
           const SlaveID&,
           const process::PID<slave::Slave>&,
           bool checkpoint));
@@ -170,7 +170,7 @@ TEST_F(ExternalContainerizerTest, DISABLED_Launch)
   Option<double> cpus = resources.cpus();
   ASSERT_SOME(cpus);
 
-  const std::string& file = path::join(flags.work_dir, "ready");
+  const string& file = path::join(flags.work_dir, "ready");
 
   // This task induces user/system load in a child process by
   // running top in a child process for ten seconds.

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/containerizer/provisioner_docker_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/provisioner_docker_tests.cpp b/src/tests/containerizer/provisioner_docker_tests.cpp
index de99126..824f897 100644
--- a/src/tests/containerizer/provisioner_docker_tests.cpp
+++ b/src/tests/containerizer/provisioner_docker_tests.cpp
@@ -1271,8 +1271,7 @@ TEST_F(ProvisionerDockerLocalStoreTest, PullingSameImageSimutanuously)
   ASSERT_TRUE(imageInfo1.isPending());
   Future<slave::ImageInfo> imageInfo2 = store.get()->get(mesosImage);
 
-  const std::list<std::pair<std::string, std::string>> result =
-    {{"456", layerPath}};
+  const list<pair<string, string>> result = {{"456", layerPath}};
 
   ASSERT_TRUE(imageInfo2.isPending());
   promise.set(result);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/credentials_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/credentials_tests.cpp b/src/tests/credentials_tests.cpp
index 6e3725c..7edcc85 100644
--- a/src/tests/credentials_tests.cpp
+++ b/src/tests/credentials_tests.cpp
@@ -80,7 +80,7 @@ TEST_F(CredentialsTest, AuthenticatedSlaveText)
 
   CHECK_SOME(fd);
 
-  std::string credentials =
+  string credentials =
     DEFAULT_CREDENTIAL.principal() + " " + DEFAULT_CREDENTIAL.secret();
 
   CHECK_SOME(os::write(fd.get(), credentials))

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/fetcher_cache_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/fetcher_cache_tests.cpp b/src/tests/fetcher_cache_tests.cpp
index 2747b72..1cf4566 100644
--- a/src/tests/fetcher_cache_tests.cpp
+++ b/src/tests/fetcher_cache_tests.cpp
@@ -1388,7 +1388,7 @@ TEST_F(FetcherCacheTest, FallbackFromEviction)
   // extra characters so the cache will fill up to the last byte.
   ASSERT_SOME(os::write(
       commandPath,
-      COMMAND_SCRIPT + std::string(growth, '\n')));
+      COMMAND_SCRIPT + string(growth, '\n')));
 
   CommandInfo::URI uri1;
   uri1.set_value(commandPath);
@@ -1436,7 +1436,7 @@ TEST_F(FetcherCacheTest, FallbackFromEviction)
   // fit into the cache any more.
   ASSERT_SOME(os::write(
       commandPath,
-      COMMAND_SCRIPT + std::string(2 * growth, '\n')));
+      COMMAND_SCRIPT + string(2 * growth, '\n')));
 
   CommandInfo::URI uri2;
   uri2.set_value(commandPath);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/gc_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/gc_tests.cpp b/src/tests/gc_tests.cpp
index ef5544b..61a8abb 100644
--- a/src/tests/gc_tests.cpp
+++ b/src/tests/gc_tests.cpp
@@ -307,7 +307,7 @@ TEST_F(GarbageCollectorIntegrationTest, Restart)
   // status update for a task because the directory won't get created
   // until the task is launched. We get the slave ID from the
   // SlaveRegisteredMessage.
-  const std::string& slaveDir = slave::paths::getSlavePath(
+  const string& slaveDir = slave::paths::getSlavePath(
       flags.work_dir,
       slaveRegisteredMessage.get().slave_id());
 
@@ -529,7 +529,7 @@ TEST_F(GarbageCollectorIntegrationTest, ExitedExecutor)
   AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
-  const std::string& executorDir = slave::paths::getExecutorPath(
+  const string& executorDir = slave::paths::getExecutorPath(
       flags.work_dir, slaveId, frameworkId.get(), DEFAULT_EXECUTOR_ID);
 
   ASSERT_TRUE(os::exists(executorDir));
@@ -630,7 +630,7 @@ TEST_F(GarbageCollectorIntegrationTest, DiskUsage)
   AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
-  const std::string& executorDir = slave::paths::getExecutorPath(
+  const string& executorDir = slave::paths::getExecutorPath(
       flags.work_dir, slaveId, frameworkId.get(), DEFAULT_EXECUTOR_ID);
 
   ASSERT_TRUE(os::exists(executorDir));

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/hierarchical_allocator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/hierarchical_allocator_tests.cpp b/src/tests/hierarchical_allocator_tests.cpp
index f18e6eb..0acfc09 100644
--- a/src/tests/hierarchical_allocator_tests.cpp
+++ b/src/tests/hierarchical_allocator_tests.cpp
@@ -2521,7 +2521,7 @@ TEST_F(HierarchicalAllocator_BENCHMARK_Test, DeclineOffers)
     Resources     resources;
   };
 
-  std::vector<OfferedResources> offers;
+  vector<OfferedResources> offers;
 
   auto offerCallback = [&offerCount, &offers](
       const FrameworkID& frameworkId,

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/hook_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/hook_tests.cpp b/src/tests/hook_tests.cpp
index 1a1bab4..59a00ea 100644
--- a/src/tests/hook_tests.cpp
+++ b/src/tests/hook_tests.cpp
@@ -51,8 +51,6 @@
 #include "tests/flags.hpp"
 #include "tests/mesos.hpp"
 
-using std::string;
-
 using namespace mesos::modules;
 
 using mesos::internal::master::Master;

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/http_authentication_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/http_authentication_tests.cpp b/src/tests/http_authentication_tests.cpp
index bd62257..cf2bb76 100644
--- a/src/tests/http_authentication_tests.cpp
+++ b/src/tests/http_authentication_tests.cpp
@@ -16,7 +16,6 @@
 
 #include <gtest/gtest.h>
 
-#include <string>
 #include <vector>
 
 #include <mesos/authentication/http/basic_authenticator_factory.hpp>
@@ -36,7 +35,6 @@
 
 using namespace process;
 
-using std::string;
 using std::vector;
 
 namespace process {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/master_quota_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_quota_tests.cpp b/src/tests/master_quota_tests.cpp
index 04efcf3..2255fc2 100644
--- a/src/tests/master_quota_tests.cpp
+++ b/src/tests/master_quota_tests.cpp
@@ -135,9 +135,9 @@ protected:
   }
 
 protected:
-  const std::string ROLE1{"role1"};
-  const std::string ROLE2{"role2"};
-  const std::string UNKNOWN_ROLE{"unknown"};
+  const string ROLE1{"role1"};
+  const string ROLE2{"role2"};
+  const string UNKNOWN_ROLE{"unknown"};
 
   Resources defaultAgentResources;
 };

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/mesos.cpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
index 18d0d8f..8f1f8d6 100644
--- a/src/tests/mesos.cpp
+++ b/src/tests/mesos.cpp
@@ -519,7 +519,7 @@ MockQoSController::MockQoSController()
 
   ON_CALL(*this, corrections())
     .WillByDefault(
-        Return(process::Future<std::list<mesos::slave::QoSCorrection>>()));
+        Return(process::Future<list<mesos::slave::QoSCorrection>>()));
   EXPECT_CALL(*this, corrections())
     .WillRepeatedly(DoDefault());
 }
@@ -643,8 +643,8 @@ MockContainerLogger::~MockContainerLogger() {}
 
 
 MockDocker::MockDocker(
-    const std::string& path,
-    const std::string &socket)
+    const string& path,
+    const string &socket)
   : Docker(path, socket)
 {
   EXPECT_CALL(*this, ps(_, _))

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/monitor_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/monitor_tests.cpp b/src/tests/monitor_tests.cpp
index 2226458..d3a1801 100644
--- a/src/tests/monitor_tests.cpp
+++ b/src/tests/monitor_tests.cpp
@@ -46,7 +46,6 @@ using mesos::internal::slave::ResourceMonitor;
 using mesos::internal::slave::Slave;
 
 using std::numeric_limits;
-using std::string;
 using std::vector;
 
 namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/registrar_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/registrar_tests.cpp b/src/tests/registrar_tests.cpp
index 58b3fcc..c330af2 100644
--- a/src/tests/registrar_tests.cpp
+++ b/src/tests/registrar_tests.cpp
@@ -677,8 +677,8 @@ TEST_P(RegistrarTest, StopMaintenance)
 // Tests that adding and updating quotas in the registry works properly.
 TEST_P(RegistrarTest, UpdateQuota)
 {
-  const std::string ROLE1 = "role1";
-  const std::string ROLE2 = "role2";
+  const string ROLE1 = "role1";
+  const string ROLE2 = "role2";
 
   // NOTE: `quotaResources1` yields a collection with two `Resource`
   // objects once converted to `RepeatedPtrField`.
@@ -804,8 +804,8 @@ TEST_P(RegistrarTest, UpdateQuota)
 // Tests removing quotas from the registry.
 TEST_P(RegistrarTest, RemoveQuota)
 {
-  const std::string ROLE1 = "role1";
-  const std::string ROLE2 = "role2";
+  const string ROLE1 = "role1";
+  const string ROLE2 = "role2";
 
   {
     // Prepare the registrar; see the comment above why we need to do this in
@@ -1041,7 +1041,7 @@ TEST_P(Registrar_BENCHMARK_Test, Performance)
     SlaveInfo info;
     info.set_hostname("localhost");
     info.mutable_id()->set_value(
-        std::string("201310101658-2280333834-5050-48574-") + stringify(i));
+        string("201310101658-2280333834-5050-48574-") + stringify(i));
     info.mutable_resources()->MergeFrom(resources);
     info.mutable_attributes()->MergeFrom(attributes);
     infos.push_back(info);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/registrar_zookeeper_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/registrar_zookeeper_tests.cpp b/src/tests/registrar_zookeeper_tests.cpp
index 3861dcf..3df9779 100644
--- a/src/tests/registrar_zookeeper_tests.cpp
+++ b/src/tests/registrar_zookeeper_tests.cpp
@@ -14,7 +14,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <string>
 #include <vector>
 
 #include <gmock/gmock.h>
@@ -39,7 +38,6 @@ using mesos::internal::slave::Slave;
 using process::Future;
 using process::PID;
 
-using std::string;
 using std::vector;
 
 using testing::_;

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/scheduler_driver_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/scheduler_driver_tests.cpp b/src/tests/scheduler_driver_tests.cpp
index f35c495..f6dc25d 100644
--- a/src/tests/scheduler_driver_tests.cpp
+++ b/src/tests/scheduler_driver_tests.cpp
@@ -14,7 +14,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <string>
 #include <vector>
 
 #include <gmock/gmock.h>
@@ -61,7 +60,6 @@ using process::http::OK;
 
 using process::metrics::internal::MetricsProcess;
 
-using std::string;
 using std::vector;
 
 using testing::_;

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/slave_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index ede2df0..b2b1fd4 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -395,7 +395,7 @@ TEST_F(SlaveTest, CommandExecutorWithOverride)
   // succesfully replaced, this file will end up containing the string
   // 'Hello World\n'. Otherwise, the original task command i.e.
   // 'sleep' will be called and the test will fail.
-  Try<std::string> file = os::mktemp();
+  Try<string> file = os::mktemp();
   ASSERT_SOME(file);
 
   string executorCommand =
@@ -443,7 +443,7 @@ TEST_F(SlaveTest, CommandExecutorWithOverride)
   AWAIT_READY(executor.get().status());
 
   // Verify file contents.
-  Try<std::string> validate = os::read(file.get());
+  Try<string> validate = os::read(file.get());
   ASSERT_SOME(validate);
 
   EXPECT_EQ(validate.get(), "hello world\n");

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/tests/values_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/values_tests.cpp b/src/tests/values_tests.cpp
index a4eb68a..9298615 100644
--- a/src/tests/values_tests.cpp
+++ b/src/tests/values_tests.cpp
@@ -15,7 +15,6 @@
 // limitations under the License.
 
 #include <sstream>
-#include <string>
 
 #include <gtest/gtest.h>
 
@@ -28,8 +27,6 @@
 
 using namespace mesos::internal::values;
 
-using std::string;
-
 namespace mesos {
   extern void coalesce(Value::Ranges* ranges);
   extern void coalesce(Value::Ranges* ranges, const Value::Range& range);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/uri/fetchers/curl.cpp
----------------------------------------------------------------------
diff --git a/src/uri/fetchers/curl.cpp b/src/uri/fetchers/curl.cpp
index 269df87..cb50103 100644
--- a/src/uri/fetchers/curl.cpp
+++ b/src/uri/fetchers/curl.cpp
@@ -110,7 +110,7 @@ Future<Nothing> CurlFetcherPlugin::fetch(
       s.get().status(),
       io::read(s.get().out().get()),
       io::read(s.get().err().get()))
-    .then([](const std::tuple<
+    .then([](const tuple<
         Future<Option<int>>,
         Future<string>,
         Future<string>>& t) -> Future<Nothing> {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/watcher/whitelist_watcher.cpp
----------------------------------------------------------------------
diff --git a/src/watcher/whitelist_watcher.cpp b/src/watcher/whitelist_watcher.cpp
index 14d7de7..3d0d582 100644
--- a/src/watcher/whitelist_watcher.cpp
+++ b/src/watcher/whitelist_watcher.cpp
@@ -45,7 +45,7 @@ WhitelistWatcher::WhitelistWatcher(
     const Option<Path>& path,
     const Duration& watchInterval,
     const function<void(const Option<hashset<string>>& whitelist)>& subscriber,
-    const Option<hashset<std::string>>& initialWhitelist)
+    const Option<hashset<string>>& initialWhitelist)
   : ProcessBase(process::ID::generate("whitelist")),
     path(path),
     watchInterval(watchInterval),

http://git-wip-us.apache.org/repos/asf/mesos/blob/c7217c66/src/zookeeper/detector.cpp
----------------------------------------------------------------------
diff --git a/src/zookeeper/detector.cpp b/src/zookeeper/detector.cpp
index a3d68c1..b184deb 100644
--- a/src/zookeeper/detector.cpp
+++ b/src/zookeeper/detector.cpp
@@ -15,7 +15,6 @@
 // limitations under the License
 
 #include <set>
-#include <string>
 
 #include <process/defer.hpp>
 #include <process/dispatch.hpp>
@@ -33,7 +32,6 @@
 using namespace process;
 
 using std::set;
-using std::string;
 
 namespace zookeeper {
 


[3/3] mesos git commit: Cleaned up usage of qualified identifiers in stout.

Posted by mp...@apache.org.
Cleaned up usage of qualified identifiers in stout.

For example, avoid using `std::string` in a `.cpp` file that already has
a using declaration: `using std::string`.

Review: https://reviews.apache.org/r/42617/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/000c617b
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/000c617b
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/000c617b

Branch: refs/heads/master
Commit: 000c617b96b7629cda21d781e257048e7c514556
Parents: 0b0a3dc
Author: Neil Conway <ne...@gmail.com>
Authored: Wed Feb 3 16:50:24 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Feb 3 18:12:58 2016 -0800

----------------------------------------------------------------------
 .../3rdparty/stout/tests/flags_tests.cpp        |  2 +-
 .../stout/tests/linkedhashmap_tests.cpp         |  2 +-
 .../stout/tests/os/filesystem_tests.cpp         | 11 ++++----
 .../3rdparty/stout/tests/os_tests.cpp           | 28 ++++++++++----------
 .../3rdparty/stout/tests/some_tests.cpp         | 20 +++++++-------
 .../3rdparty/stout/tests/strings_tests.cpp      |  4 +--
 6 files changed, 34 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/000c617b/3rdparty/libprocess/3rdparty/stout/tests/flags_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/flags_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/flags_tests.cpp
index 5a10f59..e87bee2 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/flags_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/flags_tests.cpp
@@ -711,7 +711,7 @@ TEST_F(FlagsFileTest, FilePrefix)
 {
   Flags<TestFlags> flags;
 
-  Option<std::string> something;
+  Option<string> something;
 
   flags.add(&something,
             "something",

http://git-wip-us.apache.org/repos/asf/mesos/blob/000c617b/3rdparty/libprocess/3rdparty/stout/tests/linkedhashmap_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/linkedhashmap_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/linkedhashmap_tests.cpp
index 21a98b8..7a80769 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/linkedhashmap_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/linkedhashmap_tests.cpp
@@ -72,7 +72,7 @@ TEST(LinkedHashmapTest, Keys)
 {
   LinkedHashMap<string, int> map;
 
-  std::list<string> keys;
+  list<string> keys;
   keys.push_back("foo");
   keys.push_back("bar");
   keys.push_back("food");

http://git-wip-us.apache.org/repos/asf/mesos/blob/000c617b/3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp
index 01e4b2f..d0592ef 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp
@@ -40,7 +40,7 @@ using std::string;
 static hashset<string> listfiles(const string& directory)
 {
   hashset<string> fileset;
-  Try<std::list<std::string>> entries = os::ls(directory);
+  Try<list<string>> entries = os::ls(directory);
   if (entries.isSome()) {
     foreach (const string& entry, entries.get()) {
       fileset.insert(entry);
@@ -69,7 +69,7 @@ TEST_F(FsTest, Find)
   ASSERT_SOME(os::touch(file3));
 
   // Find "*.txt" files.
-  Try<std::list<string>> result = os::find(testdir, ".txt");
+  Try<list<string>> result = os::find(testdir, ".txt");
   ASSERT_SOME(result);
 
   hashset<string> files;
@@ -176,16 +176,15 @@ TEST_F(FsTest, List)
   ASSERT_SOME(os::touch(file3));
 
   // Search all files in folder
-  Try<std::list<std::string>> allFiles = fs::list(path::join(testdir, "*"));
+  Try<list<string>> allFiles = fs::list(path::join(testdir, "*"));
   ASSERT_TRUE(allFiles.get().size() == 3);
 
   // Search .jpg files in folder
-  Try<std::list<std::string>> jpgFiles = fs::list(path::join(testdir, "*.jpg"));
+  Try<list<string>> jpgFiles = fs::list(path::join(testdir, "*.jpg"));
   ASSERT_TRUE(jpgFiles.get().size() == 1);
 
   // Search test*.txt files in folder
-  Try<std::list<std::string>> testTxtFiles =
-    fs::list(path::join(testdir, "*.txt"));
+  Try<list<string>> testTxtFiles = fs::list(path::join(testdir, "*.txt"));
 
   ASSERT_TRUE(testTxtFiles.get().size() == 2);
 }

http://git-wip-us.apache.org/repos/asf/mesos/blob/000c617b/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
index 4b7d134..a2bc5c4 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
@@ -64,7 +64,7 @@ using std::vector;
 static hashset<string> listfiles(const string& directory)
 {
   hashset<string> fileset;
-  Try<std::list<std::string> > entries = os::ls(directory);
+  Try<list<string> > entries = os::ls(directory);
   if (entries.isSome()) {
     foreach (const string& entry, entries.get()) {
       fileset.insert(entry);
@@ -102,9 +102,9 @@ TEST_F(OsTest, Environment)
   hashmap<string, string> environment = os::environment();
 
   for (size_t index = 0; environ[index] != NULL; index++) {
-    std::string entry(environ[index]);
+    string entry(environ[index]);
     size_t position = entry.find_first_of('=');
-    if (position == std::string::npos) {
+    if (position == string::npos) {
       continue; // Skip malformed environment entries.
     }
     const string key = entry.substr(0, position);
@@ -281,7 +281,7 @@ TEST_F(OsTest, Find)
   ASSERT_SOME(os::touch(file3));
 
   // Find "*.txt" files.
-  Try<std::list<string> > result = os::find(testdir, ".txt");
+  Try<list<string> > result = os::find(testdir, ".txt");
   ASSERT_SOME(result);
 
   hashset<string> files;
@@ -632,7 +632,7 @@ TEST_F(OsTest, Killtree)
 
   // Kill the process tree and follow sessions and groups to make sure
   // we cross the broken link due to the grandchild.
-  Try<std::list<ProcessTree> > trees =
+  Try<list<ProcessTree> > trees =
     os::killtree(child, SIGKILL, true, true);
 
   ASSERT_SOME(trees);
@@ -784,7 +784,7 @@ TEST_F(OsTest, KilltreeNoRoot)
   // Kill the process tree. Even though the root process has exited,
   // we specify to follow sessions and groups which should kill the
   // grandchild and greatgrandchild.
-  Try<std::list<ProcessTree>> trees = os::killtree(child, SIGKILL, true, true);
+  Try<list<ProcessTree>> trees = os::killtree(child, SIGKILL, true, true);
 
   ASSERT_SOME(trees);
   EXPECT_FALSE(trees.get().empty());
@@ -945,10 +945,10 @@ TEST_F(OsTest, User)
 // variable (DYLD_LIBRARY_PATH on OS X).
 TEST_F(OsTest, Libraries)
 {
-  const std::string path1 = "/tmp/path1";
-  const std::string path2 = "/tmp/path1";
-  std::string ldLibraryPath;
-  const std::string originalLibraryPath = os::libraries::paths();
+  const string path1 = "/tmp/path1";
+  const string path2 = "/tmp/path1";
+  string ldLibraryPath;
+  const string originalLibraryPath = os::libraries::paths();
 
   // Test setPaths.
   os::libraries::setPaths(path1);
@@ -1041,13 +1041,13 @@ TEST_F(OsTest, Mknod)
 TEST_F(OsTest, Realpath)
 {
   // Create a file.
-  const Try<std::string> _testFile = os::mktemp();
+  const Try<string> _testFile = os::mktemp();
   ASSERT_SOME(_testFile);
   ASSERT_SOME(os::touch(_testFile.get()));
-  const std::string testFile = _testFile.get();
+  const string testFile = _testFile.get();
 
   // Create a symlink pointing to a file.
-  const std::string testLink = UUID::random().toString();
+  const string testLink = UUID::random().toString();
   ASSERT_SOME(fs::symlink(testFile, testLink));
 
   // Validate the symlink.
@@ -1058,7 +1058,7 @@ TEST_F(OsTest, Realpath)
   ASSERT_EQ(fileInode.get(), linkInode.get());
 
   // Verify that the symlink resolves correctly.
-  Result<std::string> resolved = os::realpath(testLink);
+  Result<string> resolved = os::realpath(testLink);
   ASSERT_SOME(resolved);
   EXPECT_TRUE(strings::contains(resolved.get(), testFile));
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/000c617b/3rdparty/libprocess/3rdparty/stout/tests/some_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/some_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/some_tests.cpp
index c0be974..6858735 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/some_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/some_tests.cpp
@@ -22,6 +22,8 @@
 #include <stout/some.hpp>
 #include <stout/try.hpp>
 
+using std::string;
+
 TEST(SomeTest, Some)
 {
   Option<int> o1 = Some(42);
@@ -32,7 +34,7 @@ TEST(SomeTest, Some)
   EXPECT_SOME(r1);
   EXPECT_EQ(42, r1.get());
 
-  Try<Option<int> > t1 = Some(42);
+  Try<Option<int>> t1 = Some(42);
   ASSERT_SOME(t1);
   EXPECT_SOME(t1.get());
   EXPECT_EQ(42, t1.get().get());
@@ -40,40 +42,40 @@ TEST(SomeTest, Some)
   ASSERT_SOME(t1);
   EXPECT_NONE(t1.get());
 
-  Try<Result<int> > t2 = Some(42);
+  Try<Result<int>> t2 = Some(42);
   ASSERT_SOME(t2);
   EXPECT_SOME(t2.get());
   EXPECT_EQ(42, t2.get().get());
 
-  Option<Result<int> > o2 = Some(42);
+  Option<Result<int>> o2 = Some(42);
   ASSERT_SOME(o2);
   EXPECT_SOME(o2.get());
   EXPECT_EQ(42, o2.get().get());
 
-  Option<Result<int> > o3 = Some(Some(42));
+  Option<Result<int>> o3 = Some(Some(42));
   ASSERT_SOME(o3);
   EXPECT_SOME(o3.get());
   EXPECT_EQ(42, o3.get().get());
 
-  Result<Option<int> > r2 = Some(42);
+  Result<Option<int>> r2 = Some(42);
   ASSERT_SOME(r2);
   EXPECT_SOME(r2.get());
   EXPECT_EQ(42, r2.get().get());
 
-  Result<Option<int> > r3 = Some(Some(42));
+  Result<Option<int>> r3 = Some(Some(42));
   ASSERT_SOME(r3);
   EXPECT_SOME(r3.get());
   EXPECT_EQ(42, r3.get().get());
 
-  Option<std::string> o4 = Some("hello");
+  Option<string> o4 = Some("hello");
   EXPECT_SOME(o4);
   EXPECT_EQ("hello", o4.get());
 
-  Result<std::string> r4 = Some("world");
+  Result<string> r4 = Some("world");
   EXPECT_SOME(r4);
   EXPECT_EQ("world", r4.get());
 
-  std::map<std::string, Option<std::string> > values;
+  std::map<string, Option<string>> values;
   values["no-debug"] = None();
   values["debug"] = None();
   values["debug"] = Some("true");

http://git-wip-us.apache.org/repos/asf/mesos/blob/000c617b/3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp
index 7715fa4..8e7d3ee 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp
@@ -31,7 +31,7 @@ using std::vector;
 
 TEST(StringsTest, Format)
 {
-  Try<std::string> result = strings::format("%s %s", "hello", "world");
+  Try<string> result = strings::format("%s %s", "hello", "world");
   EXPECT_SOME_EQ("hello world", result);
 
   result = strings::format("hello %d", 42);
@@ -384,7 +384,7 @@ TEST(StringsTest, Join)
   EXPECT_EQ("a\nb\nc\nd", strings::join("\n", "a", "b", "c", "d"));
   std::stringstream ss;
   EXPECT_EQ("a, b, c", strings::join(ss, ", ", "a", "b", "c").str());
-  const std::string gnarly("gnarly");
+  const string gnarly("gnarly");
   EXPECT_EQ("a/gnarly/c", strings::join("/", "a", gnarly, "c"));
   const bool is_true = true;
   const std::set<int32_t> my_set {1, 2, 3};


[2/3] mesos git commit: Cleaned up usage of qualified identifiers in libprocess.

Posted by mp...@apache.org.
Cleaned up usage of qualified identifiers in libprocess.

For example, avoid using `std::string` in a `.cpp` file that already has
a using declaration: `using std::string`.

Review: https://reviews.apache.org/r/42616/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/cd3d5cbf
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/cd3d5cbf
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/cd3d5cbf

Branch: refs/heads/master
Commit: cd3d5cbff253bdea9bc5a8c1dacb06cb17c79837
Parents: 000c617
Author: Neil Conway <ne...@gmail.com>
Authored: Wed Feb 3 16:50:07 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Feb 3 18:12:58 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/authenticator.cpp       |  8 +++----
 3rdparty/libprocess/src/http.cpp                | 24 ++++++++++----------
 3rdparty/libprocess/src/io.cpp                  |  2 +-
 3rdparty/libprocess/src/libevent_ssl_socket.cpp |  2 +-
 3rdparty/libprocess/src/metrics/metrics.cpp     |  2 +-
 3rdparty/libprocess/src/pid.cpp                 |  2 +-
 3rdparty/libprocess/src/process.cpp             |  4 ++--
 3rdparty/libprocess/src/socket.cpp              |  2 +-
 3rdparty/libprocess/src/tests/process_tests.cpp |  2 +-
 9 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/authenticator.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/authenticator.cpp b/3rdparty/libprocess/src/authenticator.cpp
index 16b48cd..55e8558 100644
--- a/3rdparty/libprocess/src/authenticator.cpp
+++ b/3rdparty/libprocess/src/authenticator.cpp
@@ -38,15 +38,15 @@ class BasicAuthenticatorProcess : public Process<BasicAuthenticatorProcess>
 {
 public:
   BasicAuthenticatorProcess(
-      const std::string& realm,
-      const hashmap<std::string, std::string>& credentials);
+      const string& realm,
+      const hashmap<string, string>& credentials);
 
   virtual Future<AuthenticationResult> authenticate(
       const http::Request& request);
 
 private:
-  const std::string realm_;
-  const hashmap<std::string, std::string> credentials_;
+  const string realm_;
+  const hashmap<string, string> credentials_;
 };
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/http.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/http.cpp b/3rdparty/libprocess/src/http.cpp
index 762da9a..a19cd12 100644
--- a/3rdparty/libprocess/src/http.cpp
+++ b/3rdparty/libprocess/src/http.cpp
@@ -567,7 +567,7 @@ OK::OK(const JSON::Value& value, const Option<string>& jsonp)
 }
 
 
-OK::OK(JSON::Proxy&& value, const Option<std::string>& jsonp)
+OK::OK(JSON::Proxy&& value, const Option<string>& jsonp)
   : Response(Status::OK)
 {
   type = BODY;
@@ -749,24 +749,24 @@ Try<vector<Response>> decodeResponses(const string& s)
 
 namespace query {
 
-Try<hashmap<std::string, std::string>> decode(const std::string& query)
+Try<hashmap<string, string>> decode(const string& query)
 {
-  hashmap<std::string, std::string> result;
+  hashmap<string, string> result;
 
-  const std::vector<std::string> tokens = strings::tokenize(query, ";&");
-  foreach (const std::string& token, tokens) {
-    const std::vector<std::string> pairs = strings::split(token, "=", 2);
+  const vector<string> tokens = strings::tokenize(query, ";&");
+  foreach (const string& token, tokens) {
+    const vector<string> pairs = strings::split(token, "=", 2);
     if (pairs.size() == 0) {
       continue;
     }
 
-    Try<std::string> key = http::decode(pairs[0]);
+    Try<string> key = http::decode(pairs[0]);
     if (key.isError()) {
       return Error(key.error());
     }
 
     if (pairs.size() == 2) {
-      Try<std::string> value = http::decode(pairs[1]);
+      Try<string> value = http::decode(pairs[1]);
       if (value.isError()) {
         return Error(value.error());
       }
@@ -781,11 +781,11 @@ Try<hashmap<std::string, std::string>> decode(const std::string& query)
 }
 
 
-std::string encode(const hashmap<std::string, std::string>& query)
+string encode(const hashmap<string, string>& query)
 {
-  std::string output;
+  string output;
 
-  foreachpair (const std::string& key, const std::string& value, query) {
+  foreachpair (const string& key, const string& value, query) {
     output += http::encode(key);
     if (!value.empty()) {
       output += "=" + http::encode(value);
@@ -999,7 +999,7 @@ public:
     return response;
   }
 
-  Future<Nothing> disconnect(const Option<std::string>& message = None())
+  Future<Nothing> disconnect(const Option<string>& message = None())
   {
     Try<Nothing> shutdown = socket.shutdown();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/io.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/io.cpp b/3rdparty/libprocess/src/io.cpp
index 9530192..4a58d6d 100644
--- a/3rdparty/libprocess/src/io.cpp
+++ b/3rdparty/libprocess/src/io.cpp
@@ -425,7 +425,7 @@ Future<string> read(int fd)
 }
 
 
-Future<Nothing> write(int fd, const std::string& data)
+Future<Nothing> write(int fd, const string& data)
 {
   process::initialize();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/libevent_ssl_socket.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libevent_ssl_socket.cpp b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
index 9321ce6..5a987ea 100644
--- a/3rdparty/libprocess/src/libevent_ssl_socket.cpp
+++ b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
@@ -455,7 +455,7 @@ LibeventSSLSocketImpl::LibeventSSLSocketImpl(int _s)
 LibeventSSLSocketImpl::LibeventSSLSocketImpl(
     int _s,
     bufferevent* _bev,
-    Option<std::string>&& _peer_hostname)
+    Option<string>&& _peer_hostname)
   : Socket::Impl(_s),
     bev(_bev),
     listener(NULL),

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/metrics/metrics.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/metrics/metrics.cpp b/3rdparty/libprocess/src/metrics/metrics.cpp
index 3083b92..a984008 100644
--- a/3rdparty/libprocess/src/metrics/metrics.cpp
+++ b/3rdparty/libprocess/src/metrics/metrics.cpp
@@ -89,7 +89,7 @@ Future<Nothing> MetricsProcess::add(Owned<Metric> metric)
 }
 
 
-Future<Nothing> MetricsProcess::remove(const std::string& name)
+Future<Nothing> MetricsProcess::remove(const string& name)
 {
   if (!metrics.contains(name)) {
     return Failure("Metric '" + name + "' not found.");

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/pid.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/pid.cpp b/3rdparty/libprocess/src/pid.cpp
index 3cd04ec..9387f59 100644
--- a/3rdparty/libprocess/src/pid.cpp
+++ b/3rdparty/libprocess/src/pid.cpp
@@ -63,7 +63,7 @@ UPID::UPID(const ProcessBase& process)
 }
 
 
-UPID::operator std::string() const
+UPID::operator string() const
 {
   ostringstream out;
   out << *this;

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 65a247a..1672e08 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -501,7 +501,7 @@ namespace http {
 namespace authentication {
 
 Future<Nothing> setAuthenticator(
-    const std::string& realm,
+    const string& realm,
     Owned<Authenticator> authenticator)
 {
   process::initialize();
@@ -3313,7 +3313,7 @@ void ProcessBase::route(
 
 void ProcessBase::route(
     const string& name,
-    const std::string& realm,
+    const string& realm,
     const Option<string>& help_,
     const AuthenticatedHttpRequestHandler& handler)
 {

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/socket.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/socket.cpp b/3rdparty/libprocess/src/socket.cpp
index 6c1b16f..ab73814 100644
--- a/3rdparty/libprocess/src/socket.cpp
+++ b/3rdparty/libprocess/src/socket.cpp
@@ -235,7 +235,7 @@ static Future<Nothing> _send(
 }
 
 
-Future<Nothing> Socket::Impl::send(const std::string& _data)
+Future<Nothing> Socket::Impl::send(const string& _data)
 {
   Owned<string> data(new string(_data));
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/tests/process_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/process_tests.cpp b/3rdparty/libprocess/src/tests/process_tests.cpp
index df1c7b3..e9bf80e 100644
--- a/3rdparty/libprocess/src/tests/process_tests.cpp
+++ b/3rdparty/libprocess/src/tests/process_tests.cpp
@@ -1835,7 +1835,7 @@ TEST(ProcessTest, PercentEncodedURLs)
 class HTTPEndpointProcess : public Process<HTTPEndpointProcess>
 {
 public:
-  explicit HTTPEndpointProcess(const std::string& id)
+  explicit HTTPEndpointProcess(const string& id)
     : ProcessBase(id) {}
 
   virtual void initialize()