You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/03/28 21:59:43 UTC

[3/8] mesos git commit: Fixed various style issues.

Fixed various style issues.

Avoid capturing temporaries by const reference, which is against the
style guide. Fixup some whitespace as well.

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


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

Branch: refs/heads/master
Commit: 9a9f520131ed709c25d7cca905ef8be027745ee9
Parents: 3302bc1
Author: Neil Conway <ne...@gmail.com>
Authored: Mon Mar 28 12:57:45 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon Mar 28 12:57:45 2016 -0700

----------------------------------------------------------------------
 src/slave/state.hpp                   | 12 ++++++------
 src/tests/persistent_volume_tests.cpp |  7 ++++---
 2 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/9a9f5201/src/slave/state.hpp
----------------------------------------------------------------------
diff --git a/src/slave/state.hpp b/src/slave/state.hpp
index 9cc9df2..0de2a4e 100644
--- a/src/slave/state.hpp
+++ b/src/slave/state.hpp
@@ -122,7 +122,7 @@ inline Try<Nothing> checkpoint(
 //   - mesos::Resources
 //
 // NOTE: We provide atomic (all-or-nothing) semantics here by always
-// writing to a temporary file first then use os::rename to atomically
+// writing to a temporary file first then using os::rename to atomically
 // move it to the desired path.
 template <typename T>
 Try<Nothing> checkpoint(const std::string& path, const T& t)
@@ -178,7 +178,7 @@ Try<Nothing> checkpoint(const std::string& path, const T& t)
 
 struct TaskState
 {
-  TaskState () : errors(0) {}
+  TaskState() : errors(0) {}
 
   static Try<TaskState> recover(
       const std::string& rootDir,
@@ -199,7 +199,7 @@ struct TaskState
 
 struct RunState
 {
-  RunState () : completed(false), errors(0) {}
+  RunState() : completed(false), errors(0) {}
 
   static Try<RunState> recover(
       const std::string& rootDir,
@@ -227,7 +227,7 @@ struct RunState
 
 struct ExecutorState
 {
-  ExecutorState () : errors(0) {}
+  ExecutorState() : errors(0) {}
 
   static Try<ExecutorState> recover(
       const std::string& rootDir,
@@ -246,7 +246,7 @@ struct ExecutorState
 
 struct FrameworkState
 {
-  FrameworkState () : errors(0) {}
+  FrameworkState() : errors(0) {}
 
   static Try<FrameworkState> recover(
       const std::string& rootDir,
@@ -281,7 +281,7 @@ struct ResourcesState
 
 struct SlaveState
 {
-  SlaveState () : errors(0) {}
+  SlaveState() : errors(0) {}
 
   static Try<SlaveState> recover(
       const std::string& rootDir,

http://git-wip-us.apache.org/repos/asf/mesos/blob/9a9f5201/src/tests/persistent_volume_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/persistent_volume_tests.cpp b/src/tests/persistent_volume_tests.cpp
index 547ea88..5b3c9e7 100644
--- a/src/tests/persistent_volume_tests.cpp
+++ b/src/tests/persistent_volume_tests.cpp
@@ -744,7 +744,7 @@ TEST_P(PersistentVolumeTest, AccessPersistentVolume)
   ExecutorID executorId;
   executorId.set_value(task.task_id().value());
 
-  const string& directory = slave::paths::getExecutorLatestRunPath(
+  string directory = slave::paths::getExecutorLatestRunPath(
       slaveFlags.work_dir,
       offer.slave_id(),
       frameworkId.get(),
@@ -752,7 +752,7 @@ TEST_P(PersistentVolumeTest, AccessPersistentVolume)
 
   EXPECT_FALSE(os::exists(path::join(directory, "path1")));
 
-  const string& volumePath = slave::paths::getPersistentVolumePath(
+  string volumePath = slave::paths::getPersistentVolumePath(
       slaveFlags.work_dir,
       volume);
 
@@ -815,7 +815,8 @@ TEST_P(PersistentVolumeTest, SlaveRecovery)
       "path1",
       None());
 
-  // Create a task which writes a file in the persistent volume.
+  // Create a task which tests for the existence of
+  // the persistent volume directory.
   Resources taskResources = Resources::parse("cpus:1;mem:128").get() + volume;
 
   TaskInfo task = createTask(