mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Marshall" <>
Subject Re: Review Request: Made DRF per user and log(N)
Date Mon, 09 Jul 2012 22:55:03 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated July 9, 2012, 10:55 p.m.)

Review request for mesos and Benjamin Hindman.


Significant restructuring of the allocator code to make writing new allocators easier:

- The Allocator class is renamed AllocatorProcess.
- A new Allocator class is introduced which knows only about "elements" (either user names
or frameworkIds) and how many resources they have been allocated, and then has an interface
for retrieving the elements in the order they should be allocated to.
- SimpleAllocatorProcess which can be used with different Allocators to carry out different
allocation policies, including the possibility of having different policies for the per-user
and per-framework allocations.

Why is this restructuring a good thing?
Now that we're doing allocations based on users, rather than frameworks, we have to do two
levels of allocation - determine which user to give resources to, then determine which of
their frameworks to actually make the offer to. Rather than hard-coding the allocation policies
in, the new Allocator class allows us to reuse the same code to do both levels of allocation,
and it allows us to easily swap different policies in or mix and match. You can even imagine
some day having an allocator that allows each user to pick the per-framework allocation policy
they prefer.

Merely giving SimpleAllocatorProcess different Allocators is not sufficient to implement all
allocation policies - only those where all resources are considered equal and there is no
revocation. But, you can always create new AllocatorProcess subclasses (there will soon be
a code review where I implement a static allocator this way) and these new AllocatorProcess
classes can still reuse Allocators as appropriate.


Rewrote the DRF algorithm in DominantShareAllocator to calculate shares on a per user, rather
than per framework, basis and to store those shares in sorted order so that allocations have
log(n) time complexity instead of n^2.

This patch relies on 3 pending code reviews:

This addresses bugs MESOS-225 and MESOS-226.

Diffs (updated)

  src/ 8760f59 
  src/local/local.hpp 55f9eaf 
  src/local/local.cpp d35639f 
  src/master/allocator.hpp 0fc61a5 
  src/master/allocator.cpp PRE-CREATION 
  src/master/allocator_process.hpp PRE-CREATION 
  src/master/dominant_share_allocator.hpp PRE-CREATION 
  src/master/dominant_share_allocator.cpp PRE-CREATION 
  src/master/main.cpp bcbe35a 
  src/master/master.hpp 886f79c 
  src/master/master.cpp 89cdaf6 
  src/master/simple_allocator_process.hpp PRE-CREATION 
  src/master/simple_allocator_process.cpp PRE-CREATION 
  src/tests/allocator_tests.cpp PRE-CREATION 
  src/tests/fault_tolerance_tests.cpp b2529ca 
  src/tests/master_detector_tests.cpp 4cefbfa 
  src/tests/master_tests.cpp fcaf7dc 
  src/tests/resource_offers_tests.cpp c1f1760 
  src/tests/slave_tests.cpp 84e8e7d 
  src/tests/utils.hpp e81ec82 



make check on Lion


Thomas Marshall

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message