eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject eagle git commit: [EAGLE-932] Support group in stream definition
Date Thu, 02 Mar 2017 10:19:57 GMT
Repository: eagle
Updated Branches:
  refs/heads/master 75a92dcf6 -> a8d82d55f


[EAGLE-932] Support group in stream definition

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

Support group in stream definition

Author: Hao Chen <hao@apache.org>

Closes #848 from haoch/SupportStreamGroup.


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

Branch: refs/heads/master
Commit: a8d82d55f53a25d24cdab45c4b59a24007e9085e
Parents: 75a92dc
Author: Hao Chen <hao@apache.org>
Authored: Thu Mar 2 18:19:49 2017 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Thu Mar 2 18:19:49 2017 +0800

----------------------------------------------------------------------
 .../engine/coordinator/StreamDefinition.java    | 21 +++++++++++++++++---
 .../coordinator/StreamDefinitionTest.java       |  6 +++---
 ...le.metric.HadoopMetricMonitorAppProdiver.xml |  3 +++
 ...ecurity.auditlog.HdfsAuditLogAppProvider.xml |  1 +
 ....auditlog.HiveQueryMonitoringAppProvider.xml |  1 +
 5 files changed, 26 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/a8d82d55/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/StreamDefinition.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/StreamDefinition.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/StreamDefinition.java
