eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [6/6] incubator-eagle git commit: Rebase code base
Date Thu, 07 Jul 2016 00:53:36 GMT
Rebase code base

Author: Ralph, Su <suliangfei@gmail.com>

Closes #250 from RalphSu/develop.


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

Branch: refs/heads/develop
Commit: 72a1501c3ff645d93067b4fd9907f8183c2763b6
Parents: fe50912
Author: Ralph, Su <suliangfei@gmail.com>
Authored: Thu Jul 7 08:53:16 2016 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Thu Jul 7 08:53:16 2016 +0800

----------------------------------------------------------------------
 .../eagle-alert-parent/eagle-alert/README.md    |  48 ++-
 .../eagle-alert/alert-assembly/pom.xml          |  37 +--
 .../eagle-alert/alert-common/pom.xml            |  19 +-
 .../model/Tuple2StreamConverter.java            |  19 +-
 .../alert/engine/codec/IEventSerializer.java    |  27 ++
 .../alert/engine/coordinator/Publishment.java   |  31 +-
 .../alert/engine/coordinator/StreamColumn.java  |  36 ++-
 .../alert/service/IMetadataServiceClient.java   |   6 +-
 .../apache/eagle/alert/utils/KafkaEmbedded.java |  94 ++++++
 .../eagle/alert/utils/ZookeeperEmbedded.java    |  71 +++++
 .../apache/eagle/correlation/meta/JsonTest.java |  13 +-
 .../eagle/correlation/meta/LocalKafkaTest.java  |  66 +++++
 .../src/test/resources/streamDef.json           |  42 +++
 .../eagle-alert/alert-coordinator/pom.xml       |   1 -
 .../eagle/alert/coordinator/Coordinator.java    |  61 ++--
 .../alert/coordinator/CoordinatorListener.java  |  44 +++
 .../resource/CoordinatorResource.java           |  19 ++
 .../coordinator/trigger/CoordinatorTrigger.java |  88 ++++++
 .../trigger/DynamicPolicyLoader.java            |   9 +-
 .../src/main/resources/application.conf         |  42 ---
 .../src/main/resources/log4j.properties         |  21 --
 .../src/main/webapp/WEB-INF/web.xml             |  87 ------
 .../src/main/webapp/index.html                  |  18 --
 .../alert/coordinator/CoordinatorTest.java      |  24 +-
 .../coordinator/DynamicPolicyLoaderTest.java    |  29 ++
 .../mock/TestTopologyMgmtService.java           |  11 +-
 .../src/test/resources/application.conf         |  42 +++
 .../src/test/resources/log4j.properties         |  21 ++
 .../eagle-alert/alert-devtools/pom.xml          |   1 -
 .../eagle-alert/alert-engine/pom.xml            |  10 +-
 .../eagle/alert/engine/UnitTopologyMain.java    |  40 ++-
 .../engine/evaluator/PolicyStreamHandlers.java  |   4 +
 .../impl/DistinctValuesInTimeWindow.java        | 141 +++++++++
 .../impl/PolicyGroupEvaluatorImpl.java          |   2 +-
 .../evaluator/impl/SiddhiPolicyHandler.java     |   8 +-
 .../evaluator/nodata/NoDataPolicyHandler.java   | 164 +++++++++++
 .../evaluator/nodata/NoDataWisbParser.java      |  33 +++
 .../nodata/NoDataWisbProvidedParser.java        |  46 +++
 .../engine/evaluator/nodata/NoDataWisbType.java |  25 ++
 .../engine/publisher/AlertPublishPlugin.java    |  14 +-
 .../alert/engine/publisher/AlertPublisher.java  |   4 +-
 .../publisher/impl/AbstractPublishPlugin.java   |  79 +++++
 .../impl/AlertEagleStorePersister.java          |  60 ----
 .../impl/AlertEagleStorePublisher.java          | 113 -------
 .../publisher/impl/AlertEmailPublisher.java     |  35 +--
 .../publisher/impl/AlertKafkaPublisher.java     |  56 ++--
 .../impl/AlertPublishPluginsFactory.java        |   7 +-
 .../publisher/impl/AlertPublisherImpl.java      |   8 +-
 .../publisher/impl/KafkaProducerManager.java    |  60 +++-
 .../publisher/impl/StringEventSerializer.java   |  39 +++
 .../impl/StreamRouterBoltOutputCollector.java   |   4 +-
 .../alert/engine/runner/AbstractStreamBolt.java |   2 +
 .../eagle/alert/engine/runner/AlertBolt.java    |   2 +-
 .../alert/engine/runner/AlertPublisherBolt.java |   2 +-
 .../alert/engine/runner/StreamRouterBolt.java   |  28 +-
 .../alert/engine/runner/UnitTopologyRunner.java |  17 +-
 .../eagle/alert/engine/scheme/JsonScheme.java   |   3 +-
 .../alert/engine/scheme/PlainStringScheme.java  |   3 +-
 .../PartitionedEventDigestSerializer.java       |   8 +-
 .../PartitionedEventSerializer.java             |   4 +-
 .../alert/engine/serialization/Serializers.java |  14 +-
 .../serialization/impl/BooleanSerializer.java   |   4 +-
 .../serialization/impl/DoubleSerializer.java    |   4 +-
 .../serialization/impl/FloatSerializer.java     |   4 +-
 .../serialization/impl/IntegerSerializer.java   |   4 +-
 .../impl/JavaObjectSerializer.java              |   6 +-
 .../serialization/impl/LongSerializer.java      |   4 +-
 .../impl/PartitionedEventSerializerImpl.java    |   9 +-
 .../impl/StreamEventSerializer.java             |  10 +-
 .../impl/StreamPartitionDigestSerializer.java   |  16 +-
 .../impl/StreamPartitionSerializer.java         |   8 +-
 .../serialization/impl/StringSerializer.java    |   4 +-
 .../alert/engine/spout/CorrelationSpout.java    |  13 +-
 .../alert/engine/spout/CreateTopicUtils.java    |  19 +-
 .../eagle/alert/engine/spout/SchemeBuilder.java |   8 +-
 .../spout/SpoutOutputCollectorWrapper.java      |  17 +-
 .../alert/engine/utils/CompressionUtils.java    |   9 +-
 .../src/main/resources/application.conf         |  22 +-
 .../src/main/resources/log4j.properties         |   1 +
 .../eagle/alert/engine/e2e/Integration1.java    | 110 ++++---
 .../eagle/alert/engine/e2e/Integration2.java    |   7 +-
 .../engine/e2e/Integration4NoDataAlert.java     |  95 ++++++
 .../e2e/MetadataServiceClientImpTest.java       |  74 +++++
 .../alert/engine/e2e/MetadataServiceTest.java   |  85 ------
 .../eagle/alert/engine/e2e/SampleClient1.java   |  14 +-
 .../eagle/alert/engine/e2e/SampleClient2.java   |   8 +-
 .../engine/e2e/SampleClient4NoDataAlert.java    | 138 +++++++++
 .../nodata/TestDistinctValuesInTimeWindow.java  |  71 +++++
 .../alert/engine/nodata/TestEventTable.java     |  53 ++++
 .../alert/engine/nodata/TestNoDataAlert.java    |  83 ++++++
 .../engine/nodata/TestNoDataPolicyHandler.java  | 134 +++++++++
 .../engine/router/TestAlertPublisherBolt.java   |  21 +-
 .../engine/runner/TestStreamRouterBolt.java     |  38 ++-
 .../PartitionedEventSerializerTest.java         |  24 +-
 .../alert/engine/siddhi/SiddhiPolicyTest.java   | 247 ++++++++++++++++
 .../engine/topology/AlertTopologyTest.java      |   4 +-
 .../engine/topology/CorrelationSpoutTest.java   |  46 +++
 .../eagle/alert/engine/topology/TestBolt.java   |  17 +-
 .../engine/utils/CompressionUtilsTest.java      |   4 +-
 .../test/resources/application-integration.conf |  57 ----
 .../test/resources/application-test-backup.conf |   6 +-
 .../src/test/resources/application-test.conf    |   2 +-
 .../correlation/application-integration-2.conf  |   9 +-
 .../resources/correlation/publishments.json     |   5 +-
 .../test/resources/correlation_spouttest.conf   |  53 ++++
 .../src/test/resources/datasources.json         |  19 --
 .../src/test/resources/log4j.properties         |   2 +-
 .../resources/nodata/application-nodata.conf    |  60 ++++
 .../src/test/resources/nodata/datasources.json  |  17 ++
 .../nodata/policies-provided-wisb.json          |  23 ++
 .../src/test/resources/nodata/policies.json     |  23 ++
 .../src/test/resources/nodata/publishments.json |  20 ++
 .../resources/nodata/streamdefinitions.json     |  29 ++
 .../src/test/resources/nodata/topologies.json   |  31 ++
 .../src/test/resources/policies.json            |  54 ----
 .../src/test/resources/publishments.json        |  29 --
 .../src/test/resources/publishments1.json       |  20 ++
 .../simple/application-integration.conf         |  60 ++++
 .../src/test/resources/simple/datasources.json  |  19 ++
 .../src/test/resources/simple/policies.json     |  54 ++++
 .../src/test/resources/simple/publishments.json |  31 ++
 .../resources/simple/streamdefinitions.json     |  44 +++
 .../src/test/resources/simple/topologies.json   |  31 ++
 .../src/test/resources/streamdefinitions.json   |  44 ---
 .../src/test/resources/topologies.json          |  31 --
 .../alert-metadata-service/pom.xml              |  44 ++-
 .../metadata/resource/MetadataResource.java     |   4 +-
 .../resource/impl/TopologyMgmtResourceImpl.java |   2 +-
 .../src/main/resources/application.conf         |  21 --
 .../src/main/webapp/WEB-INF/web.xml             |  81 -----
 .../src/main/webapp/index.html                  |  18 --
 .../src/test/resources/application.conf         |  20 ++
 .../alert-metadata/pom.xml                      |  21 +-
 .../eagle/alert/metadata/IMetadataDao.java      |  89 ++++++
 .../eagle/alert/metadata/MetadataUtils.java     |  74 +++++
 .../metadata/impl/InMemMetadataDaoImpl.java     |  39 +--
 .../metadata/impl/JdbcDatabaseHandler.java      | 277 ++++++++++++++++++
 .../metadata/impl/JdbcMetadataDaoImpl.java      | 176 +++++++++++
 .../alert/metadata/impl/JdbcSchemaManager.java  | 151 ++++++++++
 .../alert/metadata/impl/MetadataDaoFactory.java |   6 +-
 .../metadata/impl/MongoMetadataDaoImpl.java     |  15 +-
 .../metadata/impl/jdbc/JdbcMetadataDaoImpl.java | 292 -------------------
 .../alert/metadata/resource/IMetadataDao.java   |  86 ------
 .../eagle/alert/metadata/resource/OpResult.java |   4 +-
 .../src/main/resources/application.conf         |  24 --
 .../alert/resource/impl/InMemoryTest.java       |   9 +-
 .../alert/resource/impl/JdbcImplTest.java       | 167 +++++++++++
 .../alert/resource/impl/MongoImplTest.java      |   2 +-
 .../src/test/resources/application-mysql.conf   |  22 ++
 .../src/test/resources/application.conf         |  24 ++
 .../eagle-alert/alert-metadata-parent/pom.xml   |   3 +-
 .../eagle-alert/alert-service/pom.xml           | 169 +++++++++++
 .../app/AlertDropWizardConfiguration.java       |  27 ++
 .../apache/eagle/service/app/ServiceApp.java    |  84 ++++++
 .../src/main/resources/application.conf         |  45 +++
 .../src/main/resources/log4j.properties         |  21 ++
 .../src/main/webapp/WEB-INF/web.xml             |  91 ++++++
 .../alert-service/src/main/webapp/index.html    |  19 ++
 .../eagle-alert-parent/eagle-alert/pom.xml      | 110 ++++++-
 .../storm/kafka/KafkaSourcedSpoutProvider.java  |   2 +-
 .../topo/NewKafkaSourcedSpoutProvider.java      |   2 +-
 .../auditlog/kafka/UserPartitioner.java         |   3 +-
 pom.xml                                         |  32 +-
 163 files changed, 4864 insertions(+), 1682 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/README.md
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/README.md b/eagle-core/eagle-alert-parent/eagle-alert/README.md
index e23ef68..4fd7622 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/README.md
+++ b/eagle-core/eagle-alert-parent/eagle-alert/README.md
@@ -35,18 +35,13 @@ The alert engine have three dependency module: Coordinator Service, Metadata Ser
 ####0. Dependencies
 > Alert engine need kafka as data source, ZK as coordination. Check alert-devtools/bin to start zk and kafka through start-zk-kafka.sh.
 
