Skip to content

Server selector improvement#4315

Merged
leventov merged 2 commits intoapache:masterfrom
metamx:server-selector-optimization
May 26, 2017
Merged

Server selector improvement#4315
leventov merged 2 commits intoapache:masterfrom
metamx:server-selector-optimization

Conversation

@dgolitsyn
Copy link
Copy Markdown
Contributor

This PR is intended to slightly improve ServerSelector class:

  1. Get rid of TreeMap creation on each call to pick() method and store servers in Int2ObjectRBTreeMap instead. Pick() is called for every segment for each query on broker side, so a lot of temp collections are created
  2. Use Int2ObjectRBTreeMap instead of TreeMap and change TierSelectorStrategy interface to accept Int2ObjectRBTreeMap instead of TreeMap
  3. Pick method in TierSelectorStrategy does not modify input map anymore
  4. Extend ServerSelectStrategy and TierSelectorStrategy interfaces with method for multiple instance selection and use it in ServerSelector to simplify logic and keep all selection details in strategy implementation

Initial PR: metamx#58

…and extend TierSelectorStrategy interface with a method to pick multiple elements at once
@leventov leventov merged commit 515fabc into apache:master May 26, 2017
@leventov leventov deleted the server-selector-optimization branch May 26, 2017 16:02
@gianm gianm added this to the 0.10.1 milestone Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants