mesos-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guangya Liu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MESOS-4447) Updated reserved() API
Date Mon, 29 Feb 2016 07:45:18 GMT

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

Guangya Liu commented on MESOS-4447:
------------------------------------

[~bmahler] can you please help shepherd for this? I have made this as a single patch without
any dependency with other patches.

> Updated reserved() API
> ----------------------
>
>                 Key: MESOS-4447
>                 URL: https://issues.apache.org/jira/browse/MESOS-4447
>             Project: Mesos
>          Issue Type: Bug
>            Reporter: Guangya Liu
>            Assignee: Guangya Liu
>
> There are some problems for current {{reserve}} API. The problem is as following:
> {code}
> hashmap<string, Resources> Resources::reserved() const
> {
>   hashmap<string, Resources> result;
>   foreach (const Resource& resource, resources) {
>     if (isReserved(resource)) {
>       result[resource.role()] += resource;
>     }
>   }
>   return result;
> }
> Resources Resources::reserved(const string& role) const
> {
>   return filter(lambda::bind(isReserved, lambda::_1, role));
> }
> bool Resources::isReserved(
>     const Resource& resource,
>     const Option<string>& role)
> {
>   if (role.isSome()) {
>     return !isUnreserved(resource) && role.get() == resource.role();
>   } else {
>     return !isUnreserved(resource);
>   }
> }
> {code}
> This caused the {{reserved(const string& role) }} has no chance to transfer a   None()
parameter to get all reserved resources in flatten mode.
> The solution is remove {{reserved()}} and update {{reserved(const string& role) }}
to {{reserved(const Option<string>& role = None()) }}



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

Mime
View raw message