incubator-eagle git commit: [MINOR] add sortSpec to pattern match if exists corresponding StreamPartition
Repository: incubator-eagle Updated Branches: refs/heads/master 02abe02c3 -> aa8d3c9b9 [MINOR] add sortSpec to pattern match if exists corresponding StreamPartition Author: wujinhu Closes #728 from wujinhu/EAGLE-793. Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/aa8d3c9b Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/aa8d3c9b Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/aa8d3c9b Branch: refs/heads/master Commit: aa8d3c9b9a17ffa66c599fb88bd06e898328d431 Parents: 02abe02 Author: wujinhu Authored: Fri Dec 9 14:22:23 2016 +0800 Committer: wujinhu Committed: Fri Dec 9 14:22:23 2016 +0800 -- .../interpreter/PolicyExecutionPlannerImpl.java | 13 ++- .../interpreter/PolicyInterpreterTest.java | 38 .../impl/ApplicationHealthCheckServiceImpl.java | 13 --- .../eagle/app/spi/ApplicationProvider.java | 9 ++--- .../src/main/resources/HealthCheckTemplate.vm | 7 ++-- .../queue/HadoopQueueRunningAppProvider.java| 6 ++-- .../MRHistoryJobApplicationProvider.java| 4 +-- .../history/SparkHistoryJobAppProvider.java | 6 ++-- .../topology/TopologyCheckAppProvider.java | 6 ++-- 9 files changed, 78 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/aa8d3c9b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/interpreter/PolicyExecutionPlannerImpl.java -- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/interpreter/PolicyExecutionPlannerImpl.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/interpreter/PolicyExecutionPlannerImpl.java index 1f46298..e30b3de 100644 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/interpreter/PolicyExecutionPlannerImpl.java +++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/interpreter/PolicyExecutionPlannerImpl.java @@ -198,7 +198,18 @@ class PolicyExecutionPlannerImpl implements PolicyExecutionPlanner { } for (Map.Entry> entry : streamGroupBy.entrySet()) { if (entry.getValue().size() > 0) { - retrievePartition(generatePartition(entry.getKey(), null, Arrays.asList(entry.getValue().toArray(new Variable[entry.getValue().size()]; +StreamPartition partition = generatePartition(entry.getKey(), null, Arrays.asList(entry.getValue().toArray(new Variable[entry.getValue().size()]))); +if (((StateInputStream) inputStream).getStateType().equals(StateInputStream.Type.PATTERN)) { +if (effectivePartitions.containsKey(partition.getStreamId())) { +StreamPartition existingPartition = effectivePartitions.get(partition.getStreamId()); +if (!existingPartition.equals(partition) +&& existingPartition.getType().equals(partition.getType()) +&& ListUtils.isEqualList(existingPartition.getColumns(), partition.getColumns())) { + partition.setSortSpec(existingPartition.getSortSpec()); +} +} +} +retrievePartition(partition); } } } http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/aa8d3c9b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/interpreter/PolicyInterpreterTest.java -- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/interpreter/PolicyInterpreterTest.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/interpreter/PolicyInterpreterTest.java index f68a295..1553e17 100644 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/interpreter/PolicyInterpreterTest.java +++ b/eagle-core/eagle-alert-p
incubator-eagle git commit: [EAGLE-832] Support to define granularity for MetricDefinition to avoid metric duplicate
Repository: incubator-eagle Updated Branches: refs/heads/master cfd4d38fd -> 02abe02c3 [EAGLE-832] Support to define granularity for MetricDefinition to avoid metric duplicate Support to define granularity for MetricDefinition to avoid metric duplicate Author: Hao Chen Closes #724 from haoch/SupportGranularity. Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/02abe02c Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/02abe02c Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/02abe02c Branch: refs/heads/master Commit: 02abe02c37cd4351ea456ccf42fe24fb9544682d Parents: cfd4d38 Author: Hao Chen Authored: Thu Dec 8 22:44:29 2016 +0800 Committer: Hao Chen Committed: Thu Dec 8 22:44:29 2016 +0800 -- .../environment/builder/MetricDefinition.java | 21 .../app/messaging/MetricStreamPersist.java | 3 ++- .../eagle/metric/HadoopMetricMonitorApp.java| 3 +++ 3 files changed, 26 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/02abe02c/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/builder/MetricDefinition.java -- diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/builder/MetricDefinition.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/builder/MetricDefinition.java index 62a81b0..d45ad2b 100644 --- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/builder/MetricDefinition.java +++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/builder/MetricDefinition.java @@ -19,6 +19,7 @@ package org.apache.eagle.app.environment.builder; import java.io.Serializable; import java.util.Arrays; +import java.util.Calendar; import java.util.List; import java.util.Map; @@ -40,6 +41,11 @@ public class MetricDefinition implements Serializable { private List dimensionFields; /** + * Metric granularity. + */ +private int granularity = Calendar.MINUTE; + +/** * Metric value field name. */ private String valueField = "value"; @@ -76,6 +82,13 @@ public class MetricDefinition implements Serializable { this.timestampSelector = timestampSelector; } +public int getGranularity() { +return granularity; +} + +public void setGranularity(int granularity) { +this.granularity = granularity; +} @FunctionalInterface public interface NameSelector extends Serializable { @@ -93,6 +106,14 @@ public class MetricDefinition implements Serializable { return metricDefinition; } +/** + * @see java.util.Calendar + */ +public MetricDefinition granularity(int granularity) { +this.setGranularity(granularity); +return this; +} + public static MetricDefinition namedByField(String nameField) { MetricDefinition metricDefinition = new MetricDefinition(); metricDefinition.setNameSelector(new FieldNameSelector(nameField)); http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/02abe02c/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/messaging/MetricStreamPersist.java -- diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/messaging/MetricStreamPersist.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/messaging/MetricStreamPersist.java index 32b168b..2a1d8a8 100644 --- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/messaging/MetricStreamPersist.java +++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/messaging/MetricStreamPersist.java @@ -26,6 +26,7 @@ import com.google.common.base.Preconditions; import com.typesafe.config.Config; import org.apache.eagle.app.environment.builder.MetricDefinition; import org.apache.eagle.app.utils.StreamConvertHelper; +import org.apache.eagle.common.DateTimeUtil; import org.apache.eagle.log.entity.GenericMetricEntity; import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity; import org.apache.eagle.service.client.IEagleServiceClient; @@ -143,7 +144,7 @@ public class MetricStreamPersist extends BaseRichBolt { GenericMetricEntity entity = new GenericMetricEntity(); entity.setPrefix(metricName); -entity.setTimestamp(timestamp); + entity.setTimestamp(DateTimeUtil.roundDown(metricDefinition.getGranularity(), timestamp)); entity.setTags(tags); entity.setValue(
[2/2] incubator-eagle git commit: [MINOR] Rename createTable.sql to metadata-ddl.sql
[MINOR] Rename createTable.sql to metadata-ddl.sql Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/cfd4d38f Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/cfd4d38f Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/cfd4d38f Branch: refs/heads/master Commit: cfd4d38fdbe9fa3922dcec566461f0ead810cf0c Parents: c1dcfb1 Author: Hao Chen Authored: Thu Dec 8 20:47:05 2016 +0800 Committer: Hao Chen Committed: Thu Dec 8 20:47:05 2016 +0800 -- .../src/main/bin/createTables.sql | 137 --- .../src/main/bin/metadata-ddl.sql | 137 +++ 2 files changed, 137 insertions(+), 137 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/cfd4d38f/eagle-server-assembly/src/main/bin/createTables.sql -- diff --git a/eagle-server-assembly/src/main/bin/createTables.sql b/eagle-server-assembly/src/main/bin/createTables.sql deleted file mode 100644 index f80a7ea..000 --- a/eagle-server-assembly/src/main/bin/createTables.sql +++ /dev/null @@ -1,137 +0,0 @@ --- /* --- * 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 regarding copyright ownership. --- * The ASF licenses this file to You under the Apache License, Version 2.0 --- * (the "License"); you may not use this file except in compliance with --- * the License. You may obtain a copy of the License at --- * --- *http://www.apache.org/licenses/LICENSE-2.0 --- * --- * Unless required by applicable law or agreed to in writing, software --- * distributed under the License is distributed on an "AS IS" BASIS, --- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- * See the License for the specific language governing permissions and --- * limitations under the License. --- * --- */ - - --- application framework metadata - -CREATE TABLE IF NOT EXISTS applications ( - uuid varchar(50) PRIMARY KEY, - appid varchar(100) DEFAULT NULL, - siteid varchar(100) DEFAULT NULL, - apptype varchar(30) DEFAULT NULL, - appmode varchar(10) DEFAULT NULL, - jarpath varchar(255) DEFAULT NULL, - appstatus varchar(20) DEFAULT NULL, - configuration mediumtext DEFAULT NULL, - context mediumtext DEFAULT NULL, - createdtime bigint(20) DEFAULT NULL, - modifiedtime bigint(20) DEFAULT NULL -); - -CREATE TABLE IF NOT EXISTS sites ( - uuid varchar(50) PRIMARY KEY, - siteid varchar(100) DEFAULT NULL, - sitename varchar(100) DEFAULT NULL, - description varchar(255) DEFAULT NULL, - createdtime bigint(20) DEFAULT NULL, - modifiedtime bigint(20) DEFAULT NULL, - UNIQUE (siteid) -); - --- eagle security module metadata - -CREATE TABLE IF NOT EXISTS hdfs_sensitivity_entity ( - site varchar(20) DEFAULT NULL, - filedir varchar(100) DEFAULT NULL, - sensitivity_type varchar(20) DEFAULT NULL, - primary key (site, filedir) -); - -CREATE TABLE IF NOT EXISTS ip_securityzone ( - iphost varchar(100) DEFAULT NULL, - security_zone varchar(100) DEFAULT NULL, - primary key (iphost) -); - -CREATE TABLE IF NOT EXISTS hbase_sensitivity_entity ( - site varchar(20) DEFAULT NULL, - hbase_resource varchar(100) DEFAULT NULL, - sensitivity_type varchar(20) DEFAULT NULL, - primary key (site, hbase_resource) -); - --- alert engine metadata - -CREATE TABLE IF NOT EXISTS stream_cluster ( - id VARCHAR (50) PRIMARY KEY, - content longtext DEFAULT NULL -); - -CREATE TABLE IF NOT EXISTS stream_definition ( - id VARCHAR (50) PRIMARY KEY, - content longtext DEFAULT NULL -); - -CREATE TABLE IF NOT EXISTS kafka_tuple_metadata ( - id VARCHAR (50) PRIMARY KEY, - content longtext DEFAULT NULL -); - -CREATE TABLE IF NOT EXISTS policy_definition ( - id VARCHAR (50) PRIMARY KEY, - content longtext DEFAULT NULL -); - -CREATE TABLE IF NOT EXISTS publishment ( - id VARCHAR (50) PRIMARY KEY, - content longtext DEFAULT NULL -); - -CREATE TABLE IF NOT EXISTS schedule_state ( - id VARCHAR (50) PRIMARY KEY, - content longtext DEFAULT NULL -); - -CREATE TABLE IF NOT EXISTS policy_assignment ( - id VARCHAR (50) PRIMARY KEY, - content longtext DEFAULT NULL -); - -CREATE TABLE IF NOT EXISTS topology ( - id VARCHAR (50) PRIMARY KEY, - content longtext DEFAULT NULL -); - -CREATE TABLE IF NOT EXISTS publishment_type ( - id VARCHAR (50) PRIMARY KEY, - content longtext DEFAULT NULL -); - -CREATE TABLE IF NOT EXISTS policy_publishment ( - policyId VARCHAR(50), - publishmentName VARCHAR(50), - PRIMARY KEY(policyId, publishmentName), - CONSTRAINT `policy_id_fk` FOREIGN KEY (`policyId`) REFERENCES `policy_definition` (`id`) ON DELETE CASC
[1/2] incubator-eagle git commit: [MINOR] Assemble eagle-external/hadoop_jmx_collector to lib/scripts
Repository: incubator-eagle Updated Branches: refs/heads/master dd9cd7c51 -> cfd4d38fd [MINOR] Assemble eagle-external/hadoop_jmx_collector to lib/scripts Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/c1dcfb13 Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/c1dcfb13 Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/c1dcfb13 Branch: refs/heads/master Commit: c1dcfb13b47588b886a9bc0fc002eaf87e713523 Parents: dd9cd7c Author: Hao Chen Authored: Thu Dec 8 20:44:55 2016 +0800 Committer: Hao Chen Committed: Thu Dec 8 20:44:55 2016 +0800 -- eagle-server-assembly/src/assembly/eagle-bin.xml | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1dcfb13/eagle-server-assembly/src/assembly/eagle-bin.xml -- diff --git a/eagle-server-assembly/src/assembly/eagle-bin.xml b/eagle-server-assembly/src/assembly/eagle-bin.xml index c56b0aa..cb23c2d 100644 --- a/eagle-server-assembly/src/assembly/eagle-bin.xml +++ b/eagle-server-assembly/src/assembly/eagle-bin.xml @@ -91,5 +91,11 @@ eagle-storage-hbase-*.jar + + + + ${project.basedir}/../eagle-external/hadoop_jmx_collector +lib/scripts/hadoop_jmx_collector + - + \ No newline at end of file
incubator-eagle git commit: [EAGLE-831] UI alert support time range select
Repository: incubator-eagle Updated Branches: refs/heads/master 162aac84f -> dd9cd7c51 [EAGLE-831] UI alert support time range select * alert list support time range * policy detail page display alert template Author: zombieJ Closes #723 from zombieJ/831. Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/dd9cd7c5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/dd9cd7c5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/dd9cd7c5 Branch: refs/heads/master Commit: dd9cd7c51cd5454fd201cd27377f22eb2d60d9ec Parents: 162aac8 Author: zombieJ Authored: Thu Dec 8 17:35:38 2016 +0800 Committer: Hao Chen Committed: Thu Dec 8 17:35:38 2016 +0800 -- eagle-server/src/main/webapp/app/dev/index.html | 9 +++- .../webapp/app/dev/partials/alert/list.html | 14 +- .../app/dev/partials/alert/policyDetail.html| 47 +-- .../src/main/webapp/app/dev/public/js/app.js| 8 +++- .../webapp/app/dev/public/js/ctrls/alertCtrl.js | 48 +--- .../app/dev/public/js/services/timeSrv.js | 37 ++- 6 files changed, 104 insertions(+), 59 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/dd9cd7c5/eagle-server/src/main/webapp/app/dev/index.html -- diff --git a/eagle-server/src/main/webapp/app/dev/index.html b/eagle-server/src/main/webapp/app/dev/index.html index 93018b4..47e1b76 100644 --- a/eagle-server/src/main/webapp/app/dev/index.html +++ b/eagle-server/src/main/webapp/app/dev/index.html @@ -66,7 +66,7 @@ - + {{Time.format("startTime", Time.SHORT_FORMAT)}} ~ {{Time.format("endTime", Time.SHORT_FORMAT)}} @@ -75,6 +75,13 @@ Last 12 Hours Last 24 Hours Customize + + + + + Auto Refresh + + http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/dd9cd7c5/eagle-server/src/main/webapp/app/dev/partials/alert/list.html -- diff --git a/eagle-server/src/main/webapp/app/dev/partials/alert/list.html b/eagle-server/src/main/webapp/app/dev/partials/alert/list.html index 806234d..d06b41f 100644 --- a/eagle-server/src/main/webapp/app/dev/partials/alert/list.html +++ b/eagle-server/src/main/webapp/app/dev/partials/alert/list.html @@ -22,18 +22,6 @@ Alert List - - - - - - - - - - @@ -42,7 +30,7 @@ Time - + Severity Site http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/dd9cd7c5/eagle-server/src/main/webapp/app/dev/partials/alert/policyDetail.html --