qqu0127 opened a new pull request, #2023: URL: https://github.com/apache/helix/pull/2023
### Issues - [X] My PR addresses the following Helix issues and references them in the PR description: Resolve https://github.com/apache/helix/issues/2022 ### Description - [X] Here are some details about my PR, including screenshots of any UI changes: We introduce a set of REST API to enable/disable fault zone as an entity. Store the disabled zone info with cluster config. Get all fault zones in the cluster `GET: clusters/{clusterId}/zones` Get disabled zones in the cluster `GET: clusters/{clusterId}/zones/disabledZones` Set status of a zone in a cluster `POST: clusters/{clusterId}/zones/{zoneId}?command={enable, disable}` An instance is disabled if any of the following is true: - Disabled in cluster config (clusterConfig.getDisabledInstances()) - Disabled in instance config - Belongs to a disabled fault zone Above logic is implemented with [helix-core/src/main/java/org/apache/helix/util/InstanceValidationUtil.java](https://github.com/apache/helix/compare/master...qqu0127:disable-fault-zone?expand=1#diff-9e6a0144cb83407580269ee8fe7bf98fb51c82a927e6aa83c0372d89e4a6d59f) and integrated with all client side code. ### Tests - [X] The following tests are written for this issue: [helix-rest/src/test/java/org/apache/helix/rest/server/TestZoneAccessor.java](https://github.com/apache/helix/compare/master...qqu0127:disable-fault-zone?expand=1#diff-64fb8a0ba86233d3d4ccd71ba3c54174b85e17d22fad734f5da94b172b08fea0) New test cases in [helix-core/src/test/java/org/apache/helix/model/TestClusterConfig.java](https://github.com/apache/helix/compare/master...qqu0127:disable-fault-zone?expand=1#diff-27d08a56c5892883c5af6283feffeaa12d6ecfcb03c062305c27e603d62841da) and [helix-core/src/test/java/org/apache/helix/util/TestInstanceValidationUtil.java](https://github.com/apache/helix/compare/master...qqu0127:disable-fault-zone?expand=1#diff-00c2d85b89dacf8b7f46cda1777b32d969415df2a79080f35fbc5dcb2468b071) - The following is the result of the "mvn test" command on the appropriate module: helix-rest [INFO] Tests run: 208, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 269.443 s - in TestSuite [INFO] [INFO] Results: [INFO] [INFO] Tests run: 208, Failures: 0, Errors: 0, Skipped: 0 ### Documentation (Optional) TODO: Will link when ready ### Commits - My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)": 1. Subject is separated from body by a blank line 1. Subject is limited to 50 characters (not including Jira issue reference) 1. Subject does not end with a period 1. Subject uses the imperative mood ("add", not "adding") 1. Body wraps at 72 characters 1. Body explains "what" and "why", not "how" ### Code Quality - My diff has been formatted using helix-style.xml (helix-style-intellij.xml if IntelliJ IDE is used) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