index fd5d5a6..73d3991 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/StreamDefinition.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/StreamDefinition.java
@@ -52,6 +52,8 @@ public class StreamDefinition implements Serializable {
     // Stream data source ID
     private String dataSource;
 
+    private String group = "Default";
+
     //
     private String streamSource;
 
@@ -61,19 +63,22 @@ public class StreamDefinition implements Serializable {
     private List<StreamColumn> columns = new ArrayList<>();
 
     public String toString() {
-        return String.format("StreamDefinition[streamId=%s, dataSource=%s, description=%s,
validate=%s, timeseries=%s, columns=%s",
+        return String.format("StreamDefinition[group=%s, streamId=%s, dataSource=%s, description=%s,
validate=%s, timeseries=%s, columns=%s",
+            group,
             streamId,
             dataSource,
             description,
             validate,
             timeseries,
-            columns);
+            columns
+        );
     }
 
     @Override
     public int hashCode() {
         return new HashCodeBuilder()
                 .append(this.streamId)
+                .append(this.group)
                 .append(this.description)
                 .append(this.validate)
                 .append(this.timeseries)
@@ -94,11 +99,12 @@ public class StreamDefinition implements Serializable {
         }
         StreamDefinition streamDefinition = (StreamDefinition) obj;
         return Objects.equals(this.streamId, streamDefinition.streamId)
+            && Objects.equals(this.group, streamDefinition.group)
             && Objects.equals(this.description, streamDefinition.description)
             && Objects.equals(this.validate, streamDefinition.validate)
             && Objects.equals(this.timeseries, streamDefinition.timeseries)
             && Objects.equals(this.dataSource, streamDefinition.dataSource)
-                && Objects.equals(this.streamSource, streamDefinition.streamSource)
+            && Objects.equals(this.streamSource, streamDefinition.streamSource)
             && Objects.equals(this.siteId, streamDefinition.siteId)
             && CollectionUtils.isEqualCollection(this.columns, streamDefinition.columns);
     }
@@ -187,8 +193,17 @@ public class StreamDefinition implements Serializable {
         copied.setDescription(this.getDescription());
         copied.setSiteId(this.getSiteId());
         copied.setStreamId(this.getStreamId());
+        copied.setGroup(this.getGroup());
         copied.setTimeseries(this.isTimeseries());
         copied.setValidate(this.isValidate());
         return copied;
     }
+
+    public String getGroup() {
+        return group;
+    }
+
+    public void setGroup(String group) {
+        this.group = group;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/eagle/blob/a8d82d55/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/alert/engine/coordinator/StreamDefinitionTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/alert/engine/coordinator/StreamDefinitionTest.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/alert/engine/coordinator/StreamDefinitionTest.java
index e33ef07..c0d9213 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/alert/engine/coordinator/StreamDefinitionTest.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/alert/engine/coordinator/StreamDefinitionTest.java
@@ -35,15 +35,15 @@ public class StreamDefinitionTest {
         streamColumns.add(new StreamColumn.Builder().name("value").type(StreamColumn.Type.DOUBLE).build());
 
         StreamDefinition streamDefinition = new StreamDefinition();
-        Assert.assertEquals("StreamDefinition[streamId=null, dataSource=null, description=null,
validate=false, timeseries=false, columns=[]", streamDefinition.toString());
+        Assert.assertEquals("StreamDefinition[group=Default, streamId=null, dataSource=null,
description=null, validate=false, timeseries=false, columns=[]", streamDefinition.toString());
         streamDefinition.setColumns(streamColumns);
 
         Assert.assertEquals(3, streamDefinition.getColumnIndex("data"));
         Assert.assertEquals(-1, streamDefinition.getColumnIndex("DATA"));
         Assert.assertEquals(-1, streamDefinition.getColumnIndex("isYhd"));
-        Assert.assertEquals("StreamDefinition[streamId=null, dataSource=null, description=null,
validate=false, timeseries=false, columns=[StreamColumn=name[name], type=[string], defaultValue=[null],
required=[false], nodataExpression=[null], StreamColumn=name[host], type=[string], defaultValue=[null],
required=[false], nodataExpression=[null], StreamColumn=name[flag], type=[bool], defaultValue=[null],
required=[false], nodataExpression=[null], StreamColumn=name[data], type=[long], defaultValue=[null],
required=[false], nodataExpression=[null], StreamColumn=name[value], type=[double], defaultValue=[null],
required=[false], nodataExpression=[null]]", streamDefinition.toString());
+        Assert.assertEquals("StreamDefinition[group=Default, streamId=null, dataSource=null,
description=null, validate=false, timeseries=false, columns=[StreamColumn=name[name], type=[string],
defaultValue=[null], required=[false], nodataExpression=[null], StreamColumn=name[host], type=[string],
defaultValue=[null], required=[false], nodataExpression=[null], StreamColumn=name[flag], type=[bool],
defaultValue=[null], required=[false], nodataExpression=[null], StreamColumn=name[data], type=[long],
defaultValue=[null], required=[false], nodataExpression=[null], StreamColumn=name[value],
type=[double], defaultValue=[null], required=[false], nodataExpression=[null]]", streamDefinition.toString());
         StreamDefinition streamDefinition1 = streamDefinition.copy();
-        Assert.assertEquals("StreamDefinition[streamId=null, dataSource=null, description=null,
validate=false, timeseries=false, columns=[StreamColumn=name[name], type=[string], defaultValue=[null],
required=[false], nodataExpression=[null], StreamColumn=name[host], type=[string], defaultValue=[null],
required=[false], nodataExpression=[null], StreamColumn=name[flag], type=[bool], defaultValue=[null],
required=[false], nodataExpression=[null], StreamColumn=name[data], type=[long], defaultValue=[null],
required=[false], nodataExpression=[null], StreamColumn=name[value], type=[double], defaultValue=[null],
required=[false], nodataExpression=[null]]", streamDefinition1.toString());
+        Assert.assertEquals("StreamDefinition[group=Default, streamId=null, dataSource=null,
description=null, validate=false, timeseries=false, columns=[StreamColumn=name[name], type=[string],
defaultValue=[null], required=[false], nodataExpression=[null], StreamColumn=name[host], type=[string],
defaultValue=[null], required=[false], nodataExpression=[null], StreamColumn=name[flag], type=[bool],
defaultValue=[null], required=[false], nodataExpression=[null], StreamColumn=name[data], type=[long],
defaultValue=[null], required=[false], nodataExpression=[null], StreamColumn=name[value],
type=[double], defaultValue=[null], required=[false], nodataExpression=[null]]", streamDefinition1.toString());
 
         Assert.assertTrue(streamDefinition1.equals(streamDefinition));
         Assert.assertFalse(streamDefinition1 == streamDefinition);

http://git-wip-us.apache.org/repos/asf/eagle/blob/a8d82d55/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
b/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
index 51a9257..eff1a70 100644
--- a/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
+++ b/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
@@ -110,6 +110,7 @@
         <stream>
             <streamId>HADOOP_JMX_METRIC_STREAM</streamId>
             <description>Hadoop JMX Metric Stream including name node, resource manager,
etc.</description>
+            <group>Hadoop Metric</group>
             <columns>
                 <column>
                     <name>host</name>
@@ -141,6 +142,7 @@
         <stream>
             <streamId>SYSTEM_METRIC_STREAM</streamId>
             <description>System Metrics Stream including CPU, Network, Disk, etc.</description>
+            <group>System Metric</group>
             <columns>
                 <column>
                     <name>host</name>
@@ -176,6 +178,7 @@
         <stream>
             <streamId>HADOOP_JMX_RESOURCE_STREAM</streamId>
             <description>Hadoop JMX Resource Stream including name node, resource manager,
etc.</description>
+            <group>Hadoop Metric</group>
             <columns>
                 <column>
                     <name>host</name>

http://git-wip-us.apache.org/repos/asf/eagle/blob/a8d82d55/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HdfsAuditLogAppProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HdfsAuditLogAppProvider.xml
b/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HdfsAuditLogAppProvider.xml
index 1997257..426a78f 100644
--- a/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HdfsAuditLogAppProvider.xml
+++ b/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HdfsAuditLogAppProvider.xml
@@ -193,6 +193,7 @@
     <streams>
         <stream>
             <streamId>hdfs_audit_log_enriched_stream</streamId>
+            <group>Hadoop Log</group>
             <description>Hdfs Audit Log Enriched Stream</description>
             <validate>true</validate>
             <timeseries>true</timeseries>

http://git-wip-us.apache.org/repos/asf/eagle/blob/a8d82d55/eagle-security/eagle-security-hive/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HiveQueryMonitoringAppProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hive/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HiveQueryMonitoringAppProvider.xml
b/eagle-security/eagle-security-hive/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HiveQueryMonitoringAppProvider.xml
index 89fbfbd..1237519 100644
--- a/eagle-security/eagle-security-hive/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HiveQueryMonitoringAppProvider.xml
+++ b/eagle-security/eagle-security-hive/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HiveQueryMonitoringAppProvider.xml
@@ -135,6 +135,7 @@
     <streams>
         <stream>
             <streamId>hdfs_audit_log_stream</streamId>
+            <group>Hadoop Log</group>
             <description>Hdfs Audit Log Stream</description>
             <validate>true</validate>
             <timeseries>true</timeseries>


Mime
View raw message