You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2015/04/25 23:33:36 UTC

[09/11] mesos git commit: Added output stream operators for scheduler Calls and Events.

Added output stream operators for scheduler Calls and Events.

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


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

Branch: refs/heads/master
Commit: 94cb038f13d4793812fd0ae0eeb9c68ae2e4d152
Parents: 2d447e7
Author: Vinod Kone <vi...@gmail.com>
Authored: Wed Mar 25 11:36:52 2015 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Sat Apr 25 11:32:48 2015 -1000

----------------------------------------------------------------------
 include/mesos/type_utils.hpp | 22 +++++++++++++++++++++-
 src/master/master.cpp        |  8 ++++----
 2 files changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/94cb038f/include/mesos/type_utils.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/type_utils.hpp b/include/mesos/type_utils.hpp
index cdf5864..0446374 100644
--- a/include/mesos/type_utils.hpp
+++ b/include/mesos/type_utils.hpp
@@ -19,12 +19,16 @@
 #ifndef __MESOS_TYPE_UTILS_H__
 #define __MESOS_TYPE_UTILS_H__
 
+#include <ostream>
+
 #include <boost/functional/hash.hpp>
 
 #include <mesos/mesos.hpp>
 
 #include <mesos/module/module.hpp>
 
+#include <mesos/scheduler/scheduler.hpp>
+
 #include <stout/uuid.hpp>
 
 // This file includes definitions for operators on public protobuf
@@ -338,7 +342,23 @@ inline std::ostream& operator << (
     std::ostream& stream,
     const TaskState& state)
 {
-  return stream << TaskState_descriptor()->FindValueByNumber(state)->name();
+  return stream << TaskState_Name(state);
+}
+
+
+inline std::ostream& operator << (
+    std::ostream& stream,
+    const scheduler::Call::Type& type)
+{
+  return stream << scheduler::Call_Type_Name(type);
+}
+
+
+inline std::ostream& operator << (
+    std::ostream& stream,
+    const scheduler::Event::Type& type)
+{
+  return stream << scheduler::Event_Type_Name(type);
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/94cb038f/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index d443c80..2c161a9 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -1526,10 +1526,10 @@ void Master::drop(
 {
   // TODO(bmahler): Increment a metric.
 
-  LOG(ERROR) << "Dropping " << scheduler::Call::Type_Name(call.type())
-             << " call from framework " << call.framework_info().id()
-             << " (" << call.framework_info().name() << ") at " << from
-             << ": " << message;
+  LOG(ERROR) << "Dropping " << call.type() << " call"
+             << " from framework " << call.framework_info().id()
+             << " (" << call.framework_info().name()
+             << ") at " << from << ": " << message;
 }