helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zzh...@apache.org
Subject [2/4] [HELIX-109] Review Helix model package, merge model changes with accessor changes, incomplete, rb=13878
Date Thu, 29 Aug 2013 06:17:46 GMT
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/model/Message.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/model/Message.java b/helix-core/src/main/java/org/apache/helix/model/Message.java
index d599b8b..5bc4a46 100644
--- a/helix-core/src/main/java/org/apache/helix/model/Message.java
+++ b/helix-core/src/main/java/org/apache/helix/model/Message.java
@@ -31,8 +31,17 @@ import org.apache.helix.HelixException;
 import org.apache.helix.HelixProperty;
 import org.apache.helix.InstanceType;
 import org.apache.helix.PropertyKey;
-import org.apache.helix.ZNRecord;
 import org.apache.helix.PropertyKey.Builder;
+import org.apache.helix.ZNRecord;
+import org.apache.helix.api.Id;
+import org.apache.helix.api.MessageId;
+import org.apache.helix.api.PartitionId;
+import org.apache.helix.api.ResourceId;
+import org.apache.helix.api.SessionId;
+import org.apache.helix.api.State;
+import org.apache.helix.api.StateModelDefId;
+
+import com.google.common.collect.ImmutableList;
 
 /**
  * Messages sent internally among nodes in the system to respond to changes in state.
@@ -196,11 +205,19 @@ public class Message extends HelixProperty {
    * Get the session identifier of the destination node
    * @return session identifier
    */
-  public String getTgtSessionId() {
+  public String getTgtSessionIdString() {
     return _record.getSimpleField(Attributes.TGT_SESSION_ID.toString());
   }
 
   /**
+   * Get the session identifier of the destination node
+   * @return session identifier
+   */
+  public SessionId getTgtSessionId() {
+    return Id.session(getTgtSessionIdString());
+  }
+
+  /**
    * Set the session identifier of the destination node
    * @param tgtSessionId session identifier
    */
@@ -212,11 +229,19 @@ public class Message extends HelixProperty {
    * Get the session identifier of the source node
    * @return session identifier
    */
-  public String getSrcSessionId() {
+  public String getSrcSessionIdString() {
     return _record.getSimpleField(Attributes.SRC_SESSION_ID.toString());
   }
 
   /**
+   * Get the session identifier of the source node
+   * @return session identifier
+   */
+  public SessionId getSrcSessionId() {
+    return Id.session(getSrcSessionIdString());
+  }
+
+  /**
    * Set the session identifier of the source node
    * @param srcSessionId session identifier
    */
@@ -228,11 +253,23 @@ public class Message extends HelixProperty {
    * Get the session identifier of the node that executes the message
    * @return session identifier
    */
-  public String getExecutionSessionId() {
+  public String getExecutionSessionIdString() {
     return _record.getSimpleField(Attributes.EXE_SESSION_ID.toString());
   }
 
   /**
+   * Get the session identifier of the node that executes the message
+   * @return session identifier
+   */
+  public SessionId getExecutionSessionId() {
+    String sessionId = getExecutionSessionIdString();
+    if (sessionId != null) {
+      return Id.session(sessionId);
+    }
+    return null;
+  }
+
+  /**
    * Set the session identifier of the node that executes the message
    * @param exeSessionId session identifier
    */
@@ -312,11 +349,19 @@ public class Message extends HelixProperty {
    * Get the unique identifier of this message
    * @return message identifier
    */
-  public String getMsgId() {
+  public String getMsgIdString() {
     return _record.getSimpleField(Attributes.MSG_ID.toString());
   }
 
   /**
+   * Get the unique identifier of this message
+   * @return message identifier
+   */
+  public MessageId getMsgId() {
+    return Id.message(getMsgIdString());
+  }
+
+  /**
    * Set the unique identifier of this message
    * @param msgId message identifier
    */
@@ -336,11 +381,19 @@ public class Message extends HelixProperty {
    * Get the "from-state" for transition-related messages
    * @return state name, or null for other message types
    */
-  public String getFromState() {
+  public String getFromStateString() {
     return _record.getSimpleField(Attributes.FROM_STATE.toString());
   }
 
   /**
+   * Get the "from-state" for transition-related messages
+   * @return state, or null for other message types
+   */
+  public State getFromState() {
+    return State.from(getFromStateString());
+  }
+
+  /**
    * Set the "to state" for transition-related messages
    * @param state the state name
    */
@@ -352,11 +405,19 @@ public class Message extends HelixProperty {
    * Get the "to state" for transition-related messages
    * @return state name, or null for other message types
    */
-  public String getToState() {
+  public String getToStateString() {
     return _record.getSimpleField(Attributes.TO_STATE.toString());
   }
 
   /**
+   * Get the "to state" for transition-related messages
+   * @return state, or null for other message types
+   */
+  public State getToState() {
+    return State.from(getToStateString());
+  }
+
+  /**
    * Set the instance for which this message is targeted
    * @param msgTgt instance name
    */
@@ -397,6 +458,14 @@ public class Message extends HelixProperty {
   }
 
   /**
+   * Get the resource associated with this message
+   * @return resource id
+   */
+  public ResourceId getResourceId() {
+    return Id.resource(getResourceName());
+  }
+
+  /**
    * Get the resource partition associated with this message
    * @return partition name
    */
@@ -405,6 +474,14 @@ public class Message extends HelixProperty {
   }
 
   /**
+   * Get the resource partition associated with this message
+   * @return partition id
+   */
+  public PartitionId getPartitionId() {
+    return Id.partition(getPartitionName());
+  }
+
+  /**
    * Get the state model definition name
    * @return a String reference to the state model definition, e.g. "MasterSlave"
    */
@@ -413,6 +490,14 @@ public class Message extends HelixProperty {
   }
 
   /**
+   * Get the state model definition id
+   * @return a reference to the state model definition
+   */
+  public StateModelDefId getStateModelDefId() {
+    return Id.stateModelDef(getStateModelDef());
+  }
+
+  /**
    * Set the state model definition name
    * @param stateModelDefName a reference to the state model definition, e.g. "MasterSlave"
    */
@@ -581,7 +666,7 @@ public class Message extends HelixProperty {
   public static Message createReplyMessage(Message srcMessage, String instanceName,
       Map<String, String> taskResultMap) {
     if (srcMessage.getCorrelationId() == null) {
-      throw new HelixException("Message " + srcMessage.getMsgId()
+      throw new HelixException("Message " + srcMessage.getMsgIdString()
           + " does not contain correlation id");
     }
     Message replyMessage = new Message(MessageType.TASK_REPLY, UUID.randomUUID().toString());
@@ -626,6 +711,18 @@ public class Message extends HelixProperty {
     return partitionNames;
   }
 
+  /**
+   * Get a list of partitions associated with this message
+   * @return list of partition ids
+   */
+  public List<PartitionId> getPartitionIds() {
+    ImmutableList.Builder<PartitionId> builder = new ImmutableList.Builder<PartitionId>();
+    for (String partitionName : getPartitionNames()) {
+      builder.add(Id.partition(partitionName));
+    }
+    return builder.build();
+  }
+
   // public AtomicInteger getGroupMsgCountDown()
   // {
   // return _groupMsgCountDown;
@@ -671,8 +768,8 @@ public class Message extends HelixProperty {
       boolean isNotValid =
           isNullOrEmpty(getTgtName()) || isNullOrEmpty(getPartitionName())
               || isNullOrEmpty(getResourceName()) || isNullOrEmpty(getStateModelDef())
-              || isNullOrEmpty(getToState()) || isNullOrEmpty(getStateModelFactoryName())
-              || isNullOrEmpty(getFromState());
+              || isNullOrEmpty(getToStateString()) || isNullOrEmpty(getStateModelFactoryName())
+              || isNullOrEmpty(getFromStateString());
 
       return !isNotValid;
     }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/model/ResourceAssignment.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/model/ResourceAssignment.java b/helix-core/src/main/java/org/apache/helix/model/ResourceAssignment.java
index 2b3d14d..7013829 100644
--- a/helix-core/src/main/java/org/apache/helix/model/ResourceAssignment.java
+++ b/helix-core/src/main/java/org/apache/helix/model/ResourceAssignment.java
@@ -56,6 +56,14 @@ public class ResourceAssignment extends HelixProperty {
   }
 
   /**
+   * Get the resource for which this assignment was created
+   * @return resource name
+   */
+  public String getResourceName() {
+    return getId();
+  }
+
+  /**
    * Get the currently mapped partitions
    * @return list of Partition objects
    */

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/model/StateModelDefinition.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/model/StateModelDefinition.java b/helix-core/src/main/java/org/apache/helix/model/StateModelDefinition.java
index 7f08b6f..caaf81e 100644
--- a/helix-core/src/main/java/org/apache/helix/model/StateModelDefinition.java
+++ b/helix-core/src/main/java/org/apache/helix/model/StateModelDefinition.java
@@ -30,9 +30,12 @@ import java.util.TreeMap;
 import org.apache.helix.HelixDefinedState;
 import org.apache.helix.HelixProperty;
 import org.apache.helix.ZNRecord;
+import org.apache.helix.api.State;
 import org.apache.helix.model.builder.StateTransitionTableBuilder;
 import org.apache.log4j.Logger;
 
+import com.google.common.collect.ImmutableList;
+
 /**
  * Describe the state model
  */
@@ -141,19 +144,43 @@ public class StateModelDefinition extends HelixProperty {
    * Get an ordered priority list of transitions
    * @return transitions in the form SRC-DEST, the first of which is highest priority
    */
-  public List<String> getStateTransitionPriorityList() {
+  public List<String> getStateTransitionPriorityStringList() {
     return _stateTransitionPriorityList;
   }
 
   /**
+   * Get an ordered priority list of transitions
+   * @return Transition objects, the first of which is highest priority
+   */
+  public List<Transition> getStateTransitionPriorityList() {
+    ImmutableList.Builder<Transition> builder = new ImmutableList.Builder<Transition>();
+    for (String transition : getStateTransitionPriorityStringList()) {
+      builder.add(Transition.from(transition));
+    }
+    return builder.build();
+  }
+
+  /**
    * Get an ordered priority list of states
    * @return state names, the first of which is highest priority
    */
-  public List<String> getStatesPriorityList() {
+  public List<String> getStatesPriorityStringList() {
     return _statesPriorityList;
   }
 
   /**
+   * Get an ordered priority list of states
+   * @return immutable list of states, the first of which is highest priority
+   */
+  public List<State> getStatesPriorityList() {
+    ImmutableList.Builder<State> builder = new ImmutableList.Builder<State>();
+    for (String state : getStatesPriorityStringList()) {
+      builder.add(State.from(state));
+    }
+    return builder.build();
+  }
+
+  /**
    * Get the intermediate state required to transition from one state to the other
    * @param fromState the source
    * @param toState the destination
@@ -168,16 +195,40 @@ public class StateModelDefinition extends HelixProperty {
   }
 
   /**
+   * Get the intermediate state required to transition from one state to the other
+   * @param fromState the source
+   * @param toState the destination
+   * @return the intermediate state, or null if not present
+   */
+  public State getNextStateForTransition(State fromState, State toState) {
+    String next = getNextStateForTransition(fromState.toString(), toState.toString());
+    if (next != null) {
+      return State.from(getNextStateForTransition(fromState.toString(), toState.toString()));
+    }
+    return null;
+  }
+
+  /**
    * Get the starting state in the model
    * @return name of the initial state
    */
-  public String getInitialState() {
+  public String getInitialStateString() {
     // return _record.getSimpleField(StateModelDefinitionProperty.INITIAL_STATE
     // .toString());
     return _initialState;
   }
 
   /**
+   * Get the starting state in the model
+   * @return name of the initial state
+   */
+  public State getInitialState() {
+    // return _record.getSimpleField(StateModelDefinitionProperty.INITIAL_STATE
+    // .toString());
+    return State.from(_initialState);
+  }
+
+  /**
    * Number of instances that can be in each state
    * @param state the state name
    * @return maximum instance count per state, can be "N" or "R"
@@ -188,7 +239,7 @@ public class StateModelDefinition extends HelixProperty {
 
   @Override
   public boolean isValid() {
-    if (getInitialState() == null) {
+    if (getInitialStateString() == null) {
       _logger.error("State model does not contain init state, statemodel:" + _record.getId());
       return false;
     }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/model/Transition.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/model/Transition.java b/helix-core/src/main/java/org/apache/helix/model/Transition.java
index 2151c44..0e7f32f 100644
--- a/helix-core/src/main/java/org/apache/helix/model/Transition.java
+++ b/helix-core/src/main/java/org/apache/helix/model/Transition.java
@@ -70,4 +70,14 @@ public class Transition {
     return _toState;
   }
 
+  /**
+   * Create a new transition
+   * @param transition string representing a transition, e.g. "STATE1-STATE2"
+   * @return Transition
+   */
+  public static Transition from(String transition) {
+    String fromState = transition.substring(0, transition.indexOf('-'));
+    String toState = transition.substring(transition.indexOf('-') + 1);
+    return new Transition(fromState, toState);
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/model/builder/CurrentStateBuilder.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/model/builder/CurrentStateBuilder.java b/helix-core/src/main/java/org/apache/helix/model/builder/CurrentStateBuilder.java
new file mode 100644
index 0000000..26238f2
--- /dev/null
+++ b/helix-core/src/main/java/org/apache/helix/model/builder/CurrentStateBuilder.java
@@ -0,0 +1,123 @@
+package org.apache.helix.model.builder;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.helix.ZNRecord;
+import org.apache.helix.api.PartitionId;
+import org.apache.helix.api.ResourceId;
+import org.apache.helix.api.SessionId;
+import org.apache.helix.api.State;
+import org.apache.helix.api.StateModelDefId;
+import org.apache.helix.model.CurrentState;
+import org.apache.helix.model.CurrentState.CurrentStateProperty;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Assemble a CurrentState
+ */
+public class CurrentStateBuilder {
+  private final ResourceId _resourceId;
+  private final Map<PartitionId, State> _partitionStateMap;
+  private SessionId _sessionId;
+  private StateModelDefId _stateModelDefId;
+  private String _stateModelFactoryName;
+
+  /**
+   * Build a current state for a given resource
+   * @param resourceId resource identifier
+   */
+  public CurrentStateBuilder(ResourceId resourceId) {
+    _resourceId = resourceId;
+    _partitionStateMap = new HashMap<PartitionId, State>();
+  }
+
+  /**
+   * Add partition-state mappings for this instance and resource
+   * @param mappings map of partition to state
+   * @return CurrentStateBuilder
+   */
+  public CurrentStateBuilder addMappings(Map<PartitionId, State> mappings) {
+    _partitionStateMap.putAll(mappings);
+    return this;
+  }
+
+  /**
+   * Add a single partition-state mapping for this instance and resource
+   * @param partitionId the partition to map
+   * @param state the replica state
+   * @return CurrentStateBuilder
+   */
+  public CurrentStateBuilder addMapping(PartitionId partitionId, State state) {
+    _partitionStateMap.put(partitionId, state);
+    return this;
+  }
+
+  /**
+   * Set the session id for this current state
+   * @param sessionId session identifier
+   * @return CurrentStateBuilder
+   */
+  public CurrentStateBuilder sessionId(SessionId sessionId) {
+    _sessionId = sessionId;
+    return this;
+  }
+
+  /**
+   * Set the state model for this current state
+   * @param stateModelDefId state model definition identifier
+   * @return CurrentStateBuilder
+   */
+  public CurrentStateBuilder stateModelDef(StateModelDefId stateModelDefId) {
+    _stateModelDefId = stateModelDefId;
+    return this;
+  }
+
+  /**
+   * Set the name of the state model factory
+   * @param stateModelFactoryName state model factory identifier
+   * @return CurrentStateBuilder
+   */
+  public CurrentStateBuilder stateModelFactory(String stateModelFactoryName) {
+    _stateModelFactoryName = stateModelFactoryName;
+    return this;
+  }
+
+  /**
+   * Create a CurrentState
+   * @return instantiated CurrentState
+   */
+  public CurrentState build() {
+    ZNRecord record = new ZNRecord(_resourceId.stringify());
+    for (PartitionId partitionId : _partitionStateMap.keySet()) {
+      Map<String, String> stateMap = new HashMap<String, String>();
+      stateMap.put(CurrentStateProperty.CURRENT_STATE.toString(),
+          _partitionStateMap.get(partitionId).toString());
+      record.setMapField(partitionId.toString(), stateMap);
+    }
+    record.setSimpleField(CurrentStateProperty.SESSION_ID.toString(), _sessionId.toString());
+    record.setSimpleField(CurrentStateProperty.STATE_MODEL_DEF.toString(),
+        _stateModelDefId.toString());
+    record.setSimpleField(CurrentStateProperty.STATE_MODEL_FACTORY_NAME.toString(),
+        _stateModelFactoryName);
+    return new CurrentState(record);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/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 a7c0335..7ae9dfe 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
@@ -22,6 +22,8 @@ package org.apache.helix.model.builder;
 import org.apache.helix.HelixConstants;
 import org.apache.helix.HelixException;
 import org.apache.helix.ZNRecord;
+import org.apache.helix.api.ResourceId;
+import org.apache.helix.api.StateModelDefId;
 import org.apache.helix.model.IdealState;
 
 public abstract class IdealStateBuilder {
@@ -74,6 +76,14 @@ public abstract class IdealStateBuilder {
   }
 
   /**
+   * Instantiate with a resource id
+   * @param resourceId the resource for which to build an ideal state
+   */
+  public IdealStateBuilder(ResourceId resourceId) {
+    this(resourceId.stringify());
+  }
+
+  /**
    * @param numReplica
    */
   public IdealStateBuilder setNumReplica(int numReplica) {
@@ -98,6 +108,15 @@ public abstract class IdealStateBuilder {
   }
 
   /**
+   * Set the state model definition to use with this ideal state
+   * @param stateModelDefId state model identifier
+   */
+  public IdealStateBuilder setStateModelDefId(StateModelDefId stateModelDefId) {
+    this.stateModel = stateModelDefId.stringify();
+    return this;
+  }
+
+  /**
    * @param stateModelFactoryName
    */
   public IdealStateBuilder setStateModelFactoryName(String stateModelFactoryName) {

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ResourceMonitor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ResourceMonitor.java b/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ResourceMonitor.java
index e24b41f..769ef2d 100644
--- a/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ResourceMonitor.java
+++ b/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ResourceMonitor.java
@@ -111,7 +111,7 @@ public class ResourceMonitor implements ResourceMonitorMBean {
     }
     _numOfErrorPartitions = numOfErrorPartitions;
     _externalViewIdealStateDiff = numOfDiff;
-    _numOfPartitionsInExternalView = externalView.getPartitionSet().size();
+    _numOfPartitionsInExternalView = externalView.getPartitionStringSet().size();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/participant/DistClusterControllerElection.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/participant/DistClusterControllerElection.java b/helix-core/src/main/java/org/apache/helix/participant/DistClusterControllerElection.java
index 25aada2..3551043 100644
--- a/helix-core/src/main/java/org/apache/helix/participant/DistClusterControllerElection.java
+++ b/helix-core/src/main/java/org/apache/helix/participant/DistClusterControllerElection.java
@@ -142,7 +142,7 @@ public class DistClusterControllerElection implements ControllerChangeListener {
 
     leader = accessor.getProperty(keyBuilder.controllerLeader());
     if (leader != null) {
-      String leaderSessionId = leader.getSessionId();
+      String leaderSessionId = leader.getSessionIdString();
       LOG.info("Leader exists for cluster: " + manager.getClusterName() + ", currentLeader: "
           + leader.getInstanceName() + ", leaderSessionId: " + leaderSessionId);
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/participant/HelixStateMachineEngine.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/participant/HelixStateMachineEngine.java b/helix-core/src/main/java/org/apache/helix/participant/HelixStateMachineEngine.java
index 31fcecf..5fd276f 100644
--- a/helix-core/src/main/java/org/apache/helix/participant/HelixStateMachineEngine.java
+++ b/helix-core/src/main/java/org/apache/helix/participant/HelixStateMachineEngine.java
@@ -160,13 +160,13 @@ public class HelixStateMachineEngine implements StateMachineEngine {
 
     if (!type.equals(MessageType.STATE_TRANSITION.toString())) {
       throw new HelixException("Expect state-transition message type, but was "
-          + message.getMsgType() + ", msgId: " + message.getMsgId());
+          + message.getMsgType() + ", msgId: " + message.getMsgIdString());
     }
 
     String partitionKey = message.getPartitionName();
     String stateModelName = message.getStateModelDef();
     String resourceName = message.getResourceName();
-    String sessionId = message.getTgtSessionId();
+    String sessionId = message.getTgtSessionIdString();
     int bucketSize = message.getBucketSize();
 
     if (stateModelName == null) {
@@ -205,7 +205,7 @@ public class HelixStateMachineEngine implements StateMachineEngine {
 
     if (message.getBatchMessageMode() == false) {
       // create currentStateDelta for this partition
-      String initState = _stateModelDefs.get(message.getStateModelDef()).getInitialState();
+      String initState = _stateModelDefs.get(message.getStateModelDef()).getInitialStateString();
       StateModel stateModel = stateModelFactory.getStateModel(partitionKey);
       if (stateModel == null) {
         stateModel = stateModelFactory.createAndAddStateModel(partitionKey);

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/spectator/RoutingTableProvider.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/spectator/RoutingTableProvider.java b/helix-core/src/main/java/org/apache/helix/spectator/RoutingTableProvider.java
index 9bba660..ed411d1 100644
--- a/helix-core/src/main/java/org/apache/helix/spectator/RoutingTableProvider.java
+++ b/helix-core/src/main/java/org/apache/helix/spectator/RoutingTableProvider.java
@@ -133,7 +133,7 @@ public class RoutingTableProvider implements ExternalViewChangeListener, ConfigC
     if (externalViewList != null) {
       for (ExternalView extView : externalViewList) {
         String resourceName = extView.getId();
-        for (String partitionName : extView.getPartitionSet()) {
+        for (String partitionName : extView.getPartitionStringSet()) {
           Map<String, String> stateMap = extView.getStateMap(partitionName);
           for (String instanceName : stateMap.keySet()) {
             String currentState = stateMap.get(instanceName);

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/tools/ZkLogAnalyzer.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/tools/ZkLogAnalyzer.java b/helix-core/src/main/java/org/apache/helix/tools/ZkLogAnalyzer.java
index 11e1b66..1cf824c 100644
--- a/helix-core/src/main/java/org/apache/helix/tools/ZkLogAnalyzer.java
+++ b/helix-core/src/main/java/org/apache/helix/tools/ZkLogAnalyzer.java
@@ -342,11 +342,11 @@ public class ZkLogAnalyzer {
               // sendMessageLines.add(inputLine);
               stats.msgSentCount++;
 
-              if (msg.getFromState().equals("OFFLINE") && msg.getToState().equals("SLAVE")) {
+              if (msg.getFromStateString().equals("OFFLINE") && msg.getToStateString().equals("SLAVE")) {
                 stats.msgSentCount_O2S++;
-              } else if (msg.getFromState().equals("SLAVE") && msg.getToState().equals("MASTER")) {
+              } else if (msg.getFromStateString().equals("SLAVE") && msg.getToStateString().equals("MASTER")) {
                 stats.msgSentCount_S2M++;
-              } else if (msg.getFromState().equals("MASTER") && msg.getToState().equals("SLAVE")) {
+              } else if (msg.getFromStateString().equals("MASTER") && msg.getToStateString().equals("SLAVE")) {
                 stats.msgSentCount_M2S++;
               }
               // System.out.println("Message create:"+new

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/util/RebalanceUtil.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/util/RebalanceUtil.java b/helix-core/src/main/java/org/apache/helix/util/RebalanceUtil.java
index 273adc3..0911cc4 100644
--- a/helix-core/src/main/java/org/apache/helix/util/RebalanceUtil.java
+++ b/helix-core/src/main/java/org/apache/helix/util/RebalanceUtil.java
@@ -37,7 +37,7 @@ public class RebalanceUtil {
     Map<String, Integer> partitionIndex = new HashMap<String, Integer>();
     Map<String, String> reversePartitionIndex = new HashMap<String, String>();
     boolean indexInPartitionName = true;
-    for (String partitionId : state.getPartitionSet()) {
+    for (String partitionId : state.getPartitionStringSet()) {
       int lastPos = partitionId.lastIndexOf("_");
       if (lastPos < 0) {
         indexInPartitionName = false;
@@ -58,7 +58,7 @@ public class RebalanceUtil {
 
     if (indexInPartitionName == false) {
       List<String> partitions = new ArrayList<String>();
-      partitions.addAll(state.getPartitionSet());
+      partitions.addAll(state.getPartitionStringSet());
       Collections.sort(partitions);
       for (int i = 0; i < partitions.size(); i++) {
         partitionIndex.put(partitions.get(i), i);
@@ -69,7 +69,7 @@ public class RebalanceUtil {
     Map<String, List<Integer>> nodeMasterAssignmentMap = new TreeMap<String, List<Integer>>();
     Map<String, Map<String, List<Integer>>> combinedNodeSlaveAssignmentMap =
         new TreeMap<String, Map<String, List<Integer>>>();
-    for (String partition : state.getPartitionSet()) {
+    for (String partition : state.getPartitionStringSet()) {
       List<String> instances = state.getRecord().getListField(partition);
       String master = instances.get(0);
       if (!nodeMasterAssignmentMap.containsKey(master)) {
@@ -104,7 +104,7 @@ public class RebalanceUtil {
 
     // StateModelDefinition def = new StateModelDefinition(stateModDef);
 
-    List<String> statePriorityList = stateModDef.getStatesPriorityList();
+    List<String> statePriorityList = stateModDef.getStatesPriorityStringList();
 
     for (String state : statePriorityList) {
       String count = stateModDef.getNumInstancesPerState(state);

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/main/java/org/apache/helix/util/StatusUpdateUtil.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/util/StatusUpdateUtil.java b/helix-core/src/main/java/org/apache/helix/util/StatusUpdateUtil.java
index 02c39d1..7fab9d5 100644
--- a/helix-core/src/main/java/org/apache/helix/util/StatusUpdateUtil.java
+++ b/helix-core/src/main/java/org/apache/helix/util/StatusUpdateUtil.java
@@ -254,7 +254,7 @@ public class StatusUpdateUtil {
    */
   ZNRecord createMessageLogRecord(Message message) {
     ZNRecord result = new ZNRecord(getStatusUpdateRecordName(message));
-    String mapFieldKey = "MESSAGE " + message.getMsgId();
+    String mapFieldKey = "MESSAGE " + message.getMsgIdString();
     result.setMapField(mapFieldKey, new TreeMap<String, String>());
 
     // Store all the simple fields of the message in the new ZNRecord's map
@@ -290,7 +290,7 @@ public class StatusUpdateUtil {
     contentMap.put("Message state", message.getMsgState().toString());
     contentMap.put("AdditionalInfo", additionalInfo);
     contentMap.put("Class", classInfo.toString());
-    contentMap.put("MSG_ID", message.getMsgId());
+    contentMap.put("MSG_ID", message.getMsgIdString());
 
     DateFormat formatter = new SimpleDateFormat("yyyyMMdd-HHmmss.SSSSSS");
     String time = formatter.format(new Date());
@@ -304,8 +304,8 @@ public class StatusUpdateUtil {
 
   String getRecordIdForMessage(Message message) {
     if (message.getMsgType().equals(MessageType.STATE_TRANSITION)) {
-      return message.getPartitionName() + " Trans:" + message.getFromState().charAt(0) + "->"
-          + message.getToState().charAt(0) + "  " + UUID.randomUUID().toString();
+      return message.getPartitionName() + " Trans:" + message.getFromStateString().charAt(0) + "->"
+          + message.getToStateString().charAt(0) + "  " + UUID.randomUUID().toString();
     } else {
       return message.getMsgType() + " " + UUID.randomUUID().toString();
     }
@@ -375,16 +375,16 @@ public class StatusUpdateUtil {
     String instanceName = message.getTgtName();
     String statusUpdateSubPath = getStatusUpdateSubPath(message);
     String statusUpdateKey = getStatusUpdateKey(message);
-    String sessionId = message.getExecutionSessionId();
+    String sessionId = message.getExecutionSessionIdString();
     if (sessionId == null) {
-      sessionId = message.getTgtSessionId();
+      sessionId = message.getTgtSessionIdString();
     }
     if (sessionId == null) {
       sessionId = "*";
     }
 
     Builder keyBuilder = accessor.keyBuilder();
-    if (!_recordedMessages.containsKey(message.getMsgId())) {
+    if (!_recordedMessages.containsKey(message.getMsgIdString())) {
       // TODO instanceName of a controller might be any string
       if (instanceName.equalsIgnoreCase("Controller")) {
         accessor.updateProperty(
@@ -408,7 +408,7 @@ public class StatusUpdateUtil {
         accessor.updateProperty(propertyKey, new StatusUpdate(statusUpdateRecord));
 
       }
-      _recordedMessages.put(message.getMsgId(), message.getMsgId());
+      _recordedMessages.put(message.getMsgIdString(), message.getMsgIdString());
     }
 
     if (instanceName.equalsIgnoreCase("Controller")) {
@@ -438,7 +438,7 @@ public class StatusUpdateUtil {
     if (message.getMsgType().equalsIgnoreCase(MessageType.STATE_TRANSITION.toString())) {
       return message.getPartitionName();
     }
-    return message.getMsgId();
+    return message.getMsgIdString();
   }
 
   /**
@@ -454,9 +454,9 @@ public class StatusUpdateUtil {
 
   String getStatusUpdateRecordName(Message message) {
     if (message.getMsgType().equalsIgnoreCase(MessageType.STATE_TRANSITION.toString())) {
-      return message.getTgtSessionId() + "__" + message.getResourceName();
+      return message.getTgtSessionIdString() + "__" + message.getResourceName();
     }
-    return message.getMsgId();
+    return message.getMsgIdString();
   }
 
   /**
@@ -472,9 +472,9 @@ public class StatusUpdateUtil {
     String instanceName = message.getTgtName();
     String statusUpdateSubPath = getStatusUpdateSubPath(message);
     String statusUpdateKey = getStatusUpdateKey(message);
-    String sessionId = message.getExecutionSessionId();
+    String sessionId = message.getExecutionSessionIdString();
     if (sessionId == null) {
-      sessionId = message.getTgtSessionId();
+      sessionId = message.getTgtSessionIdString();
     }
     if (sessionId == null) {
       sessionId = "*";

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/ZkUnitTestBase.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/ZkUnitTestBase.java b/helix-core/src/test/java/org/apache/helix/ZkUnitTestBase.java
index abf75be..58dd070 100644
--- a/helix-core/src/test/java/org/apache/helix/ZkUnitTestBase.java
+++ b/helix-core/src/test/java/org/apache/helix/ZkUnitTestBase.java
@@ -43,9 +43,9 @@ import org.apache.helix.model.IdealState.RebalanceMode;
 import org.apache.helix.model.InstanceConfig;
 import org.apache.helix.model.LiveInstance;
 import org.apache.helix.model.Message;
-import org.apache.helix.model.StateModelDefinition;
 import org.apache.helix.model.Message.Attributes;
 import org.apache.helix.model.Message.MessageType;
+import org.apache.helix.model.StateModelDefinition;
 import org.apache.helix.tools.StateModelConfigGenerator;
 import org.apache.helix.util.HelixUtil;
 import org.apache.log4j.Logger;
@@ -177,7 +177,7 @@ public class ZkUnitTestBase {
     Builder keyBuilder = accessor.keyBuilder();
 
     IdealState idealState = accessor.getProperty(keyBuilder.idealStates(resource));
-    for (String partitionName : idealState.getPartitionSet()) {
+    for (String partitionName : idealState.getPartitionStringSet()) {
       if (idealState.getRebalanceMode() == RebalanceMode.SEMI_AUTO) {
         AssertJUnit.assertEquals(repl, idealState.getPreferenceList(partitionName).size());
       } else if (idealState.getRebalanceMode() == RebalanceMode.CUSTOMIZED) {

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/controller/stages/TestMsgSelectionStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestMsgSelectionStage.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestMsgSelectionStage.java
index 820abbe..b8166f6 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestMsgSelectionStage.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestMsgSelectionStage.java
@@ -67,7 +67,7 @@ public class TestMsgSelectionStage {
             messages, stateConstraints, stateTransitionPriorities, "OFFLINE");
 
     Assert.assertEquals(selectedMsg.size(), 1);
-    Assert.assertEquals(selectedMsg.get(0).getMsgId(), "msgId_1");
+    Assert.assertEquals(selectedMsg.get(0).getMsgIdString(), "msgId_1");
     System.out.println("END testMasterXfer at " + new Date(System.currentTimeMillis()));
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/controller/stages/TestRebalancePipeline.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestRebalancePipeline.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestRebalancePipeline.java
index fccd0c7..4c5a0d7 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestRebalancePipeline.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestRebalancePipeline.java
@@ -111,8 +111,8 @@ public class TestRebalancePipeline extends ZkUnitTestBase {
         msgSelOutput.getMessages(resourceName, new Partition(resourceName + "_0"));
     Assert.assertEquals(messages.size(), 1, "Should output 1 message: OFFLINE-SLAVE for node0");
     Message message = messages.get(0);
-    Assert.assertEquals(message.getFromState(), "OFFLINE");
-    Assert.assertEquals(message.getToState(), "SLAVE");
+    Assert.assertEquals(message.getFromStateString(), "OFFLINE");
+    Assert.assertEquals(message.getToStateString(), "SLAVE");
     Assert.assertEquals(message.getTgtName(), "localhost_0");
 
     // round2: updates node0 currentState to SLAVE but keep the
@@ -258,8 +258,8 @@ public class TestRebalancePipeline extends ZkUnitTestBase {
         msgSelOutput.getMessages(resourceName, new Partition(resourceName + "_0"));
     Assert.assertEquals(messages.size(), 1, "Should output 1 message: OFFLINE-SLAVE for node0");
     Message message = messages.get(0);
-    Assert.assertEquals(message.getFromState(), "OFFLINE");
-    Assert.assertEquals(message.getToState(), "SLAVE");
+    Assert.assertEquals(message.getFromStateString(), "OFFLINE");
+    Assert.assertEquals(message.getToStateString(), "SLAVE");
     Assert.assertEquals(message.getTgtName(), "localhost_0");
 
     // round2: drop resource, but keep the
@@ -275,8 +275,8 @@ public class TestRebalancePipeline extends ZkUnitTestBase {
         "Should output only 1 message: OFFLINE->DROPPED for localhost_1");
 
     message = messages.get(0);
-    Assert.assertEquals(message.getFromState(), "SLAVE");
-    Assert.assertEquals(message.getToState(), "OFFLINE");
+    Assert.assertEquals(message.getFromStateString(), "SLAVE");
+    Assert.assertEquals(message.getToStateString(), "OFFLINE");
     Assert.assertEquals(message.getTgtName(), "localhost_1");
 
     // round3: remove O->S for localhost_0, controller should now send O->DROPPED to
@@ -291,8 +291,8 @@ public class TestRebalancePipeline extends ZkUnitTestBase {
     Assert.assertEquals(messages.size(), 1,
         "Should output 1 message: OFFLINE->DROPPED for localhost_0");
     message = messages.get(0);
-    Assert.assertEquals(message.getFromState(), "OFFLINE");
-    Assert.assertEquals(message.getToState(), "DROPPED");
+    Assert.assertEquals(message.getFromStateString(), "OFFLINE");
+    Assert.assertEquals(message.getToStateString(), "DROPPED");
     Assert.assertEquals(message.getTgtName(), "localhost_0");
 
     System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
@@ -351,8 +351,8 @@ public class TestRebalancePipeline extends ZkUnitTestBase {
         msgSelOutput.getMessages(resourceName, new Partition(resourceName + "_0"));
     Assert.assertEquals(messages.size(), 1, "Should output 1 message: SLAVE-MASTER for node1");
     Message message = messages.get(0);
-    Assert.assertEquals(message.getFromState(), "SLAVE");
-    Assert.assertEquals(message.getToState(), "MASTER");
+    Assert.assertEquals(message.getFromStateString(), "SLAVE");
+    Assert.assertEquals(message.getToStateString(), "MASTER");
     Assert.assertEquals(message.getTgtName(), "localhost_1");
 
     // round2: updates node0 currentState to SLAVE but keep the

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/controller/stages/TestResourceComputationStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestResourceComputationStage.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestResourceComputationStage.java
index 6febe93..3f6fa75 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestResourceComputationStage.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestResourceComputationStage.java
@@ -173,7 +173,7 @@ public class TestResourceComputationStage extends BaseStageTest {
     AssertJUnit.assertEquals(resourceMap.get(oldResource).getStateModelDefRef(),
         currentState.getStateModelDefRef());
     AssertJUnit.assertEquals(resourceMap.get(oldResource).getPartitions().size(), currentState
-        .getPartitionStateMap().size());
+        .getPartitionStateStringMap().size());
     AssertJUnit.assertNotNull(resourceMap.get(oldResource).getPartition("testResourceOld_0"));
     AssertJUnit.assertNotNull(resourceMap.get(oldResource).getPartition("testResourceOld_1"));
     AssertJUnit.assertNotNull(resourceMap.get(oldResource).getPartition("testResourceOld_2"));

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/healthcheck/TestAddDropAlert.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/healthcheck/TestAddDropAlert.java b/helix-core/src/test/java/org/apache/helix/healthcheck/TestAddDropAlert.java
index d5a1b08..3de9d4d 100644
--- a/helix-core/src/test/java/org/apache/helix/healthcheck/TestAddDropAlert.java
+++ b/helix-core/src/test/java/org/apache/helix/healthcheck/TestAddDropAlert.java
@@ -75,8 +75,8 @@ public class TestAddDropAlert extends ZkIntegrationTestBase {
     public void doTransition(Message message, NotificationContext context) {
       HelixManager manager = context.getManager();
       HelixDataAccessor accessor = manager.getHelixDataAccessor();
-      String fromState = message.getFromState();
-      String toState = message.getToState();
+      String fromState = message.getFromStateString();
+      String toState = message.getToStateString();
       String instance = message.getTgtName();
       String partition = message.getPartitionName();
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/healthcheck/TestExpandAlert.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/healthcheck/TestExpandAlert.java b/helix-core/src/test/java/org/apache/helix/healthcheck/TestExpandAlert.java
index 69d1062..211f230 100644
--- a/helix-core/src/test/java/org/apache/helix/healthcheck/TestExpandAlert.java
+++ b/helix-core/src/test/java/org/apache/helix/healthcheck/TestExpandAlert.java
@@ -77,8 +77,8 @@ public class TestExpandAlert extends ZkIntegrationTestBase {
     public void doTransition(Message message, NotificationContext context) {
       HelixManager manager = context.getManager();
       HelixDataAccessor accessor = manager.getHelixDataAccessor();
-      String fromState = message.getFromState();
-      String toState = message.getToState();
+      String fromState = message.getFromStateString();
+      String toState = message.getToStateString();
       String instance = message.getTgtName();
       String partition = message.getPartitionName();
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/healthcheck/TestSimpleAlert.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/healthcheck/TestSimpleAlert.java b/helix-core/src/test/java/org/apache/helix/healthcheck/TestSimpleAlert.java
index 1db5ddd..f5eb13c 100644
--- a/helix-core/src/test/java/org/apache/helix/healthcheck/TestSimpleAlert.java
+++ b/helix-core/src/test/java/org/apache/helix/healthcheck/TestSimpleAlert.java
@@ -82,8 +82,8 @@ public class TestSimpleAlert extends ZkIntegrationTestBase {
     public void doTransition(Message message, NotificationContext context) {
       HelixManager manager = context.getManager();
       HelixDataAccessor accessor = manager.getHelixDataAccessor();
-      String fromState = message.getFromState();
-      String toState = message.getToState();
+      String fromState = message.getFromStateString();
+      String toState = message.getToStateString();
       String instance = message.getTgtName();
       String partition = message.getPartitionName();
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/healthcheck/TestSimpleWildcardAlert.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/healthcheck/TestSimpleWildcardAlert.java b/helix-core/src/test/java/org/apache/helix/healthcheck/TestSimpleWildcardAlert.java
index c5b55da..9e7077e 100644
--- a/helix-core/src/test/java/org/apache/helix/healthcheck/TestSimpleWildcardAlert.java
+++ b/helix-core/src/test/java/org/apache/helix/healthcheck/TestSimpleWildcardAlert.java
@@ -81,8 +81,8 @@ public class TestSimpleWildcardAlert extends ZkIntegrationTestBase {
     public void doTransition(Message message, NotificationContext context) {
       HelixManager manager = context.getManager();
       HelixDataAccessor accessor = manager.getHelixDataAccessor();
-      String fromState = message.getFromState();
-      String toState = message.getToState();
+      String fromState = message.getFromStateString();
+      String toState = message.getToStateString();
       String instance = message.getTgtName();
       String partition = message.getPartitionName();
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/healthcheck/TestStalenessAlert.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/healthcheck/TestStalenessAlert.java b/helix-core/src/test/java/org/apache/helix/healthcheck/TestStalenessAlert.java
index 2304b41..36cd9f5 100644
--- a/helix-core/src/test/java/org/apache/helix/healthcheck/TestStalenessAlert.java
+++ b/helix-core/src/test/java/org/apache/helix/healthcheck/TestStalenessAlert.java
@@ -75,8 +75,8 @@ public class TestStalenessAlert extends ZkIntegrationTestBase {
     public void doTransition(Message message, NotificationContext context) {
       HelixManager manager = context.getManager();
       HelixDataAccessor accessor = manager.getHelixDataAccessor();
-      String fromState = message.getFromState();
-      String toState = message.getToState();
+      String fromState = message.getFromStateString();
+      String toState = message.getToStateString();
       String instance = message.getTgtName();
       String partition = message.getPartitionName();
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/healthcheck/TestWildcardAlert.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/healthcheck/TestWildcardAlert.java b/helix-core/src/test/java/org/apache/helix/healthcheck/TestWildcardAlert.java
index a0456a7..a33e75c 100644
--- a/helix-core/src/test/java/org/apache/helix/healthcheck/TestWildcardAlert.java
+++ b/helix-core/src/test/java/org/apache/helix/healthcheck/TestWildcardAlert.java
@@ -151,8 +151,8 @@ public class TestWildcardAlert extends ZkIntegrationTestBase {
     public void doTransition(Message message, NotificationContext context) {
       HelixManager manager = context.getManager();
       HelixDataAccessor accessor = manager.getHelixDataAccessor();
-      String fromState = message.getFromState();
-      String toState = message.getToState();
+      String fromState = message.getFromStateString();
+      String toState = message.getToStateString();
       String instance = message.getTgtName();
       String partition = message.getPartitionName();
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/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 1943364..f873b0e 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
@@ -264,7 +264,7 @@ public class TestAutoRebalance extends ZkStandAloneCMTestBaseWithPropertyServerC
       cache.refresh(accessor);
       String masterValue =
           cache.getStateModelDef(cache.getIdealState(_resourceName).getStateModelDefRef())
-              .getStatesPriorityList().get(0);
+              .getStatesPriorityStringList().get(0);
       int replicas = Integer.parseInt(cache.getIdealState(_resourceName).getReplicas());
       String instanceGroupTag = cache.getIdealState(_resourceName).getInstanceGroupTag();
       int instances = 0;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestAutoRebalancePartitionLimit.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestAutoRebalancePartitionLimit.java b/helix-core/src/test/java/org/apache/helix/integration/TestAutoRebalancePartitionLimit.java
index 32cafcf..2d16e61 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestAutoRebalancePartitionLimit.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestAutoRebalancePartitionLimit.java
@@ -98,11 +98,11 @@ public class TestAutoRebalancePartitionLimit extends ZkStandAloneCMTestBaseWithP
         Assert.assertTrue(result);
         ExternalView ev =
             manager.getHelixDataAccessor().getProperty(accessor.keyBuilder().externalView(TEST_DB));
-        System.out.println(ev.getPartitionSet().size());
+        System.out.println(ev.getPartitionStringSet().size());
         if (i < 3) {
-          Assert.assertEquals(ev.getPartitionSet().size(), 25 * (i + 1));
+          Assert.assertEquals(ev.getPartitionStringSet().size(), 25 * (i + 1));
         } else {
-          Assert.assertEquals(ev.getPartitionSet().size(), 100);
+          Assert.assertEquals(ev.getPartitionStringSet().size(), 100);
         }
       }
     }
@@ -132,7 +132,7 @@ public class TestAutoRebalancePartitionLimit extends ZkStandAloneCMTestBaseWithP
     HelixDataAccessor accessor = manager.getHelixDataAccessor();
     ExternalView ev =
         manager.getHelixDataAccessor().getProperty(accessor.keyBuilder().externalView(TEST_DB));
-    Assert.assertEquals(ev.getPartitionSet().size(), 100);
+    Assert.assertEquals(ev.getPartitionStringSet().size(), 100);
 
     instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + 1);
     _startCMResultMap.get(instanceName)._manager.disconnect();
@@ -145,7 +145,7 @@ public class TestAutoRebalancePartitionLimit extends ZkStandAloneCMTestBaseWithP
             CLUSTER_NAME, TEST_DB));
     Assert.assertTrue(result);
     ev = manager.getHelixDataAccessor().getProperty(accessor.keyBuilder().externalView(TEST_DB));
-    Assert.assertEquals(ev.getPartitionSet().size(), 75);
+    Assert.assertEquals(ev.getPartitionStringSet().size(), 75);
 
     // add 2 nodes
     for (int i = 0; i < 2; i++) {
@@ -231,7 +231,7 @@ public class TestAutoRebalancePartitionLimit extends ZkStandAloneCMTestBaseWithP
       cache.refresh(accessor);
       String masterValue =
           cache.getStateModelDef(cache.getIdealState(_resourceName).getStateModelDefRef())
-              .getStatesPriorityList().get(0);
+              .getStatesPriorityStringList().get(0);
       int replicas = Integer.parseInt(cache.getIdealState(_resourceName).getReplicas());
       return verifyBalanceExternalView(accessor.getProperty(keyBuilder.externalView(_resourceName))
           .getRecord(), numberOfPartitions, masterValue, replicas, cache.getLiveInstances().size(),

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestCleanupExternalView.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestCleanupExternalView.java b/helix-core/src/test/java/org/apache/helix/integration/TestCleanupExternalView.java
index 781aa89..d3ac8ac 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestCleanupExternalView.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestCleanupExternalView.java
@@ -94,10 +94,10 @@ public class TestCleanupExternalView extends ZkUnitTestBase {
 
     // System.out.println("remove current-state");
     LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance("localhost_12918"));
-    accessor.removeProperty(keyBuilder.currentState("localhost_12918", liveInstance.getSessionId(),
+    accessor.removeProperty(keyBuilder.currentState("localhost_12918", liveInstance.getSessionIdString(),
         "TestDB0"));
     liveInstance = accessor.getProperty(keyBuilder.liveInstance("localhost_12919"));
-    accessor.removeProperty(keyBuilder.currentState("localhost_12919", liveInstance.getSessionId(),
+    accessor.removeProperty(keyBuilder.currentState("localhost_12919", liveInstance.getSessionIdString(),
         "TestDB0"));
 
     // re-enable controller shall remove orphan external-view

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestCustomizedIdealStateRebalancer.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestCustomizedIdealStateRebalancer.java b/helix-core/src/test/java/org/apache/helix/integration/TestCustomizedIdealStateRebalancer.java
index 55fc876..aba14a7 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestCustomizedIdealStateRebalancer.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestCustomizedIdealStateRebalancer.java
@@ -78,7 +78,7 @@ public class TestCustomizedIdealStateRebalancer extends
         int nodeIndex = i % liveInstances.size();
         currentIdealState.getInstanceStateMap(partitionName).clear();
         currentIdealState.getInstanceStateMap(partitionName).put(liveInstances.get(nodeIndex),
-            stateModelDef.getStatesPriorityList().get(0));
+            stateModelDef.getStatesPriorityStringList().get(0));
         resourceMapping.addReplicaMap(partition,
             currentIdealState.getInstanceStateMap(partitionName));
         i++;
@@ -108,12 +108,12 @@ public class TestCustomizedIdealStateRebalancer extends
         new ZKHelixDataAccessor(CLUSTER_NAME, new ZkBaseDataAccessor(_zkClient));
     Builder keyBuilder = accessor.keyBuilder();
     ExternalView ev = accessor.getProperty(keyBuilder.externalView(db2));
-    Assert.assertEquals(ev.getPartitionSet().size(), 60);
-    for (String partition : ev.getPartitionSet()) {
+    Assert.assertEquals(ev.getPartitionStringSet().size(), 60);
+    for (String partition : ev.getPartitionStringSet()) {
       Assert.assertEquals(ev.getStateMap(partition).size(), 1);
     }
     IdealState is = accessor.getProperty(keyBuilder.idealStates(db2));
-    for (String partition : is.getPartitionSet()) {
+    for (String partition : is.getPartitionStringSet()) {
       Assert.assertEquals(is.getPreferenceList(partition).size(), 0);
       Assert.assertEquals(is.getInstanceStateMap(partition).size(), 0);
     }
@@ -145,7 +145,7 @@ public class TestCustomizedIdealStateRebalancer extends
         cache.refresh(accessor);
         String masterValue =
             cache.getStateModelDef(cache.getIdealState(_resourceName).getStateModelDefRef())
-                .getStatesPriorityList().get(0);
+                .getStatesPriorityStringList().get(0);
         int replicas = Integer.parseInt(cache.getIdealState(_resourceName).getReplicas());
         String instanceGroupTag = cache.getIdealState(_resourceName).getInstanceGroupTag();
         int instances = 0;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestDrop.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestDrop.java b/helix-core/src/test/java/org/apache/helix/integration/TestDrop.java
index b1fcc60..84e70ef 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestDrop.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestDrop.java
@@ -353,7 +353,7 @@ public class TestDrop extends ZkIntegrationTestBase {
     ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, baseAccessor);
     Builder keyBuilder = accessor.keyBuilder();
     ExternalView extView = accessor.getProperty(keyBuilder.externalView("schemata"));
-    Assert.assertEquals(extView.getPartitionSet().size(), 0,
+    Assert.assertEquals(extView.getPartitionStringSet().size(), 0,
         "schemata externalView should be empty but was \"" + extView + "\"");
 
     // clean up

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestEnablePartitionDuringDisable.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestEnablePartitionDuringDisable.java b/helix-core/src/test/java/org/apache/helix/integration/TestEnablePartitionDuringDisable.java
index 48cabbd..507a355 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestEnablePartitionDuringDisable.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestEnablePartitionDuringDisable.java
@@ -50,8 +50,8 @@ public class TestEnablePartitionDuringDisable extends ZkIntegrationTestBase {
 
       String instance = message.getTgtName();
       String partitionName = message.getPartitionName();
-      String fromState = message.getFromState();
-      String toState = message.getToState();
+      String fromState = message.getFromStateString();
+      String toState = message.getToStateString();
       if (instance.equals("localhost_12919") && partitionName.equals("TestDB0_0")) {
         if (fromState.equals("SLAVE") && toState.equals("OFFLINE")) {
           slaveToOfflineCnt++;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestHelixInstanceTag.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestHelixInstanceTag.java b/helix-core/src/test/java/org/apache/helix/integration/TestHelixInstanceTag.java
index 4484386..69b45da 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestHelixInstanceTag.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestHelixInstanceTag.java
@@ -56,7 +56,7 @@ public class TestHelixInstanceTag extends ZkStandAloneCMTestBase {
 
     ExternalView ev = accessor.getProperty(accessor.keyBuilder().externalView(DB2));
     Set<String> hosts = new HashSet<String>();
-    for (String p : ev.getPartitionSet()) {
+    for (String p : ev.getPartitionStringSet()) {
       for (String hostName : ev.getStateMap(p).keySet()) {
         InstanceConfig config =
             accessor.getProperty(accessor.keyBuilder().instanceConfig(hostName));
@@ -85,7 +85,7 @@ public class TestHelixInstanceTag extends ZkStandAloneCMTestBase {
 
     ev = accessor.getProperty(accessor.keyBuilder().externalView(DB3));
     hosts = new HashSet<String>();
-    for (String p : ev.getPartitionSet()) {
+    for (String p : ev.getPartitionStringSet()) {
       for (String hostName : ev.getStateMap(p).keySet()) {
         InstanceConfig config =
             accessor.getProperty(accessor.keyBuilder().instanceConfig(hostName));

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestMessagePartitionStateMismatch.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestMessagePartitionStateMismatch.java b/helix-core/src/test/java/org/apache/helix/integration/TestMessagePartitionStateMismatch.java
index 487e689..0d47bef 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestMessagePartitionStateMismatch.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestMessagePartitionStateMismatch.java
@@ -47,8 +47,8 @@ public class TestMessagePartitionStateMismatch extends ZkStandAloneCMTestBase {
         accessor.getChildValuesMap(accessor.keyBuilder().liveInstances());
 
     for (String instanceName : liveinstanceMap.keySet()) {
-      String sessionid = liveinstanceMap.get(instanceName).getSessionId();
-      for (String partition : ev.getPartitionSet()) {
+      String sessionid = liveinstanceMap.get(instanceName).getSessionIdString();
+      for (String partition : ev.getPartitionStringSet()) {
         if (ev.getStateMap(partition).containsKey(instanceName)) {
           String uuid = UUID.randomUUID().toString();
           Message message = new Message(MessageType.STATE_TRANSITION, uuid);
@@ -78,7 +78,7 @@ public class TestMessagePartitionStateMismatch extends ZkStandAloneCMTestBase {
             message.setStateModelDef("MasterSlave");
             message.setStateModelFactoryName("DEFAULT");
           }
-          accessor.setProperty(accessor.keyBuilder().message(instanceName, message.getMsgId()),
+          accessor.setProperty(accessor.keyBuilder().message(instanceName, message.getMsgIdString()),
               message);
         }
       }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestMessagingService.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestMessagingService.java b/helix-core/src/test/java/org/apache/helix/integration/TestMessagingService.java
index 2354ebd..b711e9e 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestMessagingService.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestMessagingService.java
@@ -67,7 +67,7 @@ public class TestMessagingService extends ZkStandAloneCMTestBaseWithPropertyServ
         HelixTaskResult result = new HelixTaskResult();
         result.setSuccess(true);
         Thread.sleep(1000);
-        System.out.println("TestMessagingHandler " + _message.getMsgId());
+        System.out.println("TestMessagingHandler " + _message.getMsgIdString());
         _processedMsgIds.add(_message.getRecord().getSimpleField("TestMessagingPara"));
         result.getTaskResultMap().put("ReplyMessage", "TestReplyMessage");
         return result;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestResetPartitionState.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestResetPartitionState.java b/helix-core/src/test/java/org/apache/helix/integration/TestResetPartitionState.java
index 09e57c6..c34281a 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestResetPartitionState.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestResetPartitionState.java
@@ -52,8 +52,8 @@ public class TestResetPartitionState extends ZkIntegrationTestBase {
     public void doTransition(Message message, NotificationContext context) {
       // System.err.println("doReset() invoked");
       super.doTransition(message, context);
-      String fromState = message.getFromState();
-      String toState = message.getToState();
+      String fromState = message.getFromStateString();
+      String toState = message.getToStateString();
       if (fromState.equals("ERROR") && toState.equals("OFFLINE")) {
         _errToOfflineInvoked++;
       }
@@ -189,7 +189,7 @@ public class TestResetPartitionState extends ZkIntegrationTestBase {
     Builder keyBuilder = accessor.keyBuilder();
 
     LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance(instance));
-    accessor.removeProperty(keyBuilder.stateTransitionStatus(instance, liveInstance.getSessionId(),
+    accessor.removeProperty(keyBuilder.stateTransitionStatus(instance, liveInstance.getSessionIdString(),
         resource, partition));
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java b/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
index 2c174c4..6c3716a 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
@@ -114,13 +114,13 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBaseWithPropertyServ
         HelixTaskResult result = new HelixTaskResult();
         result.setSuccess(true);
         String destName = _message.getTgtName();
-        result.getTaskResultMap().put("Message", _message.getMsgId());
+        result.getTaskResultMap().put("Message", _message.getMsgIdString());
         synchronized (_results) {
           if (!_results.containsKey(_message.getPartitionName())) {
             _results.put(_message.getPartitionName(), new ConcurrentSkipListSet<String>());
           }
         }
-        _results.get(_message.getPartitionName()).add(_message.getMsgId());
+        _results.get(_message.getPartitionName()).add(_message.getMsgIdString());
         // System.err.println("Message " + _message.getMsgId() + " executed");
         return result;
       }
@@ -169,7 +169,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBaseWithPropertyServ
         _latch.await();
         HelixTaskResult result = new HelixTaskResult();
         result.setSuccess(true);
-        result.getTaskResultMap().put("Message", _message.getMsgId());
+        result.getTaskResultMap().put("Message", _message.getMsgIdString());
         String destName = _message.getTgtName();
         synchronized (_results) {
           if (!_results.containsKey(_message.getPartitionName())) {
@@ -236,7 +236,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBaseWithPropertyServ
 
     HelixDataAccessor helixDataAccessor = manager.getHelixDataAccessor();
     Builder keyBuilder = helixDataAccessor.keyBuilder();
-    helixDataAccessor.createProperty(keyBuilder.controllerMessage(schedulerMessage.getMsgId()),
+    helixDataAccessor.createProperty(keyBuilder.controllerMessage(schedulerMessage.getMsgIdString()),
         schedulerMessage);
 
     for (int i = 0; i < 30; i++) {
@@ -249,7 +249,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBaseWithPropertyServ
     Assert.assertEquals(_PARTITIONS, _factory._results.size());
     PropertyKey controllerTaskStatus =
         keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(),
-            schedulerMessage.getMsgId());
+            schedulerMessage.getMsgIdString());
 
     int messageResultCount = 0;
     for (int i = 0; i < 10; i++) {
@@ -324,7 +324,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBaseWithPropertyServ
 
     HelixDataAccessor helixDataAccessor = manager.getHelixDataAccessor();
     Builder keyBuilder = helixDataAccessor.keyBuilder();
-    helixDataAccessor.createProperty(keyBuilder.controllerMessage(schedulerMessage.getMsgId()),
+    helixDataAccessor.createProperty(keyBuilder.controllerMessage(schedulerMessage.getMsgIdString()),
         schedulerMessage);
 
     for (int i = 0; i < 30; i++) {
@@ -337,7 +337,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBaseWithPropertyServ
     Assert.assertEquals(_PARTITIONS, _factory._results.size());
     PropertyKey controllerTaskStatus =
         keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(),
-            schedulerMessage.getMsgId());
+            schedulerMessage.getMsgIdString());
 
     int messageResultCount = 0;
     for (int i = 0; i < 10; i++) {
@@ -552,7 +552,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBaseWithPropertyServ
 
     HelixDataAccessor helixDataAccessor = manager.getHelixDataAccessor();
     Builder keyBuilder = helixDataAccessor.keyBuilder();
-    PropertyKey controllerMessageKey = keyBuilder.controllerMessage(schedulerMessage.getMsgId());
+    PropertyKey controllerMessageKey = keyBuilder.controllerMessage(schedulerMessage.getMsgIdString());
     helixDataAccessor.setProperty(controllerMessageKey, schedulerMessage);
 
     Thread.sleep(3000);
@@ -560,7 +560,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBaseWithPropertyServ
     Assert.assertEquals(0, factory._results.size());
     PropertyKey controllerTaskStatus =
         keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(),
-            schedulerMessage.getMsgId());
+            schedulerMessage.getMsgIdString());
     for (int i = 0; i < 10; i++) {
       StatusUpdate update = helixDataAccessor.getProperty(controllerTaskStatus);
       if (update == null || update.getRecord().getMapField("SentMessageCount") == null) {

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestStateTransitionTimeout.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestStateTransitionTimeout.java b/helix-core/src/test/java/org/apache/helix/integration/TestStateTransitionTimeout.java
index edc10c6..7500003 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestStateTransitionTimeout.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestStateTransitionTimeout.java
@@ -28,14 +28,13 @@ import java.util.Set;
 
 import org.apache.helix.HelixDataAccessor;
 import org.apache.helix.NotificationContext;
-import org.apache.helix.TestHelper;
 import org.apache.helix.PropertyKey.Builder;
+import org.apache.helix.TestHelper;
 import org.apache.helix.TestHelper.StartCMResult;
 import org.apache.helix.controller.HelixControllerMain;
 import org.apache.helix.manager.zk.ZNRecordSerializer;
 import org.apache.helix.manager.zk.ZkClient;
 import org.apache.helix.messaging.handling.MessageHandler.ErrorCode;
-import org.apache.helix.mock.participant.MockJobIntf;
 import org.apache.helix.mock.participant.MockMSStateModel;
 import org.apache.helix.mock.participant.MockParticipant;
 import org.apache.helix.mock.participant.MockTransition;
@@ -43,7 +42,6 @@ import org.apache.helix.mock.participant.SleepTransition;
 import org.apache.helix.model.ExternalView;
 import org.apache.helix.model.IdealState;
 import org.apache.helix.model.Message;
-import org.apache.helix.participant.statemachine.StateModel;
 import org.apache.helix.participant.statemachine.StateModelFactory;
 import org.apache.helix.participant.statemachine.StateModelInfo;
 import org.apache.helix.participant.statemachine.StateTransitionError;
@@ -178,7 +176,7 @@ public class TestStateTransitionTimeout extends ZkStandAloneCMTestBase {
       String instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + i);
       SleepStateModelFactory factory = new SleepStateModelFactory(1000);
       factories.put(instanceName, factory);
-      for (String p : idealState.getPartitionSet()) {
+      for (String p : idealState.getPartitionStringSet()) {
         if (idealState.getPreferenceList(p).get(0).equals(instanceName)) {
           factory.addPartition(p);
         }
@@ -200,7 +198,7 @@ public class TestStateTransitionTimeout extends ZkStandAloneCMTestBase {
 
     Builder kb = accessor.keyBuilder();
     ExternalView ev = accessor.getProperty(kb.externalView(TEST_DB));
-    for (String p : idealState.getPartitionSet()) {
+    for (String p : idealState.getPartitionStringSet()) {
       String idealMaster = idealState.getPreferenceList(p).get(0);
       Assert.assertTrue(ev.getStateMap(p).get(idealMaster).equals("ERROR"));
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/integration/TestStatusUpdate.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestStatusUpdate.java b/helix-core/src/test/java/org/apache/helix/integration/TestStatusUpdate.java
index 4b92670..f59ca1d 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestStatusUpdate.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestStatusUpdate.java
@@ -49,7 +49,7 @@ public class TestStatusUpdate extends ZkStandAloneCMTestBase {
 
     for (ExternalView extView : extViews) {
       String resourceName = extView.getResourceName();
-      Set<String> partitionSet = extView.getPartitionSet();
+      Set<String> partitionSet = extView.getPartitionStringSet();
       for (String partition : partitionSet) {
         Map<String, String> stateMap = extView.getStateMap(partition);
         for (String instance : stateMap.keySet()) {

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkClusterManager.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkClusterManager.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkClusterManager.java
index 7809711..3dc0564 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkClusterManager.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkClusterManager.java
@@ -191,7 +191,7 @@ public class TestZkClusterManager extends ZkUnitTestBase {
     Assert.assertTrue(liveInstance.getRecord().getListFields().size() == 1);
     Assert.assertTrue(liveInstance.getRecord().getMapFields().size() == 1);
     Assert.assertTrue(liveInstance.getRecord().getSimpleFields().size() == 5);
-    Assert.assertFalse(liveInstance.getSessionId().equals("value"));
+    Assert.assertFalse(liveInstance.getSessionIdString().equals("value"));
     Assert.assertFalse(liveInstance.getLiveInstance().equals("value"));
 
     // //////////////////////////////////
@@ -207,9 +207,9 @@ public class TestZkClusterManager extends ZkUnitTestBase {
     Assert.assertTrue(liveInstance.getRecord().getListFields().size() == 1);
     Assert.assertTrue(liveInstance.getRecord().getMapFields().size() == 1);
     Assert.assertTrue(liveInstance.getRecord().getSimpleFields().size() == 5);
-    Assert.assertFalse(liveInstance.getSessionId().equals("value"));
+    Assert.assertFalse(liveInstance.getSessionIdString().equals("value"));
     Assert.assertFalse(liveInstance.getLiveInstance().equals("value"));
-    String sessionId = liveInstance.getSessionId();
+    String sessionId = liveInstance.getSessionIdString();
 
     ZkTestHelper.expireSession(manager2.getZkClient());
     Thread.sleep(1000);
@@ -218,9 +218,9 @@ public class TestZkClusterManager extends ZkUnitTestBase {
     Assert.assertTrue(liveInstance.getRecord().getListFields().size() == 1);
     Assert.assertTrue(liveInstance.getRecord().getMapFields().size() == 1);
     Assert.assertTrue(liveInstance.getRecord().getSimpleFields().size() == 5);
-    Assert.assertFalse(liveInstance.getSessionId().equals("value"));
+    Assert.assertFalse(liveInstance.getSessionIdString().equals("value"));
     Assert.assertFalse(liveInstance.getLiveInstance().equals("value"));
-    Assert.assertFalse(sessionId.equals(liveInstance.getSessionId()));
+    Assert.assertFalse(sessionId.equals(liveInstance.getSessionIdString()));
 
     System.out.println("END " + className + ".testLiveInstanceInfoProvider() at "
         + new Date(System.currentTimeMillis()));

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/messaging/TestAsyncCallbackSvc.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/messaging/TestAsyncCallbackSvc.java b/helix-core/src/test/java/org/apache/helix/messaging/TestAsyncCallbackSvc.java
index 2be955f..9f039d4 100644
--- a/helix-core/src/test/java/org/apache/helix/messaging/TestAsyncCallbackSvc.java
+++ b/helix-core/src/test/java/org/apache/helix/messaging/TestAsyncCallbackSvc.java
@@ -59,7 +59,7 @@ public class TestAsyncCallbackSvc {
     @Override
     public void onReplyMessage(Message message) {
       // TODO Auto-generated method stub
-      _repliedMessageId.add(message.getMsgId());
+      _repliedMessageId.add(message.getMsgIdString());
     }
 
   }
@@ -77,14 +77,14 @@ public class TestAsyncCallbackSvc {
     try {
       MessageHandler aHandler = svc.createHandler(msg, changeContext);
     } catch (HelixException e) {
-      AssertJUnit.assertTrue(e.getMessage().indexOf(msg.getMsgId()) != -1);
+      AssertJUnit.assertTrue(e.getMessage().indexOf(msg.getMsgIdString()) != -1);
     }
     Message msg2 = new Message("RandomType", UUID.randomUUID().toString());
     msg2.setTgtSessionId(manager.getSessionId());
     try {
       MessageHandler aHandler = svc.createHandler(msg2, changeContext);
     } catch (HelixException e) {
-      AssertJUnit.assertTrue(e.getMessage().indexOf(msg2.getMsgId()) != -1);
+      AssertJUnit.assertTrue(e.getMessage().indexOf(msg2.getMsgIdString()) != -1);
     }
     Message msg3 = new Message(svc.getMessageType(), UUID.randomUUID().toString());
     msg3.setTgtSessionId(manager.getSessionId());
@@ -92,7 +92,7 @@ public class TestAsyncCallbackSvc {
     try {
       MessageHandler aHandler = svc.createHandler(msg3, changeContext);
     } catch (HelixException e) {
-      AssertJUnit.assertTrue(e.getMessage().indexOf(msg3.getMsgId()) != -1);
+      AssertJUnit.assertTrue(e.getMessage().indexOf(msg3.getMsgIdString()) != -1);
     }
 
     TestAsyncCallback callback = new TestAsyncCallback();
@@ -113,6 +113,6 @@ public class TestAsyncCallbackSvc {
     aHandler.handleMessage();
 
     AssertJUnit.assertTrue(callback.isDone());
-    AssertJUnit.assertTrue(callback._repliedMessageId.contains(msg.getMsgId()));
+    AssertJUnit.assertTrue(callback._repliedMessageId.contains(msg.getMsgIdString()));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/messaging/handling/TestHelixTaskExecutor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/messaging/handling/TestHelixTaskExecutor.java b/helix-core/src/test/java/org/apache/helix/messaging/handling/TestHelixTaskExecutor.java
index 1ff6595..6c1f9fc 100644
--- a/helix-core/src/test/java/org/apache/helix/messaging/handling/TestHelixTaskExecutor.java
+++ b/helix-core/src/test/java/org/apache/helix/messaging/handling/TestHelixTaskExecutor.java
@@ -60,7 +60,7 @@ public class TestHelixTaskExecutor {
       @Override
       public HelixTaskResult handleMessage() throws InterruptedException {
         HelixTaskResult result = new HelixTaskResult();
-        _processedMsgIds.put(_message.getMsgId(), _message.getMsgId());
+        _processedMsgIds.put(_message.getMsgIdString(), _message.getMsgIdString());
         Thread.sleep(100);
         result.setSuccess(true);
         return result;
@@ -127,14 +127,14 @@ public class TestHelixTaskExecutor {
         if (_message.getRecord().getSimpleFields().containsKey("Cancelcount")) {
           sleepTimes = 10;
         }
-        _processingMsgIds.put(_message.getMsgId(), _message.getMsgId());
+        _processingMsgIds.put(_message.getMsgIdString(), _message.getMsgIdString());
         try {
           for (int i = 0; i < sleepTimes; i++) {
             Thread.sleep(100);
           }
         } catch (InterruptedException e) {
           _interrupted = true;
-          _timedOutMsgIds.put(_message.getMsgId(), "");
+          _timedOutMsgIds.put(_message.getMsgIdString(), "");
           result.setInterrupted(true);
           if (!_message.getRecord().getSimpleFields().containsKey("Cancelcount")) {
             _message.getRecord().setSimpleField("Cancelcount", "1");
@@ -144,7 +144,7 @@ public class TestHelixTaskExecutor {
           }
           throw e;
         }
-        _processedMsgIds.put(_message.getMsgId(), _message.getMsgId());
+        _processedMsgIds.put(_message.getMsgIdString(), _message.getMsgIdString());
         result.setSuccess(true);
         return result;
       }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/mock/participant/ErrTransition.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/mock/participant/ErrTransition.java b/helix-core/src/test/java/org/apache/helix/mock/participant/ErrTransition.java
index 301cd62..0fddcbf 100644
--- a/helix-core/src/test/java/org/apache/helix/mock/participant/ErrTransition.java
+++ b/helix-core/src/test/java/org/apache/helix/mock/participant/ErrTransition.java
@@ -46,8 +46,8 @@ public class ErrTransition extends MockTransition {
 
   @Override
   public void doTransition(Message message, NotificationContext context) {
-    String fromState = message.getFromState();
-    String toState = message.getToState();
+    String fromState = message.getFromStateString();
+    String toState = message.getToStateString();
     String partition = message.getPartitionName();
 
     String key = (fromState + "-" + toState).toUpperCase();

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-core/src/test/java/org/apache/helix/tools/TestHelixAdminCli.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/tools/TestHelixAdminCli.java b/helix-core/src/test/java/org/apache/helix/tools/TestHelixAdminCli.java
index c58f94d..1f28f4b 100644
--- a/helix-core/src/test/java/org/apache/helix/tools/TestHelixAdminCli.java
+++ b/helix-core/src/test/java/org/apache/helix/tools/TestHelixAdminCli.java
@@ -652,7 +652,7 @@ public class TestHelixAdminCli extends ZkIntegrationTestBase {
 
     IdealState dbIs = accessor.getProperty(accessor.keyBuilder().idealStates("db_11"));
     Set<String> hosts = new HashSet<String>();
-    for (String p : dbIs.getPartitionSet()) {
+    for (String p : dbIs.getPartitionStringSet()) {
       for (String hostName : dbIs.getInstanceStateMap(p).keySet()) {
         InstanceConfig config =
             accessor.getProperty(accessor.keyBuilder().instanceConfig(hostName));
@@ -674,7 +674,7 @@ public class TestHelixAdminCli extends ZkIntegrationTestBase {
 
     dbIs = accessor.getProperty(accessor.keyBuilder().idealStates("db_11"));
     hosts = new HashSet<String>();
-    for (String p : dbIs.getPartitionSet()) {
+    for (String p : dbIs.getPartitionStringSet()) {
       for (String hostName : dbIs.getInstanceStateMap(p).keySet()) {
         InstanceConfig config =
             accessor.getProperty(accessor.keyBuilder().instanceConfig(hostName));
@@ -702,7 +702,7 @@ public class TestHelixAdminCli extends ZkIntegrationTestBase {
     ClusterSetup.processCommandLineArgs(command.split("\\s+"));
     dbIs = accessor.getProperty(accessor.keyBuilder().idealStates("db_11"));
     hosts = new HashSet<String>();
-    for (String p : dbIs.getPartitionSet()) {
+    for (String p : dbIs.getPartitionStringSet()) {
       for (String hostName : dbIs.getInstanceStateMap(p).keySet()) {
         InstanceConfig config =
             accessor.getProperty(accessor.keyBuilder().instanceConfig(hostName));

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/433b0011/helix-examples/src/main/config/log4j.properties
----------------------------------------------------------------------
diff --git a/helix-examples/src/main/config/log4j.properties b/helix-examples/src/main/config/log4j.properties
new file mode 100644
index 0000000..4b3dc31
--- /dev/null
+++ b/helix-examples/src/main/config/log4j.properties
@@ -0,0 +1,31 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=ERROR,A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+
+log4j.logger.org.I0Itec=ERROR
+log4j.logger.org.apache=ERROR


Mime
View raw message