helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zzh...@apache.org
Subject git commit: [HELIX-243] Fix failing tests related to helix model overhaul
Date Tue, 17 Sep 2013 00:47:14 GMT
Updated Branches:
  refs/heads/helix-logical-model 01ed356f7 -> fdb48ec13


[HELIX-243] Fix failing tests related to helix model overhaul


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

Branch: refs/heads/helix-logical-model
Commit: fdb48ec1373d54201df6deeb5543296820020cf4
Parents: 01ed356
Author: zzhang <zzhang@apache.org>
Authored: Mon Sep 16 17:46:59 2013 -0700
Committer: zzhang <zzhang@apache.org>
Committed: Mon Sep 16 17:46:59 2013 -0700

----------------------------------------------------------------------
 .../java/org/apache/helix/api/RebalancerConfig.java   | 14 ++++++++++++++
 .../src/main/java/org/apache/helix/api/Resource.java  | 12 ++++++++----
 .../controller/stages/BestPossibleStateCalcStage.java |  1 +
 .../controller/stages/BestPossibleStateOutput.java    |  1 +
 .../helix/controller/stages/ClusterDataCache.java     |  1 +
 .../stages/CurrentStateComputationStage.java          |  1 +
 .../helix/controller/stages/CurrentStateOutput.java   |  1 +
 .../controller/stages/ExternalViewComputeStage.java   |  1 +
 .../controller/stages/MessageGenerationOutput.java    |  1 +
 .../controller/stages/MessageGenerationPhase.java     |  1 +
 .../controller/stages/MessageSelectionStage.java      |  1 +
 .../stages/MessageSelectionStageOutput.java           |  1 +
 .../helix/controller/stages/MessageThrottleStage.java |  1 +
 .../controller/stages/MessageThrottleStageOutput.java |  1 +
 .../helix/controller/stages/NewMessageOutput.java     |  4 ++++
 .../controller/stages/NewMessageSelectionStage.java   |  6 +++++-
 .../helix/controller/stages/ReadClusterDataStage.java |  1 +
 .../controller/stages/RebalanceIdealStateStage.java   |  1 +
 .../controller/stages/ResourceComputationStage.java   |  1 +
 .../helix/controller/stages/TaskAssignmentStage.java  |  1 +
 .../zk/DefaultSchedulerMessageHandlerFactory.java     |  4 ++--
 .../apache/helix/integration/TestAutoRebalance.java   | 12 +++++-------
 .../helix/integration/TestHelixCustomCodeRunner.java  |  4 ++--
 23 files changed, 56 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/api/RebalancerConfig.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/api/RebalancerConfig.java b/helix-core/src/main/java/org/apache/helix/api/RebalancerConfig.java
