Refactor soft constraints to simply the algorithm and fix potential issues. (#520)

* Refactor soft constraints to simply the algorithm and fix potential issues.

1. Check for zero weight so as to avoid unnecessary calculations.
2. Simply the soft constraint interfaces and implementations. Avoid duplicate code.
3. Adjust partition movements constraint logic to reduce the chance of moving partition when the baseline and best possible assignment diverge.
4. Estimate utilization in addition to the other usage estimation. The estimation will be used as a base when calculating the capacity usage score. This is to ensure the algorithm treats different clusters with different overall usage in the same way.
5. Fix the issue that high utilization calculation does not consider the current proposed replica usage.
6. Use Sigmoid to calculate usage-based soft constraints score. This enhances the assignment result of the algorithm.
7. Adjust the related test cases.
27 files changed
tree: 140f13027988f906f0187c62699962a01ac4acb1
  1. helix-admin-webapp/
  2. helix-agent/
  3. helix-core/
  4. helix-front/
  5. helix-rest/
  6. recipes/
  7. scripts/
  8. website/
  9. .gitignore
  10. build
  11. bump-up.command
  12. deploySite.sh
  13. helix-style-intellij.xml
  14. helix-style.xml
  15. hpost-review.sh
  16. LICENSE
  17. NOTICE
  18. pom.xml
  19. README.md
README.md

Apache Helix

Helix is part of the Apache Software Foundation.

Project page: http://helix.apache.org/

Mailing list: http://helix.apache.org/mail-lists.html

Build

mvn clean install package -DskipTests

WHAT IS HELIX

Helix is a generic cluster management framework used for automatic management of partitioned, replicated and distributed resources hosted on a cluster of nodes. Helix provides the following features:

  1. Automatic assignment of resource/partition to nodes
  2. Node failure detection and recovery
  3. Dynamic addition of Resources
  4. Dynamic addition of nodes to the cluster
  5. Pluggable distributed state machine to manage the state of a resource via state transitions
  6. Automatic load balancing and throttling of transitions