Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-9722

Refactor the sorter interface to enable lazy sorting.

    XMLWordPrintableJSON

Details

    Description

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

      vector<string> Sorter::sort()
      

      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.

      Attachments

        Activity

          People

            mzhu Meng Zhu
            mzhu Meng Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: