eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ralp...@apache.org
Subject incubator-eagle git commit: [Fix] MultiScheme not a sub interface of scheme
Date Wed, 21 Sep 2016 22:37:31 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master 269cdcf87 -> b4bbecdc4


[Fix] MultiScheme not a sub interface of scheme


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

Branch: refs/heads/master
Commit: b4bbecdc4bc60c82dc3106b678e4abc5cc404650
Parents: 269cdcf
Author: Ralph, Su <suliangfei@gmail.com>
Authored: Wed Sep 21 15:36:30 2016 -0700
Committer: Ralph, Su <suliangfei@gmail.com>
Committed: Wed Sep 21 15:37:04 2016 -0700

----------------------------------------------------------------------
 .../org/apache/eagle/alert/engine/spout/CorrelationSpout.java | 7 +++++--
 .../org/apache/eagle/alert/engine/spout/SchemeBuilder.java    | 6 ++----
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b4bbecdc/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/CorrelationSpout.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/CorrelationSpout.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/CorrelationSpout.java
index 25c0607..6f7d9af 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/CorrelationSpout.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/CorrelationSpout.java
@@ -345,11 +345,14 @@ public class CorrelationSpout extends BaseRichSpout implements SpoutSpecListener
     }
 
     private MultiScheme createMultiScheme(Map conf, String topic, String schemeClsName) throws
Exception {
-        Scheme scheme = SchemeBuilder.buildFromClsName(schemeClsName, topic, conf);
+        Object scheme = SchemeBuilder.buildFromClsName(schemeClsName, topic, conf);
         if (scheme instanceof MultiScheme) {
             return (MultiScheme) scheme;
+        } else if (scheme instanceof  Scheme){
+            return new SchemeAsMultiScheme((Scheme)scheme);
         } else {
-            return new SchemeAsMultiScheme(scheme);
+            LOG.error("create spout scheme failed.");
+            throw new IllegalArgumentException("create spout scheme failed.");
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b4bbecdc/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/SchemeBuilder.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/SchemeBuilder.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/SchemeBuilder.java
index f1945be..440db0a 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/SchemeBuilder.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/SchemeBuilder.java
@@ -19,8 +19,6 @@
 
 package org.apache.eagle.alert.engine.spout;
 
-import backtype.storm.spout.Scheme;
-
 import java.util.Map;
 
 
@@ -32,8 +30,8 @@ import java.util.Map;
 public class SchemeBuilder {
 
     @SuppressWarnings("rawtypes")
-    public static Scheme buildFromClsName(String clsName, String topic, Map conf) throws
Exception {
+    public static Object buildFromClsName(String clsName, String topic, Map conf) throws
Exception {
         Object o = Class.forName(clsName).getConstructor(String.class, Map.class).newInstance(topic,
conf);
-        return (Scheme) o;
+        return o;
     }
 }


Mime
View raw message