mesos-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jie Yu (JIRA)" <>
Subject [jira] [Commented] (MESOS-1974) Refactor the C++ 'Resources' abstraction.
Date Tue, 04 Nov 2014 17:40:36 GMT


Jie Yu commented on MESOS-1974:

> Refactor the C++ 'Resources' abstraction.
> -----------------------------------------
>                 Key: MESOS-1974
>                 URL:
>             Project: Mesos
>          Issue Type: Improvement
>            Reporter: Jie Yu
>            Assignee: Jie Yu
> The existing C++ 'Resources' interfaces are poorly designed. Some of them are confusing
and unintuitive. Some of them are overloaded with too many functionalities. For instance,
> {noformat}
> bool operator <= (const Resource& left, const Resource& right);
> {noformat}
> This interface in non-intuitive because A <= B doesn't imply !(B <= A).
> {noformat}
> Resource operator + (const Resource& left, const Resource& right);
> {noformat}
> This one is also non-intuitive because if 'left' is not compatible with 'right', the
result is 'left' (why not right???). Similar for operator '-'.
> {noformat}
> Option<Resource> Resources::get(const Resource& r) const;
> {noformat}
> This one assume Resources is flattened, but it might not be.
> As we start to introduce persistent disk resources (MESOS-1554), things will get more
complicated. For example, one may want to get two types of 'disk()' functions: one returns
the ephemeral disk bytes (with no disk info), one returns the total disk bytes (including
ones that have disk info). We may wanna introduce a concept about Resource that indicates
that a resource cannot be merged or split (e.g., atomic?).
> Since we need to change this class anyway. I wanna take this chance to refactor it.

This message was sent by Atlassian JIRA

View raw message