storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [07/10] storm git commit: Update according to review comments
Date Thu, 10 Mar 2016 14:33:54 GMT
Update according to review comments


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/1ef010d6
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/1ef010d6
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/1ef010d6

Branch: refs/heads/master
Commit: 1ef010d699581d902f34e6e78779d42eb289333f
Parents: ee4fa72
Author: basti.lj <basti.lj@alibaba-inc.com>
Authored: Wed Mar 9 20:19:32 2016 +0800
Committer: basti.lj <basti.lj@alibaba-inc.com>
Committed: Wed Mar 9 20:19:32 2016 +0800

----------------------------------------------------------------------
 .../org/apache/storm/daemon/StormCommon.java    | 46 +++++++++++++-------
 .../storm/messaging/netty_integration_test.clj  |  1 +
 2 files changed, 31 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/1ef010d6/storm-core/src/jvm/org/apache/storm/daemon/StormCommon.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/daemon/StormCommon.java b/storm-core/src/jvm/org/apache/storm/daemon/StormCommon.java
index 7c7b3c2..85568ec 100644
--- a/storm-core/src/jvm/org/apache/storm/daemon/StormCommon.java
+++ b/storm-core/src/jvm/org/apache/storm/daemon/StormCommon.java
@@ -24,8 +24,17 @@ import org.apache.storm.Thrift;
 import org.apache.storm.cluster.IStormClusterState;
 import org.apache.storm.daemon.metrics.MetricsUtils;
 import org.apache.storm.daemon.metrics.reporters.PreparableReporter;
-import org.apache.storm.generated.*;
+import org.apache.storm.generated.Bolt;
+import org.apache.storm.generated.ComponentCommon;
+import org.apache.storm.generated.GlobalStreamId;
+import org.apache.storm.generated.Grouping;
+import org.apache.storm.generated.InvalidTopologyException;
+import org.apache.storm.generated.NodeInfo;
+import org.apache.storm.generated.SpoutSpec;
+import org.apache.storm.generated.StateSpoutSpec;
 import org.apache.storm.generated.StormBase;
+import org.apache.storm.generated.StormTopology;
+import org.apache.storm.generated.StreamInfo;
 import org.apache.storm.metric.EventLoggerBolt;
 import org.apache.storm.metric.MetricsConsumerBolt;
 import org.apache.storm.metric.SystemBolt;
@@ -40,7 +49,14 @@ import org.json.simple.JSONValue;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
 
 public class StormCommon {
     // A singleton instance allows us to mock delegated static methods in our
@@ -105,22 +121,20 @@ public class StormCommon {
         for (StormTopology._Fields field : Thrift.getTopologyFields()) {
             if (ThriftTopologyUtils.isWorkerHook(field) == false) {
                 Object value = topology.getFieldValue(field);
-                if (value != null) {
-                    Map<String, Object> componentMap = (Map<String, Object>)
value;
-                    componentIds.addAll(componentMap.keySet());
+                Map<String, Object> componentMap = (Map<String, Object>) value;
+                componentIds.addAll(componentMap.keySet());
 
-                    for (String id : componentMap.keySet()) {
-                        if (Utils.isSystemId(id)) {
-                            throw new InvalidTopologyException(id + " is not a valid component
id.");
-                        }
+                for (String id : componentMap.keySet()) {
+                    if (Utils.isSystemId(id)) {
+                        throw new InvalidTopologyException(id + " is not a valid component
id.");
                     }
-                    for (Object componentObj : componentMap.values()) {
-                        ComponentCommon common = getComponentCommon(componentObj);
-                        Set<String> streamIds = common.get_streams().keySet();
-                        for (String id : streamIds) {
-                            if (Utils.isSystemId(id)) {
-                                throw new InvalidTopologyException(id + " is not a valid
stream id.");
-                            }
+                }
+                for (Object componentObj : componentMap.values()) {
+                    ComponentCommon common = getComponentCommon(componentObj);
+                    Set<String> streamIds = common.get_streams().keySet();
+                    for (String id : streamIds) {
+                        if (Utils.isSystemId(id)) {
+                            throw new InvalidTopologyException(id + " is not a valid stream
id.");
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/storm/blob/1ef010d6/storm-core/test/clj/org/apache/storm/messaging/netty_integration_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/org/apache/storm/messaging/netty_integration_test.clj b/storm-core/test/clj/org/apache/storm/messaging/netty_integration_test.clj
index 7fffd34..6a3d3ca 100644
--- a/storm-core/test/clj/org/apache/storm/messaging/netty_integration_test.clj
+++ b/storm-core/test/clj/org/apache/storm/messaging/netty_integration_test.clj
@@ -1,3 +1,4 @@
+
 ;; 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


Mime
View raw message