helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject [01/38] helix git commit: Minor fix: Do not set MaxPartitionPerNode in IdealState if it is not greater than 0.
Date Wed, 08 Feb 2017 17:59:36 GMT
Repository: helix
Updated Branches:
  refs/heads/helix-0.6.x 5ee5e59ba -> 3a61f5db1


Minor fix: Do not set MaxPartitionPerNode in IdealState if it is not greater than 0.


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

Branch: refs/heads/helix-0.6.x
Commit: 68e2fdca5c0fdf98d93ca59bee05a0ff30a3d54d
Parents: 5ee5e59
Author: Lei Xia <lxia@linkedin.com>
Authored: Sun Feb 5 16:37:29 2017 -0800
Committer: Lei Xia <lxia@linkedin.com>
Committed: Sun Feb 5 16:37:29 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/helix/model/builder/IdealStateBuilder.java  | 5 ++++-
 .../src/main/java/org/apache/helix/task/WorkflowRebalancer.java | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/68e2fdca/helix-core/src/main/java/org/apache/helix/model/builder/IdealStateBuilder.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/model/builder/IdealStateBuilder.java
b/helix-core/src/main/java/org/apache/helix/model/builder/IdealStateBuilder.java
index 9ad3023..712546c 100644
--- a/helix-core/src/main/java/org/apache/helix/model/builder/IdealStateBuilder.java
+++ b/helix-core/src/main/java/org/apache/helix/model/builder/IdealStateBuilder.java
@@ -208,12 +208,15 @@ public abstract class IdealStateBuilder {
   public IdealState build() {
     IdealState idealstate = new IdealState(_record);
     idealstate.setNumPartitions(numPartitions);
-    idealstate.setMaxPartitionsPerInstance(maxPartitionsPerNode);
     idealstate.setStateModelDefRef(stateModel);
     idealstate.setStateModelFactoryName(stateModelFactoryName);
     idealstate.setRebalanceMode(rebalancerMode);
     idealstate.setReplicas("" + numReplica);
 
+    if (maxPartitionsPerNode > 0) {
+      idealstate.setMaxPartitionsPerInstance(maxPartitionsPerNode);
+    }
+
     if (rebalancerClassName != null) {
       idealstate.setRebalancerClassName(rebalancerClassName);
     }

http://git-wip-us.apache.org/repos/asf/helix/blob/68e2fdca/helix-core/src/main/java/org/apache/helix/task/WorkflowRebalancer.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/task/WorkflowRebalancer.java b/helix-core/src/main/java/org/apache/helix/task/WorkflowRebalancer.java
index 4d7b893..36324d8 100644
--- a/helix-core/src/main/java/org/apache/helix/task/WorkflowRebalancer.java
+++ b/helix-core/src/main/java/org/apache/helix/task/WorkflowRebalancer.java
@@ -26,6 +26,7 @@ import org.apache.helix.controller.stages.ClusterDataCache;
 import org.apache.helix.controller.stages.CurrentStateOutput;
 import org.apache.helix.model.*;
 import org.apache.helix.model.builder.CustomModeISBuilder;
+import org.apache.helix.model.builder.IdealStateBuilder;
 import org.apache.log4j.Logger;
 
 import java.text.DateFormat;
@@ -237,7 +238,7 @@ public class WorkflowRebalancer extends TaskRebalancer {
     accessor.setProperty(keyBuilder.resourceConfig(jobResource), resourceConfig);
 
     // Push out new ideal state based on number of target partitions
-    CustomModeISBuilder builder = new CustomModeISBuilder(jobResource);
+    IdealStateBuilder builder = new CustomModeISBuilder(jobResource);
     builder.setRebalancerMode(IdealState.RebalanceMode.TASK);
     builder.setNumReplica(1);
     builder.setNumPartitions(numPartitions);


Mime
View raw message