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 2016/04/25 23:36:21 UTC

[40/48] mesos git commit: Removed the duplicate "active" field in json schema of `Framework`.

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/57c80bfc
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/57c80bfc
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/57c80bfc

Branch: refs/heads/0.27.x
Commit: 57c80bfcf76a4e7f34881756fea7b546f6d5dee5
Parents: 6c61957
Author: Michael Park <mp...@apache.org>
Authored: Tue Feb 16 15:02:16 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Tue Feb 16 18:29:21 2016 -0500

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/57c80bfc/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 9593373..d67f0da 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();