eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject incubator-eagle git commit: EAGLE-609: Fix nullPointerException in DefaultDeduplicator
Date Wed, 12 Oct 2016 04:16:57 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master fc2407cd5 -> 279bc01cd


EAGLE-609: Fix nullPointerException in DefaultDeduplicator

https://issues.apache.org/jira/browse/EAGLE-609

Author: Zhao, Qingwen <qingwzhao@apache.org>

Closes #492 from qingwen220/EAGLE-609.


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

Branch: refs/heads/master
Commit: 279bc01cd6115281d44df7f81ac3b2be9f3b748f
Parents: fc2407c
Author: Zhao, Qingwen <qingwzhao@apache.org>
Authored: Wed Oct 12 12:16:37 2016 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Wed Oct 12 12:16:37 2016 +0800

----------------------------------------------------------------------
 ...e.alert.app.AlertUnitTopologyAppProvider.xml |  6 ++++++
 .../publisher/impl/DefaultDeduplicator.java     | 21 +++++++++++---------
 .../auditlog/HdfsAuditLogParserBolt.java        |  8 ++++----
 3 files changed, 22 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/279bc01c/eagle-core/eagle-alert-parent/eagle-alert-app/src/main/resources/META-INF/providers/org.apache.eagle.alert.app.AlertUnitTopologyAppProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert-app/src/main/resources/META-INF/providers/org.apache.eagle.alert.app.AlertUnitTopologyAppProvider.xml
b/eagle-core/eagle-alert-parent/eagle-alert-app/src/main/resources/META-INF/providers/org.apache.eagle.alert.app.AlertUnitTopologyAppProvider.xml
index bf22123..0188210 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert-app/src/main/resources/META-INF/providers/org.apache.eagle.alert.app.AlertUnitTopologyAppProvider.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert-app/src/main/resources/META-INF/providers/org.apache.eagle.alert.app.AlertUnitTopologyAppProvider.xml
@@ -25,6 +25,12 @@
     <configuration>
        <!-- alert topology sizing parameters -->
         <property>
+            <name>topology.name</name>
+            <displayName>topology.name</displayName>
+            <value>alertUnitTopology_1</value>
+            <description>alert topology name</description>
+        </property>
+        <property>
             <name>topology.numOfTotalWorkers</name>
             <displayName>topology.numOfTotalWorkers</displayName>
             <value>2</value>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/279bc01c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/DefaultDeduplicator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/DefaultDeduplicator.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/DefaultDeduplicator.java
index a3969ab..ac99db3 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/DefaultDeduplicator.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/DefaultDeduplicator.java
@@ -116,19 +116,22 @@ public class DefaultDeduplicator implements AlertDeduplicator {
                 continue;
             }
             String colName = streamDefinition.getColumns().get(i).getName();
+            Object colValue = event.getData()[i];
 
-            if (colName.equals(dedupStateField)) {
-                stateFiledValue = event.getData()[i].toString();
+            if (colName.equals(dedupStateField) && colValue != null) {
+                stateFiledValue = colValue.toString();
             }
 
             // make all of the field as unique key if no custom dedup field provided
-            if (customDedupFields == null || customDedupFields.size() <= 0) {
-                customFieldValues.put(colName, event.getData()[i].toString());
-            } else {
-                for (String field : customDedupFields) {
-                    if (colName.equals(field)) {
-                        customFieldValues.put(field, event.getData()[i].toString());
-                        break;
+            if (colValue != null) {
+                if (customDedupFields == null || customDedupFields.size() <= 0) {
+                    customFieldValues.put(colName, colValue.toString());
+                } else {
+                    for (String field : customDedupFields) {
+                        if (colName.equals(field)) {
+                            customFieldValues.put(field, colValue.toString());
+                            break;
+                        }
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/279bc01c/eagle-security/eagle-security-hdfs-auditlog/src/main/java/org/apache/eagle/security/auditlog/HdfsAuditLogParserBolt.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hdfs-auditlog/src/main/java/org/apache/eagle/security/auditlog/HdfsAuditLogParserBolt.java
b/eagle-security/eagle-security-hdfs-auditlog/src/main/java/org/apache/eagle/security/auditlog/HdfsAuditLogParserBolt.java
index 5ea5950..1134cb5 100644
--- a/eagle-security/eagle-security-hdfs-auditlog/src/main/java/org/apache/eagle/security/auditlog/HdfsAuditLogParserBolt.java
+++ b/eagle-security/eagle-security-hdfs-auditlog/src/main/java/org/apache/eagle/security/auditlog/HdfsAuditLogParserBolt.java
@@ -52,7 +52,7 @@ public class HdfsAuditLogParserBolt extends BaseRichBolt {
 
         HDFSAuditLogParser parser = new HDFSAuditLogParser();
         HDFSAuditLogObject entity = null;
-        try{
+        try {
             entity = parser.parse(logLine);
             Map<String, Object> map = new TreeMap<String, Object>();
             map.put("src", entity.src);
@@ -63,9 +63,9 @@ public class HdfsAuditLogParserBolt extends BaseRichBolt {
             map.put("user", entity.user);
             map.put("cmd", entity.cmd);
             collector.emit(Arrays.asList(map));
-        }catch(Exception ex){
-            LOG.error("Failing parse audit log message", ex);
-        }finally {
+        } catch (Exception ex) {
+            LOG.error("Failing parse audit log message {}", logLine, ex);
+        } finally {
             collector.ack(input);
         }
     }


Mime
View raw message