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: EAGLE-758: Add tuple log for spout & alert bolt
Date Wed, 09 Nov 2016 07:16:18 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master 1d549abbe -> 81114c3b5


EAGLE-758: Add tuple log for spout & alert bolt

Author: Li, Garrett
Reviewer: ralphsu

This closes #631


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

Branch: refs/heads/master
Commit: 81114c3b50ca5186c8e661c5dcd066a92acb82fe
Parents: 1d549ab
Author: Xiancheng Li <xiancheng.li@ebay.com>
Authored: Wed Nov 9 14:54:30 2016 +0800
Committer: Ralph, Su <suliangfei@gmail.com>
Committed: Wed Nov 9 15:17:50 2016 +0800

----------------------------------------------------------------------
 .../eagle/alert/engine/runner/AlertBolt.java     | 19 ++++++++++---------
 .../spout/SpoutOutputCollectorWrapper.java       |  4 +++-
 2 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/81114c3b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/runner/AlertBolt.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/runner/AlertBolt.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/runner/AlertBolt.java
index d85f76b..bdd9a99 100755
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/runner/AlertBolt.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/runner/AlertBolt.java
@@ -16,7 +16,11 @@
  */
 package org.apache.eagle.alert.engine.runner;
 
-import backtype.storm.metric.api.IMetric;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+
 import org.apache.eagle.alert.coordination.model.AlertBoltSpec;
 import org.apache.eagle.alert.coordination.model.WorkSlot;
 import org.apache.eagle.alert.engine.AlertStreamCollector;
@@ -35,6 +39,10 @@ import org.apache.eagle.alert.engine.utils.SingletonExecutor;
 import org.apache.eagle.alert.service.IMetadataServiceClient;
 import org.apache.eagle.alert.service.MetadataServiceClientImpl;
 import org.apache.eagle.alert.utils.AlertConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.typesafe.config.Config;
 
 import backtype.storm.metric.api.MultiCountMetric;
 import backtype.storm.task.OutputCollector;
@@ -42,14 +50,6 @@ import backtype.storm.task.TopologyContext;
 import backtype.storm.topology.OutputFieldsDeclarer;
 import backtype.storm.tuple.Fields;
 import backtype.storm.tuple.Tuple;
-import com.typesafe.config.Config;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ExecutorService;
 
 /**
  * Since 5/1/16.
@@ -81,6 +81,7 @@ public class AlertBolt extends AbstractStreamBolt implements AlertBoltSpecListen
         this.streamContext.counter().scope("execute_count").incr();
         try {
             PartitionedEvent pe = deserialize(input.getValueByField(AlertConstants.FIELD_0));
+            LOG.info("Alert bolt {} received event: {}", boltId, pe.getEvent());
             String streamEventVersion = pe.getEvent().getMetaVersion();
 
             if (streamEventVersion == null) {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/81114c3b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/SpoutOutputCollectorWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/SpoutOutputCollectorWrapper.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/SpoutOutputCollectorWrapper.java
index 4545fa8..b75814e 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/SpoutOutputCollectorWrapper.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/spout/SpoutOutputCollectorWrapper.java
@@ -103,7 +103,7 @@ public class SpoutOutputCollectorWrapper extends SpoutOutputCollector
implements
          */
         List<Object> convertedTuple = converter.convert(tuple);
         if (convertedTuple == null) {
-            LOG.warn("source data {} can't be converted to a stream, ignore this message",
tuple);
+            LOG.debug("source data {} can't be converted to a stream, ignore this message",
tuple);
             spout.ack(newMessageId);
             return null;
         }
@@ -118,6 +118,8 @@ public class SpoutOutputCollectorWrapper extends SpoutOutputCollector
implements
         }
 
         StreamEvent event = convertToStreamEventByStreamDefinition((Long) convertedTuple.get(2),
m, sds.get(streamId));
+        LOG.info("Spout from topic {} emit event: {}", topic, event);
+        
         /*
             phase 2: stream repartition
         */


Mime
View raw message