eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [24/46] incubator-eagle git commit: [EAGLE-325] Initialize next-gen alert engine code on branch-0.5
Date Thu, 02 Jun 2016 07:08:03 GMT
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MongoMetadataDaoImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MongoMetadataDaoImpl.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MongoMetadataDaoImpl.java
new file mode 100644
index 0000000..a46f0c7
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MongoMetadataDaoImpl.java
@@ -0,0 +1,380 @@
+/*
+ * 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.metadata.impl;
+
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.eagle.alert.coordination.model.Kafka2TupleMetadata;
+import org.apache.eagle.alert.coordination.model.ScheduleState;
+import org.apache.eagle.alert.coordination.model.internal.PolicyAssignment;
+import org.apache.eagle.alert.coordination.model.internal.Topology;
+import org.apache.eagle.alert.engine.coordinator.PolicyDefinition;
+import org.apache.eagle.alert.engine.coordinator.Publishment;
+import org.apache.eagle.alert.engine.coordinator.PublishmentType;
+import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
+import org.apache.eagle.alert.engine.coordinator.StreamingCluster;
+import org.apache.eagle.alert.metadata.resource.IMetadataDao;
+import org.apache.eagle.alert.metadata.resource.Models;
+import org.apache.eagle.alert.metadata.resource.OpResult;
+import org.bson.BsonDocument;
+import org.bson.BsonInt32;
+import org.bson.BsonString;
+import org.bson.Document;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.mongodb.Function;
+import com.mongodb.MongoClient;
+import com.mongodb.client.MongoCollection;
+import com.mongodb.client.MongoDatabase;
+import com.mongodb.client.model.IndexOptions;
+import com.mongodb.client.model.UpdateOptions;
+import com.mongodb.client.result.DeleteResult;
+import com.mongodb.client.result.UpdateResult;
+import com.typesafe.config.Config;
+
+/**
+ * @since Apr 11, 2016
+ *
+ */
+public class MongoMetadataDaoImpl implements IMetadataDao {
+
+    private static final String DB_NAME = "ump_alert_metadata";
+    private static final Logger LOG = LoggerFactory.getLogger(MongoMetadataDaoImpl.class);
+    private static final ObjectMapper mapper = new ObjectMapper();
+    static {
+        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+    }
+
+    private final String connection;
+    private final MongoClient client;
+    
+    private MongoDatabase db;
+    private MongoCollection<Document> cluster;
+    private MongoCollection<Document> schema;
+    private MongoCollection<Document> datasource;
+    private MongoCollection<Document> policy;
+    private MongoCollection<Document> publishment;
+    private MongoCollection<Document> publishmentType;
+    private MongoCollection<Document> scheduleStates;
+    private MongoCollection<Document> assignments;
+    private MongoCollection<Document> topologies;
+
+    public MongoMetadataDaoImpl(Config config) {
+        this.connection = config.getString("connection");
+        this.client = new MongoClient(connection);
+        init();
+    }
+
+    private void init() {
+        db = client.getDatabase(DB_NAME);
+        IndexOptions io = new IndexOptions().background(true).unique(true).name("nameIndex");
+        BsonDocument doc = new BsonDocument();
+        doc.append("name", new BsonInt32(1));
+        cluster = db.getCollection("clusters");
+        cluster.createIndex(doc, io);
+        {
+            BsonDocument doc2 = new BsonDocument();
+            doc2.append("streamId", new BsonInt32(1));
+            schema = db.getCollection("schemas");
+            schema.createIndex(doc2, io);
+        }
+        datasource = db.getCollection("datasources");
+        datasource.createIndex(doc, io);
+        policy = db.getCollection("policies");
+        policy.createIndex(doc, io);
+        publishment = db.getCollection("publishments");
+        publishment.createIndex(doc, io);
+        topologies = db.getCollection("topologies");
+        topologies.createIndex(doc, io);
+
+        publishmentType = db.getCollection("publishmentTypes");
+        {
+            IndexOptions io1 = new IndexOptions().background(true).unique(true).name("pubTypeIndex");
+            BsonDocument doc1 = new BsonDocument();
+            doc1.append("type", new BsonInt32(1));
+            publishmentType.createIndex(doc1, io1);
+        }
+
+        scheduleStates = db.getCollection("schedule_specs");
+        {
+            IndexOptions io1 = new IndexOptions().background(true).unique(true).name("nameIndex");
+            BsonDocument doc1 = new BsonDocument();
+            doc1.append("version", new BsonInt32(1));
+            scheduleStates.createIndex(doc1, io1);
+        }
+
+        assignments = db.getCollection("assignments");
+        {
+            IndexOptions io1 = new IndexOptions().background(true).unique(true).name("policyNameIndex");
+            BsonDocument doc1 = new BsonDocument();
+            doc1.append("policyName", new BsonInt32(1));
+            assignments.createIndex(doc1, io1);
+        }
+    }
+
+    @Override
+    public List<StreamingCluster> listClusters() {
+        return list(cluster, StreamingCluster.class);
+    }
+
+    private <T> List<T> list(MongoCollection<Document> collection, Class<T> clz) {
+        List<T> result = new LinkedList<T>();
+        collection.find().map(new Function<Document, T>() {
+            @Override
+            public T apply(Document t) {
+                String json = t.toJson();
+                try {
+                    return mapper.readValue(json, clz);
+                } catch (IOException e) {
+                    LOG.error("deserialize config item failed!", e);
+                }
+                return null;
+            }
+        }).into(result);
+        return result;
+    }
+
+    private <T> OpResult addOrReplace(MongoCollection<Document> collection, T t) {
+        BsonDocument filter = new BsonDocument();
+        if (t instanceof StreamDefinition) {
+            filter.append("streamId", new BsonString(InMemMetadataDaoImpl.getKey(t)));
+        } else {
+            filter.append("name", new BsonString(InMemMetadataDaoImpl.getKey(t)));
+        }
+
+        String json = "";
+        OpResult result = new OpResult();
+        try {
+            json = mapper.writeValueAsString(t);
+            UpdateOptions options = new UpdateOptions();
+            options.upsert(true);
+            UpdateResult ur = collection.replaceOne(filter, Document.parse(json), options);
+            // FIXME: could based on matched count do better matching...
+            if (ur.getModifiedCount() > 0 || ur.getUpsertedId() != null) {
+                result.code = 200;
+                result.message = String.format("update %d configuration item.", ur.getModifiedCount());
+            } else {
+                result.code = 500;
+                result.message = "no configuration item create/updated.";
+            }
+        } catch (Exception e) {
+            result.code = 500;
+            result.message = e.getMessage();
+            LOG.error("", e);
+        }
+        return result;
+    }
+
+    private <T> OpResult remove(MongoCollection<Document> collection, String name) {
+        BsonDocument filter = new BsonDocument();
+        filter.append("name", new BsonString(name));
+        DeleteResult dr = collection.deleteOne(filter);
+        OpResult result = new OpResult();
+        result.code = 200;
+        result.message = String.format(" %d config item removed!", dr.getDeletedCount());
+        return result;
+    }
+
+    @Override
+    public OpResult addCluster(StreamingCluster cluster) {
+        return addOrReplace(this.cluster, cluster);
+    }
+
+    @Override
+    public OpResult removeCluster(String clusterId) {
+        return remove(cluster, clusterId);
+    }
+
+    @Override
+    public List<StreamDefinition> listStreams() {
+        return list(schema, StreamDefinition.class);
+    }
+
+    @Override
+    public OpResult createStream(StreamDefinition stream) {
+        return addOrReplace(this.schema, stream);
+    }
+
+    @Override
+    public OpResult removeStream(String streamId) {
+        return remove(schema, streamId);
+    }
+
+    @Override
+    public List<Kafka2TupleMetadata> listDataSources() {
+        return list(datasource, Kafka2TupleMetadata.class);
+    }
+
+    @Override
+    public OpResult addDataSource(Kafka2TupleMetadata dataSource) {
+        return addOrReplace(this.datasource, dataSource);
+    }
+
+    @Override
+    public OpResult removeDataSource(String datasourceId) {
+        return remove(datasource, datasourceId);
+    }
+
+    @Override
+    public List<PolicyDefinition> listPolicies() {
+        return list(policy, PolicyDefinition.class);
+    }
+
+    @Override
+    public OpResult addPolicy(PolicyDefinition policy) {
+        return addOrReplace(this.policy, policy);
+    }
+
+    @Override
+    public OpResult removePolicy(String policyId) {
+        return remove(policy, policyId);
+    }
+
+    @Override
+    public List<Publishment> listPublishment() {
+        return list(publishment, Publishment.class);
+    }
+
+    @Override
+    public OpResult addPublishment(Publishment publishment) {
+        return addOrReplace(this.publishment, publishment);
+    }
+
+    @Override
+    public OpResult removePublishment(String pubId) {
+        return remove(publishment, pubId);
+    }
+
+    @Override
+    public List<PublishmentType> listPublishmentType() {
+        return list(publishmentType, PublishmentType.class);
+    }
+
+    @Override
+    public OpResult addPublishmentType(PublishmentType pubType) {
+        return addOrReplace(this.publishmentType, pubType);
+    }
+
+    @Override
+    public OpResult removePublishmentType(String pubType) {
+        return remove(publishmentType, pubType);
+    }
+
+    @Override
+    public ScheduleState getScheduleState(String versionId) {
+        BsonDocument doc = new BsonDocument();
+        doc.append("version", new BsonString(versionId));
+        ScheduleState state = scheduleStates.find(doc).map(new Function<Document, ScheduleState>() {
+            @Override
+            public ScheduleState apply(Document t) {
+                String json = t.toJson();
+                try {
+                    return mapper.readValue(json, ScheduleState.class);
+                } catch (IOException e) {
+                    LOG.error("deserialize config item failed!", e);
+                }
+                return null;
+            }
+        }).first();
+        return state;
+    }
+
+    @Override
+    public OpResult addScheduleState(ScheduleState state) {
+        return addOne(scheduleStates, state);
+    }
+
+    private <T> OpResult addOne(MongoCollection<Document> collection, T t) {
+        OpResult result = new OpResult();
+        try {
+            String json = mapper.writeValueAsString(t);
+            collection.insertOne(Document.parse(json));
+            result.code = 200;
+            result.message = "add state succeed!";
+        } catch (Exception e) {
+            result.code = 400;
+            result.message = e.getMessage();
+            LOG.error("", e);
+        }
+        return result;
+    }
+
+    @Override
+    public ScheduleState getScheduleState() {
+        BsonDocument sort = new BsonDocument();
+        sort.append("generateTime", new BsonInt32(-1));
+        ScheduleState state = scheduleStates.find().sort(sort).map(new Function<Document, ScheduleState>() {
+            @Override
+            public ScheduleState apply(Document t) {
+                String json = t.toJson();
+                try {
+                    return mapper.readValue(json, ScheduleState.class);
+                } catch (IOException e) {
+                    LOG.error("deserialize config item failed!", e);
+                }
+                return null;
+            }
+        }).first();
+        return state;
+    }
+
+    @Override
+    public List<PolicyAssignment> listAssignments() {
+        return list(assignments, PolicyAssignment.class);
+    }
+
+    @Override
+    public OpResult addAssignment(PolicyAssignment assignment) {
+        return addOne(assignments, assignment);
+    }
+
+    @Override
+    public List<Topology> listTopologies() {
+        return list(topologies, Topology.class);
+    }
+
+    @Override
+    public OpResult addTopology(Topology t) {
+        return addOrReplace(this.topologies, t);
+    }
+
+    @Override
+    public OpResult removeTopology(String topologyName) {
+        return remove(topologies, topologyName);
+    }
+
+    @Override
+    public OpResult clear() {
+        throw new UnsupportedOperationException("clear not support!");
+    }
+
+    @Override
+    public Models export() {
+        throw new UnsupportedOperationException("export not support!");
+    }
+
+    @Override
+    public OpResult importModels(Models models) {
+        throw new UnsupportedOperationException("importModels not support!");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/jdbc/JdbcMetadataDaoImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/jdbc/JdbcMetadataDaoImpl.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/jdbc/JdbcMetadataDaoImpl.java
new file mode 100644
index 0000000..9ec119a
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/jdbc/JdbcMetadataDaoImpl.java
@@ -0,0 +1,292 @@
+/*
+ * 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.metadata.impl.jdbc;
+
+import java.util.List;
+
+import org.apache.eagle.alert.coordination.model.Kafka2TupleMetadata;
+import org.apache.eagle.alert.coordination.model.ScheduleState;
+import org.apache.eagle.alert.coordination.model.internal.PolicyAssignment;
+import org.apache.eagle.alert.coordination.model.internal.Topology;
+import org.apache.eagle.alert.engine.coordinator.PolicyDefinition;
+import org.apache.eagle.alert.engine.coordinator.Publishment;
+import org.apache.eagle.alert.engine.coordinator.PublishmentType;
+import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
+import org.apache.eagle.alert.engine.coordinator.StreamingCluster;
+import org.apache.eagle.alert.metadata.resource.OpResult;
+import org.apache.eagle.alert.metadata.resource.IMetadataDao;
+import org.apache.eagle.alert.metadata.resource.Models;
+
+/**
+ * @since May 26, 2016
+ *
+ */
+public class JdbcMetadataDaoImpl implements IMetadataDao {
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#listTopologies()
+     */
+    @Override
+    public List<Topology> listTopologies() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#addTopology(org.apache.eagle.alert.coordination.model.internal.Topology)
+     */
+    @Override
+    public OpResult addTopology(Topology t) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#removeTopology(java.lang.String)
+     */
+    @Override
+    public OpResult removeTopology(String topologyName) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#listClusters()
+     */
+    @Override
+    public List<StreamingCluster> listClusters() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#addCluster(org.apache.eagle.alert.engine.coordinator.StreamingCluster)
+     */
+    @Override
+    public OpResult addCluster(StreamingCluster cluster) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#removeCluster(java.lang.String)
+     */
+    @Override
+    public OpResult removeCluster(String clusterId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#listStreams()
+     */
+    @Override
+    public List<StreamDefinition> listStreams() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#createStream(org.apache.eagle.alert.engine.coordinator.StreamDefinition)
+     */
+    @Override
+    public OpResult createStream(StreamDefinition stream) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#removeStream(java.lang.String)
+     */
+    @Override
+    public OpResult removeStream(String streamId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#listDataSources()
+     */
+    @Override
+    public List<Kafka2TupleMetadata> listDataSources() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#addDataSource(org.apache.eagle.alert.coordination.model.Kafka2TupleMetadata)
+     */
+    @Override
+    public OpResult addDataSource(Kafka2TupleMetadata dataSource) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#removeDataSource(java.lang.String)
+     */
+    @Override
+    public OpResult removeDataSource(String datasourceId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#listPolicies()
+     */
+    @Override
+    public List<PolicyDefinition> listPolicies() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#addPolicy(org.apache.eagle.alert.engine.coordinator.PolicyDefinition)
+     */
+    @Override
+    public OpResult addPolicy(PolicyDefinition policy) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#removePolicy(java.lang.String)
+     */
+    @Override
+    public OpResult removePolicy(String policyId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#listPublishment()
+     */
+    @Override
+    public List<Publishment> listPublishment() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#addPublishment(org.apache.eagle.alert.engine.coordinator.Publishment)
+     */
+    @Override
+    public OpResult addPublishment(Publishment publishment) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#removePublishment(java.lang.String)
+     */
+    @Override
+    public OpResult removePublishment(String pubId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#getScheduleState(java.lang.String)
+     */
+    @Override
+    public ScheduleState getScheduleState(String versionId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#getScheduleState()
+     */
+    @Override
+    public ScheduleState getScheduleState() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#addScheduleState(org.apache.eagle.alert.coordination.model.ScheduleState)
+     */
+    @Override
+    public OpResult addScheduleState(ScheduleState state) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#listAssignments()
+     */
+    @Override
+    public List<PolicyAssignment> listAssignments() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#addAssignment(org.apache.eagle.alert.coordination.model.internal.PolicyAssignment)
+     */
+    @Override
+    public OpResult addAssignment(PolicyAssignment assignment) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#clear()
+     */
+    @Override
+    public OpResult clear() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#export()
+     */
+    @Override
+    public Models export() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.eagle.service.alert.resource.IMetadataDao#importModels(org.apache.eagle.service.alert.resource.Models)
+     */
+    @Override
+    public OpResult importModels(Models models) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public List<PublishmentType> listPublishmentType() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public OpResult addPublishmentType(PublishmentType publishmentType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public OpResult removePublishmentType(String pubType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/IMetadataDao.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/IMetadataDao.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/IMetadataDao.java
new file mode 100644
index 0000000..8eef985
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/IMetadataDao.java
@@ -0,0 +1,86 @@
+/*
+ * 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.metadata.resource;
+
+import java.util.List;
+
+import org.apache.eagle.alert.coordination.model.Kafka2TupleMetadata;
+import org.apache.eagle.alert.coordination.model.ScheduleState;
+import org.apache.eagle.alert.coordination.model.internal.PolicyAssignment;
+import org.apache.eagle.alert.coordination.model.internal.Topology;
+import org.apache.eagle.alert.engine.coordinator.*;
+
+public interface IMetadataDao {
+
+    List<Topology> listTopologies();
+
+    OpResult addTopology(Topology t);
+
+    OpResult removeTopology(String topologyName);
+
+    List<StreamingCluster> listClusters();
+
+    OpResult addCluster(StreamingCluster cluster);
+
+    OpResult removeCluster(String clusterId);
+
+    List<StreamDefinition> listStreams();
+
+    OpResult createStream(StreamDefinition stream);
+
+    OpResult removeStream(String streamId);
+
+    List<Kafka2TupleMetadata> listDataSources();
+
+    OpResult addDataSource(Kafka2TupleMetadata dataSource);
+
+    OpResult removeDataSource(String datasourceId);
+
+    List<PolicyDefinition> listPolicies();
+
+    OpResult addPolicy(PolicyDefinition policy);
+
+    OpResult removePolicy(String policyId);
+
+    List<Publishment> listPublishment();
+
+    OpResult addPublishment(Publishment publishment);
+
+    OpResult removePublishment(String pubId);
+
+    List<PublishmentType> listPublishmentType();
+
+    OpResult addPublishmentType(PublishmentType publishmentType);
+
+    OpResult removePublishmentType(String pubType);
+
+    ScheduleState getScheduleState(String versionId);
+
+    ScheduleState getScheduleState();
+
+    OpResult addScheduleState(ScheduleState state);
+
+    List<PolicyAssignment> listAssignments();
+
+    OpResult addAssignment(PolicyAssignment assignment);
+
+    // APIs for test friendly
+    OpResult clear();
+    Models export();
+    OpResult importModels(Models models);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/Models.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/Models.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/Models.java
new file mode 100644
index 0000000..6bb38f1
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/Models.java
@@ -0,0 +1,48 @@
+/*
+ * 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.metadata.resource;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+import org.apache.eagle.alert.coordination.model.Kafka2TupleMetadata;
+import org.apache.eagle.alert.coordination.model.ScheduleState;
+import org.apache.eagle.alert.coordination.model.internal.PolicyAssignment;
+import org.apache.eagle.alert.coordination.model.internal.Topology;
+import org.apache.eagle.alert.engine.coordinator.PolicyDefinition;
+import org.apache.eagle.alert.engine.coordinator.Publishment;
+import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
+import org.apache.eagle.alert.engine.coordinator.StreamingCluster;
+
+/**
+ * This models used for metadata export/import to easy of test.
+ * 
+ * @since May 23, 2016
+ *
+ */
+public class Models {
+    public List<StreamingCluster> clusters = new ArrayList<StreamingCluster>();
+    public List<StreamDefinition> schemas = new ArrayList<StreamDefinition>();
+    public List<Kafka2TupleMetadata> datasources = new ArrayList<Kafka2TupleMetadata>();
+    public List<PolicyDefinition> policies = new ArrayList<PolicyDefinition>();
+    public List<Publishment> publishments = new ArrayList<Publishment>();
+    public SortedMap<String, ScheduleState> scheduleStates = new TreeMap<String, ScheduleState>();
+    public List<PolicyAssignment> assignments = new ArrayList<PolicyAssignment>();
+    public List<Topology> topologies = new ArrayList<Topology>();
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/OpResult.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/OpResult.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/OpResult.java
new file mode 100644
index 0000000..44f507d
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/resource/OpResult.java
@@ -0,0 +1,28 @@
+/*
+ * 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.metadata.resource;
+
+/**
+ * @since Apr 11, 2016
+ *
+ */
+public class OpResult {
+
+    public int code = 200;
+    public String message = "";
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/resources/application.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/resources/application.conf
new file mode 100644
index 0000000..9c80298
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/resources/application.conf
@@ -0,0 +1,23 @@
+# 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.
+
+{
+	"datastore": {
+		"metadataDao": "org.apache.eagle.service.alert.resource.impl.InMemMetadataDaoImpl",
+		"connection": "localhost:27017",
+		"properties" : {
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/InMemoryTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/InMemoryTest.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/InMemoryTest.java
new file mode 100644
index 0000000..54a2ffc
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/InMemoryTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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.service.alert.resource.impl;
+
+import org.apache.eagle.alert.engine.coordinator.PolicyDefinition;
+import org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl;
+import org.apache.eagle.alert.metadata.resource.IMetadataDao;
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.typesafe.config.ConfigFactory;
+
+/**
+ * @since May 1, 2016
+ *
+ */
+public class InMemoryTest {
+
+    private IMetadataDao dao = new InMemMetadataDaoImpl(ConfigFactory.load());
+
+    @Test
+    public void test_AddPolicy() {
+        PolicyDefinition pd = new PolicyDefinition();
+        pd.setName("pd1");
+        dao.addPolicy(pd);
+
+        Assert.assertEquals(1, dao.listPolicies().size());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/MongoImplTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/MongoImplTest.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/MongoImplTest.java
new file mode 100644
index 0000000..16b53d4
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/MongoImplTest.java
@@ -0,0 +1,187 @@
+/*
+ * 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.service.alert.resource.impl;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.eagle.alert.coordination.model.Kafka2TupleMetadata;
+import org.apache.eagle.alert.coordination.model.ScheduleState;
+import org.apache.eagle.alert.coordination.model.internal.PolicyAssignment;
+import org.apache.eagle.alert.coordination.model.internal.Topology;
+import org.apache.eagle.alert.engine.coordinator.PolicyDefinition;
+import org.apache.eagle.alert.engine.coordinator.Publishment;
+import org.apache.eagle.alert.engine.coordinator.PublishmentType;
+import org.apache.eagle.alert.engine.coordinator.StreamingCluster;
+import org.apache.eagle.alert.metadata.impl.MongoMetadataDaoImpl;
+import org.apache.eagle.alert.metadata.resource.IMetadataDao;
+import org.apache.eagle.alert.metadata.resource.OpResult;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+
+import de.flapdoodle.embed.mongo.MongodExecutable;
+import de.flapdoodle.embed.mongo.MongodProcess;
+import de.flapdoodle.embed.mongo.MongodStarter;
+import de.flapdoodle.embed.mongo.config.MongodConfigBuilder;
+import de.flapdoodle.embed.mongo.config.Net;
+import de.flapdoodle.embed.mongo.distribution.Version;
+import de.flapdoodle.embed.process.runtime.Network;
+
+/**
+ * @since May 1, 2016
+ *
+ */
+public class MongoImplTest {
+    private static Logger LOG = LoggerFactory.getLogger(MongoImplTest.class);
+    static IMetadataDao dao;
+
+    private static MongodExecutable mongodExe;
+    private static MongodProcess mongod;
+
+    public static void before() {
+        try {
+            MongodStarter starter = MongodStarter.getDefaultInstance();
+            mongodExe = starter.prepare(new MongodConfigBuilder().version(Version.V3_2_1)
+                    .net(new Net(27017, Network.localhostIsIPv6())).build());
+            mongod = mongodExe.start();
+        } catch (Exception e) {
+            LOG.error("start embed mongod failed, assume some external mongo running. continue run test!", e);
+        }
+    }
+
+    @BeforeClass
+    public static void setup() {
+        before();
+
+        System.setProperty("config.resource", "/application-mongo.conf");
+        ConfigFactory.invalidateCaches();
+        Config config = ConfigFactory.load().getConfig("datastore");
+        dao = new MongoMetadataDaoImpl(config);
+
+    }
+
+    @AfterClass
+    public static void teardown() {
+        if (mongod != null) {
+            mongod.stop();
+            mongodExe.stop();
+        }
+    }
+
+    private String TOPO_NAME = "topoName";
+
+    @Test
+    public void test_apis() {
+        // topology
+        {
+            OpResult result = dao.addTopology(new Topology(TOPO_NAME, 3, 5));
+            System.out.println(result.message);
+            Assert.assertEquals(200, result.code);
+            List<Topology> topos = dao.listTopologies();
+            Assert.assertEquals(1, topos.size());
+
+            result = dao.addTopology(new Topology(TOPO_NAME + "-new", 3, 5));
+            topos = dao.listTopologies();
+            Assert.assertEquals(2, topos.size());
+            // add again: replace existing one
+            result = dao.addTopology(new Topology(TOPO_NAME, 4, 5));
+            topos = dao.listTopologies();
+            Assert.assertEquals(2, topos.size());
+            Assert.assertEquals(TOPO_NAME, topos.get(0).getName());
+            Assert.assertEquals(4, topos.get(0).getNumOfGroupBolt());
+        }
+        // assignment
+        {
+            PolicyAssignment assignment = new PolicyAssignment();
+            assignment.setPolicyName("policy1");
+            OpResult result = dao.addAssignment(assignment);
+            Assert.assertEquals(200, result.code);
+            List<PolicyAssignment> assigns = dao.listAssignments();
+            Assert.assertEquals(1, assigns.size());
+        }
+        // cluster
+        {
+            StreamingCluster cluster = new StreamingCluster();
+            cluster.setName("dd");
+            OpResult result = dao.addCluster(cluster);
+            Assert.assertEquals(200, result.code);
+            List<StreamingCluster> assigns = dao.listClusters();
+            Assert.assertEquals(1, assigns.size());
+        }
+        // data source
+        {
+            Kafka2TupleMetadata dataSource = new Kafka2TupleMetadata();
+            dataSource.setName("ds");
+            OpResult result = dao.addDataSource(dataSource);
+            Assert.assertEquals(200, result.code);
+            List<Kafka2TupleMetadata> assigns = dao.listDataSources();
+            Assert.assertEquals(1, assigns.size());
+        }
+        // policy
+        {
+            PolicyDefinition policy = new PolicyDefinition();
+            policy.setName("ds");
+            OpResult result = dao.addPolicy(policy);
+            Assert.assertEquals(200, result.code);
+            List<PolicyDefinition> assigns = dao.listPolicies();
+            Assert.assertEquals(1, assigns.size());
+        }
+        // publishment
+        {
+            Publishment publishment = new Publishment();
+            publishment.setName("pub-");
+            OpResult result = dao.addPublishment(publishment);
+            Assert.assertEquals(200, result.code);
+            List<Publishment> assigns = dao.listPublishment();
+            Assert.assertEquals(1, assigns.size());
+        }
+        // publishment
+        {
+            PublishmentType publishmentType = new PublishmentType();
+            publishmentType.setType("KAFKA");
+            OpResult result = dao.addPublishmentType(publishmentType);
+            Assert.assertEquals(200, result.code);
+            List<PublishmentType> assigns = dao.listPublishmentType();
+            Assert.assertEquals(1, assigns.size());
+        }
+    }
+
+    private void test_addstate() {
+        ScheduleState state = new ScheduleState();
+        state.setVersion("state-" + System.currentTimeMillis());
+        state.setGenerateTime(String.valueOf(new Date().getTime()));
+        OpResult result = dao.addScheduleState(state);
+        Assert.assertEquals(200, result.code);
+    }
+
+    @Test
+    public void test_readCurrentState() {
+        test_addstate();
+        ScheduleState state = dao.getScheduleState();
+        Assert.assertNotNull(state);
+
+        System.out.println(state.getVersion());
+        System.out.println(state.getGenerateTime());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/application-mongo.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/application-mongo.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/application-mongo.conf
new file mode 100644
index 0000000..0becbfc
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/application-mongo.conf
@@ -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.
+
+{
+	"datastore": {
+		"metadataDao": "org.apache.eagle.service.alert.resource.impl.InMemMetadataDaoImpl",
+		"connection": "localhost:27017"
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/policy-sample.json
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/policy-sample.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/policy-sample.json
new file mode 100644
index 0000000..56a53e7
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/policy-sample.json
@@ -0,0 +1,32 @@
+{
+  "name": "policy1",
+  "description": "test policy",
+  "inputStreams": [
+    "in-stream-1",
+    "in-stream-2"
+  ],
+  "outputStreams": [
+    "out-stream-1"
+  ],
+  "definition": {
+    "type": "siddhiCEPEngine",
+    "value": "select count(*) from in-stream-1"
+  },
+  "partitionSpec": [
+    {
+      "streamId": "in-stream-1",
+      "type": "GROUPBY",
+      "columns": [
+        "col-1",
+        "col-2"
+      ],
+      "sortSpec": {
+        "column": "col-1",
+        "windowPeriod": "60",
+        "order": "asc",
+        "windowMargin": 30000
+      }
+    }
+  ],
+  "parallelismHint": 2
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/pom.xml
new file mode 100644
index 0000000..f344667
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/pom.xml
@@ -0,0 +1,30 @@
+<?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. -->
+<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.4.0-incubating-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+	<artifactId>alert-metadata-parent</artifactId>
+	<packaging>pom</packaging>
+
+	<modules>
+		<module>alert-metadata</module>
+		<module>alert-metadata-service</module>
+	</modules>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/eagle-alert/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/pom.xml
new file mode 100644
index 0000000..b065869
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/pom.xml
@@ -0,0 +1,392 @@
+<?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. -->
+<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-parent</artifactId>
+		<version>0.4.0-incubating-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+
+	<artifactId>eagle-alert</artifactId>
+	<packaging>pom</packaging>
+
+	<modules>
+		<module>alert-common</module>
+		<module>alert-engine</module>
+		<module>alert-metadata-parent</module>
+		<module>alert-coordinator</module>
+		<module>alert-assembly</module>
+		<module>alert-devtools</module>
+	</modules>
+
+	<properties>
+		<!-- Runtime -->
+		<java.version>1.8</java.version>
+
+		<!-- Build -->
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<maven-compiler.version>2.0.2</maven-compiler.version>
+
+		<!-- Test -->
+		<junit.version>4.12</junit.version>
+
+		<!-- Utilities -->
+		<typesafe-config.version>1.2.1</typesafe-config.version>
+		<guava.version>19.0</guava.version>
+		<commons-lang3.version>3.3.2</commons-lang3.version>
+		<commons-collections.version>3.2.1</commons-collections.version>
+		<commons-lang.version>2.6</commons-lang.version>
+		<archaius.version>0.6.1</archaius.version>
+		<metrics.version>3.1.0</metrics.version>
+		<mapdb.version>3.0.0-M6</mapdb.version>
+
+		<!-- CEP -->
+		<siddhi.version>3.0.5</siddhi.version>
+
+		<!-- PUBLISH -->
+		<velocity.version>1.7</velocity.version>
+		<javax.mail.version>1.4</javax.mail.version>
+
+		<!-- JSON -->
+		<fastxml.version>2.4.5</fastxml.version>
+		<jackson.version>1.9.13</jackson.version>
+		<fasterxml-jackson.version>2.4.5</fasterxml-jackson.version>
+		<codehaus-jackson.version>1.9.13</codehaus-jackson.version>
+
+		<!-- Storm and Kafka -->
+		<storm.version>0.9.3</storm.version>
+		<storm-kafka.version>0.9.3.2.2.0.0-2041</storm-kafka.version>
+		<kafka-clients.version>0.8.2.0</kafka-clients.version>
+		<kafka.version>0.8.1.2.2.0.0-2041</kafka.version>
+		<kafka.artifact.id>kafka_2.10</kafka.artifact.id>
+		<zkclient.version>0.3</zkclient.version>
+		<slf4j-api.veresion>1.7.20</slf4j-api.veresion>
+		<slf4j-log4j12.veresion>1.7.20</slf4j-log4j12.veresion>
+		<logback.version>1.1.7</logback.version>
+
+		<!-- Web Service/Client -->
+		<jersey.version>1.19.1</jersey.version>
+		<!--<jersey-client.version>1.19.1</jersey-client.version>-->
+		<!--<jersey-server.version>1.19.1</jersey-server.version>-->
+		<!--<jersey-multipart.version>1.19.1</jersey-multipart.version>-->
+
+		<jetty.version>9.2.3.v20140905</jetty.version>
+		<tomcat-embed.version>7.0.55</tomcat-embed.version>
+		<swagger.version>1.5.8</swagger.version>
+		<curator-framework.version>2.8.0</curator-framework.version>
+		<mongodb.version>3.2.2</mongodb.version>
+		<mockito.version>1.10.19</mockito.version>
+		<joda.version>2.2</joda.version>
+		<metrics-elasticsearch-reporter.version>2.2.0</metrics-elasticsearch-reporter.version>
+	</properties>
+
+	<repositories>
+		<repository>
+			<id>Maven Central Repository</id>
+			<url>http://central.maven.org/maven2/</url>
+		</repository>
+		<repository>
+			<id>HDP Release Repository</id>
+			<url>http://repo.hortonworks.com/content/repositories/releases/</url>
+		</repository>
+		<repository>
+			<id>HDP Central Repository</id>
+			<url>http://repo.hortonworks.com/content/repositories/central/</url>
+		</repository>
+		<repository>
+			<id>WSO2 Public</id>
+			<url>http://maven.wso2.org/nexus/content/groups/wso2-public</url>
+		</repository>
+	</repositories>
+
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>com.fasterxml.jackson.core</groupId>
+				<artifactId>jackson-core</artifactId>
+				<version>${fastxml.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.fasterxml.jackson.core</groupId>
+				<artifactId>jackson-databind</artifactId>
+				<version>${fastxml.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>javax.mail</groupId>
+				<artifactId>mail</artifactId>
+				<version>${javax.mail.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.velocity</groupId>
+				<artifactId>velocity</artifactId>
+				<version>${velocity.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.mockito</groupId>
+				<artifactId>mockito-all</artifactId>
+				<version>${mockito.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.curator</groupId>
+				<artifactId>curator-framework</artifactId>
+				<version>${curator-framework.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.curator</groupId>
+				<artifactId>curator-recipes</artifactId>
+				<version>${curator-framework.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.fasterxml.jackson.core</groupId>
+				<artifactId>jackson-annotations</artifactId>
+				<version>${fasterxml-jackson.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.commons</groupId>
+				<artifactId>commons-lang3</artifactId>
+				<version>${commons-lang3.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>commons-collections</groupId>
+				<artifactId>commons-collections</artifactId>
+				<version>${commons-collections.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>commons-lang</groupId>
+				<artifactId>commons-lang</artifactId>
+				<version>${commons-lang.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>junit</groupId>
+				<artifactId>junit</artifactId>
+				<version>${junit.version}</version>
+				<scope>test</scope>
+			</dependency>
+			<dependency>
+				<groupId>com.fasterxml.jackson.core</groupId>
+				<artifactId>jackson-databind</artifactId>
+				<version>${fasterxml-jackson.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.storm</groupId>
+				<artifactId>storm-kafka</artifactId>
+				<version>${storm-kafka.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.slf4j</groupId>
+				<artifactId>slf4j-log4j12</artifactId>
+				<version>${slf4j-log4j12.veresion}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.storm</groupId>
+				<artifactId>storm-core</artifactId>
+				<version>${storm.version}</version>
+				<exclusions>
+					<exclusion>
+						<groupId>org.slf4j</groupId>
+						<artifactId>log4j-over-slf4j</artifactId>
+					</exclusion>
+					<exclusion>
+						<groupId>org.apache.logging.log4j</groupId>
+						<artifactId>log4j-slf4j-impl</artifactId>
+					</exclusion>
+					<exclusion>
+						<groupId>ch.qos.logback</groupId>
+						<artifactId>logback-classic</artifactId>
+					</exclusion>
+				</exclusions>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.kafka</groupId>
+				<artifactId>${kafka.artifact.id}</artifactId>
+				<version>${kafka.version}</version>
+				<exclusions>
+					<exclusion>
+						<groupId>org.sfl4j</groupId>
+						<artifactId>slf4j-log4j</artifactId>
+					</exclusion>
+				</exclusions>
+			</dependency>
+			<dependency>
+				<groupId>com.sun.jersey</groupId>
+				<artifactId>jersey-client</artifactId>
+				<version>${jersey.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.codehaus.jackson</groupId>
+				<artifactId>jackson-jaxrs</artifactId>
+				<version>${codehaus-jackson.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.codehaus.jackson</groupId>
+				<artifactId>jackson-xc</artifactId>
+				<version>${codehaus-jackson.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.codehaus.jackson</groupId>
+				<artifactId>jackson-mapper-asl</artifactId>
+				<version>${codehaus-jackson.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.typesafe</groupId>
+				<artifactId>config</artifactId>
+				<version>${typesafe-config.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.netflix.archaius</groupId>
+				<artifactId>archaius-core</artifactId>
+				<version>${archaius.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>io.dropwizard.metrics</groupId>
+				<artifactId>metrics-core</artifactId>
+				<version>${metrics.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>io.dropwizard.metrics</groupId>
+				<artifactId>metrics-jvm</artifactId>
+				<version>${metrics.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.wso2.siddhi</groupId>
+				<artifactId>siddhi-core</artifactId>
+				<version>${siddhi.version}</version>
+				<exclusions>
+					<exclusion>
+						<groupId>org.slf4j</groupId>
+						<artifactId>slf4j-simple</artifactId>
+					</exclusion>
+				</exclusions>
+			</dependency>
+			<dependency>
+				<groupId>org.wso2.siddhi</groupId>
+				<artifactId>siddhi-query-api</artifactId>
+				<version>${siddhi.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.wso2.siddhi</groupId>
+				<artifactId>siddhi-query-compiler</artifactId>
+				<version>${siddhi.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.wso2.siddhi</groupId>
+				<artifactId>siddhi-extension-regex</artifactId>
+				<version>${siddhi.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.wso2.siddhi</groupId>
+				<artifactId>siddhi-extension-string</artifactId>
+				<version>${siddhi.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.kafka</groupId>
+				<artifactId>kafka-clients</artifactId>
+				<version>${kafka-clients.version}</version>
+				<!--<scope>test</scope> -->
+				<exclusions>
+					<exclusion>
+						<groupId>org.slf4j</groupId>
+						<artifactId>slf4j-log4j12</artifactId>
+					</exclusion>
+				</exclusions>
+			</dependency>
+			<dependency>
+				<groupId>com.101tec</groupId>
+				<artifactId>zkclient</artifactId>
+				<version>${zkclient.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.sun.jersey</groupId>
+				<artifactId>jersey-server</artifactId>
+				<version>${jersey.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.sun.jersey</groupId>
+				<artifactId>jersey-servlet</artifactId>
+				<version>${jersey.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.sun.jersey.contribs</groupId>
+				<artifactId>jersey-multipart</artifactId>
+				<version>${jersey.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.tomcat.embed</groupId>
+				<artifactId>tomcat-embed-core</artifactId>
+				<version>${tomcat-embed.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.google.guava</groupId>
+				<artifactId>guava</artifactId>
+				<version>${guava.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.slf4j</groupId>
+				<artifactId>slf4j-api</artifactId>
+				<version>${slf4j-api.veresion}</version>
+			</dependency>
+			<!--<dependency>-->
+				<!--<groupId>ch.qos.logback</groupId>-->
+				<!--<artifactId>logback-classic</artifactId>-->
+				<!--<version>${logback.version}</version>-->
+			<!--</dependency>-->
+			<dependency>
+				<groupId>io.swagger</groupId>
+				<artifactId>swagger-jaxrs</artifactId>
+				<version>${swagger.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.mapdb</groupId>
+				<artifactId>mapdb</artifactId>
+				<version>${mapdb.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>joda-time</groupId>
+				<artifactId>joda-time</artifactId>
+				<version>${joda.version}</version>
+			</dependency>
+
+			<dependency>
+				<groupId>org.elasticsearch</groupId>
+				<artifactId>metrics-elasticsearch-reporter</artifactId>
+				<version>${metrics-elasticsearch-reporter.version}</version>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+	<build>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<artifactId>maven-compiler-plugin</artifactId>
+					<version>${maven-compiler.version}</version>
+					<configuration>
+						<source>${java.version}</source>
+						<target>${java.version}</target>
+						<encoding>UTF-8</encoding>
+						<maxmem>2048m</maxmem>
+						<fork>true</fork>
+					</configuration>
+				</plugin>
+				<plugin>
+					<groupId>org.eclipse.jetty</groupId>
+					<artifactId>jetty-maven-plugin</artifactId>
+					<version>${jetty.version}</version>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert-parent/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/pom.xml b/eagle-core/eagle-alert-parent/pom.xml
new file mode 100644
index 0000000..6a383e8
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/pom.xml
@@ -0,0 +1,39 @@
+<?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.
+  -->
+
+<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-core</artifactId>
+		<version>0.4.0-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+	</parent>
+
+	<artifactId>eagle-alert-parent</artifactId>
+	<packaging>pom</packaging>
+
+	<name>eagle-alert-parent</name>
+	<modules>
+		<module>eagle-alert</module>
+		<module>eagle-alert-base</module>
+		<module>eagle-alert-process</module>
+		<module>eagle-alert-service</module>
+		<module>eagle-alert-notification-plugin</module>
+	</modules>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert/alert/.gitignore
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/alert/.gitignore b/eagle-core/eagle-alert/alert/.gitignore
deleted file mode 100644
index 12af842..0000000
--- a/eagle-core/eagle-alert/alert/.gitignore
+++ /dev/null
@@ -1,80 +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.
-
-# Eagle - Git Ignore Configuration
-#
-# See: https://github.com/github/gitignore/
-
-*.class
-*.out
-
-# Mobile Tools for Java (J2ME)
-.mtj.tmp/
-
-# Package Files #
-*.jar
-*.war
-*.ear
-
-.cache-main
-
-# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
-hs_err_pid*
-
-# Maven
-target/
-target/*
-*/target/*
-**/target/*
-pom.xml.tag
-pom.xml.releaseBackup
-pom.xml.versionsBackup
-pom.xml.next
-release.properties
-dependency-reduced-pom.xml
-buildNumber.properties
-eagle-security/eagle-security-mltraining/src/test/resources/outputDir/
-eagle-security/eagle-security-userprofile/src/test/resources/models/
-
-# IntelliJ IDEA
-.idea/
-.metadata/
-**.iml
-**.eml
-**.patch
-mobile.userlibraries
-
-# Eclipse
-build
-.metadata
-.classpath
-.project
-.settings
-.externalToolBuilders
-classes
-# bin
-
-# Temporary files
-logs/
-*.log*
-# Mac files
-.DS_Store
-
-*.cache-tests
-application-local.conf
-
-*.orig
-**/*.pyc
-*.bak

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert/alert/README.md
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/alert/README.md b/eagle-core/eagle-alert/alert/README.md
deleted file mode 100644
index e23ef68..0000000
--- a/eagle-core/eagle-alert/alert/README.md
+++ /dev/null
@@ -1,169 +0,0 @@
-<!--
-{% comment %}
-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.
-{% endcomment %}
--->
-
-## Prerequisites
-
-* [Apache Maven](https://maven.apache.org/)
-* [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
-
-## Documentation
-
-
-## Build
-
-    mvn install
-    
-## Setup
-The alert engine have three dependency module: Coordinator Service, Metadata Service, and engine runtime(storm topologies).
-
-####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
-
-> For deployment, after mvn install, a war is avaialble in alert-metadata-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 
-
-See below detailed steps.
-
-
-## Run
-* pre-requisites
-  * zookeeper
-  * storm
-  * kafka
-  * 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
-    ```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,
-		"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" : "/alertmetadata/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
-   ```json
-  {
-  "topology" : {
-    "name" : "alertUnitTopology_1",
-    "numOfTotalWorkers" : 2,
-    "numOfSpoutTasks" : 1,
-    "numOfRouterBolts" : 4,
-    "numOfAlertBolts" : 10,
-    "numOfPublishTasks" : 1,
-    "messageTimeoutSecs": 3600,
-    "localMode" : "true"
-  },
-  "spout" : {
-    "kafkaBrokerZkQuorum": "localhost:2181",
-    "kafkaBrokerZkBasePath": "/brokers",
-    "stormKafkaUseSameZkQuorumWithKafkaBroker": true,
-    "stormKafkaTransactionZkQuorum": "",
-    "stormKafkaTransactionZkPath": "/consumers",
-    "stormKafkaEagleConsumer": "eagle_consumer",
-    "stormKafkaStateUpdateIntervalMs": 2000,
-    "stormKafkaFetchSizeBytes": 1048586,
-  },
-  "zkConfig" : {
-    "zkQuorum" : "localhost:2181",
-    "zkRoot" : "/alert",
-    "zkSessionTimeoutMs" : 10000,
-    "connectionTimeoutMs" : 10000,
-    "zkRetryTimes" : 3,
-    "zkRetryInterval" : 3000
-  },
-  "dynamicConfigSource" : {
-    "initDelayMillis": 3000,
-    "delayMillis" : 10000
-  },
-  "metadataService": {
-    "context" : "/alertmetadata/api",
-    "host" : "localhost",
-    "port" : 8080
-  },
-  "coordinatorService": {
-    "host": "localhost",
-    "port": 8080,
-    "context" : "/coordinator/api"
-  }
-  "metric": {
-    "sink": {
-      "stdout": {}
-    }
-  }
-}
-```
-  Note: please make sure the above configuration is used by storm instead of the configuration within fat jar
-  3. start storm
-     storm jar alert-engine-0.0.1-SNAPSHOT-alert-assembly.jar org.apache.eagle.alert.engine.UnitTopologyMain
-
-## Support
-

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert/alert/alert-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/alert/alert-assembly/pom.xml b/eagle-core/eagle-alert/alert/alert-assembly/pom.xml
deleted file mode 100644
index 3f5b341..0000000
--- a/eagle-core/eagle-alert/alert/alert-assembly/pom.xml
+++ /dev/null
@@ -1,102 +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.
-  -->
-<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>alert-parent</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>alert-assembly</artifactId>
-    <packaging>jar</packaging>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>alert-common</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>alert-coordinator</artifactId>
-            <version>${project.version}</version>
-            <type>war</type>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>alert-metadata-service</artifactId>
-            <version>${project.version}</version>
-            <type>war</type>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>alert-engine-base</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!-- package test cases -->
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>alert-common</artifactId>
-            <version>${project.version}</version>
-            <type>test-jar</type>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>alert-coordinator</artifactId>
-            <version>${project.version}</version>
-            <type>test-jar</type>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>alert-engine-base</artifactId>
-            <version>${project.version}</version>
-            <type>test-jar</type>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <resources>
-            <resource>
-                <directory>src/resources</directory>
-            </resource>
-        </resources>
-        <plugins>
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <configuration>
-                    <descriptor>src/assembly/alert-assembly.xml</descriptor>
-                    <finalName>alert-engine-${project.version}</finalName>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                        <configuration>
-                            <tarLongFileMode>posix</tarLongFileMode>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert/alert/alert-assembly/src/assembly/alert-assembly.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/alert/alert-assembly/src/assembly/alert-assembly.xml b/eagle-core/eagle-alert/alert/alert-assembly/src/assembly/alert-assembly.xml
deleted file mode 100644
index b61e6b2..0000000
--- a/eagle-core/eagle-alert/alert/alert-assembly/src/assembly/alert-assembly.xml
+++ /dev/null
@@ -1,58 +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.
-  -->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-    <id>alert-assembly</id>
-    <formats>
-        <format>jar</format>
-    </formats>
-    <includeBaseDirectory>false</includeBaseDirectory>
-    <dependencySets>
-        <dependencySet>
-            <outputDirectory>/</outputDirectory>
-            <useProjectArtifact>false</useProjectArtifact>
-            <unpack>true</unpack>
-            <scope>runtime</scope>
-            <unpackOptions>
-            </unpackOptions>
-            <excludes>
-                <!--<exclude>org.apache.storm:storm-core</exclude>
-                <exclude>org.slf4j:slf4j-log4j12</exclude>-->
-                <exclude>org.apache.storm:storm-core</exclude>
-                <exclude>org.slf4j:slf4j-api</exclude>
-                <exclude>org.slf4j:log4j-over-slf4j</exclude>
-                <exclude>org.slf4j:slf4j-log4j12</exclude>
-                <exclude>log4j:log4j</exclude>
-                <exclude>asm:asm</exclude>
-                <exclude>org.apache.log4j.wso2:log4j</exclude>
-                <exclude>log4j:apache-log4j-extras</exclude>
-            </excludes>
-        </dependencySet>
-    </dependencySets>
-    <fileSets>
-        <fileSet>
-            <directory>${project.build.outputDirectory}</directory>
-            <outputDirectory>/</outputDirectory>
-            <excludes>
-            </excludes>
-            <includes>
-            </includes>
-        </fileSet>
-    </fileSets>
-</assembly>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert/alert/alert-common/.gitignore
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/alert/alert-common/.gitignore b/eagle-core/eagle-alert/alert/alert-common/.gitignore
deleted file mode 100644
index 1dd3331..0000000
--- a/eagle-core/eagle-alert/alert/alert-common/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/target/
-/target/

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/737e5a2d/eagle-core/eagle-alert/alert/alert-common/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/alert/alert-common/pom.xml b/eagle-core/eagle-alert/alert/alert-common/pom.xml
deleted file mode 100644
index 129cff0..0000000
--- a/eagle-core/eagle-alert/alert/alert-common/pom.xml
+++ /dev/null
@@ -1,129 +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. -->
-<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>alert-parent</artifactId>
-		<version>0.0.1-SNAPSHOT</version>
-	</parent>
-
-	<artifactId>alert-common</artifactId>
-	<packaging>jar</packaging>
-
-	<dependencies>
-		<dependency>
-			<groupId>com.typesafe</groupId>
-			<artifactId>config</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>com.fasterxml.jackson.core</groupId>
-			<artifactId>jackson-annotations</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.commons</groupId>
-			<artifactId>commons-lang3</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>commons-collections</groupId>
-			<artifactId>commons-collections</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>commons-lang</groupId>
-			<artifactId>commons-lang</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>com.google.guava</groupId>
-			<artifactId>guava</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-log4j12</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.curator</groupId>
-			<artifactId>curator-framework</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.curator</groupId>
-			<artifactId>curator-recipes</artifactId>
-		</dependency>
-		<dependency>
-			<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>
-		</dependency>
-		<dependency>
-			<groupId>joda-time</groupId>
-			<artifactId>joda-time</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>io.dropwizard.metrics</groupId>
-			<artifactId>metrics-core</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.storm</groupId>
-			<artifactId>storm-core</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.elasticsearch</groupId>
-			<artifactId>metrics-elasticsearch-reporter</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.kafka</groupId>
-			<artifactId>kafka-clients</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.kafka</groupId>
-			<artifactId>${kafka.artifact.id}</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>io.dropwizard.metrics</groupId>
-			<artifactId>metrics-jvm</artifactId>
-		</dependency>
-	</dependencies>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-jar-plugin</artifactId>
-				<version>2.6</version>
-				<executions>
-					<execution>
-						<goals>
-							<goal>test-jar</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-</project>


Mime
View raw message