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

Review request for mesos and Benjamin Hindman.


Bugs: MESOS-505
    https://issues.apache.org/jira/browse/MESOS-505


Repository: mesos


Description
-------

One of the biggest potential problems with adding roles to resources is that it 
significantly increases the complexity of dealing with resources for scheduler 
writers - you end up in a situation where the Resources sent as part of an 
offer may, for example, contain multiple cpu resources, each marked with a 
different role, and you may want to launch tasks that use cpus across roles.

The solution for this is to provide the utilities of the Resources class for 
use by scheduler writers. In particular, I've implemented a function called 
findWithRoles that I believe covers the common case of launching tasks from 
offers in a simple way - the idea is that a scheduler will construct a 
Resources object representing the amount of resources it wants for a task but 
not marked with roles. Then you call findWithRoles on the offer's resources 
with the task's resources as the parameter. findWithRoles will return a 
Resources object with the same total amount of resources as the parameter, but 
with roles marked appropriately to match up with resources from the offer, 
taking resources first from the role specified as a parameter to findWithRoles, 
then from the default role, then from any other role. test_framework.cpp is a 
good example of how this would work.


Diffs
-----

  include/mesos/resources.hpp PRE-CREATION 
  src/Makefile.am 5d6f309 
  src/common/resources.hpp 42dfb6a 
  src/common/resources.cpp 8bc1057 
  src/common/type_utils.hpp 377b65f 
  src/common/values.cpp 36e11d1 
  src/examples/test_framework.cpp 2c46c24 
  src/master/allocator.hpp 9fc802a 
  src/master/drf_sorter.hpp 80f4798 
  src/master/hierarchical_allocator_process.hpp c959c3f 
  src/master/http.cpp b5c8db9 
  src/master/master.hpp a076658 
  src/slave/http.cpp dc2955f 
  src/slave/isolator.hpp 67effd3 
  src/slave/slave.hpp c679447 
  src/tests/gc_tests.cpp 1745800 
  src/tests/isolator_tests.cpp a37f006 
  src/tests/mesos.hpp 5cb5aa2 
  src/tests/resources_tests.cpp 67a11b3 
  src/tests/slave_recovery_tests.cpp b0843d7 
  src/tests/sorter_tests.cpp 619e786 

Diff: https://reviews.apache.org/r/12365/diff/


Testing
-------

make check


Thanks,

Thomas Marshall

Reply via email to