eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [01/18] incubator-eagle git commit: [EAGLE-530] Fix checkstyle problems on eagle-alert module and enable failOnViolation
Date Thu, 08 Sep 2016 07:14:59 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/develop 5c4dddb9d -> 60f9642e0


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/test/resources/application.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/test/resources/application.conf
index 63e649c..f760241 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/test/resources/application.conf
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/test/resources/application.conf
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 {
-	"datastore": {
-		"metadataDao": "org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl"
-	}
+  "datastore": {
+    "metadataDao": "org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl"
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/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/IMetadataDao.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/IMetadataDao.java
index 59bd4bf..d245afd 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/IMetadataDao.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/IMetadataDao.java
@@ -16,9 +16,6 @@
  */
 package org.apache.eagle.alert.metadata;
 
-import java.io.Closeable;
-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;
@@ -27,6 +24,9 @@ import org.apache.eagle.alert.engine.coordinator.*;
 import org.apache.eagle.alert.metadata.resource.Models;
 import org.apache.eagle.alert.metadata.resource.OpResult;
 
+import java.io.Closeable;
+import java.util.List;
+
 public interface IMetadataDao extends Closeable {
 
     List<Topology> listTopologies();
@@ -83,7 +83,9 @@ public interface IMetadataDao extends Closeable {
 
     // APIs for test friendly
     OpResult clear();
+
     Models export();
+
     OpResult importModels(Models models);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/MetadataUtils.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/MetadataUtils.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/MetadataUtils.java
index 1210861..7015a53 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/MetadataUtils.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/MetadataUtils.java
@@ -18,11 +18,11 @@
 
 package org.apache.eagle.alert.metadata;
 
-import com.typesafe.config.Config;
 import org.apache.eagle.alert.coordination.model.ScheduleState;
 import org.apache.eagle.alert.coordination.model.internal.PolicyAssignment;
 import org.apache.eagle.alert.engine.coordinator.PublishmentType;
 import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
+import com.typesafe.config.Config;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -34,7 +34,7 @@ import java.sql.SQLException;
 
 public class MetadataUtils {
 
-    private final static Logger LOG = LoggerFactory.getLogger(MetadataUtils.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MetadataUtils.class);
 
     public static <T> String getKey(T t) {
         if (t instanceof StreamDefinition) {
@@ -54,11 +54,11 @@ public class MetadataUtils {
             Method m = t.getClass().getMethod("getName");
             return (String) m.invoke(t);
         } catch (NoSuchMethodException | SecurityException | InvocationTargetException | IllegalAccessException
-                | IllegalArgumentException e) {
+            | IllegalArgumentException e) {
             LOG.error(" getName not found on given class :" + t.getClass().getName());
         }
         throw new RuntimeException(String.format("no getName() found on target class %s for matching", t.getClass()
-                .getName()));
+            .getName()));
     }
 
     public static Connection getJdbcConnection(Config config) {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/InMemMetadataDaoImpl.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/InMemMetadataDaoImpl.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/InMemMetadataDaoImpl.java
index ecd9a6e..dea5b82 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/InMemMetadataDaoImpl.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/InMemMetadataDaoImpl.java
@@ -16,40 +16,29 @@
  */
 package org.apache.eagle.alert.metadata.impl;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Optional;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.function.Predicate;
-
-import com.google.inject.Inject;
 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.engine.coordinator.*;
 import org.apache.eagle.alert.metadata.IMetadataDao;
 import org.apache.eagle.alert.metadata.MetadataUtils;
 import org.apache.eagle.alert.metadata.resource.Models;
 import org.apache.eagle.alert.metadata.resource.OpResult;
+import com.google.inject.Inject;
+import com.typesafe.config.Config;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.typesafe.config.Config;
+import java.io.IOException;
+import java.util.*;
+import java.util.function.Predicate;
 
 /**
  * In memory service for simple service start. Make all service API as
  * synchronized.
- * 
- * @since Apr 11, 2016
  *
+ * @since Apr 11, 2016
  */
 public class InMemMetadataDaoImpl implements IMetadataDao {
 
@@ -207,10 +196,6 @@ public class InMemMetadataDaoImpl implements IMetadataDao {
         return remove(publishmentTypes, pubType);
     }
 
-    @Override
-    public ScheduleState getScheduleState(String versionId) {
-        return scheduleStates.get(versionId);
-    }
 
     @Override
     public synchronized OpResult addScheduleState(ScheduleState state) {
@@ -239,6 +224,11 @@ public class InMemMetadataDaoImpl implements IMetadataDao {
     }
 
     @Override
+    public ScheduleState getScheduleState(String versionId) {
+        return scheduleStates.get(versionId);
+    }
+
+    @Override
     public List<PolicyAssignment> listAssignments() {
         return assignments;
     }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcDatabaseHandler.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/JdbcDatabaseHandler.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcDatabaseHandler.java
index 08d670a..e484e09 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcDatabaseHandler.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcDatabaseHandler.java
@@ -18,12 +18,12 @@
 
 package org.apache.eagle.alert.metadata.impl;
 
+import org.apache.eagle.alert.metadata.MetadataUtils;
+import org.apache.eagle.alert.metadata.resource.OpResult;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.typesafe.config.Config;
-import org.apache.eagle.alert.metadata.MetadataUtils;
-import org.apache.eagle.alert.metadata.resource.OpResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -38,12 +38,12 @@ public class JdbcDatabaseHandler {
 
     private static final Logger LOG = LoggerFactory.getLogger(JdbcDatabaseHandler.class);
 
-    private final String INSERT_STATEMENT = "INSERT INTO %s VALUES (?, ?)";
-    private final String DELETE_STATEMENT = "DELETE FROM %s WHERE id=?";
-    private final String UPDATE_STATEMENT = "UPDATE %s set value=? WHERE id=?";
-    private final String QUERY_ALL_STATEMENT = "SELECT value FROM %s";
-    private final String QUERY_CONDITION_STATEMENT = "SELECT value FROM %s WHERE id=?";
-    private final String QUERY_ORDERBY_STATEMENT = "SELECT value FROM %s ORDER BY id %s";
+    private static final String INSERT_STATEMENT = "INSERT INTO %s VALUES (?, ?)";
+    private static final String DELETE_STATEMENT = "DELETE FROM %s WHERE id=?";
+    private static final String UPDATE_STATEMENT = "UPDATE %s set value=? WHERE id=?";
+    private static final String QUERY_ALL_STATEMENT = "SELECT value FROM %s";
+    private static final String QUERY_CONDITION_STATEMENT = "SELECT value FROM %s WHERE id=?";
+    private static final String QUERY_ORDERBY_STATEMENT = "SELECT value FROM %s ORDER BY id %s";
 
     private Map<String, String> tblNameMap = new HashMap<>();
 
@@ -98,19 +98,19 @@ public class JdbcDatabaseHandler {
             LOG.info("update {} entities", status);
             connection.commit();
         } catch (SQLException e) {
-            LOG.error(e.getMessage(),e.getCause());
-            if(e.getMessage().toLowerCase().contains("duplicate")){
+            LOG.error(e.getMessage(), e.getCause());
+            if (e.getMessage().toLowerCase().contains("duplicate")) {
                 LOG.info("Detected duplicated entity");
                 try {
                     connection.rollback(savepoint);
                     update(tb, key, value);
                 } catch (SQLException e1) {
                     //e1.printStackTrace();
-                    LOG.warn("Rollback failed",e1);
+                    LOG.warn("Rollback failed", e1);
                 }
             }
         } catch (JsonProcessingException e) {
-            LOG.error("Got JsonProcessingException: {}",e.getMessage(),e.getCause());
+            LOG.error("Got JsonProcessingException: {}", e.getMessage(), e.getCause());
             result.code = OpResult.FAILURE;
             result.message = e.getMessage();
         } finally {
@@ -118,7 +118,7 @@ public class JdbcDatabaseHandler {
                 try {
                     statement.close();
                 } catch (SQLException e) {
-                    LOG.error("Failed to close statement: {}",e.getMessage(),e.getCause());
+                    LOG.error("Failed to close statement: {}", e.getMessage(), e.getCause());
                 }
             }
         }
@@ -157,7 +157,7 @@ public class JdbcDatabaseHandler {
             ResultSet rs = statement.executeQuery(String.format(QUERY_ALL_STATEMENT, tb));
             while (rs.next()) {
                 //String key = rs.getString(1);
-                String json= rs.getString(1);
+                String json = rs.getString(1);
                 try {
                     T obj = mapper.readValue(json, clz);
                     result.add(obj);
@@ -183,7 +183,7 @@ public class JdbcDatabaseHandler {
             ResultSet rs = statement.executeQuery();
             while (rs.next()) {
                 //String key = rs.getString(1);
-                String json= rs.getString(1);
+                String json = rs.getString(1);
                 try {
                     T obj = mapper.readValue(json, clz);
                     result.add(obj);
@@ -219,7 +219,7 @@ public class JdbcDatabaseHandler {
             ResultSet rs = statement.executeQuery();
             while (rs.next()) {
                 //String key = rs.getString(1);
-                String json= rs.getString(1);
+                String json = rs.getString(1);
                 try {
                     T obj = mapper.readValue(json, clz);
                     result.add(obj);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/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/JdbcMetadataDaoImpl.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcMetadataDaoImpl.java
index 639edd6..bba2d1e 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcMetadataDaoImpl.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcMetadataDaoImpl.java
@@ -16,27 +16,22 @@
  */
 package org.apache.eagle.alert.metadata.impl;
 
-import java.io.IOException;
-import java.util.List;
-
-import com.google.inject.Inject;
-import com.typesafe.config.Config;
 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.engine.coordinator.*;
 import org.apache.eagle.alert.metadata.IMetadataDao;
 import org.apache.eagle.alert.metadata.resource.Models;
+import org.apache.eagle.alert.metadata.resource.OpResult;
+import com.google.inject.Inject;
+import com.typesafe.config.Config;
+
+import java.io.IOException;
+import java.util.List;
 
 /**
- * @since May 26, 2016
- *
+ * @since May 26, 2016.
  */
 public class JdbcMetadataDaoImpl implements IMetadataDao {
     private JdbcDatabaseHandler handler;
@@ -50,39 +45,48 @@ public class JdbcMetadataDaoImpl implements IMetadataDao {
     public List<Topology> listTopologies() {
         return handler.list(Topology.class);
     }
+
     @Override
     public List<StreamingCluster> listClusters() {
         return handler.list(StreamingCluster.class);
     }
+
     @Override
     public List<StreamDefinition> listStreams() {
         return handler.list(StreamDefinition.class);
     }
+
     @Override
     public List<Kafka2TupleMetadata> listDataSources() {
         return handler.list(Kafka2TupleMetadata.class);
     }
+
     @Override
     public List<PolicyDefinition> listPolicies() {
         return handler.list(PolicyDefinition.class);
     }
+
     @Override
     public List<Publishment> listPublishment() {
         return handler.list(Publishment.class);
     }
+
     @Override
     public ScheduleState getScheduleState(String versionId) {
         return handler.listWithFilter(versionId, ScheduleState.class);
         //return null;
     }
+
     @Override
     public ScheduleState getScheduleState() {
         return handler.listTop(ScheduleState.class, "DESC");
     }
+
     @Override
     public List<PolicyAssignment> listAssignments() {
         return handler.list(PolicyAssignment.class);
     }
+
     @Override
     public List<PublishmentType> listPublishmentType() {
         return handler.list(PublishmentType.class);
@@ -92,34 +96,42 @@ public class JdbcMetadataDaoImpl implements IMetadataDao {
     public OpResult addTopology(Topology t) {
         return handler.addOrReplace(Topology.class.getSimpleName(), t);
     }
+
     @Override
     public OpResult addCluster(StreamingCluster cluster) {
         return handler.addOrReplace(StreamingCluster.class.getSimpleName(), cluster);
     }
+
     @Override
     public OpResult createStream(StreamDefinition stream) {
         return handler.addOrReplace(StreamDefinition.class.getSimpleName(), stream);
     }
+
     @Override
     public OpResult addDataSource(Kafka2TupleMetadata dataSource) {
         return handler.addOrReplace(Kafka2TupleMetadata.class.getSimpleName(), dataSource);
     }
+
     @Override
     public OpResult addPolicy(PolicyDefinition policy) {
         return handler.addOrReplace(PolicyDefinition.class.getSimpleName(), policy);
     }
+
     @Override
     public OpResult addPublishment(Publishment publishment) {
         return handler.addOrReplace(Publishment.class.getSimpleName(), publishment);
     }
+
     @Override
     public OpResult addScheduleState(ScheduleState state) {
         return handler.addOrReplace(ScheduleState.class.getSimpleName(), state);
     }
+
     @Override
     public OpResult addAssignment(PolicyAssignment assignment) {
         return handler.addOrReplace(PolicyAssignment.class.getSimpleName(), assignment);
     }
+
     @Override
     public OpResult addPublishmentType(PublishmentType publishmentType) {
         return handler.addOrReplace(PublishmentType.class.getSimpleName(), publishmentType);
@@ -129,26 +141,32 @@ public class JdbcMetadataDaoImpl implements IMetadataDao {
     public OpResult removeTopology(String topologyName) {
         return handler.remove(Topology.class.getSimpleName(), topologyName);
     }
+
     @Override
     public OpResult removeCluster(String clusterId) {
         return handler.remove(StreamingCluster.class.getSimpleName(), clusterId);
     }
+
     @Override
     public OpResult removeStream(String streamId) {
         return handler.remove(StreamDefinition.class.getSimpleName(), streamId);
     }
+
     @Override
     public OpResult removeDataSource(String datasourceId) {
         return handler.remove(Kafka2TupleMetadata.class.getSimpleName(), datasourceId);
     }
+
     @Override
     public OpResult removePolicy(String policyId) {
         return handler.remove(PolicyDefinition.class.getSimpleName(), policyId);
     }
+
     @Override
     public OpResult removePublishment(String pubId) {
         return handler.remove(Publishment.class.getSimpleName(), pubId);
     }
+
     @Override
     public OpResult removePublishmentType(String pubType) {
         return handler.remove(PublishmentType.class.getSimpleName(), pubType);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcSchemaManager.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/JdbcSchemaManager.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcSchemaManager.java
index d9df055..274164d 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcSchemaManager.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/JdbcSchemaManager.java
@@ -18,16 +18,18 @@
 
 package org.apache.eagle.alert.metadata.impl;
 
-import com.typesafe.config.Config;
-import org.apache.ddlutils.Platform;
-import org.apache.ddlutils.PlatformFactory;
-import org.apache.ddlutils.model.*;
 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.*;
 import org.apache.eagle.alert.metadata.MetadataUtils;
+import com.typesafe.config.Config;
+import org.apache.ddlutils.Platform;
+import org.apache.ddlutils.PlatformFactory;
+import org.apache.ddlutils.model.Column;
+import org.apache.ddlutils.model.Database;
+import org.apache.ddlutils.model.Table;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -40,7 +42,7 @@ import java.util.Map;
 
 public class JdbcSchemaManager {
 
-    private final static Logger LOG = LoggerFactory.getLogger(JdbcSchemaManager.class);
+    private static final Logger LOG = LoggerFactory.getLogger(JdbcSchemaManager.class);
     private Database database;
     private Platform platform;
 
@@ -48,9 +50,10 @@ public class JdbcSchemaManager {
 
     public static Map<String, String> tblNameMap = new HashMap<>();
 
-    private JdbcSchemaManager(){}
+    private JdbcSchemaManager() {
+    }
 
-    private static void registerTableName(String clzName, String tblName){
+    private static void registerTableName(String clzName, String tblName) {
         tblNameMap.put(clzName, tblName);
     }
 
@@ -66,8 +69,8 @@ public class JdbcSchemaManager {
         registerTableName(Topology.class.getSimpleName(), "topology");
     }
 
-    public static JdbcSchemaManager getInstance(){
-        if(instance == null) {
+    public static JdbcSchemaManager getInstance() {
+        if (instance == null) {
             instance = new JdbcSchemaManager();
         }
         return instance;
@@ -84,28 +87,28 @@ public class JdbcSchemaManager {
             LOG.info("Loaded " + database);
 
             Database _database = identifyNewTables();
-            if(_database.getTableCount() > 0) {
+            if (_database.getTableCount() > 0) {
                 LOG.info("Creating {} new tables (totally {} tables)", _database.getTableCount(), database.getTableCount());
                 this.platform.createTables(connection, _database, false, true);
-                LOG.info("Created {} new tables: ",_database.getTableCount(), _database.getTables());
+                LOG.info("Created {} new tables: ", _database.getTableCount(), _database.getTables());
             } else {
                 LOG.debug("All the {} tables have already been created, no new tables", database.getTableCount());
             }
         } catch (Exception e) {
-            LOG.error(e.getMessage(),e);
+            LOG.error(e.getMessage(), e);
             throw new IllegalStateException(e);
         } finally {
-            if (connection != null){
+            if (connection != null) {
                 try {
                     connection.close();
                 } catch (SQLException e) {
-                    LOG.warn(e.getMessage(),e);
+                    LOG.warn(e.getMessage(), e);
                 }
             }
         }
     }
 
-    private Database identifyNewTables(){
+    private Database identifyNewTables() {
         Database _database = new Database();
         _database.setName(database.getName());
         Collection<String> tableNames = tblNameMap.values();
@@ -127,7 +130,7 @@ public class JdbcSchemaManager {
         this.platform.shutdownDatabase();
     }
 
-    private Table createTable(String tableName){
+    private Table createTable(String tableName) {
         Table table = new Table();
         table.setName(tableName);
         buildTable(table);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MetadataDaoFactory.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/MetadataDaoFactory.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MetadataDaoFactory.java
index 0b91277..b03fc61 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MetadataDaoFactory.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MetadataDaoFactory.java
@@ -16,18 +16,16 @@
  */
 package org.apache.eagle.alert.metadata.impl;
 
-import java.lang.reflect.Constructor;
-
 import org.apache.eagle.alert.metadata.IMetadataDao;
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.typesafe.config.Config;
-import com.typesafe.config.ConfigFactory;
+import java.lang.reflect.Constructor;
 
 /**
- * @since Apr 12, 2016
- *
+ * @since Apr 12, 2016.
  */
 public class MetadataDaoFactory {
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/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
index d68dc6a..2f03bf9 100644
--- 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
@@ -16,6 +16,16 @@
  */
 package org.apache.eagle.alert.metadata.impl;
 
+import org.apache.eagle.alert.coordination.model.*;
+import org.apache.eagle.alert.coordination.model.internal.MonitoredStream;
+import org.apache.eagle.alert.coordination.model.internal.PolicyAssignment;
+import org.apache.eagle.alert.coordination.model.internal.ScheduleStateBase;
+import org.apache.eagle.alert.coordination.model.internal.Topology;
+import org.apache.eagle.alert.engine.coordinator.*;
+import org.apache.eagle.alert.metadata.IMetadataDao;
+import org.apache.eagle.alert.metadata.MetadataUtils;
+import org.apache.eagle.alert.metadata.resource.Models;
+import org.apache.eagle.alert.metadata.resource.OpResult;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.inject.Inject;
@@ -30,16 +40,6 @@ import com.mongodb.client.model.UpdateOptions;
 import com.mongodb.client.result.DeleteResult;
 import com.mongodb.client.result.UpdateResult;
 import com.typesafe.config.Config;
-import org.apache.eagle.alert.coordination.model.*;
-import org.apache.eagle.alert.coordination.model.internal.MonitoredStream;
-import org.apache.eagle.alert.coordination.model.internal.PolicyAssignment;
-import org.apache.eagle.alert.coordination.model.internal.ScheduleStateBase;
-import org.apache.eagle.alert.coordination.model.internal.Topology;
-import org.apache.eagle.alert.engine.coordinator.*;
-import org.apache.eagle.alert.metadata.IMetadataDao;
-import org.apache.eagle.alert.metadata.MetadataUtils;
-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;
@@ -54,14 +54,14 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @since Apr 11, 2016
- *
+ * @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);
     }
@@ -135,18 +135,18 @@ public class MongoMetadataDaoImpl implements IMetadataDao {
 
         spoutSpecs = db.getCollection("spoutSpecs");
         {
-            IndexOptions io_internal = new IndexOptions().background(true).unique(true).name("topologyIdIndex");
-            BsonDocument doc_internal = new BsonDocument();
-            doc_internal.append("topologyId", new BsonInt32(1));
-            spoutSpecs.createIndex(doc_internal, io_internal);
+            IndexOptions ioInternal = new IndexOptions().background(true).unique(true).name("topologyIdIndex");
+            BsonDocument docInternal = new BsonDocument();
+            docInternal.append("topologyId", new BsonInt32(1));
+            spoutSpecs.createIndex(docInternal, ioInternal);
         }
 
         alertSpecs = db.getCollection("alertSpecs");
         {
-            IndexOptions io_internal = new IndexOptions().background(true).unique(true).name("topologyNameIndex");
-            BsonDocument doc_internal = new BsonDocument();
-            doc_internal.append("topologyName", new BsonInt32(1));
-            alertSpecs.createIndex(doc_internal, io_internal);
+            IndexOptions ioInternal = new IndexOptions().background(true).unique(true).name("topologyNameIndex");
+            BsonDocument docInternal = new BsonDocument();
+            docInternal.append("topologyName", new BsonInt32(1));
+            alertSpecs.createIndex(docInternal, ioInternal);
         }
 
         groupSpecs = db.getCollection("groupSpecs");
@@ -173,22 +173,6 @@ public class MongoMetadataDaoImpl implements IMetadataDao {
         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();
@@ -350,7 +334,7 @@ public class MongoMetadataDaoImpl implements IMetadataDao {
             }
         }).first();
 
-        if (state != null){
+        if (state != null) {
             // based on version, to add content from collections of spoutSpecs/alertSpecs/etc..
             state = addDetailForScheduleState(state, versionId);
         }
@@ -358,10 +342,9 @@ public class MongoMetadataDaoImpl implements IMetadataDao {
         return state;
     }
 
-    /***
+    /**
      * get the basic ScheduleState, and then based on the version to get all sub-part(spoutSpecs/alertSpecs/etc)
      * to form a completed ScheduleState.
-     *
      * @return the latest ScheduleState
      */
     @Override
@@ -381,7 +364,7 @@ public class MongoMetadataDaoImpl implements IMetadataDao {
             }
         }).first();
 
-        if (state != null){
+        if (state != null) {
             String version = state.getVersion();
             // based on version, to add content from collections of spoutSpecs/alertSpecs/etc..
             state = addDetailForScheduleState(state, version);
@@ -390,55 +373,55 @@ public class MongoMetadataDaoImpl implements IMetadataDao {
         return state;
     }
 
-    private ScheduleState addDetailForScheduleState(ScheduleState state, String version){
+    private ScheduleState addDetailForScheduleState(ScheduleState state, String version) {
         Map<String, SpoutSpec> spoutMaps = maps(spoutSpecs, SpoutSpec.class, version);
-        if (spoutMaps.size() !=0){
+        if (spoutMaps.size() != 0) {
             state.setSpoutSpecs(spoutMaps);
         }
 
         Map<String, AlertBoltSpec> alertMaps = maps(alertSpecs, AlertBoltSpec.class, version);
-        if (alertMaps.size() !=0){
+        if (alertMaps.size() != 0) {
             state.setAlertSpecs(alertMaps);
         }
 
         Map<String, RouterSpec> groupMaps = maps(groupSpecs, RouterSpec.class, version);
-        if (groupMaps.size() !=0){
+        if (groupMaps.size() != 0) {
             state.setGroupSpecs(groupMaps);
         }
 
         Map<String, PublishSpec> publishMaps = maps(publishSpecs, PublishSpec.class, version);
-        if (publishMaps.size() !=0){
+        if (publishMaps.size() != 0) {
             state.setPublishSpecs(publishMaps);
         }
 
         List<VersionedPolicyDefinition> policyLists = list(policySnapshots, VersionedPolicyDefinition.class, version);
-        if (policyLists.size() !=0){
+        if (policyLists.size() != 0) {
             state.setPolicySnapshots(policyLists);
         }
 
         List<VersionedStreamDefinition> streamLists = list(streamSnapshots, VersionedStreamDefinition.class, version);
-        if (streamLists.size() !=0){
+        if (streamLists.size() != 0) {
             state.setStreamSnapshots(streamLists);
         }
 
         List<MonitoredStream> monitorLists = list(monitoredStreams, MonitoredStream.class, version);
-        if (monitorLists.size() !=0){
+        if (monitorLists.size() != 0) {
             state.setMonitoredStreams(monitorLists);
         }
 
         List<PolicyAssignment> assignmentLists = list(assignments, PolicyAssignment.class, version);
-        if (assignmentLists.size() !=0){
+        if (assignmentLists.size() != 0) {
             state.setAssignments(assignmentLists);
         }
         return state;
     }
 
-    private <T> Map<String, T> maps(MongoCollection<Document> collection, Class<T> clz, String version){
+    private <T> Map<String, T> maps(MongoCollection<Document> collection, Class<T> clz, String version) {
         BsonDocument doc = new BsonDocument();
         doc.append("version", new BsonString(version));
 
         Map<String, T> maps = new HashMap<String, T>();
-        String mapKey = (clz == SpoutSpec.class)? "topologyId" : "topologyName";
+        String mapKey = (clz == SpoutSpec.class) ? "topologyId" : "topologyName";
         collection.find(doc).forEach(new Block<Document>() {
             @Override
             public void apply(Document document) {
@@ -454,7 +437,7 @@ public class MongoMetadataDaoImpl implements IMetadataDao {
         return maps;
     }
 
-    private <T> List<T> list(MongoCollection<Document> collection, Class<T> clz, String version){
+    private <T> List<T> list(MongoCollection<Document> collection, Class<T> clz, String version) {
         BsonDocument doc = new BsonDocument();
         doc.append("version", new BsonString(version));
 
@@ -474,7 +457,24 @@ public class MongoMetadataDaoImpl implements IMetadataDao {
         return result;
     }
 
-    /***
+    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;
+    }
+
+    /**
      * write ScheduleState to several collections. basic info writes to ScheduleState, other writes to collections
      * named by spoutSpecs/alertSpecs/etc.
      *
@@ -485,45 +485,45 @@ public class MongoMetadataDaoImpl implements IMetadataDao {
     public OpResult addScheduleState(ScheduleState state) {
         OpResult result = new OpResult();
         try {
-            for (String key: state.getSpoutSpecs().keySet()){
+            for (String key : state.getSpoutSpecs().keySet()) {
                 SpoutSpec spoutSpec = state.getSpoutSpecs().get(key);
                 addOne(spoutSpecs, spoutSpec);
             }
 
-            for (String key: state.getAlertSpecs().keySet()){
+            for (String key : state.getAlertSpecs().keySet()) {
                 AlertBoltSpec alertBoltSpec = state.getAlertSpecs().get(key);
                 addOne(alertSpecs, alertBoltSpec);
             }
 
-            for (String key: state.getGroupSpecs().keySet()){
+            for (String key : state.getGroupSpecs().keySet()) {
                 RouterSpec groupSpec = state.getGroupSpecs().get(key);
                 addOne(groupSpecs, groupSpec);
             }
 
-            for (String key: state.getPublishSpecs().keySet()){
+            for (String key : state.getPublishSpecs().keySet()) {
                 PublishSpec publishSpec = state.getPublishSpecs().get(key);
                 addOne(publishSpecs, publishSpec);
             }
 
-            for (VersionedPolicyDefinition policySnapshot: state.getPolicySnapshots()){
+            for (VersionedPolicyDefinition policySnapshot : state.getPolicySnapshots()) {
                 addOne(policySnapshots, policySnapshot);
             }
 
-            for (VersionedStreamDefinition streamSnapshot: state.getStreamSnapshots()){
+            for (VersionedStreamDefinition streamSnapshot : state.getStreamSnapshots()) {
                 addOne(streamSnapshots, streamSnapshot);
             }
 
-            for (MonitoredStream monitoredStream: state.getMonitoredStreams()){
+            for (MonitoredStream monitoredStream : state.getMonitoredStreams()) {
                 addOne(monitoredStreams, monitoredStream);
             }
 
-            for (PolicyAssignment assignment: state.getAssignments()){
+            for (PolicyAssignment assignment : state.getAssignments()) {
                 addOne(assignments, assignment);
             }
 
             ScheduleStateBase stateBase = new ScheduleStateBase(
-                    state.getVersion(), state.getGenerateTime(), state.getCode(),
-                    state.getMessage(), state.getScheduleTimeMillis());
+                state.getVersion(), state.getGenerateTime(), state.getCode(),
+                state.getMessage(), state.getScheduleTimeMillis());
 
             addOne(scheduleStates, stateBase);
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/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
index 6bb38f1..2463e5b 100644
--- 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
@@ -16,11 +16,6 @@
  */
 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;
@@ -30,11 +25,15 @@ import org.apache.eagle.alert.engine.coordinator.Publishment;
 import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
 import org.apache.eagle.alert.engine.coordinator.StreamingCluster;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
 /**
  * This models used for metadata export/import to easy of test.
- * 
- * @since May 23, 2016
  *
+ * @since May 23, 2016
  */
 public class Models {
     public List<StreamingCluster> clusters = new ArrayList<StreamingCluster>();

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/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
index 3115439..a43b064 100644
--- 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
@@ -17,8 +17,7 @@
 package org.apache.eagle.alert.metadata.resource;
 
 /**
- * @since Apr 11, 2016
- *
+ * @since Apr 11, 2016.
  */
 public class OpResult {
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/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
index 645fc2b..840f4a7 100644
--- 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
@@ -16,19 +16,17 @@
  */
 package org.apache.eagle.service.alert.resource.impl;
 
+import com.typesafe.config.ConfigFactory;
 import org.apache.eagle.alert.engine.coordinator.PolicyDefinition;
+import org.apache.eagle.alert.metadata.IMetadataDao;
 import org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl;
 import org.apache.eagle.alert.metadata.impl.MetadataDaoFactory;
-import org.apache.eagle.alert.metadata.IMetadataDao;
 import org.junit.Assert;
 import org.junit.Test;
 import org.slf4j.LoggerFactory;
 
-import com.typesafe.config.ConfigFactory;
-
 /**
  * @since May 1, 2016
- *
  */
 public class InMemoryTest {
 
@@ -36,11 +34,11 @@ public class InMemoryTest {
 
     @Test
     public void test_AddPolicy() {
-        
+
         LoggerFactory.getLogger(InMemoryTest.class);
-        
+
         MetadataDaoFactory.getInstance().getMetadataDao();
-        
+
         PolicyDefinition pd = new PolicyDefinition();
         pd.setName("pd1");
         dao.addPolicy(pd);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/JdbcImplTest.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/JdbcImplTest.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/JdbcImplTest.java
index 1a78109..8812f87 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/JdbcImplTest.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/java/org/apache/eagle/service/alert/resource/impl/JdbcImplTest.java
@@ -18,10 +18,8 @@
 
 package org.apache.eagle.service.alert.resource.impl;
 
-import java.io.IOException;
-import java.util.Date;
-import java.util.List;
-
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
 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;
@@ -33,16 +31,13 @@ import org.apache.eagle.alert.engine.coordinator.StreamingCluster;
 import org.apache.eagle.alert.metadata.IMetadataDao;
 import org.apache.eagle.alert.metadata.impl.JdbcMetadataDaoImpl;
 import org.apache.eagle.alert.metadata.resource.OpResult;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.typesafe.config.Config;
-import com.typesafe.config.ConfigFactory;
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
 
 public class JdbcImplTest {
     private static Logger LOG = LoggerFactory.getLogger(JdbcImplTest.class);
@@ -69,7 +64,8 @@ public class JdbcImplTest {
 
     private String TOPO_NAME = "topoName";
 
-    @Ignore @Test
+    @Ignore
+    @Test
     public void test_apis() {
         // publishment
         {
@@ -155,7 +151,8 @@ public class JdbcImplTest {
         Assert.assertEquals(state.getVersion(), versionId);
     }
 
-    @Ignore @Test
+    @Ignore
+    @Test
     public void test_readCurrentState() {
         test_addstate();
         ScheduleState state = dao.getScheduleState();

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/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
index 95f2682..63871c3 100644
--- 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
@@ -46,7 +46,6 @@ import java.util.*;
 
 /**
  * @since May 1, 2016
- *
  */
 public class MongoImplTest {
     private static Logger LOG = LoggerFactory.getLogger(MongoImplTest.class);
@@ -59,7 +58,7 @@ public class MongoImplTest {
         try {
             MongodStarter starter = MongodStarter.getDefaultInstance();
             mongodExe = starter.prepare(new MongodConfigBuilder().version(Version.V3_2_1)
-                    .net(new Net(27017, Network.localhostIsIPv6())).build());
+                .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);
@@ -82,16 +81,14 @@ public class MongoImplTest {
         if (mongod != null) {
             try {
                 mongod.stop();
-            }
-            catch (IllegalStateException e) {
+            } catch (IllegalStateException e) {
                 // catch this exception for the unstable stopping mongodb
                 // reason: the exception is usually thrown out with below message format when stop() returns null value,
                 //         but actually this should have been captured in ProcessControl.stopOrDestroyProcess() by destroying
                 //         the process ultimately
                 if (e.getMessage() != null && e.getMessage().matches("^Couldn't kill.*process!.*")) {
                     // if matches, do nothing, just ignore the exception
-                }
-                else {
+                } else {
                     LOG.warn(String.format("Ignored error for stopping mongod process, see stack trace: %s", ExceptionUtils.getStackTrace(e)));
                 }
             }
@@ -193,7 +190,7 @@ public class MongoImplTest {
             state.setCode(201);
             result = dao.addScheduleState(state);
             Assert.assertEquals(200, result.code);
-            
+
             ScheduleState getState = dao.getScheduleState();
             Assert.assertEquals(201, getState.getCode());
         }
@@ -274,10 +271,10 @@ public class MongoImplTest {
 
         // Assignments
         Collection<PolicyAssignment> assignments = new ArrayList<>();
-        assignments.add(new PolicyAssignment("syslog_regex", "SG[syslog_stream-]"+timestamp));
+        assignments.add(new PolicyAssignment("syslog_regex", "SG[syslog_stream-]" + timestamp));
 
         ScheduleState state = new ScheduleState(version, spoutSpecsMap, groupSpecsMap, alertSpecsMap, pubMap,
-                assignments, monitoredStreams, policySnapshots, streams);
+            assignments, monitoredStreams, policySnapshots, streams);
 
         OpResult result = dao.addScheduleState(state);
         Assert.assertEquals(200, result.code);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/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
index f9b2597..fbb99de 100644
--- 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
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 {
-	"datastore": {
-        "metadataDao": "org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl",
-		"connection": "mongodb://localhost:27017"
-	}
+  "datastore": {
+    "metadataDao": "org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl",
+    "connection": "mongodb://localhost:27017"
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/application.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/application.conf
index 7213a9f..cdb0b25 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/application.conf
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/test/resources/application.conf
@@ -15,10 +15,10 @@
 
 
 {
-	"datastore": {
-		"metadataDao": "org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl",
-		"connection": "localhost:27017",
-		"properties" : {
-		}
-	}
+  "datastore": {
+    "metadataDao": "org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl",
+    "connection": "localhost:27017",
+    "properties": {
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/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
index 1d4b33d..5694a7b 100644
--- 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
@@ -11,20 +11,20 @@
 	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>
+         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-metadata-parent</artifactId>
-	<packaging>pom</packaging>
+    <parent>
+        <groupId>org.apache.eagle</groupId>
+        <artifactId>eagle-alert</artifactId>
+        <version>0.5.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>
+    <modules>
+        <module>alert-metadata</module>
+        <module>alert-metadata-service</module>
+    </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-service/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/pom.xml
index 18c054e..7764ccf 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/pom.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/pom.xml
@@ -11,196 +11,196 @@
 	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">
-	<parent>
-		<artifactId>eagle-alert</artifactId>
-		<groupId>org.apache.eagle</groupId>
-		<version>0.5.0-incubating-SNAPSHOT</version>
-	</parent>
-	<modelVersion>4.0.0</modelVersion>
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>eagle-alert</artifactId>
+        <groupId>org.apache.eagle</groupId>
+        <version>0.5.0-incubating-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
 
-	<artifactId>alert-service</artifactId>
-	<description>Alert Service: Coordinator + Metadata</description>
-	<packaging>jar</packaging>
+    <artifactId>alert-service</artifactId>
+    <description>Alert Service: Coordinator + Metadata</description>
+    <packaging>jar</packaging>
 
-	<dependencies>
-		<dependency>
-			<groupId>org.apache.eagle</groupId>
-			<artifactId>alert-coordinator</artifactId>
-			<version>${project.version}</version>
-			<exclusions>
-				<exclusion>
-					<groupId>org.slf4j</groupId>
-					<artifactId>slf4j-log4j12</artifactId>
-				</exclusion>
-				<exclusion>
-					<artifactId>storm-core</artifactId>
-					<groupId>org.apache.storm</groupId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.eagle</groupId>
-			<artifactId>alert-metadata-service</artifactId>
-			<version>${project.version}</version>
-			<exclusions>
-				<exclusion>
-					<groupId>org.slf4j</groupId>
-					<artifactId>slf4j-log4j12</artifactId>
-				</exclusion>
-				<exclusion>
-					<artifactId>storm-core</artifactId>
-					<groupId>org.apache.storm</groupId>
-				</exclusion>
-			</exclusions>
-		</dependency>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
+            <artifactId>alert-coordinator</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>storm-core</artifactId>
+                    <groupId>org.apache.storm</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
+            <artifactId>alert-metadata-service</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>storm-core</artifactId>
+                    <groupId>org.apache.storm</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
 
-		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-json</artifactId>
-		</dependency>
-		<!-- dropwizard -->
-		<dependency>
-			<groupId>io.dropwizard</groupId>
-			<artifactId>dropwizard-core</artifactId>
-			<exclusions>
-				<exclusion>
-					<groupId>org.slf4j</groupId>
-					<artifactId>slf4j-log4j12</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
-			<groupId>io.dropwizard</groupId>
-			<artifactId>dropwizard-jersey</artifactId>
-			<exclusions>
-				<exclusion>
-					<groupId>org.slf4j</groupId>
-					<artifactId>slf4j-log4j12</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
-			<groupId>io.swagger</groupId>
-			<artifactId>swagger-jersey-jaxrs</artifactId>
-			<scope>compile</scope>
-			<exclusions>
-				<exclusion>
-					<groupId>com.sun.jersey</groupId>
-					<artifactId>*</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-	</dependencies>
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.eclipse.jetty</groupId>
-				<artifactId>jetty-maven-plugin</artifactId>
-				<version>9.2.11.v20150529</version>
-				<configuration>
-					<scanIntervalSeconds>5</scanIntervalSeconds>
-				</configuration>
-			</plugin>
+        <dependency>
+            <groupId>com.sun.jersey</groupId>
+            <artifactId>jersey-json</artifactId>
+        </dependency>
+        <!-- dropwizard -->
+        <dependency>
+            <groupId>io.dropwizard</groupId>
+            <artifactId>dropwizard-core</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>io.dropwizard</groupId>
+            <artifactId>dropwizard-jersey</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-jersey-jaxrs</artifactId>
+            <scope>compile</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.sun.jersey</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-maven-plugin</artifactId>
+                <version>9.2.11.v20150529</version>
+                <configuration>
+                    <scanIntervalSeconds>5</scanIntervalSeconds>
+                </configuration>
+            </plugin>
 
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-shade-plugin</artifactId>
-				<version>1.4</version>
-				<configuration>
-					<filters>
-						<filter>
-							<artifact>*:*</artifact>
-							<excludes>
-								<exclude>META-INF/*.SF</exclude>
-								<exclude>META-INF/*.DSA</exclude>
-								<exclude>META-INF/*.RSA</exclude>
-							</excludes>
-						</filter>
-					</filters>
-				</configuration>
-				<executions>
-					<execution>
-						<phase>package</phase>
-						<goals>
-							<goal>shade</goal>
-						</goals>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>1.4</version>
+                <configuration>
+                    <filters>
+                        <filter>
+                            <artifact>*:*</artifact>
+                            <excludes>
+                                <exclude>META-INF/*.SF</exclude>
+                                <exclude>META-INF/*.DSA</exclude>
+                                <exclude>META-INF/*.RSA</exclude>
+                            </excludes>
+                        </filter>
+                    </filters>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
 
-						<configuration>
-							<shadedArtifactAttached>true</shadedArtifactAttached>
-							<shadedClassifierName>shaded</shadedClassifierName>
-							<transformers>
-								<transformer
-									implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
-								<transformer
-									implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
-									<mainClass>org.apache.eagle.service.app.ServiceApp</mainClass>
-								</transformer>
-							</transformers>
+                        <configuration>
+                            <shadedArtifactAttached>true</shadedArtifactAttached>
+                            <shadedClassifierName>shaded</shadedClassifierName>
+                            <transformers>
+                                <transformer
+                                        implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                                <transformer
+                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <mainClass>org.apache.eagle.service.app.ServiceApp</mainClass>
+                                </transformer>
+                            </transformers>
 
-							<artifactSet>
-								<excludes>
-									<exclude>org.slf4j:slf4j-log4j12</exclude>
-								</excludes>
-							</artifactSet>
+                            <artifactSet>
+                                <excludes>
+                                    <exclude>org.slf4j:slf4j-log4j12</exclude>
+                                </excludes>
+                            </artifactSet>
 
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
 
-			<!-- change project to war, and use maven-war-plugin to build the war -->
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-war-plugin</artifactId>
-				<version>2.6</version>
-				<executions>
-					<execution>
-						<phase>package</phase>
-						<goals>
-							<goal>war</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
+            <!-- change project to war, and use maven-war-plugin to build the war -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>2.6</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>war</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
 
-			<plugin>
-				<groupId>org.codehaus.mojo</groupId>
-				<artifactId>build-helper-maven-plugin</artifactId>
-				<version>1.12</version>
-				<executions>
-					<execution>
-						<id>attach-artifacts</id>
-						<phase>package</phase>
-						<goals>
-							<goal>attach-artifact</goal>
-						</goals>
-						<configuration>
-							<artifacts>
-								<artifact>
-									<file>target/alert-service-${project.version}.war</file>
-									<type>war</type>
-								</artifact>
-							</artifacts>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.12</version>
+                <executions>
+                    <execution>
+                        <id>attach-artifacts</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attach-artifact</goal>
+                        </goals>
+                        <configuration>
+                            <artifacts>
+                                <artifact>
+                                    <file>target/alert-service-${project.version}.war</file>
+                                    <type>war</type>
+                                </artifact>
+                            </artifacts>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
 
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-source-plugin</artifactId>
-				<version>2.1.2</version>
-				<executions>
-					<execution>
-						<id>attach-sources</id>
-						<phase>verify</phase>
-						<goals>
-							<goal>jar-no-fork</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.1.2</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <phase>verify</phase>
+                        <goals>
+                            <goal>jar-no-fork</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/java/org/apache/eagle/service/app/AlertDropWizardConfiguration.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/java/org/apache/eagle/service/app/AlertDropWizardConfiguration.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/java/org/apache/eagle/service/app/AlertDropWizardConfiguration.java
index adb55c5..c44a950 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/java/org/apache/eagle/service/app/AlertDropWizardConfiguration.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/java/org/apache/eagle/service/app/AlertDropWizardConfiguration.java
@@ -21,8 +21,7 @@ import io.dropwizard.Configuration;
 import javax.validation.Valid;
 
 /**
- * @since Jun 27, 2016
- *
+ * @since Jun 27, 2016.
  */
 public class AlertDropWizardConfiguration extends Configuration {
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/java/org/apache/eagle/service/app/ServiceApp.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/java/org/apache/eagle/service/app/ServiceApp.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/java/org/apache/eagle/service/app/ServiceApp.java
index 8e6fa88..0f8b57e 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/java/org/apache/eagle/service/app/ServiceApp.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/java/org/apache/eagle/service/app/ServiceApp.java
@@ -16,28 +16,24 @@
  */
 package org.apache.eagle.service.app;
 
+import org.apache.eagle.alert.coordinator.CoordinatorListener;
+import org.apache.eagle.alert.coordinator.resource.CoordinatorResource;
+import org.apache.eagle.alert.resource.SimpleCORSFiler;
+import org.apache.eagle.service.metadata.resource.MetadataResource;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.typesafe.config.ConfigFactory;
 import io.dropwizard.Application;
 import io.dropwizard.setup.Bootstrap;
 import io.dropwizard.setup.Environment;
 import io.swagger.jaxrs.config.BeanConfig;
 import io.swagger.jaxrs.listing.ApiListingResource;
+import org.apache.commons.lang3.StringUtils;
 
 import java.util.EnumSet;
-
 import javax.servlet.DispatcherType;
 
-import org.apache.commons.lang3.StringUtils;
-import org.apache.eagle.alert.coordinator.CoordinatorListener;
-import org.apache.eagle.alert.coordinator.resource.CoordinatorResource;
-import org.apache.eagle.alert.resource.SimpleCORSFiler;
-import org.apache.eagle.service.metadata.resource.MetadataResource;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.typesafe.config.ConfigFactory;
-
 /**
- * @since Jun 27, 2016
- *
+ * @since Jun 27, 2016.
  */
 public class ServiceApp extends Application<AlertDropWizardConfiguration> {
 
@@ -76,12 +72,12 @@ public class ServiceApp extends Application<AlertDropWizardConfiguration> {
         swaggerConfig.setVersion("v1.2");
         swaggerConfig.setBasePath("/rest");
         swaggerConfig
-                .setResourcePackage("org.apache.eagle.alert.coordinator.resource,org.apache.eagle.service.metadata.resource");
+            .setResourcePackage("org.apache.eagle.alert.coordinator.resource,org.apache.eagle.service.metadata.resource");
         swaggerConfig.setScan(true);
 
         // simple CORS filter
         environment.servlets().addFilter("corsFilter", new SimpleCORSFiler())
-                .addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/*");
+            .addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/*");
 
         // context listener
         environment.servlets().addServletListeners(new CoordinatorListener());

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/resources/application.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/resources/application.conf
index 72a731a..710459f 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/resources/application.conf
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/resources/application.conf
@@ -14,41 +14,41 @@
 # limitations under the License.
 
 {
-	"coordinator" : {
-		"policiesPerBolt" : 30,
-		"boltParallelism" : 5,
-		"policyDefaultParallelism" : 5,
-		"boltLoadUpbound": 0.8,
-		"topologyLoadUpbound" : 0.8,
-		"numOfAlertBoltsPerTopology" : 20,
-		"zkConfig" : {
-			"zkQuorum" : "127.0.0.1:2181",
-			"zkRoot" : "/alert",
-			"zkSessionTimeoutMs" : 10000,
-			"connectionTimeoutMs" : 10000,
-			"zkRetryTimes" : 3,
-			"zkRetryInterval" : 3000
-		},
-		"metadataService" : {
-			"host" : "localhost",
-			"port" : 8080,
-			"context" : "/rest"
-		},
-		"metadataDynamicCheck" : {
-			"initDelayMillis" : 1000,
-			"delayMillis" : 30000
-		},
-		"kafkaProducer": {
-			"bootstrapServers": "127.0.0.1:9092"
-		},
-		"email": {
-			"sender": "eagle@eagle.com",
-			"recipients": "test@eagle.com",
-			"mailSmtpHost": "test.eagle.com",
-			"mailSmtpPort": "25"
-		}
-	},
-	"datastore": {
-		"metadataDao": "org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl"
-	}
+  "coordinator": {
+    "policiesPerBolt": 30,
+    "boltParallelism": 5,
+    "policyDefaultParallelism": 5,
+    "boltLoadUpbound": 0.8,
+    "topologyLoadUpbound": 0.8,
+    "numOfAlertBoltsPerTopology": 20,
+    "zkConfig": {
+      "zkQuorum": "127.0.0.1:2181",
+      "zkRoot": "/alert",
+      "zkSessionTimeoutMs": 10000,
+      "connectionTimeoutMs": 10000,
+      "zkRetryTimes": 3,
+      "zkRetryInterval": 3000
+    },
+    "metadataService": {
+      "host": "localhost",
+      "port": 8080,
+      "context": "/rest"
+    },
+    "metadataDynamicCheck": {
+      "initDelayMillis": 1000,
+      "delayMillis": 30000
+    },
+    "kafkaProducer": {
+      "bootstrapServers": "127.0.0.1:9092"
+    },
+    "email": {
+      "sender": "eagle@eagle.com",
+      "recipients": "test@eagle.com",
+      "mailSmtpHost": "test.eagle.com",
+      "mailSmtpPort": "25"
+    }
+  },
+  "datastore": {
+    "metadataDao": "org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl"
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/resources/log4j.properties b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/resources/log4j.properties
index dd4407b..5337cae 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/resources/log4j.properties
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/resources/log4j.properties
@@ -12,9 +12,7 @@
 # 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=ERROR, stdout
-
 # standard output
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/webapp/WEB-INF/web.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/webapp/WEB-INF/web.xml
index c8c4707..5e10197 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/webapp/WEB-INF/web.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/main/webapp/WEB-INF/web.xml
@@ -16,28 +16,31 @@
   ~ 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
+         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">
+         version="3.0">
     <welcome-file-list>
         <welcome-file>index.html</welcome-file>
     </welcome-file-list>
-    
+
     <listener>
-    	<listener-class>org.apache.eagle.alert.coordinator.CoordinatorListener</listener-class>
+        <listener-class>org.apache.eagle.alert.coordinator.CoordinatorListener</listener-class>
     </listener>
-    
+
     <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,org.codehaus.jackson.jaxrs</param-value>
+            <param-value>io.swagger.jaxrs.json,io.swagger.jaxrs.listing,org.apache.eagle,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>
+            <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>
@@ -46,19 +49,19 @@
         <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>
+        <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>
@@ -73,7 +76,9 @@
         </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>
+            <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>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/test/java/com/apache/eagle/service/app/TestServiceAppWithZk.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/test/java/com/apache/eagle/service/app/TestServiceAppWithZk.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/test/java/com/apache/eagle/service/app/TestServiceAppWithZk.java
index f312e19..a19889b 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/test/java/com/apache/eagle/service/app/TestServiceAppWithZk.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-service/src/test/java/com/apache/eagle/service/app/TestServiceAppWithZk.java
@@ -41,91 +41,89 @@ import com.typesafe.config.Config;
 import com.typesafe.config.ConfigFactory;
 
 /**
- * 
  * @author xiancli
- *
  */
 public class TestServiceAppWithZk {
 
-	ZookeeperEmbedded zkEmbed;
-
-	PrintStream oldStream;
-	PrintStream newStream;
-	ByteArrayOutputStream newStreamOutput;
-
-	@Before
-	public void setUp() throws Exception {
-		// Create a stream to hold the output
-		newStreamOutput = new ByteArrayOutputStream();
-		newStream = new PrintStream(newStreamOutput);
-		// IMPORTANT: Save the old System.out!
-		oldStream = System.out;
-		// Tell Java to use your special stream
-		System.setOut(newStream);
-
-		zkEmbed = new ZookeeperEmbedded(2181);
-		zkEmbed.start();
-
-		Thread.sleep(2000);
-
-		new ServiceApp().run(new String[] { "server" });
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		zkEmbed.shutdown();
-	}
-
-	@Test
-	public void testMain() throws Exception {
-		try {
-			Thread.sleep(15000);
-		} catch (InterruptedException e1) {
-		}
-
-		// Put things back
-		System.out.flush();
-		System.setOut(oldStream);
-
-		BufferedReader br = new BufferedReader(new StringReader(newStreamOutput.toString()));
-		List<String> logs = new ArrayList<String>();
-		String line = null;
-		while ((line = br.readLine()) != null) {
-			logs.add(line);
-		}
-
-		System.out.println(Joiner.on("\n").join(logs));
-
-		Assert.assertTrue(logs.stream().anyMatch((log) -> log.contains("this is leader node right now..")));
-		Assert.assertTrue(logs.stream().anyMatch((log) -> log.contains("start coordinator background tasks..")));
-
-		Config config = ConfigFactory.load().getConfig("coordinator");
-		// build dynamic policy loader
-		String host = config.getString("metadataService.host");
-		int port = config.getInt("metadataService.port");
-		String context = config.getString("metadataService.context");
-		IMetadataServiceClient client = new MetadataServiceClientImpl(host, port, context);
-
-		List<PolicyDefinition> policies = client.listPolicies();
-
-		Assert.assertEquals(0, policies.size());
-
-		PolicyDefinition def = new PolicyDefinition();
-		def.setName("test-policy-1");
-		def.setInputStreams(Arrays.asList("testStreamDef"));
-		def.setOutputStreams(Arrays.asList("test-datasource-1"));
-		def.setParallelismHint(5);
-		def.setDefinition(new Definition());
-		client.addPolicy(def);
-
-		policies = client.listPolicies();
-
-		Assert.assertEquals(1, policies.size());
-
-		try {
-			client.close();
-		} catch (IOException e) {
-		}
-	}
+    ZookeeperEmbedded zkEmbed;
+
+    PrintStream oldStream;
+    PrintStream newStream;
+    ByteArrayOutputStream newStreamOutput;
+
+    @Before
+    public void setUp() throws Exception {
+        // Create a stream to hold the output
+        newStreamOutput = new ByteArrayOutputStream();
+        newStream = new PrintStream(newStreamOutput);
+        // IMPORTANT: Save the old System.out!
+        oldStream = System.out;
+        // Tell Java to use your special stream
+        System.setOut(newStream);
+
+        zkEmbed = new ZookeeperEmbedded(2181);
+        zkEmbed.start();
+
+        Thread.sleep(2000);
+
+        new ServiceApp().run(new String[] {"server"});
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        zkEmbed.shutdown();
+    }
+
+    @Test
+    public void testMain() throws Exception {
+        try {
+            Thread.sleep(15000);
+        } catch (InterruptedException e1) {
+        }
+
+        // Put things back
+        System.out.flush();
+        System.setOut(oldStream);
+
+        BufferedReader br = new BufferedReader(new StringReader(newStreamOutput.toString()));
+        List<String> logs = new ArrayList<String>();
+        String line = null;
+        while ((line = br.readLine()) != null) {
+            logs.add(line);
+        }
+
+        System.out.println(Joiner.on("\n").join(logs));
+
+        Assert.assertTrue(logs.stream().anyMatch((log) -> log.contains("this is leader node right now..")));
+        Assert.assertTrue(logs.stream().anyMatch((log) -> log.contains("start coordinator background tasks..")));
+
+        Config config = ConfigFactory.load().getConfig("coordinator");
+        // build dynamic policy loader
+        String host = config.getString("metadataService.host");
+        int port = config.getInt("metadataService.port");
+        String context = config.getString("metadataService.context");
+        IMetadataServiceClient client = new MetadataServiceClientImpl(host, port, context);
+
+        List<PolicyDefinition> policies = client.listPolicies();
+
+        Assert.assertEquals(0, policies.size());
+
+        PolicyDefinition def = new PolicyDefinition();
+        def.setName("test-policy-1");
+        def.setInputStreams(Arrays.asList("testStreamDef"));
+        def.setOutputStreams(Arrays.asList("test-datasource-1"));
+        def.setParallelismHint(5);
+        def.setDefinition(new Definition());
+        client.addPolicy(def);
+
+        policies = client.listPolicies();
+
+        Assert.assertEquals(1, policies.size());
+
+        try {
+            client.close();
+        } catch (IOException e) {
+        }
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60f9642e/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
index e2ba4d8..3fcb494 100644
--- a/eagle-core/eagle-alert-parent/pom.xml
+++ b/eagle-core/eagle-alert-parent/pom.xml
@@ -28,9 +28,23 @@
     <packaging>pom</packaging>
 
     <name>eagle-alert-parent</name>
+
     <modules>
         <module>eagle-alert</module>
         <module>eagle-alert-service</module>
-    <module>eagle-alert-app</module>
-  </modules>
+        <module>eagle-alert-app</module>
+    </modules>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <failOnViolation>true</failOnViolation>
+                    <failsOnError>true</failsOnError>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
\ No newline at end of file



Mime
View raw message