incubator-s4-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kisho...@apache.org
Subject git commit: [S4-110] This change allows one to migrate existing setup to a helix setup
Date Fri, 15 Feb 2013 23:13:23 GMT
Updated Branches:
  refs/heads/S4-110-new 17d667d73 -> 8af60c83e


[S4-110] This change allows one to migrate existing setup to a helix setup


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

Branch: refs/heads/S4-110-new
Commit: 8af60c83e2b2b76dd13ce8d7d8f6db78164a8d0d
Parents: 17d667d
Author: kishoreg <kishoreg@apache.org>
Authored: Fri Feb 15 15:13:10 2013 -0800
Committer: kishoreg <kishoreg@apache.org>
Committed: Fri Feb 15 15:13:10 2013 -0800

----------------------------------------------------------------------
 .../apache/s4/comm/topology/ClusterFromHelix.java  |   14 +++++++++++---
 .../org/apache/s4/tools/helix/ClusterStatus.java   |    2 +-
 .../java/org/apache/s4/tools/helix/CreateTask.java |    2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/8af60c83/subprojects/s4-comm/src/main/java/org/apache/s4/comm/topology/ClusterFromHelix.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-comm/src/main/java/org/apache/s4/comm/topology/ClusterFromHelix.java
b/subprojects/s4-comm/src/main/java/org/apache/s4/comm/topology/ClusterFromHelix.java
index 902d202..d14bded 100644
--- a/subprojects/s4-comm/src/main/java/org/apache/s4/comm/topology/ClusterFromHelix.java
+++ b/subprojects/s4-comm/src/main/java/org/apache/s4/comm/topology/ClusterFromHelix.java
@@ -285,8 +285,11 @@ public class ClusterFromHelix extends RoutingTableProvider implements
Cluster {
                 .get().get(destinationType);
         if (typeMap == null)
             return null;
-
-        Map<Integer, Destination> streamMap = typeMap.get(streamName);
+        
+        Map<Integer, Destination> streamMap =typeMap.get("TASK");
+        if(streamMap==null){
+            streamMap = typeMap.get(streamName);
+        }
         if (streamMap == null)
             return null;
 
@@ -295,7 +298,12 @@ public class ClusterFromHelix extends RoutingTableProvider implements
Cluster {
 
     @Override
     public Integer getPartitionCount(String streamName) {
-        Integer numPartitions = partitionCountMapRef.get().get(streamName);
+        
+        Integer numPartitions;
+        numPartitions = partitionCountMapRef.get().get("TASK");
+        if(numPartitions==null){
+            numPartitions = partitionCountMapRef.get().get(streamName);
+        }
         if (numPartitions == null) {
             return -1;
         }

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/8af60c83/subprojects/s4-tools/src/main/java/org/apache/s4/tools/helix/ClusterStatus.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/helix/ClusterStatus.java
b/subprojects/s4-tools/src/main/java/org/apache/s4/tools/helix/ClusterStatus.java
index 425e4fc..47ca98d 100644
--- a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/helix/ClusterStatus.java
+++ b/subprojects/s4-tools/src/main/java/org/apache/s4/tools/helix/ClusterStatus.java
@@ -129,7 +129,7 @@ public class ClusterStatus extends S4ArgsBase {
         System.out.format("%-20s%-20s%-90s%n", inMiddle("Task Id", 20), inMiddle("Cluster",
20),
                 inMiddle("Description", 90));
         System.out.println(generateEdge(130));
-        System.out.format("%-20s%-20s%-90s%n", inMiddle(taskId, 20), inMiddle(cluster, 20),
+        System.out.format("%-20s%-40s%-90s%n", inMiddle(taskId, 40), inMiddle(cluster, 20),
                 inMiddle(streamName + " " + taskType, 90));
         System.out.println(generateEdge(130));
         HelixDataAccessor helixDataAccessor = manager.getHelixDataAccessor();

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/8af60c83/subprojects/s4-tools/src/main/java/org/apache/s4/tools/helix/CreateTask.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/helix/CreateTask.java
b/subprojects/s4-tools/src/main/java/org/apache/s4/tools/helix/CreateTask.java
index b41ae82..d6074da 100644
--- a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/helix/CreateTask.java
+++ b/subprojects/s4-tools/src/main/java/org/apache/s4/tools/helix/CreateTask.java
@@ -57,7 +57,7 @@ public class CreateTask extends S4ArgsBase {
             }
         }
         admin.rebalance(taskArgs.clusterName, taskArgs.taskId, taskArgs.numStandBys + 1,instancesInGroup);
-        logger.info("Finished setting up task:" + taskArgs.taskId + "on nodes " + instancesInGroup);
+        logger.info("Finished setting up task:" + taskArgs.taskId + " on nodes " + instancesInGroup);
     }
 
     @Parameters(commandNames = "newStreamProcessor", separators = "=", commandDescription
= "Create a new stream processor")


Mime
View raw message