Repository: mesos
Updated Branches:
  refs/heads/master 619f45f0f -> 940f52548


Moved createLabel to protobuf_utils.

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


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

Branch: refs/heads/master
Commit: 75ec6dc1b67e2635d522135d4b53b812f1f776fa
Parents: 619f45f
Author: Kapil Arya <[email protected]>
Authored: Tue Jul 21 21:17:08 2015 -0700
Committer: Benjamin Hindman <[email protected]>
Committed: Tue Jul 21 21:17:11 2015 -0700

----------------------------------------------------------------------
 src/common/protobuf_utils.cpp | 9 +++++++++
 src/common/protobuf_utils.hpp | 3 +++
 src/tests/hook_tests.cpp      | 4 ++++
 src/tests/master_tests.cpp    | 3 +++
 src/tests/mesos.hpp           | 9 ---------
 src/tests/slave_tests.cpp     | 3 +++
 6 files changed, 22 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/75ec6dc1/src/common/protobuf_utils.cpp
----------------------------------------------------------------------
diff --git a/src/common/protobuf_utils.cpp b/src/common/protobuf_utils.cpp
index 9ba57a7..e0f82b5 100644
--- a/src/common/protobuf_utils.cpp
+++ b/src/common/protobuf_utils.cpp
@@ -190,6 +190,15 @@ MasterInfo createMasterInfo(const process::UPID& pid)
   return info;
 }
 
+
+Label createLabel(const std::string& key, const std::string& value)
+{
+  Label label;
+  label.set_key(key);
+  label.set_value(value);
+  return label;
+}
+
 } // namespace protobuf {
 } // namespace internal {
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/75ec6dc1/src/common/protobuf_utils.hpp
----------------------------------------------------------------------
diff --git a/src/common/protobuf_utils.hpp b/src/common/protobuf_utils.hpp
index 64974c5..2e827a0 100644
--- a/src/common/protobuf_utils.hpp
+++ b/src/common/protobuf_utils.hpp
@@ -70,6 +70,9 @@ Option<bool> getTaskHealth(const Task& task);
 // Helper function that creates a MasterInfo from UPID.
 MasterInfo createMasterInfo(const process::UPID& pid);
 
+
+Label createLabel(const std::string& key, const std::string& value);
+
 } // namespace protobuf {
 } // namespace internal {
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/75ec6dc1/src/tests/hook_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/hook_tests.cpp b/src/tests/hook_tests.cpp
index 6827dec..6b10db1 100644
--- a/src/tests/hook_tests.cpp
+++ b/src/tests/hook_tests.cpp
@@ -26,6 +26,8 @@
 #include <stout/os.hpp>
 #include <stout/try.hpp>
 
+#include "common/protobuf_utils.hpp"
+
 #include "hook/manager.hpp"
 
 #include "master/flags.hpp"
@@ -52,6 +54,8 @@ using namespace mesos::modules;
 
 using mesos::internal::master::Master;
 
+using mesos::internal::protobuf::createLabel;
+
 using mesos::internal::slave::Fetcher;
 using mesos::internal::slave::MesosContainerizer;
 using mesos::internal::slave::Slave;

http://git-wip-us.apache.org/repos/asf/mesos/blob/75ec6dc1/src/tests/master_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 8a4e2c2..85cdffb 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -48,6 +48,7 @@
 #include <stout/try.hpp>
 
 #include "common/build.hpp"
+#include "common/protobuf_utils.hpp"
 
 #include "master/flags.hpp"
 #include "master/master.hpp"
@@ -68,6 +69,8 @@ using mesos::internal::master::Master;
 
 using mesos::internal::master::allocator::MesosAllocatorProcess;
 
+using mesos::internal::protobuf::createLabel;
+
 using mesos::internal::slave::GarbageCollectorProcess;
 using mesos::internal::slave::Slave;
 using mesos::internal::slave::Containerizer;

http://git-wip-us.apache.org/repos/asf/mesos/blob/75ec6dc1/src/tests/mesos.hpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.hpp b/src/tests/mesos.hpp
index f14b8f7..69134e1 100644
--- a/src/tests/mesos.hpp
+++ b/src/tests/mesos.hpp
@@ -1444,15 +1444,6 @@ void ExpectNoFutureUnionProtobufs(
 // StatusUpdate came from the corresponding task.
 MATCHER_P(TaskStatusEq, task, "") { return arg.task_id() == task.task_id(); }
 
-
-inline Label createLabel(const std::string& key, const std::string& value)
-{
-  Label label;
-  label.set_key(key);
-  label.set_value(value);
-  return label;
-}
-
 } // namespace tests {
 } // namespace internal {
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/75ec6dc1/src/tests/slave_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 330a95b..bef5ddd 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -43,6 +43,7 @@
 
 #include "common/build.hpp"
 #include "common/http.hpp"
+#include "common/protobuf_utils.hpp"
 
 #include "master/flags.hpp"
 #include "master/master.hpp"
@@ -65,6 +66,8 @@ using namespace mesos::internal::slave;
 
 using mesos::internal::master::Master;
 
+using mesos::internal::protobuf::createLabel;
+
 using process::Clock;
 using process::Future;
 using process::PID;

Reply via email to