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/17 00:25:43 UTC

mesos git commit: Removed the duplicate "active" field in json schema of `Framework`.

Repository: mesos
Updated Branches:
  refs/heads/master c0b8a0672 -> 195464c3f


Removed the duplicate "active" field in json schema of `Framework`.

The new `jsonify` library is a writer-based approach, and does not keep
track of the fields that have been written out so far. The previous
version of `summarize(framework)` and `model(framework)` had a duplicate
`"active"` field which was de-duplicated since they simply get inserted
to a `std::map`, overriding the previous value.

In the `jsonify` case, this pattern results in duplicate key in the JSON
output. Although the presence of duplicate keys is technically not
__invalid__ according to the JSON specification, some JSON libraries
disallow them. As such, we should generate JSON outputs without
duplicate keys.

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


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

Branch: refs/heads/master
Commit: 195464c3f1f82b977d765218471350ac9bc5d2f8
Parents: c0b8a06
Author: Michael Park <mp...@apache.org>
Authored: Tue Feb 16 15:02:16 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Tue Feb 16 15:03:11 2016 -0800

----------------------------------------------------------------------
 src/master/http.cpp | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/195464c3/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index f92212b..7395828 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -219,7 +219,6 @@ void json(JSON::ObjectWriter* writer, const Full<Framework>& full)
   writer->field("role", framework.info.role());
   writer->field("registered_time", framework.registeredTime.secs());
   writer->field("unregistered_time", framework.unregisteredTime.secs());
-  writer->field("active", framework.active);
 
   if (framework.info.has_principal()) {
     writer->field("principal", framework.info.principal());
@@ -368,7 +367,6 @@ JSON::Object model(const Framework& framework)
   object.values["role"] = framework.info.role();
   object.values["registered_time"] = framework.registeredTime.secs();
   object.values["unregistered_time"] = framework.unregisteredTime.secs();
-  object.values["active"] = framework.active;
 
   if (framework.info.has_principal()) {
     object.values["principal"] = framework.info.principal();