index ec61533..be4a11f 100644
--- a/helix-core/src/main/java/org/apache/helix/api/RebalancerConfig.java
+++ b/helix-core/src/main/java/org/apache/helix/api/RebalancerConfig.java
@@ -360,6 +360,7 @@ public class RebalancerConfig extends NamespacedConfig {
     private boolean _anyLiveParticipant;
     private int _replicaCount;
     private int _maxPartitionsPerParticipant;
+    private String _participantGroupTag;
 
     /**
      * Configure the rebalancer for a resource
@@ -424,6 +425,16 @@ public class RebalancerConfig extends NamespacedConfig {
     }
 
     /**
+     * Set participant group tag
+     * @param tag
+     * @return Builder
+     */
+    public T participantGroupTag(String tag) {
+      _participantGroupTag = tag;
+      return self();
+    }
+
+    /**
      * Add a partition that the resource serves
      * @param partition fully-qualified partition
      * @return Builder
@@ -469,6 +480,9 @@ public class RebalancerConfig extends NamespacedConfig {
       if (_stateModelFactoryId != null) {
         rebalancerConfig.setStateModelFactoryId(_stateModelFactoryId);
       }
+      if (_participantGroupTag != null) {
+        rebalancerConfig.setParticipantGroupTag(_participantGroupTag);
+      }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/api/Resource.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/api/Resource.java b/helix-core/src/main/java/org/apache/helix/api/Resource.java
index f5c44e7..6fb54e6 100644
--- a/helix-core/src/main/java/org/apache/helix/api/Resource.java
+++ b/helix-core/src/main/java/org/apache/helix/api/Resource.java
@@ -84,14 +84,16 @@ public class Resource {
               .anyLiveParticipant(anyLiveParticipant).replicaCount(replicaCount)
               .maxPartitionsPerParticipant(idealState.getMaxPartitionsPerInstance())
               .stateModelDef(idealState.getStateModelDefId())
-              .stateModelFactoryId(idealState.getStateModelFactoryId()).build();
+              .stateModelFactoryId(idealState.getStateModelFactoryId())
+              .participantGroupTag(idealState.getInstanceGroupTag()).build();
     } else if (idealState.getRebalanceMode() == RebalanceMode.SEMI_AUTO) {
       SemiAutoRebalancerConfig semiAutoConfig =
           new SemiAutoRebalancerConfig.Builder(id).addPartitions(partitionMap.values())
               .anyLiveParticipant(anyLiveParticipant).replicaCount(replicaCount)
               .maxPartitionsPerParticipant(idealState.getMaxPartitionsPerInstance())
               .stateModelDef(idealState.getStateModelDefId())
-              .stateModelFactoryId(idealState.getStateModelFactoryId()).build();
+              .stateModelFactoryId(idealState.getStateModelFactoryId())
+              .participantGroupTag(idealState.getInstanceGroupTag()).build();
       for (PartitionId partitionId : partitionMap.keySet()) {
         semiAutoConfig.setPreferenceList(partitionId, idealState.getPreferenceList(partitionId));
       }
@@ -102,7 +104,8 @@ public class Resource {
               .anyLiveParticipant(anyLiveParticipant).replicaCount(replicaCount)
               .maxPartitionsPerParticipant(idealState.getMaxPartitionsPerInstance())
               .stateModelDef(idealState.getStateModelDefId())
-              .stateModelFactoryId(idealState.getStateModelFactoryId()).build();
+              .stateModelFactoryId(idealState.getStateModelFactoryId())
+              .participantGroupTag(idealState.getInstanceGroupTag()).build();
       for (PartitionId partitionId : partitionMap.keySet()) {
         customConfig.setPreferenceMap(partitionId, idealState.getParticipantStateMap(partitionId));
       }
@@ -114,7 +117,8 @@ public class Resource {
               .maxPartitionsPerParticipant(idealState.getMaxPartitionsPerInstance())
               .stateModelDef(idealState.getStateModelDefId())
               .stateModelFactoryId(idealState.getStateModelFactoryId())
-              .rebalancerRef(idealState.getRebalancerRef()).build();
+              .rebalancerRef(idealState.getRebalancerRef())
+              .participantGroupTag(idealState.getInstanceGroupTag()).build();
     }
 
     SchedulerTaskConfig schedulerTaskConfig = schedulerTaskConfig(idealState);

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
index 10240db..a2749e6 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
@@ -43,6 +43,7 @@ import org.apache.log4j.Logger;
  * For partition compute best possible (instance,state) pair based on
  * IdealState,StateModel,LiveInstance
  */
+@Deprecated
 public class BestPossibleStateCalcStage extends AbstractBaseStage {
   private static final Logger logger = Logger.getLogger(BestPossibleStateCalcStage.class.getName());
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateOutput.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateOutput.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateOutput.java
index fecefd5..dfa60c6 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateOutput.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateOutput.java
@@ -27,6 +27,7 @@ import org.apache.helix.api.ParticipantId;
 import org.apache.helix.api.State;
 import org.apache.helix.model.Partition;
 
+@Deprecated
 public class BestPossibleStateOutput {
   // resource->partition->instance->state
   Map<String, Map<Partition, Map<String, String>>> _dataMap;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/ClusterDataCache.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/ClusterDataCache.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/ClusterDataCache.java
index f50b95c..2c4d8e1 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/ClusterDataCache.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/ClusterDataCache.java
@@ -42,6 +42,7 @@ import org.apache.log4j.Logger;
  * Reads the data from the cluster using data accessor. This output ClusterData which
  * provides useful methods to search/lookup properties
  */
+@Deprecated
 public class ClusterDataCache {
 
   Map<String, LiveInstance> _liveInstanceMap;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateComputationStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateComputationStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateComputationStage.java
index 4499cd0..d731ebd 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateComputationStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateComputationStage.java
@@ -38,6 +38,7 @@ import org.apache.helix.model.Resource;
  * sessionId from LiveInstance Get Partition,State for all the resources computed in
  * previous State [ResourceComputationStage]
  */
+@Deprecated
 public class CurrentStateComputationStage extends AbstractBaseStage {
   @Override
   public void process(ClusterEvent event) throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateOutput.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateOutput.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateOutput.java
index b41f14b..61873da 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateOutput.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateOutput.java
@@ -26,6 +26,7 @@ import java.util.Map;
 import org.apache.helix.model.CurrentState;
 import org.apache.helix.model.Partition;
 
+@Deprecated
 public class CurrentStateOutput {
   private final Map<String, Map<Partition, Map<String, String>>> _currentStateMap;
   private final Map<String, Map<Partition, Map<String, String>>> _pendingStateMap;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/ExternalViewComputeStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/ExternalViewComputeStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/ExternalViewComputeStage.java
index 74e039f..8101b61 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/ExternalViewComputeStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/ExternalViewComputeStage.java
@@ -48,6 +48,7 @@ import org.apache.helix.model.StatusUpdate;
 import org.apache.helix.monitoring.mbeans.ClusterStatusMonitor;
 import org.apache.log4j.Logger;
 
+@Deprecated
 public class ExternalViewComputeStage extends AbstractBaseStage {
   private static Logger log = Logger.getLogger(ExternalViewComputeStage.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationOutput.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationOutput.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationOutput.java
index 359a959..2069974 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationOutput.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationOutput.java
@@ -28,6 +28,7 @@ import java.util.Map;
 import org.apache.helix.model.Message;
 import org.apache.helix.model.Partition;
 
+@Deprecated
 public class MessageGenerationOutput {
 
   private final Map<String, Map<Partition, List<Message>>> _messagesMap;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
index 0f17cf0..d50ddb2 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
@@ -45,6 +45,7 @@ import org.apache.log4j.Logger;
 /**
  * Compares the currentState, pendingState with IdealState and generate messages
  */
+@Deprecated
 public class MessageGenerationPhase extends AbstractBaseStage {
   private static Logger logger = Logger.getLogger(MessageGenerationPhase.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStage.java
index 23efacb..9e430b7 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStage.java
@@ -37,6 +37,7 @@ import org.apache.helix.model.Resource;
 import org.apache.helix.model.StateModelDefinition;
 import org.apache.log4j.Logger;
 
+@Deprecated
 public class MessageSelectionStage extends AbstractBaseStage {
   private static final Logger LOG = Logger.getLogger(MessageSelectionStage.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStageOutput.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStageOutput.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStageOutput.java
index 7ea545c..54ab384 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStageOutput.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStageOutput.java
@@ -27,6 +27,7 @@ import java.util.Map;
 import org.apache.helix.model.Message;
 import org.apache.helix.model.Partition;
 
+@Deprecated
 public class MessageSelectionStageOutput {
   private final Map<String, Map<Partition, List<Message>>> _messagesMap;
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStage.java
index 9eea7f1..70e0a07 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStage.java
@@ -38,6 +38,7 @@ import org.apache.helix.model.ClusterConstraints.ConstraintType;
 import org.apache.helix.model.ClusterConstraints.ConstraintValue;
 import org.apache.log4j.Logger;
 
+@Deprecated
 public class MessageThrottleStage extends AbstractBaseStage {
   private static final Logger LOG = Logger.getLogger(MessageThrottleStage.class.getName());
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStageOutput.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStageOutput.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStageOutput.java
index 7415944..5983eff 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStageOutput.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStageOutput.java
@@ -27,6 +27,7 @@ import java.util.Map;
 import org.apache.helix.model.Message;
 import org.apache.helix.model.Partition;
 
+@Deprecated
 public class MessageThrottleStageOutput {
   private final Map<String, Map<Partition, List<Message>>> _messagesMap;
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/NewMessageOutput.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/NewMessageOutput.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/NewMessageOutput.java
index 3dd5211..21f5188 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/NewMessageOutput.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/NewMessageOutput.java
@@ -68,6 +68,10 @@ public class NewMessageOutput {
 
   }
 
+  public Map<PartitionId, List<Message>> getMessages(ResourceId resourceId) {
+    return _messagesMap.get(resourceId);
+  }
+
   @Override
   public String toString() {
     return _messagesMap.toString();

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/NewMessageSelectionStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/NewMessageSelectionStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/NewMessageSelectionStage.java
index 1ec1a50..8ea2013 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/NewMessageSelectionStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/NewMessageSelectionStage.java
@@ -271,7 +271,11 @@ public class NewMessageSelectionStage extends AbstractBaseStage {
         // idealState is null when resource has been dropped,
         // R can't be evaluated and ignore state constraints
         if (rebalancerConfig != null) {
-          max = rebalancerConfig.getReplicaCount();
+          if (rebalancerConfig.canAssignAnyLiveParticipant()) {
+            max = cluster.getLiveParticipantMap().size();
+          } else {
+            max = rebalancerConfig.getReplicaCount();
+          }
         }
       } else {
         try {

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/ReadClusterDataStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/ReadClusterDataStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/ReadClusterDataStage.java
index f077d29..ce81f1f 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/ReadClusterDataStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/ReadClusterDataStage.java
@@ -27,6 +27,7 @@ import org.apache.helix.model.InstanceConfig;
 import org.apache.helix.monitoring.mbeans.ClusterStatusMonitor;
 import org.apache.log4j.Logger;
 
+@Deprecated
 public class ReadClusterDataStage extends AbstractBaseStage {
   private static final Logger logger = Logger.getLogger(ReadClusterDataStage.class.getName());
   ClusterDataCache _cache;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/RebalanceIdealStateStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/RebalanceIdealStateStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/RebalanceIdealStateStage.java
index b6facea..e6b7398 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/RebalanceIdealStateStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/RebalanceIdealStateStage.java
@@ -38,6 +38,7 @@ import org.apache.log4j.Logger;
  * If the resourceConfig has specified className of the customized rebalancer, <br/>
  * the rebalancer will be invoked to re-write the idealstate of the resource<br/>
  */
+@Deprecated
 public class RebalanceIdealStateStage extends AbstractBaseStage {
   private static final Logger LOG = Logger.getLogger(RebalanceIdealStateStage.class.getName());
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/ResourceComputationStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/ResourceComputationStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/ResourceComputationStage.java
index 9818035..cb2a7ed 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/ResourceComputationStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/ResourceComputationStage.java
@@ -37,6 +37,7 @@ import org.apache.log4j.Logger;
  * CurrentState for liveInstance-> Helps in finding resources that are inactive
  * and needs to be dropped
  */
+@Deprecated
 public class ResourceComputationStage extends AbstractBaseStage {
   private static Logger LOG = Logger.getLogger(ResourceComputationStage.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/controller/stages/TaskAssignmentStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/TaskAssignmentStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/TaskAssignmentStage.java
index b0b6cee..e0f3361 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/TaskAssignmentStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/TaskAssignmentStage.java
@@ -39,6 +39,7 @@ import org.apache.helix.model.Partition;
 import org.apache.helix.model.Resource;
 import org.apache.log4j.Logger;
 
+@Deprecated
 public class TaskAssignmentStage extends AbstractBaseStage {
   private static Logger logger = Logger.getLogger(TaskAssignmentStage.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/main/java/org/apache/helix/manager/zk/DefaultSchedulerMessageHandlerFactory.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/DefaultSchedulerMessageHandlerFactory.java
b/helix-core/src/main/java/org/apache/helix/manager/zk/DefaultSchedulerMessageHandlerFactory.java
index 8286d1b..cd18401 100644
--- a/helix-core/src/main/java/org/apache/helix/manager/zk/DefaultSchedulerMessageHandlerFactory.java
+++ b/helix-core/src/main/java/org/apache/helix/manager/zk/DefaultSchedulerMessageHandlerFactory.java
@@ -55,8 +55,8 @@ import org.apache.log4j.Logger;
 import org.codehaus.jackson.map.ObjectMapper;
 
 /*
- * The current implementation supports throttling on STATE-TRANSITION type of message, transition
SCHEDULED-COMPLETED. 
- * 
+ * The current implementation supports throttling on STATE-TRANSITION type of message, transition
SCHEDULED-COMPLETED.
+ *
  */
 public class DefaultSchedulerMessageHandlerFactory implements MessageHandlerFactory {
   public static final String WAIT_ALL = "WAIT_ALL";

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/test/java/org/apache/helix/integration/TestAutoRebalance.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestAutoRebalance.java
b/helix-core/src/test/java/org/apache/helix/integration/TestAutoRebalance.java
index eec2e33..ba44fcf 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestAutoRebalance.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestAutoRebalance.java
@@ -189,7 +189,7 @@ public class TestAutoRebalance extends ZkStandAloneCMTestBaseWithPropertyServerC
             CLUSTER_NAME, db2));
     Assert.assertTrue(result);
     HelixDataAccessor accessor =
-        new ZKHelixDataAccessor(CLUSTER_NAME, new ZkBaseDataAccessor(_zkClient));
+        new ZKHelixDataAccessor(CLUSTER_NAME, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
     Builder keyBuilder = accessor.keyBuilder();
     ExternalView ev = accessor.getProperty(keyBuilder.externalView(db2));
     Set<String> instancesSet = new HashSet<String>();
@@ -227,16 +227,14 @@ public class TestAutoRebalance extends ZkStandAloneCMTestBaseWithPropertyServerC
     for (String instanceName : masterPartitionsCountMap.keySet()) {
       int instancePartitionCount = masterPartitionsCountMap.get(instanceName);
       totalCount += instancePartitionCount;
-      if (!(instancePartitionCount == perInstancePartition || instancePartitionCount == perInstancePartition
+ 1)) {
+      if (Math.abs(instancePartitionCount - perInstancePartition) > 1) {
+        // System.out.println("instanceName: " + instanceName + ", instancePartitionCnt:
"
+        // + instancePartitionCount + ", perInstancePartition: " + perInstancePartition);
         return false;
       }
-      if (instancePartitionCount == perInstancePartition + 1) {
-        if (partitionCount % instances == 0) {
-          return false;
-        }
-      }
     }
     if (partitionCount != totalCount) {
+      // System.out.println("partitionCnt: " + partitionCount + ", totalCnt: " + totalCount);
       return false;
     }
     return true;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/fdb48ec1/helix-core/src/test/java/org/apache/helix/integration/TestHelixCustomCodeRunner.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestHelixCustomCodeRunner.java
b/helix-core/src/test/java/org/apache/helix/integration/TestHelixCustomCodeRunner.java
index b2bb561..9c0def6 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestHelixCustomCodeRunner.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestHelixCustomCodeRunner.java
@@ -27,6 +27,7 @@ import org.apache.helix.TestHelper;
 import org.apache.helix.HelixConstants.ChangeType;
 import org.apache.helix.NotificationContext.Type;
 import org.apache.helix.PropertyKey.Builder;
+import org.apache.helix.ZNRecord;
 import org.apache.helix.controller.HelixControllerMain;
 import org.apache.helix.manager.zk.ZKHelixDataAccessor;
 import org.apache.helix.manager.zk.ZNRecordSerializer;
@@ -109,7 +110,6 @@ public class TestHelixCustomCodeRunner extends ZkIntegrationTestBase {
 
       partics[i] = new MockParticipant(_clusterName, instanceName, ZK_ADDR, null, new MockJob());
       partics[i].syncStart();
-      // new Thread(partics[i]).start();
     }
     boolean result =
         ClusterStateVerifier.verifyByPolling(new ClusterStateVerifier.BestPossAndExtViewZkVerifier(
@@ -124,7 +124,7 @@ public class TestHelixCustomCodeRunner extends ZkIntegrationTestBase {
     ZkClient zkClient = new ZkClient(ZK_ADDR);
     zkClient.setZkSerializer(new ZNRecordSerializer());
     ZKHelixDataAccessor accessor =
-        new ZKHelixDataAccessor(_clusterName, new ZkBaseDataAccessor(zkClient));
+        new ZKHelixDataAccessor(_clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
     Builder keyBuilder = accessor.keyBuilder();
 
     LiveInstance newLiveIns = new LiveInstance("newLiveInstance");


Mime
View raw message