Meng Zhu created MESOS-9722:
-------------------------------

             Summary: Refactor the sorter interface to enable lazy sorting.
                 Key: MESOS-9722
                 URL: https://issues.apache.org/jira/browse/MESOS-9722
             Project: Mesos
          Issue Type: Improvement
          Components: allocation
            Reporter: Meng Zhu
            Assignee: Meng Zhu


Currently, the only way for getting a sorted client from sorter is through:

{noformat}
vector<string> Sorter::sort()
{noformat}

This sorts all the active clients in the tree and returns all of them in a 
single vector. This is inefficient if the callers end up only needing a few of 
clients (e.g. when allocating one agent, only one or a few roles are allocated).

We could refactor the interface to return an iterator-like handle and then 
callers can query the next the client in the sorting order. This would pave the 
way for lazy sorting (i.e. only get the nth client) and improve performance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to