[
https://issues.apache.org/jira/browse/MESOS-7674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Park reassigned MESOS-7674:
-----------------------------------
Resolution: Fixed
Assignee: Michael Park
Fix Version/s: 1.4.0
{noformat}
commit 6749cfd58ef9d76636ebb0d5c0ad92891dd82e34
Author: Michael Park <[email protected]>
Date: Tue Jun 20 01:09:29 2017 -0700
Removed `modelProtobufJSON` and replaced with `JSON::Protobuf` [16/20].
Review: https://reviews.apache.org/r/60223/
{noformat}
{noformat}
commit b71fe0313173bb72490ec4b63b384297ded6b1d7
Author: Michael Park <[email protected]>
Date: Tue Jun 20 01:09:19 2017 -0700
Marked `Resource.role` as deprecated [15/20].
Review: https://reviews.apache.org/r/60222/
{noformat}
{noformat}
commit 9374529209fa6b7d67530b3b44ef36dc2d0fe896
Author: Michael Park <[email protected]>
Date: Tue Jun 20 01:06:31 2017 -0700
Changed the semantics of `JSON::protobuf` for deprecated fields [14/20].
Updated `JSON::protobuf` to not emit a __deprecated__ optional field
with a default value if it's not explicitly set. The specific issue
we're solving here is that the round-trip of Protobuf to JSON and
back does not work with the current behavior. For example,
the `Resource` object in the "post-reservation-refinement" format does
not have the `Resource.role` field. During the Protobuf -> JSON
conversion, the `"role"` field is set to `"*"` since it is an optional
field with a default value. When such a JSON object is parsed back in
as a Protobuf message, the `Resource` object is in an invalid state.
In order to facilitate this at least in the short term, this patch
changes the generic Protobuf -> JSON logic to not output unset fields
if they are marked deprecated.
Review: https://reviews.apache.org/r/60207/
{noformat}
> Update the generic Protobuf to JSON facility to not output deprecated fields
> ----------------------------------------------------------------------------
>
> Key: MESOS-7674
> URL: https://issues.apache.org/jira/browse/MESOS-7674
> Project: Mesos
> Issue Type: Bug
> Components: stout
> Reporter: Michael Park
> Assignee: Michael Park
> Fix For: 1.4.0
>
>
> The current generic Protobuf to JSON conversion logic in
> {{stout/protobuf.hpp}} prints out fields even if they are deprecated. It
> would be useful to not print deprecated fields so that the user is not
> confused as to why they're seeing it.
> In the context of reservation refinement, the {{Resource.role}} field is
> printed even if it's not set, because it's an optional field with a default
> value. For now, we've added a terrible hack to avoid having to be printed. It
> would be much better to update the generic Protobuf to JSON code to not print
> deprecated fields, and we can remove this hack.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)