You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2013/11/04 23:29:20 UTC

git commit: Re-deprecated 'webui_hostname' as optional (from required).

Updated Branches:
  refs/heads/master 7bc7acc9f -> 03b94076c


Re-deprecated 'webui_hostname' as optional (from required).

We still need to set the 'webui_hostname' field for now in order for
interoperating with code that expects it to be required (e.g., a slave
on an older release). After another deprecation cycle we can either
remove this field entirely or just keep it around as an artifact so
that we don't reuse the ID.

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


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

Branch: refs/heads/master
Commit: 03b94076caddceda4c0a6a03aa44ebe4d64f1acc
Parents: 7bc7acc
Author: Benjamin Hindman <be...@gmail.com>
Authored: Mon Nov 4 11:51:05 2013 -1000
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Mon Nov 4 12:01:30 2013 -1000

----------------------------------------------------------------------
 include/mesos/mesos.proto | 4 ++++
 src/common/type_utils.hpp | 2 ++
 src/slave/slave.cpp       | 7 +++++++
 3 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/03b94076/include/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index d45ee5e..87132af 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -177,6 +177,10 @@ message SlaveInfo {
   repeated Attribute attributes = 5;
   optional SlaveID id = 6;
   optional bool checkpoint = 7 [default = false];
+
+  // Deprecated!
+  optional string webui_hostname = 2;
+  optional int32 webui_port = 4 [default = 8081];
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/03b94076/src/common/type_utils.hpp
----------------------------------------------------------------------
diff --git a/src/common/type_utils.hpp b/src/common/type_utils.hpp
index 90149d9..3b05751 100644
--- a/src/common/type_utils.hpp
+++ b/src/common/type_utils.hpp
@@ -281,6 +281,8 @@ inline bool operator == (const ExecutorInfo& left, const ExecutorInfo& right)
 
 inline bool operator == (const SlaveInfo& left, const SlaveInfo& right)
 {
+  // NOTE: We don't compare 'webui_hostname' and 'webui_port' since
+  // they're deprecated and do not carry any semantic meaning.
   return left.hostname() == right.hostname() &&
     Resources(left.resources()) == Resources(right.resources()) &&
     internal::Attributes(left.attributes()) ==

http://git-wip-us.apache.org/repos/asf/mesos/blob/03b94076/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 74bcbec..90575db 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -234,6 +234,13 @@ void Slave::initialize()
   info.mutable_attributes()->MergeFrom(attributes);
   info.set_checkpoint(flags.checkpoint);
 
+  // The required 'webui_hostname' field has been deprecated and
+  // changed to optional for now, but we still need to set it for
+  // interoperating with code that expects it to be required (e.g., an
+  // executor on an older release).
+  // TODO(benh): Remove this after the deprecation cycle.
+  info.set_webui_hostname(hostname);
+
   // Spawn and initialize the isolator.
   // TODO(benh): Seems like the isolator should really be
   // spawned before being passed to the slave.