-####1. Start metadata service
-> For local dev, project alert-metadata-service packaging as a war, and enabled mvn jetty:run to run it. By default, metadata runs on localhost:8080
+####1. Start metadata service & coordinator service
+> For local dev, project alert-service packaging as a war, and enabled mvn jetty:run to run it. By default, metadata runs on localhost:8080/rest
 
-> For deployment, after mvn install, a war is avaialble in alert-metadata-service/target
+> For deployment, after mvn install, a war is avaialble in alert-service/target
 
-####2. Start coordiantor service
-> For local dev, project alert-coordinator packaing as a war, and enabled mvn jetty:run to run it. By default, it runs in localhost:9090, and have dependency on metadata. See application.conf for coordinator.
-
-> For deployment, find war in alert-coordinator/target after mvn install
-
-####3. Start engine runtime.
-> The engine are the topologies that runs in any storm (local or remote) with configuration to connect to the ZK and metadata service. The alert engine runtime main as in UnitTopologyMain.java. The started storm bolt should have the same name described in alert-metadata. Example of the configuration is /alert-engine-base/src/main/resources/application.conf 
+####2. Start engine runtime.
+> The engine are the topologies that runs in any storm (local or remote) with configuration to connect to the ZK and metadata service. The alert engine runtime main as in UnitTopologyMain.java. The started storm bolt should have the same name(and numbers config) described in alert-metadata. Example of the configuration is /alert-engine/src/main/resources/application.conf 
 
 See below detailed steps.
 
@@ -59,25 +54,15 @@ See below detailed steps.
   * tomcat
   * mongdb
 
