You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2017/06/22 22:57:32 UTC

[13/50] [abbrv] helix git commit: Fix ResourceConfig validation

Fix ResourceConfig validation

Fix validation of resource config for RebalanceConfig check


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/42273bb2
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/42273bb2
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/42273bb2

Branch: refs/heads/master
Commit: 42273bb2b63fb2e2499601fd78b29c663e7fe097
Parents: 4bac123
Author: Junkai Xue <jx...@linkedin.com>
Authored: Thu Feb 9 14:01:16 2017 -0800
Committer: Junkai Xue <jx...@linkedin.com>
Committed: Thu Feb 9 14:01:16 2017 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/helix/model/ResourceConfig.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/42273bb2/helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java b/helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java
index 616d8a2..b195623 100644
--- a/helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java
+++ b/helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java
@@ -545,7 +545,7 @@ public class ResourceConfig extends HelixProperty {
       if (_rebalanceConfig == null) {
         throw new IllegalArgumentException("RebalanceConfig not set!");
       } else {
-        if (_rebalanceConfig.isValid()) {
+        if (!_rebalanceConfig.isValid()) {
           throw new IllegalArgumentException("Invalid RebalanceConfig!");
         }
       }
@@ -571,7 +571,8 @@ public class ResourceConfig extends HelixProperty {
     }
 
     public ResourceConfig build() {
-      validate();
+      // TODO: Reenable the validation in the future when ResourceConfig is ready.
+      // validate();
 
       return new ResourceConfig(_resourceId, _monitorDisabled, _numPartitions, _stateModelDefRef,
           _stateModelFactoryName, _numReplica, _minActiveReplica, _maxPartitionsPerInstance,