> On Dec. 18, 2016, 1:10 a.m., Guangya Liu wrote:
> > src/common/resources.cpp, line 1062
> > <https://reviews.apache.org/r/54836/diff/1/?file=1588580#file1588580line1062>
> >
> >     Shall we add a `CHECK` here to make sure this resource was not 
> > allocated to any role?
> 
> Benjamin Mahler wrote:
>     We could, the alternative that I went for was to have callers (the 
> allocator) CHECK this invariant if they care about it, since it seems 
> specific to the way the allocator works.
> 
> Guangya Liu wrote:
>     I saw that you have updated the comments of `allocate` by allowing 
> existing allocation info be overwitten by a new role, why do we allow this? 
> Which secnario need this operation?
> 
> Benjamin Mahler wrote:
>     It's not clear if we have a scenario that needs the ability to overwrite, 
> it's just the behavior I would intuit, much like set_role overwrites if there 
> is a role already set.
> 
> Guangya Liu wrote:
>     Still have one question: For which case shall we need to overwrite the 
> role? Ideally, the role info should be cleared when `recoverResources`, so if 
> there are still roles when `allocate`, we should report an error?

There shouldn't be any use cases in mesos for over-writing a role. Currently 
there is little checking that unallocated resources are unallocated and 
allocated resources are allocated, but I'd like to make this less brittle at 
some point with better types.


- Benjamin


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


On Jan. 23, 2017, 1:55 a.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54836/
> -----------------------------------------------------------
> 
> (Updated Jan. 23, 2017, 1:55 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jay Guo, Guangya Liu, and Michael 
> Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added helpers to allocate / unallocate Resources.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp c2e6d6680d9687f0bbfb73e84ffb1457072c4412 
>   include/mesos/v1/resources.hpp 98f025b68c818c384a1174ef9b969f5c0776a7f1 
>   src/common/resources.cpp be9bca2063e9f0e60c5faa0142077bea56272e45 
>   src/tests/resources_tests.cpp 8dfb1be35d9f9c6ff69139d055c6b3d3ec475e68 
>   src/v1/resources.cpp da4701c03020ff9c33ef995cd0af437d8827c267 
> 
> Diff: https://reviews.apache.org/r/54836/diff/
> 
> 
> Testing
> -------
> 
> Updated the existing allocation test to incorporate the new helper.
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>

Reply via email to