[ 
https://issues.apache.org/jira/browse/MESOS-4339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15093592#comment-15093592
 ] 

Adam B edited comment on MESOS-4339 at 1/13/16 10:19 PM:
---------------------------------------------------------

Role sorter is weighted DRF, framework sorter DRF without weight.

When add a new framework with a role, role sorter and framework sorter will 
come into play:
(I am not sure whether Mesos community curtesy allows to paste code snippet)
{code}
void HierarchicalAllocatorProcess::addFramework(
    const FrameworkID& frameworkId,
    const FrameworkInfo& frameworkInfo,
    const hashmap<SlaveID, Resources>& used)
{
  CHECK(initialized);

  const string& role = frameworkInfo.role();

  // If this is the first framework to register as this role,
  // initialize state as necessary.
  if (!activeRoles.contains(role)) {
    activeRoles[role] = 1;
    roleSorter->add(role, roleWeight(role));
    frameworkSorters[role] = frameworkSorterFactory();
  } else {
    activeRoles[role]++;
  }

  CHECK(!frameworkSorters[role]->contains(frameworkId.value()));
  frameworkSorters[role]->add(frameworkId.value());
{code}


was (Author: fan.du):
Role sorter is weighted DRF, framework sorter DRF without weight.

When add a new framework with a role, role sorter and framework sorter will 
come into play:
(I am not sure whether Mesos community curtesy allows to paste code snippet)

void HierarchicalAllocatorProcess::addFramework(
    const FrameworkID& frameworkId,
    const FrameworkInfo& frameworkInfo,
    const hashmap<SlaveID, Resources>& used)
{
  CHECK(initialized);

  const string& role = frameworkInfo.role();

  // If this is the first framework to register as this role,
  // initialize state as necessary.
  if (!activeRoles.contains(role)) {
    activeRoles[role] = 1;
    roleSorter->add(role, roleWeight(role));
    frameworkSorters[role] = frameworkSorterFactory();
  } else {
    activeRoles[role]++;
  }

  CHECK(!frameworkSorters[role]->contains(frameworkId.value()));
  frameworkSorters[role]->add(frameworkId.value());






> Add weight support for framework sorter
> ---------------------------------------
>
>                 Key: MESOS-4339
>                 URL: https://issues.apache.org/jira/browse/MESOS-4339
>             Project: Mesos
>          Issue Type: Improvement
>          Components: allocation
>            Reporter: Fan Du
>            Assignee: Fan Du
>
> Current framework sorter doesn't take into account of weights when sorting 
> framework belonging to a particular role, i.e., all frameworks has equal 
> weights as 1. Considering the role weight is controlled by the operator, 
> enable the framework weight does not impact the role level allocation 
> decision from any greedy frameworks, but it will be beneficial to some 
> framework who could get more resources within a specific role.
> The framework weight will come from message FrameworkInfo when it got 
> registered, and FrameworkSorters will "add" framework with weight,
> this will eventually result a weighted framework sorting flow when master 
> make the finally allocation decision.
> Please review this ticket which I will work on if it's considered acceptable.
> Thanks a lot.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to