You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Klaus Ma (JIRA)" <ji...@apache.org> on 2016/04/05 06:37:25 UTC

[jira] [Updated] (MESOS-5118) Publish the helper functions in test/mesos.hpp

     [ https://issues.apache.org/jira/browse/MESOS-5118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Klaus Ma updated MESOS-5118:
----------------------------
    Description: 
During the review of MESOS-3063 (Example of Dynamic Reservation), we found several helper functions are duplicated if de-coupled example from internal codes.

For example, there is a helper function named {{UNRESERVE(const Resources& resources)}} in {{src/tests/mesos.hpp}}. But we can not use it to compile example code with *installed* Mesos binaries & headers.

{code}
// Helpers for creating unreserve operations.
inline Offer::Operation UNRESERVE(const Resources& resources)
{
  Offer::Operation operation;
  operation.set_type(Offer::Operation::UNRESERVE);
  operation.mutable_unreserve()->mutable_resources()->CopyFrom(resources);
  return operation;
}
{code}

The proposal is to move such kind of helper functions into {{include/mesos/}}, so example code, test code and framework developer can reuse those helper functions. One concern is how to manage the compatibility of those helper functions.

cc [~mcypark]

  was:
During the review of MESOS-3063 (Example of Dynamic Reservation), we found several helper functions are duplicated if de-coupled example from internal codes.

For example, there is a helper function named {{UNRESERVE(const Resources& resources)}} in {{src/tests/mesos.hpp}}. But we can not use it to compile example code with installed Mesos binaries & headers.

{code}
// Helpers for creating unreserve operations.
inline Offer::Operation UNRESERVE(const Resources& resources)
{
  Offer::Operation operation;
  operation.set_type(Offer::Operation::UNRESERVE);
  operation.mutable_unreserve()->mutable_resources()->CopyFrom(resources);
  return operation;
}
{code}

The proposal is to move such kind of helper functions into {{include/mesos/}}, so example, test and framework developer can reuse those helper functions. One concern is how to manage the compatibility of those helper functions.

cc [~mcypark]


> Publish the helper functions in test/mesos.hpp
> ----------------------------------------------
>
>                 Key: MESOS-5118
>                 URL: https://issues.apache.org/jira/browse/MESOS-5118
>             Project: Mesos
>          Issue Type: Bug
>          Components: c++ api
>            Reporter: Klaus Ma
>
> During the review of MESOS-3063 (Example of Dynamic Reservation), we found several helper functions are duplicated if de-coupled example from internal codes.
> For example, there is a helper function named {{UNRESERVE(const Resources& resources)}} in {{src/tests/mesos.hpp}}. But we can not use it to compile example code with *installed* Mesos binaries & headers.
> {code}
> // Helpers for creating unreserve operations.
> inline Offer::Operation UNRESERVE(const Resources& resources)
> {
>   Offer::Operation operation;
>   operation.set_type(Offer::Operation::UNRESERVE);
>   operation.mutable_unreserve()->mutable_resources()->CopyFrom(resources);
>   return operation;
> }
> {code}
> The proposal is to move such kind of helper functions into {{include/mesos/}}, so example code, test code and framework developer can reuse those helper functions. One concern is how to manage the compatibility of those helper functions.
> cc [~mcypark]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)