> On 一月 7, 2016, 12:31 a.m., Joseph Wu wrote:
> > src/common/resources.cpp, lines 894-904
> > <https://reviews.apache.org/r/41772/diff/2/?file=1180306#file1180306line894>
> >
> >     This seems more appropriate as an optional parameter for 
> > `Resources::flatten`, just like `Option<Resource::ReservationInfo>`.
> 
> Guangya Liu wrote:
>     My original thinking was adding an optional parameter to flatten(), the 
> reason that I did not do that is because every time I want to set 
> ALLOCATION_SLACK or USAGE_SLACK for a resource, I need to put all paramters, 
> it is a long sentence, so I just add this new helper.
>     
>     The caller need to call {flatten("*", None(), 
> Resource::RevocableInfo::ALLOCATION_SLACK);} if want to set a resources as 
> allocation slack.
> 
> Joseph Wu wrote:
>     It's fine to have somewhat long expressions.  I think it's preferable 
> over having too many helpers.
> 
> Guangya Liu wrote:
>     @Joseph, seems we need to reach an agreement for this ;-) Can you please 
> take a look at the following patches in the patch chain, you may notice that 
> other patches highly depend on those helper functions.
>     
>     So what about the following:
>     1) Rename flattenReserved() to reserved_() which will return all reserved 
> resources with different roles in a flatten mode.
>     2) Remove flattenSlack() and merge it to flatten().
>     
>     Comments?
> 
> Klaus Ma wrote:
>     regarding 1), I'd like to add `allocationSlackable` which mean the 
> reosurces can be offered as `ALLOCATION_SLACK`, it's peer of 
> `allocationSlack`.
> 
> Guangya Liu wrote:
>     `allcationSlackable` is more like a `bool` function, but here I want to 
> return a `flatten reserved` resources.
> 
> Klaus Ma wrote:
>     It's not about `bool` :). I'd like to avoid the backgroud of 
> `ALLOCATION_SLACK-able` == `stateless.reserved`: the general point is 
> `ALLOCATION_SLACK-able` resources can be lend to other Tenant framework, and 
> those resource will be preempted when Lender framework launch tasks. That's 
> major reason that I'd suggest to introduce helper fuction to avoid 
> `stateless.reserved` in Master/Agent source code.
>     
>     En, maybe this can be treat as new MVP named borrow/lend policy worked 
> with Quota; it's different with Optimistic Offer Phase 2, the revocalbe 
> resources will not send to multiple framework; the revocable resources will 
> be shared between frameworks by ratio. @Joseph/Ben, any comments.

I think we did discuss this problem when start coding for phase 1, the phase 1 
only consider the allocation slack which is get from unused reserved resources, 
but Quota is not using reserved resources but only unreserved non revocable 
resources. I think that we can put this to post MVP and write a new document 
for this and  clarify the behavior there. Comments?


- Guangya


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41772/#review113153
-----------------------------------------------------------


On 一月 13, 2016, 12:16 p.m., Guangya Liu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41772/
> -----------------------------------------------------------
> 
> (Updated 一月 13, 2016, 12:16 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Artem Harutyunyan, Joris Van 
> Remoortere, Joseph Wu, and Klaus Ma.
> 
> 
> Bugs: MESOS-4267
>     https://issues.apache.org/jira/browse/MESOS-4267
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added two new helper functions to flatten resources.
> 1) Flatten reserved resources.
> 2) Flatten allocation slack revocable resources.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp cc8fef9470d779078aa408ed03e747e5a492deaa 
>   include/mesos/v1/resources.hpp f4892977f8d7b0439db6e9cf7921334f606a496c 
>   src/common/resources.cpp 6afd2dfd81adecf7bdb3e523bc840efb62b79ef4 
>   src/tests/resources_tests.cpp e4a3435adc14f3b6b278b32348a6991543d5a320 
>   src/v1/resources.cpp 8de6672ba9b34947db81c74b8e03e8965e8af5fc 
> 
> Diff: https://reviews.apache.org/r/41772/diff/
> 
> 
> Testing
> -------
> 
> make
> make check
> 
> GLOG_v=2 ./bin/mesos-tests.sh  --gtest_filter="ResourcesOperationTest.*" 
> --verbose
> 
> 
> Thanks,
> 
> Guangya Liu
> 
>

Reply via email to