[jira] [Comment Edited] (MESOS-8375) Use protobuf reflection to simplify upgrading of resources.

2018-01-10 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-8375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16321431#comment-16321431
 ] 

Michael Park edited comment on MESOS-8375 at 1/11/18 12:20 AM:
---

{noformat}
commit 3685c011bb71da0ba2af75691101ea383eeb2ccd
Author: Michael Park 
Date:   Sat Jan 6 00:48:58 2018 -0800

Replaced `os::read` with `state::read`.

The `state::checkpoint` utility was updated to checkpoint
the automatically downgraded resources. This was done to mitigate
the need to manually invoke `downgradeResources` prior to
checkpointing. `state::read` was introduced to provide a symmetric
functionality for `state::checkpoint`. Specifically, it will perform
upgrade resources upon reading the checkpointed resources state.

This patch updates the previous uses of `os::read` which was used to
read the state that was written by `state::checkpoint(path, string)`.
While there is no functional change, it completes the picture where
`state::read` is used to read state written by `state::checkpoint`.

Review: https://reviews.apache.org/r/65025
{noformat}
{noformat}
commit 80f66061e343fa26dd7e3b9613f0fa8e0b9b4a36
Author: Michael Park 
Date:   Fri Jan 5 18:03:42 2018 -0800

Replaced `protobuf::read` with `state::read`.

The `state::checkpoint` utility was updated to checkpoint
the automatically downgraded resources. This was done to mitigate
the need to manually invoke `downgradeResources` prior to
checkpointing. `state::read` was introduced to provide a symmetric
functionality for `state::checkpoint`. Specifically, it will perform
upgrade resources upon reading the checkpointed resources state.

This patch updates the previous uses of `protobuf::read` accompanied
by calls to `convertResourceFormat`. Rather than reading the protobufs
then upgrading the resources, we know simply call `state::read` which
performs the reverse operation of `state::checkpoint`.

Review: https://reviews.apache.org/r/65024
{noformat}
{noformat}
commit ef303905e0be96f28d79a569afd004ec75f98296
Author: Michael Park 
Date:   Fri Jan 5 09:52:51 2018 -0800

Added `state::read` to complement `state::checkpoint`.

Review: https://reviews.apache.org/r/65023
{noformat}
{noformat}
commit fda054b50ff7cdd2d7a60d31cfe24ce42bfbfaa5
Author: Michael Park 
Date:   Fri Jan 5 17:44:41 2018 -0800

Updated uses of `protobuf::read(path)` which now returns `Try`.

Since the path version of `protobuf::read` now returns `Try`,
many of the existing code is removed and/or simplified.

Review: https://reviews.apache.org/r/65022
{noformat}
{noformat}
commit 4f9cda17e1a747bc3c4ab3667569304e09600b29
Author: Michael Park 
Date:   Fri Jan 5 16:49:53 2018 -0800

Returned `Try` from `protobuf::read(path)` rather than `Result`.

The path version of `protobuf::read` used to return `Result` and
returned `None` only when the file is empty (`ignorePartial` is always
`false`). The `None` return represents EOF for the "streaming" version
of `protobuf::read` that takes an FD, but for the path version an empty
file when we expected to read `T` is simply an error. Thus, we map the
`None` return to an `Error` for the path version and return a `Try`.

Review: https://reviews.apache.org/r/65021
{noformat}


was (Author: mcypark):
{noformat}
commit 3685c011bb71da0ba2af75691101ea383eeb2ccd
Author: Michael Park 
Date:   Sat Jan 6 00:48:58 2018 -0800

Replaced `os::read` with `state::read`.

The `state::checkpoint` utility was updated to checkpoint
the automatically downgraded resources. This was done to mitigate
the need to manually invoke `downgradeResources` prior to
checkpointing. `state::read` was introduced to provide a symmetric
functionality for `state::checkpoint`. Specifically, it will perform
upgrade resources upon reading the checkpointed resources state.

This patch updates the previous uses of `os::read` which was used to
read the state that was written by `state::checkpoint(path, string)`.
While there is no functional change, it completes the picture where
`state::read` is used to read state written by `state::checkpoint`.

Review: https://reviews.apache.org/r/65025
{noformat}
{noformat}
commit 80f66061e343fa26dd7e3b9613f0fa8e0b9b4a36
Author: Michael Park 
Date:   Fri Jan 5 18:03:42 2018 -0800

Replaced `protobuf::read` with `state::read`.

The `state::checkpoint` utility was updated to checkpoint
the automatically downgraded resources. This was done to mitigate
the need to manually invoke `downgradeResources` prior to
checkpointing. `state::read` was introduced to provide a symmetric
functionality for `state::checkpoint`. Specifically, 

[jira] [Comment Edited] (MESOS-8375) Use protobuf reflection to simplify upgrading of resources.

2018-01-10 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-8375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16321151#comment-16321151
 ] 

Michael Park edited comment on MESOS-8375 at 1/10/18 9:36 PM:
--

{noformat}

commit 93c6809122382412c1fc9324aa3cb67c54577e4e
Author: Michael Park mp...@apache.org
Date:   Mon Jan 8 11:50:06 2018 -0800

Added `vector` overloads for `(down/up)gradeResources`.

Review: https://reviews.apache.org/r/65029
{noformat}


was (Author: mcypark):
{noformat}

commit 93c6809122382412c1fc9324aa3cb67c54577e4e
Author: Michael Park mp...@apache.org
Date:   Mon Jan 8 11:50:06 2018 -0800


Added `vector` overloads for `(down/up)gradeResources`.

Review: https://reviews.apache.org/r/65029
{noformat}

> Use protobuf reflection to simplify upgrading of resources.
> ---
>
> Key: MESOS-8375
> URL: https://issues.apache.org/jira/browse/MESOS-8375
> Project: Mesos
>  Issue Type: Task
>Reporter: Michael Park
>Assignee: Michael Park
>Priority: Blocker
>
> This is the {{upgradeResources}} half of the protobuf-reflection-based 
> upgrade/downgrade of resources: 
> https://issues.apache.org/jira/browse/MESOS-8221
> We will also add {{state::read}} to complement {{state::checkpoint}} which 
> will be used to read protobufs from disk rather than {{protobuf::read}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)