-* Run Metadata service
-    1. copy alert-metadata/target/alert-metadata-0.0.1-SNAPSHOT.war into tomcat webapps/alertmetadata.war
-    2. check config under webapps/alertmetadata/WEB-INF/classes/application.conf
+* Run Metadata service & Coordinator service
+    1. copy alert-service/target/alert-service-0.0.1-SNAPSHOT.war into tomcat webapps/alert.war
+    2. check config under webapps/alert/WEB-INF/classes/application.conf
     ```json
     {
 	"datastore": {
 		"metadataDao": "org.apache.eagle.alert.metadata.impl.MongoMetadataDaoImpl",
 		"connection": "localhost:27017"
-	}
-     }
-    ```
-    
-    3. start tomcat
-    
-* Run Coordinator service
-    1. copy alert-coordinator/target/alert-coordinator-0.0.1-SNAPSHOT.war to tomcat webappes/coordinator.war
-    2. check config under webapps/coordinator/WEB-INF/classes/application.conf
-    ```json
-      {
+	},
 	"coordinator" : {
 		"policiesPerBolt" : 5,
 		"boltParallelism" : 5,
@@ -96,17 +81,18 @@ See below detailed steps.
 		"metadataService" : {
 			"host" : "localhost",
 			"port" : 8080,
-			"context" : "/alertmetadata/api"
+			"context" : "/alert/api"
 		},
 		"metadataDynamicCheck" : {
 			"initDelayMillis" : 1000,
 			"delayMillis" : 30000
 		}
 	}
-   }
-   ```
+     }
+    ```
+    
     3. start tomcat
-
+    
 * Run UnitTopologyMain
     1. copy alert-assembly/target/alert-engine-0.0.1-SNAPSHOT-alert-assembly.jar to somewhere close to your storm installation
     2. check config application.conf
@@ -145,15 +131,15 @@ See below detailed steps.
     "delayMillis" : 10000
   },
   "metadataService": {
-    "context" : "/alertmetadata/api",
     "host" : "localhost",
+    "context" : "/alert/rest",
     "port" : 8080
   },
   "coordinatorService": {
     "host": "localhost",
     "port": 8080,
-    "context" : "/coordinator/api"
-  }
+    "context" : "/alert/rest"
+  },
   "metric": {
     "sink": {
       "stdout": {}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-assembly/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-assembly/pom.xml
index 725d22e..b3f9fea 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-assembly/pom.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-assembly/pom.xml
@@ -1,28 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
+<!-- ~ 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. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
+
     <parent>
         <groupId>org.apache.eagle</groupId>
         <artifactId>eagle-alert</artifactId>
         <version>0.5.0-incubating-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
     </parent>
+
     <artifactId>alert-assembly</artifactId>
     <packaging>jar</packaging>
 
@@ -44,10 +40,17 @@
             <version>${project.version}</version>
             <type>jar</type>
         </dependency>
+
         <dependency>
             <groupId>org.apache.eagle</groupId>
             <artifactId>alert-engine</artifactId>
             <version>${project.version}</version>
+            <exclusions>
+            	<exclusion>
+            		<artifactId>kafka_2.9.2</artifactId>
+            		<groupId>org.apache.kafka</groupId>
+            	</exclusion>
+            </exclusions>
         </dependency>
 
         <!-- package test cases -->

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml
index 58c7865..fdb3a1e 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml
@@ -10,14 +10,14 @@
 	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the 
 	License for the specific language governing permissions and ~ limitations 
 	under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
 	<parent>
 		<groupId>org.apache.eagle</groupId>
 		<artifactId>eagle-alert</artifactId>
 		<version>0.5.0-incubating-SNAPSHOT</version>
-		<relativePath>../pom.xml</relativePath>
 	</parent>
 
 	<artifactId>alert-common</artifactId>
@@ -37,6 +37,10 @@
 			<artifactId>commons-lang3</artifactId>
 		</dependency>
 		<dependency>
+			<groupId>org.apache.curator</groupId>
+			<artifactId>curator-test</artifactId>
+		</dependency>
+		<dependency>
 			<groupId>commons-collections</groupId>
 			<artifactId>commons-collections</artifactId>
 		</dependency>
@@ -73,10 +77,7 @@
 			<groupId>com.fasterxml.jackson.core</groupId>
 			<artifactId>jackson-databind</artifactId>
 		</dependency>
-		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-client</artifactId>
-		</dependency>
+		
 		<dependency>
 			<groupId>org.codehaus.jackson</groupId>
 			<artifactId>jackson-jaxrs</artifactId>
@@ -109,6 +110,12 @@
 			<groupId>io.dropwizard.metrics</groupId>
 			<artifactId>metrics-jvm</artifactId>
 		</dependency>
+
+		<dependency>
+			<groupId>com.sun.jersey</groupId>
+			<artifactId>jersey-client</artifactId>
+		</dependency>
+
 	</dependencies>
 
 	<build>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/coordination/model/Tuple2StreamConverter.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/coordination/model/Tuple2StreamConverter.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/coordination/model/Tuple2StreamConverter.java
index dc9d1ba..f152b4c 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/coordination/model/Tuple2StreamConverter.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/coordination/model/Tuple2StreamConverter.java
@@ -25,6 +25,8 @@ import java.util.Properties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Strings;
+
 /**
  * Convert incoming tuple to stream
  * incoming tuple consists of 2 fields, topic and map of key/value
@@ -64,10 +66,23 @@ public class Tuple2StreamConverter {
 
         Object timeObject = m.get(metadata.getTimestampColumn());
         long timestamp = 0L;
-        if(timeObject instanceof Number){
+        if (timeObject == null) {
+            if (LOG.isWarnEnabled()) {
+                LOG.warn("continue with current timestamp since no timestamp column specified! Metadata : ", metadata);
+            }
+            timestamp = System.currentTimeMillis();
+        } else if (timeObject instanceof Number) {
             timestamp = ((Number) timeObject).longValue();
-        }else{
+        } else {
             String timestampFieldValue = (String) m.get(metadata.getTimestampColumn());
+            String dateFormat = metadata.getTimestampFormat();
+            if (Strings.isNullOrEmpty(dateFormat)) {
+                if (LOG.isWarnEnabled()) {
+                    LOG.warn("continue with current timestamp becuase no data format sepcified! Metadata : ", metadata);
+                }
+                timestamp = System.currentTimeMillis();
+            } else 
+            
             try {
                 SimpleDateFormat sdf = new SimpleDateFormat(metadata.getTimestampFormat());
                 timestamp = sdf.parse(timestampFieldValue).getTime();

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/IEventSerializer.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/IEventSerializer.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/IEventSerializer.java
new file mode 100644
index 0000000..dd26d20
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/IEventSerializer.java
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+package org.apache.eagle.alert.engine.codec;
+
+import org.apache.eagle.alert.engine.model.AlertStreamEvent;
+
+/**
+ * @since Jun 3, 2016
+ *
+ */
+public interface IEventSerializer {
+    Object serialize(AlertStreamEvent event);
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/Publishment.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/Publishment.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/Publishment.java
index d8b4f28..b921b79 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/Publishment.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/Publishment.java
@@ -16,12 +16,12 @@
  */
 package org.apache.eagle.alert.engine.coordinator;
 
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
 /**
  * @since Apr 11, 2016
  *
@@ -33,6 +33,8 @@ public class Publishment {
     private List<String> policyIds;
     private String dedupIntervalMin;
     private Map<String, String> properties;
+    // the class name to extend the IEventSerializer interface
+    private String serializer;
 
     public String getName() {
         return name;
@@ -42,6 +44,14 @@ public class Publishment {
         this.name = name;
     }
 
+    public String getSerializer() {
+        return serializer;
+    }
+
+    public void setSerializer(String serializer) {
+        this.serializer = serializer;
+    }
+
     public String getType() {
         return type;
     }
@@ -78,24 +88,17 @@ public class Publishment {
     public boolean equals(Object obj) {
         if (obj instanceof Publishment) {
             Publishment p = (Publishment) obj;
-            return (Objects.equals(name, p.getName()) &&
-                    Objects.equals(type, p.getType()) &&
-                    Objects.equals(dedupIntervalMin, p.getDedupIntervalMin()) &&
-                    Objects.equals(policyIds, p.getPolicyIds()) &&
-                    properties.equals(p.getProperties()));
+            return (Objects.equals(name, p.getName()) && Objects.equals(type, p.getType())
+                    && Objects.equals(dedupIntervalMin, p.getDedupIntervalMin())
+                    && Objects.equals(policyIds, p.getPolicyIds()) && properties.equals(p.getProperties()));
         }
         return false;
     }
 
     @Override
     public int hashCode() {
-        return new HashCodeBuilder()
-                .append(name)
-                .append(type)
-                .append(dedupIntervalMin)
-                .append(policyIds)
-                .append(properties)
-                .build();
+        return new HashCodeBuilder().append(name).append(type).append(dedupIntervalMin).append(policyIds)
+                .append(properties).build();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/StreamColumn.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/StreamColumn.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/StreamColumn.java
index dc44571..bbfb942 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/StreamColumn.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/StreamColumn.java
@@ -18,9 +18,8 @@ package org.apache.eagle.alert.engine.coordinator;
 
 import java.io.Serializable;
 
-import com.fasterxml.jackson.annotation.JsonCreator;
 
-public class StreamColumn implements Serializable{
+public class StreamColumn implements Serializable {
     private static final long serialVersionUID = -5457861313624389106L;
     private String name;
     private Type type;
@@ -28,8 +27,9 @@ public class StreamColumn implements Serializable{
     private boolean required;
     private String description;
 
-    public String toString(){
-        return String.format("StreamColumn=name[%s], type=[%s], defaultValue=[%s], required=[%s]", name, type, defaultValue, required);
+    public String toString() {
+        return String.format("StreamColumn=name[%s], type=[%s], defaultValue=[%s], required=[%s]", name, type,
+                defaultValue, required);
     }
 
     public String getName() {
@@ -63,7 +63,7 @@ public class StreamColumn implements Serializable{
     public void setRequired(boolean required) {
         this.required = required;
     }
-    
+
     public String getDescription() {
         return description;
     }
@@ -72,13 +72,12 @@ public class StreamColumn implements Serializable{
         this.description = description;
     }
 
-
-    public enum Type implements Serializable{
+    public enum Type implements Serializable {
         STRING("string"), INT("int"), LONG("long"), FLOAT("float"), DOUBLE("double"), BOOL("bool"), OBJECT("object");
 
         private final String name;
 
-        Type(String name){
+        Type(String name) {
             this.name = name;
         }
 
@@ -87,10 +86,11 @@ public class StreamColumn implements Serializable{
             return name;
         }
 
-        @JsonCreator
+        @org.codehaus.jackson.annotate.JsonCreator
+        @com.fasterxml.jackson.annotation.JsonCreator
         public static Type getEnumFromValue(String value) {
             for (Type testEnum : values()) {
-                if (testEnum.name.equals(value)) {
+                if (testEnum.name.equalsIgnoreCase(value)) {
                     return testEnum;
                 }
             }
@@ -101,27 +101,31 @@ public class StreamColumn implements Serializable{
     public static class Builder {
         private StreamColumn column;
 
-        public Builder(){
+        public Builder() {
             column = new StreamColumn();
         }
-        public Builder name(String name){
+
+        public Builder name(String name) {
             column.setName(name);
             return this;
         }
-        public Builder type(Type type){
+
+        public Builder type(Type type) {
             column.setType(type);
             return this;
         }
-        public Builder defaultValue(Object defaultValue){
+
+        public Builder defaultValue(Object defaultValue) {
             column.setDefaultValue(defaultValue);
             return this;
         }
-        public Builder required(boolean required){
+
+        public Builder required(boolean required) {
             column.setRequired(required);
             return this;
         }
 
-        public StreamColumn build(){
+        public StreamColumn build() {
             return column;
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/service/IMetadataServiceClient.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/service/IMetadataServiceClient.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/service/IMetadataServiceClient.java
index da5a086..80cb169 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/service/IMetadataServiceClient.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/service/IMetadataServiceClient.java
@@ -41,7 +41,7 @@ public interface IMetadataServiceClient extends Closeable, Serializable {
     void addStreamingCluster(StreamingCluster cluster);
     void addStreamingClusters(List<StreamingCluster> clusters);
     List<StreamingCluster> listClusters();
-
+    
     List<Topology> listTopologies();
     void addTopology(Topology t);
     void addTopologies(List<Topology> topologies);
@@ -68,8 +68,8 @@ public interface IMetadataServiceClient extends Closeable, Serializable {
     ScheduleState getVersionedSpec();
     ScheduleState getVersionedSpec(String version);
     void addScheduleState(ScheduleState state);
-
+    
     void clear();
-
+    
     // for topology mgmt
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/utils/KafkaEmbedded.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/utils/KafkaEmbedded.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/utils/KafkaEmbedded.java
new file mode 100644
index 0000000..db4d735
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/utils/KafkaEmbedded.java
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ */
+package org.apache.eagle.alert.utils;
+
+import java.io.File;
+import java.util.Properties;
+
+import kafka.server.KafkaConfig;
+import kafka.server.KafkaServerStartable;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.curator.test.InstanceSpec;
+
+public class KafkaEmbedded {
+
+    private int port;
+    private KafkaServerStartable kafka;
+    private ZookeeperEmbedded zk;
+
+    private File logDir;
+
+    public KafkaEmbedded() {
+        this(InstanceSpec.getRandomPort(), InstanceSpec.getRandomPort());
+    }
+
+    public KafkaEmbedded(Integer kafkaPort, Integer zookeeperPort) {
+        try {
+            zk = new ZookeeperEmbedded(zookeeperPort);
+            zk.start();
+
+            this.port = null != kafkaPort ? kafkaPort : InstanceSpec.getRandomPort();
+            logDir = new File(System.getProperty("java.io.tmpdir"), "kafka/logs/kafka-test-" + kafkaPort);
+            FileUtils.deleteQuietly(logDir);
+
+            KafkaConfig config = buildKafkaConfig(zk.getConnectionString());
+            kafka = new KafkaServerStartable(config);
+            kafka.startup();
+        } catch (Exception ex) {
+            throw new RuntimeException("Could not start test broker", ex);
+        }
+    }
+
+    public KafkaEmbedded(String kafka_url, String zk_url) {
+        this(extractKafkaPort(kafka_url), extractKafkaPort(zk_url));
+
+    }
+
+    public static Integer extractKafkaPort(String url) {
+        String portString = url.substring(url.indexOf(":") + 1, url.length());
+        return Integer.valueOf(portString);
+    }
+
+    private KafkaConfig buildKafkaConfig(String zookeeperConnectionString) {
+        Properties p = new Properties();
+        p.setProperty("zookeeper.connect", zookeeperConnectionString);
+        p.setProperty("broker.id", "0");
+        p.setProperty("port", "" + port);
+        p.setProperty("log.dirs", logDir.getAbsolutePath());
+        return new KafkaConfig(p);
+    }
+
+    public String getBrokerConnectionString() {
+        return "localhost:" + port;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void shutdown() {
+        try {
+            kafka.shutdown();
+        } catch (Throwable t) {
+            t.printStackTrace();
+        } finally {
+            FileUtils.deleteQuietly(logDir);
+        }
+        zk.shutdown();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/utils/ZookeeperEmbedded.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/utils/ZookeeperEmbedded.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/utils/ZookeeperEmbedded.java
new file mode 100644
index 0000000..6140677
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/utils/ZookeeperEmbedded.java
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+package org.apache.eagle.alert.utils;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.CuratorFrameworkFactory;
+import org.apache.curator.framework.imps.CuratorFrameworkState;
+import org.apache.curator.retry.ExponentialBackoffRetry;
+import org.apache.curator.test.TestingServer;
+
+public class ZookeeperEmbedded {
+    private TestingServer server;
+    private CuratorFramework zookeeper;
+    private int port;
+    private File logDir;
+
+    public ZookeeperEmbedded(int port) {
+        this.port = port;
+        this.logDir = new File(System.getProperty("java.io.tmpdir"), "zk/logs/zookeeper-test-" + port);
+    }
+
+    public void start() throws Exception {
+        FileUtils.deleteQuietly(logDir);
+
+        server = new TestingServer(this.port, this.logDir);
+        ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(1000, 3);
+        zookeeper = CuratorFrameworkFactory.newClient(server.getConnectString(), retryPolicy);
+        zookeeper.start();
+    }
+
+    public String getConnectionString() {
+        return server.getConnectString();
+    }
+
+    public void shutdown() {
+        try {
+            if (!zookeeper.getState().equals(CuratorFrameworkState.STOPPED)) {
+                zookeeper.close();
+            }
+
+        } catch (Throwable e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                server.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            } finally {
+                FileUtils.deleteQuietly(logDir);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/correlation/meta/JsonTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/correlation/meta/JsonTest.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/correlation/meta/JsonTest.java
index 71cce51..245b249 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/correlation/meta/JsonTest.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/correlation/meta/JsonTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.eagle.correlation.meta;
 
+import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
+import org.codehaus.jackson.map.ObjectMapper;
 import org.junit.Test;
 
 /**
@@ -24,7 +26,14 @@ import org.junit.Test;
 public class JsonTest {
 
     @Test
-    public void policyDefTest() {
-        // TODO
+    public void streamDefTest() throws Exception {
+
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.readValue(JsonTest.class.getResourceAsStream("/streamDef.json"), StreamDefinition.class);
+
+        com.fasterxml.jackson.databind.ObjectMapper mapper2 = new com.fasterxml.jackson.databind.ObjectMapper();
+        mapper2.readValue(JsonTest.class.getResourceAsStream("/streamDef.json"), StreamDefinition.class);
+
     }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/correlation/meta/LocalKafkaTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/correlation/meta/LocalKafkaTest.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/correlation/meta/LocalKafkaTest.java
new file mode 100644
index 0000000..3857649
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/correlation/meta/LocalKafkaTest.java
@@ -0,0 +1,66 @@
+package org.apache.eagle.correlation.meta;
+
+/*
+ * 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.
+ */
+import java.util.Properties;
+
+import kafka.admin.AdminUtils;
+import kafka.admin.RackAwareMode;
+import kafka.utils.ZKStringSerializer$;
+import kafka.utils.ZkUtils;
+
+import org.I0Itec.zkclient.ZkClient;
+import org.I0Itec.zkclient.ZkConnection;
+import org.apache.eagle.alert.utils.KafkaEmbedded;
+import org.junit.Ignore;
+
+/**
+ * @since Jun 3, 2016
+ *
+ */
+@Ignore
+public class LocalKafkaTest {
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        KafkaEmbedded kafka = new KafkaEmbedded(9092, 2181);
+
+        makeSureTopic("local_kafka_topic");
+
+        while (true) {
+            try {
+                Thread.sleep(3000);
+            } catch (Exception e) {
+                break;
+            }
+        }
+
+        kafka.shutdown();
+
+    }
+
+    public static void makeSureTopic(String topic) {
+        ZkClient zkClient = new ZkClient("localhost:2181", 10000, 10000, ZKStringSerializer$.MODULE$);
+        Properties topicConfiguration = new Properties();
+        ZkConnection zkConnection = new ZkConnection("localhost:2181");
+        ZkUtils zkUtils = new ZkUtils(zkClient, zkConnection, false);
+        AdminUtils.createTopic(zkUtils, topic, 1, 1, topicConfiguration, RackAwareMode.Disabled$.MODULE$);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/resources/streamDef.json
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/resources/streamDef.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/resources/streamDef.json
new file mode 100644
index 0000000..078cd73
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/resources/streamDef.json
@@ -0,0 +1,42 @@
+{
+	"streamId": "perfmon_cpu_stream",
+	"dataSource" : "perfmon_datasource",
+	"description":"the data stream for perfmon cpu metrics",
+	"validate": false,
+	"timeseries":false,
+	"columns": [
+		{
+			"name": "host",
+			"type" : "string",
+			"defaultValue": "",
+			"required":true
+		},
+		{
+			"name": "timestamp",
+			"type" : "long",
+			"defaultValue": 0,
+			"required":true
+		},{
+			"name": "metric",
+			"type" : "float",
+			"defaultValue": "perfmon_cpu",
+			"required": true
+		},{
+			"name": "pool",
+			"type" : "int",
+			"defaultValue": "raptor_general",
+			"required":true
+		},{
+			"name": "value",
+			"type" : "double",
+			"defaultValue": 0.0,
+			"required":true
+		},
+		{
+			"name": "colo",
+			"type" : "bool",
+			"defaultValue": "",
+			"required":true
+		}
+	]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/pom.xml
index 92f73e6..3cc6e60 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/pom.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/pom.xml
@@ -17,7 +17,6 @@
 		<groupId>org.apache.eagle</groupId>
 		<artifactId>eagle-alert</artifactId>
 		<version>0.5.0-incubating-SNAPSHOT</version>
-		<relativePath>../pom.xml</relativePath>
 	</parent>
 
 	<artifactId>alert-coordinator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/Coordinator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/Coordinator.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/Coordinator.java
index ca8c965..9c97f9f 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/Coordinator.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/Coordinator.java
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.eagle.alert.config.ConfigBusProducer;
 import org.apache.eagle.alert.config.ConfigValue;
@@ -29,6 +30,7 @@ import org.apache.eagle.alert.config.ZKConfig;
 import org.apache.eagle.alert.config.ZKConfigBuilder;
 import org.apache.eagle.alert.coordination.model.ScheduleState;
 import org.apache.eagle.alert.coordinator.provider.ScheduleContextBuilder;
+import org.apache.eagle.alert.coordinator.trigger.CoordinatorTrigger;
 import org.apache.eagle.alert.coordinator.trigger.DynamicPolicyLoader;
 import org.apache.eagle.alert.coordinator.trigger.PolicyChangeListener;
 import org.apache.eagle.alert.engine.coordinator.PolicyDefinition;
@@ -47,8 +49,12 @@ import com.typesafe.config.ConfigFactory;
  *        pull policies and figure out if polices are changed
  */
 public class Coordinator {
+
+    private static final Logger LOG = LoggerFactory.getLogger(Coordinator.class);
+
     private static final String COORDINATOR = "coordinator";
     /**
+     * {@link ZKMetadataChangeNotifyService}
      *  /alert/{topologyName}/spout
      *                  /router
      *                  /alert
@@ -59,7 +65,6 @@ public class Coordinator {
     private static final String ZK_ALERT_CONFIG_ALERT = "{0}/alert";
     private static final String ZK_ALERT_CONFIG_PUBLISHER = "{0}/publisher";
 
-    private static final Logger LOG = LoggerFactory.getLogger(Coordinator.class);
 
     private final static String METADATA_SERVICE_HOST = "metadataService.host";
     private final static String METADATA_SERVICE_PORT = "metadataService.port";
@@ -71,7 +76,10 @@ public class Coordinator {
     private final ConfigBusProducer producer;
     private final IMetadataServiceClient client;
     private Config config;
-    
+
+    // FIXME : UGLY global state
+    private static final AtomicBoolean forcePeriodicallyBuild = new AtomicBoolean(true);
+
     public Coordinator() {
         config = ConfigFactory.load().getConfig(COORDINATOR);
         ZKConfig zkConfig = ZKConfigBuilder.getZKConfig(config);
@@ -85,7 +93,7 @@ public class Coordinator {
         this.client = client;
     }
 
-    public ScheduleState schedule(ScheduleOption option) {
+    public synchronized ScheduleState schedule(ScheduleOption option) {
         IScheduleContext context = new ScheduleContextBuilder(client).buildContext();
         TopologyMgmtService mgmtService = new TopologyMgmtService();
         IPolicyScheduler scheduler = PolicySchedulerFactory.createScheduler();
@@ -162,9 +170,9 @@ public class Coordinator {
         private Config config;
         private IMetadataServiceClient client;
 
-        public PolicyChangeHandler(Config config) {
+        public PolicyChangeHandler(Config config, IMetadataServiceClient client) {
             this.config = config;
-            this.client = new MetadataServiceClientImpl(config);
+            this.client = client;
         }
 
         @Override
@@ -173,22 +181,20 @@ public class Coordinator {
             LOG.info("policy changed ... ");
             LOG.info("allPolicies: " + allPolicies + ", addedPolicies: " + addedPolicies + ", removedPolicies: "
                     + removedPolicies + ", modifiedPolicies: " + modifiedPolicies);
+            
+            CoordinatorTrigger trigger = new CoordinatorTrigger(config, client);
+            trigger.run();
 
-            IScheduleContext context = new ScheduleContextBuilder(client).buildContext();
-            TopologyMgmtService mgmtService = new TopologyMgmtService();
-            IPolicyScheduler scheduler = PolicySchedulerFactory.createScheduler();
-
-            scheduler.init(context, mgmtService);
-
-            ScheduleState state = scheduler.schedule(new ScheduleOption());
-
-            ConfigBusProducer producer = new ConfigBusProducer(ZKConfigBuilder.getZKConfig(config));
-            postSchedule(client, state, producer);
-            producer.send("spout", new ConfigValue());
         }
     }
 
     public static void main(String[] args) throws Exception {
+        startSchedule();
+        
+        Thread.currentThread().join();
+    }
+
+    public static void startSchedule() {
         Config config = ConfigFactory.load().getConfig(COORDINATOR);
         // build dynamic policy loader
         String host = config.getString(METADATA_SERVICE_HOST);
@@ -196,16 +202,31 @@ public class Coordinator {
         String context = config.getString(METADATA_SERVICE_CONTEXT);
         IMetadataServiceClient client = new MetadataServiceClientImpl(host, port, context);
         DynamicPolicyLoader loader = new DynamicPolicyLoader(client);
-        loader.addPolicyChangeListener(new PolicyChangeHandler(config));
+        loader.addPolicyChangeListener(new PolicyChangeHandler(config, client));
 
         // schedule dynamic policy loader
         long initDelayMillis = config.getLong(DYNAMIC_POLICY_LOADER_INIT_MILLS);
         long delayMillis = config.getLong(DYNAMIC_POLICY_LOADER_DELAY_MILLS);
-        ScheduledExecutorService scheduleSrv = Executors.newScheduledThreadPool(1);
+        ScheduledExecutorService scheduleSrv = Executors.newScheduledThreadPool(2);
         scheduleSrv.scheduleAtFixedRate(loader, initDelayMillis, delayMillis, TimeUnit.MILLISECONDS);
+        
+        // 
+        scheduleSrv.scheduleAtFixedRate(new CoordinatorTrigger(config, client), CoordinatorTrigger.INIT_PERIODICALLY_TRIGGER_DELAY,
+                CoordinatorTrigger.INIT_PERIODICALLY_TRIGGER_INTERVAL, TimeUnit.MILLISECONDS);
+        
         Runtime.getRuntime().addShutdownHook(new Thread(new CoordinatorShutdownHook(scheduleSrv)));
         LOG.info("Eagle Coordinator started ...");
-        
-        Thread.currentThread().join();
+    }
+
+    public void enforcePeriodicallyBuild() {
+        forcePeriodicallyBuild.set(true);
+    }
+
+    public void disablePeriodicallyBuild() {
+        forcePeriodicallyBuild.set(false);
+    }
+
+    public static boolean isPeriodicallyForceBuildEnable() {
+        return forcePeriodicallyBuild.get();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/CoordinatorListener.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/CoordinatorListener.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/CoordinatorListener.java
new file mode 100644
index 0000000..1534a6b
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/CoordinatorListener.java
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+package org.apache.eagle.alert.coordinator;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @since Jun 16, 2016
+ *
+ */
+public class CoordinatorListener implements ServletContextListener {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(CoordinatorListener.class);
+
+    @Override
+    public void contextInitialized(ServletContextEvent sce) {
+        LOG.info("start coordinator background tasks..");
+        Coordinator.startSchedule();
+    }
+
+    @Override
+    public void contextDestroyed(ServletContextEvent sce) {
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/resource/CoordinatorResource.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/resource/CoordinatorResource.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/resource/CoordinatorResource.java
index 6b8495e..c715bf8 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/resource/CoordinatorResource.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/resource/CoordinatorResource.java
@@ -54,6 +54,25 @@ public class CoordinatorResource {
         return JsonUtils.writeValueAsString(state);
     }
 
+    @POST
+    @Path("/enablePeriodicForceBuild")
+    public void enforcePeriodicallyBuild() {
+        alertCoordinator.enforcePeriodicallyBuild();
+    }
+
+    @POST
+    @Path("/disablePeriodicForceBuild")
+    public void disablePeriodicallyBuild() {
+        alertCoordinator.disablePeriodicallyBuild();
+    }
+    
+    @SuppressWarnings("static-access")
+    @GET
+    @Path("/periodicForceBuildState")
+    public boolean statPeriodicallyBuild() {
+        return alertCoordinator.isPeriodicallyForceBuildEnable();
+    }
+
     /**
      * Manually update the topology usages, for administration
      * 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/CoordinatorTrigger.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/CoordinatorTrigger.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/CoordinatorTrigger.java
new file mode 100644
index 0000000..c489a0e
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/CoordinatorTrigger.java
@@ -0,0 +1,88 @@
+/*
+ * 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.
+ */
+package org.apache.eagle.alert.coordinator.trigger;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.eagle.alert.config.ConfigBusProducer;
+import org.apache.eagle.alert.config.ZKConfigBuilder;
+import org.apache.eagle.alert.coordination.model.ScheduleState;
+import org.apache.eagle.alert.coordinator.Coordinator;
+import org.apache.eagle.alert.coordinator.IPolicyScheduler;
+import org.apache.eagle.alert.coordinator.IScheduleContext;
+import org.apache.eagle.alert.coordinator.PolicySchedulerFactory;
+import org.apache.eagle.alert.coordinator.ScheduleOption;
+import org.apache.eagle.alert.coordinator.TopologyMgmtService;
+import org.apache.eagle.alert.coordinator.provider.ScheduleContextBuilder;
+import org.apache.eagle.alert.service.IMetadataServiceClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Stopwatch;
+import com.typesafe.config.Config;
+
+/**
+ * @since Jun 27, 2016
+ *
+ */
+public class CoordinatorTrigger implements Runnable {
+    // TODO : support configurable in coordiantor
+    public static final int INIT_PERIODICALLY_TRIGGER_DELAY = 6000;
+    // 30 minutes a trigger by default
+    public static final int INIT_PERIODICALLY_TRIGGER_INTERVAL = 1000 * 60 * 30;
+
+    private static final Logger LOG = LoggerFactory.getLogger(CoordinatorTrigger.class);
+
+    private Config config;
+    private IMetadataServiceClient client;
+
+    public CoordinatorTrigger(Config config, IMetadataServiceClient client) {
+        this.config = config;
+        this.client = client;
+    }
+
+    @Override
+    public void run() {
+        try {
+            if (Coordinator.isPeriodicallyForceBuildEnable()) {
+                LOG.info("CoordinatorTrigger started ... ");
+
+                Stopwatch watch = Stopwatch.createStarted();
+
+                // schedule
+                IScheduleContext context = new ScheduleContextBuilder(client).buildContext();
+                TopologyMgmtService mgmtService = new TopologyMgmtService();
+                IPolicyScheduler scheduler = PolicySchedulerFactory.createScheduler();
+
+                scheduler.init(context, mgmtService);
+
+                ScheduleState state = scheduler.schedule(new ScheduleOption());
+
+                ConfigBusProducer producer = new ConfigBusProducer(ZKConfigBuilder.getZKConfig(config));
+                Coordinator.postSchedule(client, state, producer);
+
+                watch.stop();
+                LOG.info("CoordinatorTrigger ended, used time {} sm.", watch.elapsed(TimeUnit.MILLISECONDS));
+            }  else {
+                LOG.info("CoordinatorTrigger found isPeriodicallyForceBuildEnable = false, skipped build");
+            }
+        } catch (Exception e) {
+            LOG.error("trigger schedule failed!", e);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/DynamicPolicyLoader.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/DynamicPolicyLoader.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/DynamicPolicyLoader.java
index 15333da..df7556d 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/DynamicPolicyLoader.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/DynamicPolicyLoader.java
@@ -21,6 +21,7 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.eagle.alert.engine.coordinator.PolicyDefinition;
@@ -28,6 +29,8 @@ import org.apache.eagle.alert.service.IMetadataServiceClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Stopwatch;
+
 /**
  * Poll policy change and notify listeners
  */
@@ -43,7 +46,7 @@ public class DynamicPolicyLoader implements Runnable{
         this.client = client;
     }
 
-    public synchronized void addPolicyChangeListener(PolicyChangeListener listener){
+    public synchronized void addPolicyChangeListener(PolicyChangeListener listener) {
         listeners.add(listener);
     }
 
@@ -56,6 +59,8 @@ public class DynamicPolicyLoader implements Runnable{
     public void run() {
         // we should catch every exception to avoid zombile thread
         try {
+            Stopwatch watch = Stopwatch.createStarted();
+            LOG.info("policies loader start.");
             List<PolicyDefinition> current = client.listPolicies();
             Map<String, PolicyDefinition> currPolicies = new HashMap<>();
             current.forEach(pe -> currPolicies.put(pe.getName(), pe));
@@ -88,6 +93,8 @@ public class DynamicPolicyLoader implements Runnable{
                 }
             }
 
+            watch.stop();
+            LOG.info("policies loader completed. used time milliseconds: {}", watch.elapsed(TimeUnit.MILLISECONDS));
             // reset cached policies
             cachedPolicies = currPolicies;
         } catch (Throwable t) {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/resources/application.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/resources/application.conf
deleted file mode 100644
index c03b624..0000000
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/resources/application.conf
+++ /dev/null
@@ -1,42 +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.
-
-{
-	"coordinator" : {
-		"policiesPerBolt" : 5,
-		"boltParallelism" : 5,
-		"policyDefaultParallelism" : 5,
-		"boltLoadUpbound": 0.8,
-		"topologyLoadUpbound" : 0.8,
-		"numOfAlertBoltsPerTopology" : 5,
-		"zkConfig" : {
-			"zkQuorum" : "sandbox.hortonworks.com:2181",
-			"zkRoot" : "/alert",
-			"zkSessionTimeoutMs" : 10000,
-			"connectionTimeoutMs" : 10000,
-			"zkRetryTimes" : 3,
-			"zkRetryInterval" : 3000
-		},
-		"metadataService" : {
-			"host" : "localhost",
-			"port" : 38080,
-			"context" : "/rest"
-		},
-		"metadataDynamicCheck" : {
-			"initDelayMillis" : 1000,
-			"delayMillis" : 30000
-		}
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/resources/log4j.properties b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/resources/log4j.properties
deleted file mode 100644
index d4bc126..0000000
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,21 +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.
-
-log4j.rootLogger=INFO, stdout
-
-# standard output
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/WEB-INF/web.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 2de0d8b..0000000
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-<web-app xmlns="http://java.sun.com/xml/ns/javaee"
-           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
-		  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-           version="3.0">
-    <welcome-file-list>
-        <welcome-file>index.html</welcome-file>
-    </welcome-file-list>
-    <servlet>
-        <servlet-name>Jersey Web Application</servlet-name>
-        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
-        <init-param>
-            <param-name>com.sun.jersey.config.property.packages</param-name>
-            <param-value>io.swagger.jaxrs.json,io.swagger.jaxrs.listing,org.apache.eagle.alert.coordinator.resource,org.codehaus.jackson.jaxrs</param-value>
-        </init-param>
-        <init-param>
-            <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
-            <param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter;com.sun.jersey.api.container.filter.PostReplaceFilter</param-value>
-        </init-param>
-        <init-param>
-            <param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
-            <param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
-        </init-param>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-    <!-- Servlet for swagger initialization only, no URL mapping. -->
-	<servlet>
-		<servlet-name>swaggerConfig</servlet-name>
-		<servlet-class>io.swagger.jaxrs.config.DefaultJaxrsConfig</servlet-class>
-		<init-param>
-			<param-name>api.version</param-name>
-			<param-value>1.0.0</param-value>
-		</init-param>
-		<init-param>
-			<param-name>swagger.api.basepath</param-name>
-			<param-value>/rest</param-value>
-		</init-param>
-		<load-on-startup>2</load-on-startup>
-	</servlet>
-
-    <servlet-mapping>
-        <servlet-name>Jersey Web Application</servlet-name>
-        <url-pattern>/rest/*</url-pattern>
-    </servlet-mapping>
-    <filter>
-        <filter-name>CorsFilter</filter-name>
-        <!-- this should be replaced by tomcat ones, see also metadata resource -->
-        <filter-class>org.apache.eagle.alert.resource.SimpleCORSFiler</filter-class>
-        <init-param>
-            <param-name>cors.allowed.origins</param-name>
-            <param-value>*</param-value>
-        </init-param>
-        <init-param>
-            <param-name>cors.allowed.headers</param-name>
-            <param-value>Authorization,Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With, Accept</param-value>
-        </init-param>
-        <init-param>
-            <param-name>cors.allowed.methods</param-name>
-            <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value>
-        </init-param>
-        <init-param>
-            <param-name>cors.support.credentials</param-name>
-            <param-value>true</param-value>
-        </init-param>
-    </filter>
-    <filter-mapping>
-        <filter-name>CorsFilter</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>
-</web-app>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/index.html b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/index.html
deleted file mode 100644
index 1c4ea76..0000000
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/index.html
+++ /dev/null
@@ -1,18 +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.
-  -->
-UMP Coordinator service!

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/CoordinatorTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/CoordinatorTest.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/CoordinatorTest.java
index 259fe6c..b618dfc 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/CoordinatorTest.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/CoordinatorTest.java
@@ -31,8 +31,11 @@ import org.apache.eagle.alert.coordinator.Coordinator;
 import org.apache.eagle.alert.coordinator.ScheduleOption;
 import org.apache.eagle.alert.service.IMetadataServiceClient;
 import org.apache.eagle.alert.service.MetadataServiceClientImpl;
+import org.apache.eagle.alert.utils.ZookeeperEmbedded;
+import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -45,6 +48,21 @@ import com.typesafe.config.ConfigFactory;
  */
 public class CoordinatorTest {
 
+    private static ZookeeperEmbedded zkEmbed;
+
+    @BeforeClass
+    public static void setup() throws Exception {
+
+        zkEmbed = new ZookeeperEmbedded(2181);
+        zkEmbed.start();
+
+    }
+
+    @AfterClass
+    public static void teardown() {
+        zkEmbed.shutdown();
+    }
+
     @SuppressWarnings({ "resource", "unused" })
     @Ignore
     @Test
@@ -75,7 +93,6 @@ public class CoordinatorTest {
     }
 
     @SuppressWarnings({ "resource", "unused" })
-    @Ignore
     @Test
     public void test_01() throws Exception {
         before();
@@ -121,5 +138,10 @@ public class CoordinatorTest {
         ConfigFactory.invalidateCaches();
         ConfigFactory.load().getConfig("coordinator");
     }
+    
+    @Test
+    public void test_Schedule() {
+        Coordinator.startSchedule();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/DynamicPolicyLoaderTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/DynamicPolicyLoaderTest.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/DynamicPolicyLoaderTest.java
new file mode 100644
index 0000000..dcb031e
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/DynamicPolicyLoaderTest.java
@@ -0,0 +1,29 @@
+/*
+ *
+ *  * 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.
+ *
+ */
+
+package org.apache.alert.coordinator;
+
+import org.junit.Ignore;
+
+/**
+ * Since 4/28/16.
+ */
+@Ignore
+public class DynamicPolicyLoaderTest {
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/mock/TestTopologyMgmtService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/mock/TestTopologyMgmtService.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/mock/TestTopologyMgmtService.java
index 8d04a6e..fe36d18 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/mock/TestTopologyMgmtService.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/java/org/apache/alert/coordinator/mock/TestTopologyMgmtService.java
@@ -16,26 +16,23 @@
  */
 package org.apache.alert.coordinator.mock;
 
-import java.util.List;
-
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.eagle.alert.coordination.model.internal.Topology;
 import org.apache.eagle.alert.coordinator.TopologyMgmtService;
 import org.apache.eagle.alert.coordinator.model.AlertBoltUsage;
 import org.apache.eagle.alert.coordinator.model.GroupBoltUsage;
 import org.apache.eagle.alert.coordinator.model.TopologyUsage;
-import org.junit.Test;
+import org.junit.Ignore;
+
+import java.util.List;
 
+@Ignore
 public class TestTopologyMgmtService extends TopologyMgmtService {
 
     public static int BOLT_NUMBER = 5;
     
     private int i = 0;
 
-    @Test
-    public void test(){
-
-    }
     @Override
     public TopologyMeta creatTopology() {
         TopologyMeta tm = new TopologyMeta();

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/resources/application.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/resources/application.conf
new file mode 100644
index 0000000..363e661
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/resources/application.conf
@@ -0,0 +1,42 @@
+# 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.
+
+{
+	"coordinator" : {
+		"policiesPerBolt" : 5,
+		"boltParallelism" : 5,
+		"policyDefaultParallelism" : 5,
+		"boltLoadUpbound": 0.8,
+		"topologyLoadUpbound" : 0.8,
+		"numOfAlertBoltsPerTopology" : 5,
+		"zkConfig" : {
+			"zkQuorum" : "localhost:2181",
+			"zkRoot" : "/alert",
+			"zkSessionTimeoutMs" : 10000,
+			"connectionTimeoutMs" : 10000,
+			"zkRetryTimes" : 3,
+			"zkRetryInterval" : 3000
+		}
+		"metadataService" : {
+			"host" : "localhost",
+			"port" : 8080,
+			"context" : "/rest"
+		}
+		"metadataDynamicCheck" : {
+			"initDelayMillis" : 1000,
+			"delayMillis" : 30000
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/resources/log4j.properties b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/resources/log4j.properties
new file mode 100644
index 0000000..d4bc126
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/test/resources/log4j.properties
@@ -0,0 +1,21 @@
+# 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.
+
+log4j.rootLogger=INFO, stdout
+
+# standard output
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-devtools/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-devtools/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-devtools/pom.xml
index 53c3743..ee6378f 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-devtools/pom.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-devtools/pom.xml
@@ -17,7 +17,6 @@
         <groupId>org.apache.eagle</groupId>
         <artifactId>eagle-alert</artifactId>
         <version>0.5.0-incubating-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
     </parent>
 
     <artifactId>alert-devtools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/72a1501c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/pom.xml
index a8079d6..4909293 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/pom.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/pom.xml
@@ -24,12 +24,6 @@
 	<packaging>jar</packaging>
 
 	<dependencies>
-		<!-- need investigate why scala here can't be 2.11 -->
-		<dependency>
-			<groupId>org.scala-lang</groupId>
-			<artifactId>scala-library</artifactId>
-			<version>2.10.4</version>
-		</dependency>
 		<dependency>
 			<groupId>org.apache.eagle</groupId>
 			<artifactId>alert-common</artifactId>
@@ -134,6 +128,10 @@
 			<groupId>org.apache.kafka</groupId>
 			<artifactId>kafka-clients</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>commons-cli</groupId>
+			<artifactId>commons-cli</artifactId>
+		</dependency>
 	</dependencies>
 
 	<build>


Mime
View raw message