You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by qi...@apache.org on 2016/03/03 10:57:11 UTC

[1/2] incubator-eagle git commit: EAGLE-177 Replace Legacy "dataSource" field with "application" in all metadata

Repository: incubator-eagle
Updated Branches:
  refs/heads/master d9ef76d97 -> 2b09be954


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamSchemaDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamSchemaDAOImpl.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamSchemaDAOImpl.java
index af1fb3a..69c74db 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamSchemaDAOImpl.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamSchemaDAOImpl.java
@@ -60,10 +60,10 @@ public class AlertStreamSchemaDAOImpl implements AlertStreamSchemaDAO {
 	}
 	
 	@Override
-	public List<AlertStreamSchemaEntity> findAlertStreamSchemaByDataSource(String dataSource) throws Exception {
+	public List<AlertStreamSchemaEntity> findAlertStreamSchemaByApplication(String application) throws Exception {
 		try {
 			IEagleServiceClient client = new EagleServiceClientImpl(eagleServiceHost, eagleServicePort, username, password);
-			String query = Constants.ALERT_STREAM_SCHEMA_SERVICE_ENDPOINT_NAME + "[@dataSource=\"" + dataSource + "\"]{*}";
+			String query = Constants.ALERT_STREAM_SCHEMA_SERVICE_ENDPOINT_NAME + "[@application=\"" + application + "\"]{*}";
 			GenericServiceAPIResponseEntity<AlertStreamSchemaEntity> response =  client.search()
 																		                .startTime(0)
 																		                .endTime(10 * DateUtils.MILLIS_PER_DAY)

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/PolicyDefinitionDAO.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/PolicyDefinitionDAO.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/PolicyDefinitionDAO.java
index b9475a1..faa81d9 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/PolicyDefinitionDAO.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/PolicyDefinitionDAO.java
@@ -30,7 +30,7 @@ public interface PolicyDefinitionDAO<T extends AbstractPolicyDefinitionEntity> e
 	 * find list of active alert definitions for one specific site and dataSource
 	 * @return
 	 */
-	List<T> findActivePolicies(String site, String dataSource) throws Exception;
+	List<T> findActivePolicies(String site, String application) throws Exception;
 	
 	/**
 	 * find map from alertExecutorId to map from policy Id to alert definition for one specific site and dataSource

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/PolicyDefinitionEntityDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/PolicyDefinitionEntityDAOImpl.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/PolicyDefinitionEntityDAOImpl.java
index 300ff02..2c8616c 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/PolicyDefinitionEntityDAOImpl.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/PolicyDefinitionEntityDAOImpl.java
@@ -50,10 +50,10 @@ public class PolicyDefinitionEntityDAOImpl<T extends AbstractPolicyDefinitionEnt
 	}
 
     @Override
-	public List<T> findActivePolicies(String site, String dataSource) throws Exception {
+	public List<T> findActivePolicies(String site, String application) throws Exception {
 		try {
 			IEagleServiceClient client = new EagleServiceClientImpl(connector);
-			String query = servicePointName + "[@site=\"" + site + "\" AND @dataSource=\"" + dataSource + "\" AND @enabled=\"true\"]{*}";
+			String query = servicePointName + "[@site=\"" + site + "\" AND @application=\"" + application + "\" AND @enabled=\"true\"]{*}";
 			GenericServiceAPIResponseEntity<T> response = client.search()
 												                .pageSize(Integer.MAX_VALUE)
 												                .query(query)
@@ -78,9 +78,9 @@ public class PolicyDefinitionEntityDAOImpl<T extends AbstractPolicyDefinitionEnt
     
 
     @Override
-	public Map<String, Map<String, T>> findActivePoliciesGroupbyExecutorId(String site, String dataSource)
+	public Map<String, Map<String, T>> findActivePoliciesGroupbyExecutorId(String site, String application)
 			throws Exception {
-		List<T> list = findActivePolicies(site, dataSource);
+		List<T> list = findActivePolicies(site, application);
 		Map<String, Map<String, T>> map = new HashMap<String, Map<String, T>>();
 		for (T entity : list) {
 			// support both executorId and legacy alertExecutorId

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/executor/PolicyProcessExecutor.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/executor/PolicyProcessExecutor.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/executor/PolicyProcessExecutor.java
index e71a045..30d2179 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/executor/PolicyProcessExecutor.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/executor/PolicyProcessExecutor.java
@@ -153,7 +153,7 @@ public abstract class PolicyProcessExecutor<T extends AbstractPolicyDefinitionEn
 		baseDimensions.put(Constants.ALERT_EXECUTOR_ID, executorId);
 		baseDimensions.put(Constants.PARTITIONSEQ, String.valueOf(partitionSeq));
 		baseDimensions.put(Constants.SOURCE, ManagementFactory.getRuntimeMXBean().getName());
-		baseDimensions.put(EagleConfigConstants.DATA_SOURCE, config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.DATA_SOURCE));
+		baseDimensions.put(EagleConfigConstants.APPLICATION, config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.APPLICATION));
 		baseDimensions.put(EagleConfigConstants.SITE, config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.SITE));
 
 		dimensionsMap = new HashMap<String, Map<String, String>>();
@@ -171,16 +171,16 @@ public abstract class PolicyProcessExecutor<T extends AbstractPolicyDefinitionEn
 		Map<String, PolicyEvaluator<T>> tmpPolicyEvaluators = new HashMap<String, PolicyEvaluator<T>>();
 		
         String site = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.SITE);
-		String dataSource = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.DATA_SOURCE);
+		String application = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.APPLICATION);
 		try {
-			initialAlertDefs = policyDefinitionDao.findActivePoliciesGroupbyExecutorId(site, dataSource);
+			initialAlertDefs = policyDefinitionDao.findActivePoliciesGroupbyExecutorId(site, application);
 		}
 		catch (Exception ex) {
 			LOG.error("fail to initialize initialAlertDefs: ", ex);
             throw new IllegalStateException("fail to initialize initialAlertDefs: ", ex);
 		}
         if(initialAlertDefs == null || initialAlertDefs.isEmpty()){
-            LOG.warn("No alert definitions was found for site: " + site + ", dataSource: " + dataSource);
+            LOG.warn("No alert definitions was found for site: " + site + ", application: " + application);
         }
         else if (initialAlertDefs.get(executorId) != null) { 
 			for(T alertDef : initialAlertDefs.get(executorId).values()){

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/StreamMetadataManager.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/StreamMetadataManager.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/StreamMetadataManager.java
index 47b7ef7..83d30e0 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/StreamMetadataManager.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/StreamMetadataManager.java
@@ -52,8 +52,8 @@ public class StreamMetadataManager {
 	
 	private void internalInit(Config config, AlertStreamSchemaDAO dao){
 		try{
-			String dataSource = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.DATA_SOURCE);
-			List<AlertStreamSchemaEntity> list = dao.findAlertStreamSchemaByDataSource(dataSource);
+			String application = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.APPLICATION);
+			List<AlertStreamSchemaEntity> list = dao.findAlertStreamSchemaByApplication(application);
 			if(list == null)
 				return;
 			for (AlertStreamSchemaEntity entity : list) {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/test/java/org/apache/eagle/policy/dao/TestSchemaDao.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/test/java/org/apache/eagle/policy/dao/TestSchemaDao.java b/eagle-core/eagle-policy/eagle-policy-base/src/test/java/org/apache/eagle/policy/dao/TestSchemaDao.java
index fd40f79..c88d9bb 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/test/java/org/apache/eagle/policy/dao/TestSchemaDao.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/test/java/org/apache/eagle/policy/dao/TestSchemaDao.java
@@ -31,7 +31,7 @@ public class TestSchemaDao {
     @Test
     public void test() throws Exception {
         AlertStreamSchemaDAO dao = new AlertStreamSchemaDAOImpl("localhost", 9099, "admin", "secret");
-        List<AlertStreamSchemaEntity> entities = dao.findAlertStreamSchemaByDataSource("hdfsAuditLog");
+        List<AlertStreamSchemaEntity> entities = dao.findAlertStreamSchemaByApplication("hdfsAuditLog");
         System.out.print(entities);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-query/eagle-audit-base/src/main/java/org/apache/eagle/audit/dao/ServiceAuditDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-audit-base/src/main/java/org/apache/eagle/audit/dao/ServiceAuditDAOImpl.java b/eagle-core/eagle-query/eagle-audit-base/src/main/java/org/apache/eagle/audit/dao/ServiceAuditDAOImpl.java
index 918009f..41332ae 100644
--- a/eagle-core/eagle-query/eagle-audit-base/src/main/java/org/apache/eagle/audit/dao/ServiceAuditDAOImpl.java
+++ b/eagle-core/eagle-query/eagle-audit-base/src/main/java/org/apache/eagle/audit/dao/ServiceAuditDAOImpl.java
@@ -39,10 +39,10 @@ public class ServiceAuditDAOImpl implements ServiceAuditDAO {
     }
 
 	@Override
-    public List<GenericAuditEntity> findPolicyAudit(String site, String dataSource) throws Exception {
+    public List<GenericAuditEntity> findPolicyAudit(String site, String application) throws Exception {
 		try {
 			IEagleServiceClient client = new EagleServiceClientImpl(connector);
-			String query = AuditConstants.AUDIT_SERVICE_ENDPOINT + "[@serviceName=\"AlertDefinitionService\" AND @site=\"" + site + "\" AND @dataSource=\"" + dataSource + "\"]{*}";
+			String query = AuditConstants.AUDIT_SERVICE_ENDPOINT + "[@serviceName=\"AlertDefinitionService\" AND @site=\"" + site + "\" AND @application=\"" + application + "\"]{*}";
             GenericServiceAPIResponseEntity<GenericAuditEntity> response =  client.search().startTime(0).endTime(10 * DateUtils.MILLIS_PER_DAY).pageSize(Integer.MAX_VALUE).query(query).send();
             client.close();
             if (response.getException() != null) {
@@ -73,10 +73,10 @@ public class ServiceAuditDAOImpl implements ServiceAuditDAO {
     }
     
 	@Override
-    public List<GenericAuditEntity> findDataSourceAudit(String dataSource) throws Exception {
+    public List<GenericAuditEntity> findDataSourceAudit(String application) throws Exception {
 		try {
 			IEagleServiceClient client = new EagleServiceClientImpl(connector);
-			String query = AuditConstants.AUDIT_SERVICE_ENDPOINT + "[@serviceName=\"AlertDataSourceService\" AND @dataSource=\"" + dataSource + "\"]{*}";
+			String query = AuditConstants.AUDIT_SERVICE_ENDPOINT + "[@serviceName=\"AlertDataSourceService\" AND @application=\"" + application + "\"]{*}";
             GenericServiceAPIResponseEntity<GenericAuditEntity> response =  client.search().startTime(0).endTime(10 * DateUtils.MILLIS_PER_DAY).pageSize(Integer.MAX_VALUE).query(query).send();
             client.close();
             if (response.getException() != null) {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigConstants.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigConstants.java b/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigConstants.java
index 307e508..720dc35 100644
--- a/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigConstants.java
+++ b/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigConstants.java
@@ -52,5 +52,8 @@ public final class EagleConfigConstants {
     public final static String PASSWORD = "password";
 
     public final static String SITE = "site";
+    @Deprecated
     public final static String DATA_SOURCE = "dataSource";
+    public final static String APPLICATION = "application";
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigHelper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigHelper.java b/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigHelper.java
index b8ac75e..fe3e190 100644
--- a/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigHelper.java
+++ b/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigHelper.java
@@ -45,7 +45,7 @@ public class EagleConfigHelper {
         return config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.SITE);
     }
 
-    public static String getDataSource(Config config) {
-        return config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.DATA_SOURCE);
+    public static String getApplication(Config config) {
+        return config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.APPLICATION);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-examples/eagle-topology-example/src/main/resources/application-plugintest.conf
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-topology-example/src/main/resources/application-plugintest.conf b/eagle-examples/eagle-topology-example/src/main/resources/application-plugintest.conf
index f73e7c0..b35abc8 100644
--- a/eagle-examples/eagle-topology-example/src/main/resources/application-plugintest.conf
+++ b/eagle-examples/eagle-topology-example/src/main/resources/application-plugintest.conf
@@ -35,7 +35,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "testSpout",
+    "application": "testSpout",
   	"dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-examples/eagle-topology-example/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-topology-example/src/main/resources/application.conf b/eagle-examples/eagle-topology-example/src/main/resources/application.conf
index aad74b3..9629917 100644
--- a/eagle-examples/eagle-topology-example/src/main/resources/application.conf
+++ b/eagle-examples/eagle-topology-example/src/main/resources/application.conf
@@ -62,7 +62,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "persistTest",
+    "application": "persistTest",
   	"dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-gc/src/main/java/org/apache/eagle/gc/executor/GCMetricGeneratorExecutor.java
----------------------------------------------------------------------
diff --git a/eagle-gc/src/main/java/org/apache/eagle/gc/executor/GCMetricGeneratorExecutor.java b/eagle-gc/src/main/java/org/apache/eagle/gc/executor/GCMetricGeneratorExecutor.java
index eda6564..ebc5a6c 100644
--- a/eagle-gc/src/main/java/org/apache/eagle/gc/executor/GCMetricGeneratorExecutor.java
+++ b/eagle-gc/src/main/java/org/apache/eagle/gc/executor/GCMetricGeneratorExecutor.java
@@ -62,7 +62,7 @@ public class GCMetricGeneratorExecutor extends JavaStormStreamExecutor2<String,
         listener = new EagleServiceReporterMetricListener(host, port, username, password);
         dimensions = new HashMap<>();
         dimensions.put(EagleConfigConstants.SITE, EagleConfigHelper.getSite(config));
-        dimensions.put(EagleConfigConstants.DATA_SOURCE, EagleConfigHelper.getDataSource(config));
+        dimensions.put(EagleConfigConstants.APPLICATION, EagleConfigHelper.getApplication(config));
         gcPausedTimeMetricName = MetricKeyCodeDecoder.codeMetricKey(GCConstants.GC_PAUSE_TIME_METRIC_NAME, dimensions);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-gc/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-gc/src/main/resources/application.conf b/eagle-gc/src/main/resources/application.conf
index 5fad589..ed14063 100644
--- a/eagle-gc/src/main/resources/application.conf
+++ b/eagle-gc/src/main/resources/application.conf
@@ -41,7 +41,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "NNGCLog",
+    "application": "NNGCLog",
     "mailHost" : "www.xyz.com",
     "mailSmtpPort":"25",
     "mailDebug" : "true",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-hadoop-metric/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/application.conf b/eagle-hadoop-metric/src/main/resources/application.conf
index d72cc26..dc1c7f3 100644
--- a/eagle-hadoop-metric/src/main/resources/application.conf
+++ b/eagle-hadoop-metric/src/main/resources/application.conf
@@ -45,7 +45,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "hadoopJmxMetricDataSource",
+    "application": "hadoopJmxMetricDataSource",
   	"dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-hadoop-metric/src/main/resources/capacityused-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/capacityused-policy-import.sh b/eagle-hadoop-metric/src/main/resources/capacityused-policy-import.sh
index a09199a..71e2756 100644
--- a/eagle-hadoop-metric/src/main/resources/capacityused-policy-import.sh
+++ b/eagle-hadoop-metric/src/main/resources/capacityused-policy-import.sh
@@ -30,7 +30,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
        "prefix": "alertdef",
        "tags": {
          "site": "sandbox",
-         "dataSource": "hadoopJmxMetricDataSource",
+         "application": "hadoopJmxMetricDataSource",
          "policyId": "capacityUsedPolicy",
          "alertExecutorId": "hadoopJmxMetricAlertExecutor",
          "policyType": "siddhiCEPEngine"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-hadoop-metric/src/main/resources/hastate-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/hastate-policy-import.sh b/eagle-hadoop-metric/src/main/resources/hastate-policy-import.sh
index a043cd4..b125e37 100644
--- a/eagle-hadoop-metric/src/main/resources/hastate-policy-import.sh
+++ b/eagle-hadoop-metric/src/main/resources/hastate-policy-import.sh
@@ -30,7 +30,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
        "prefix": "alertdef",
        "tags": {
          "site": "sandbox",
-         "dataSource": "hadoopJmxMetricDataSource",
+         "application": "hadoopJmxMetricDataSource",
          "policyId": "haStatePolicy",
          "alertExecutorId": "hadoopJmxMetricAlertExecutor",
          "policyType": "siddhiCEPEngine"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-hadoop-metric/src/main/resources/lastcheckpointtime-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/lastcheckpointtime-policy-import.sh b/eagle-hadoop-metric/src/main/resources/lastcheckpointtime-policy-import.sh
index cdb8779..333367c 100644
--- a/eagle-hadoop-metric/src/main/resources/lastcheckpointtime-policy-import.sh
+++ b/eagle-hadoop-metric/src/main/resources/lastcheckpointtime-policy-import.sh
@@ -30,7 +30,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
        "prefix": "alertdef",
        "tags": {
          "site": "sandbox",
-         "dataSource": "hadoopJmxMetricDataSource",
+         "application": "hadoopJmxMetricDataSource",
          "policyId": "lastCheckPointTimePolicy",
          "alertExecutorId": "hadoopJmxMetricAlertExecutor",
          "policyType": "siddhiCEPEngine"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-hadoop-metric/src/main/resources/missingblock-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/missingblock-policy-import.sh b/eagle-hadoop-metric/src/main/resources/missingblock-policy-import.sh
index 280399b..9a5e924 100644
--- a/eagle-hadoop-metric/src/main/resources/missingblock-policy-import.sh
+++ b/eagle-hadoop-metric/src/main/resources/missingblock-policy-import.sh
@@ -30,7 +30,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
        "prefix": "alertdef",
        "tags": {
          "site": "sandbox",
-         "dataSource": "hadoopJmxMetricDataSource",
+         "application": "hadoopJmxMetricDataSource",
          "policyId": "missingBlockPolicy",
          "alertExecutorId": "hadoopJmxMetricAlertExecutor",
          "policyType": "siddhiCEPEngine"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-hadoop-metric/src/main/resources/namenodelag-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/namenodelag-policy-import.sh b/eagle-hadoop-metric/src/main/resources/namenodelag-policy-import.sh
index 8890b83..45de4b8 100644
--- a/eagle-hadoop-metric/src/main/resources/namenodelag-policy-import.sh
+++ b/eagle-hadoop-metric/src/main/resources/namenodelag-policy-import.sh
@@ -28,7 +28,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
        "prefix": "alertdef",
        "tags": {
          "site": "sandbox",
-         "dataSource": "hadoopJmxMetricDataSource",
+         "application": "hadoopJmxMetricDataSource",
          "policyId": "NameNodeLagPolicy",
          "alertExecutorId": "hadoopJmxMetricAlertExecutor",
          "policyType": "siddhiCEPEngine"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-hadoop-metric/src/main/resources/nodecount-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/nodecount-policy-import.sh b/eagle-hadoop-metric/src/main/resources/nodecount-policy-import.sh
index e77e10e..589a44e 100644
--- a/eagle-hadoop-metric/src/main/resources/nodecount-policy-import.sh
+++ b/eagle-hadoop-metric/src/main/resources/nodecount-policy-import.sh
@@ -30,7 +30,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
        "prefix": "alertdef",
        "tags": {
          "site": "sandbox",
-         "dataSource": "hadoopJmxMetricDataSource",
+         "application": "hadoopJmxMetricDataSource",
          "policyId": "dataNodeCountPolicy",
          "alertExecutorId": "hadoopJmxMetricAlertExecutor",
          "policyType": "siddhiCEPEngine"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-hadoop-metric/src/main/resources/safemodecheck-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/safemodecheck-policy-import.sh b/eagle-hadoop-metric/src/main/resources/safemodecheck-policy-import.sh
index dfb1794..32a6bee 100644
--- a/eagle-hadoop-metric/src/main/resources/safemodecheck-policy-import.sh
+++ b/eagle-hadoop-metric/src/main/resources/safemodecheck-policy-import.sh
@@ -30,7 +30,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
        "prefix": "alertdef",
        "tags": {
          "site": "sandbox",
-         "dataSource": "hadoopJmxMetricDataSource",
+         "application": "hadoopJmxMetricDataSource",
          "policyId": "safeModePolicy",
          "alertExecutorId": "hadoopJmxMetricAlertExecutor",
          "policyType": "siddhiCEPEngine"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-security/eagle-security-hbase-securitylog/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hbase-securitylog/src/main/resources/application.conf b/eagle-security/eagle-security-hbase-securitylog/src/main/resources/application.conf
index 4979a1a..e92cb4f 100644
--- a/eagle-security/eagle-security-hbase-securitylog/src/main/resources/application.conf
+++ b/eagle-security/eagle-security-hbase-securitylog/src/main/resources/application.conf
@@ -46,7 +46,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "hbaseSecurityLog",
+    "application": "hbaseSecurityLog",
     "dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/application.conf b/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/application.conf
index 697b4f6..3c3572e 100644
--- a/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/application.conf
+++ b/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/application.conf
@@ -45,7 +45,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "hdfsAuditLog",
+    "application": "hdfsAuditLog",
   	"dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-security/eagle-security-hdfs-securitylog/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hdfs-securitylog/src/main/resources/application.conf b/eagle-security/eagle-security-hdfs-securitylog/src/main/resources/application.conf
index 9900ac8..01e25db 100644
--- a/eagle-security/eagle-security-hdfs-securitylog/src/main/resources/application.conf
+++ b/eagle-security/eagle-security-hdfs-securitylog/src/main/resources/application.conf
@@ -45,7 +45,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "hdfsSecurityLog",
+    "application": "hdfsSecurityLog",
     "dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-security/eagle-security-hive/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hive/src/main/resources/application.conf b/eagle-security/eagle-security-hive/src/main/resources/application.conf
index 3c33015..22be461 100644
--- a/eagle-security/eagle-security-hive/src/main/resources/application.conf
+++ b/eagle-security/eagle-security-hive/src/main/resources/application.conf
@@ -36,7 +36,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource" : "hiveQueryLog",
+    "application" : "hiveQueryLog",
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",
     "mailDebug" : "true",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-security/eagle-security-userprofile/detection/src/main/resources/application-batch.conf
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-userprofile/detection/src/main/resources/application-batch.conf b/eagle-security/eagle-security-userprofile/detection/src/main/resources/application-batch.conf
index 36e838c..8f2a690 100644
--- a/eagle-security/eagle-security-userprofile/detection/src/main/resources/application-batch.conf
+++ b/eagle-security/eagle-security-userprofile/detection/src/main/resources/application-batch.conf
@@ -40,7 +40,7 @@
 	},
 	"eagleProps" : {
 		"site":"sandbox",
-		"dataSource":"userProfile",
+		"application":"userProfile",
 		"eagleService": {
 			"host": "localhost",
 			"port": "38080",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-security/eagle-security-userprofile/detection/src/main/resources/application-stream.conf
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-userprofile/detection/src/main/resources/application-stream.conf b/eagle-security/eagle-security-userprofile/detection/src/main/resources/application-stream.conf
index 68e5158..09bec08 100644
--- a/eagle-security/eagle-security-userprofile/detection/src/main/resources/application-stream.conf
+++ b/eagle-security/eagle-security-userprofile/detection/src/main/resources/application-stream.conf
@@ -40,7 +40,7 @@
 	},
 	"eagleProps" : {
 		"site":"sandbox",
-		"dataSource":"userProfile",
+		"application":"userProfile",
 		"userProfileFeatures":"",
 		"userProfileMode":"streaming",
 		"eagleService": {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-webservice/src/main/webapp/app/public/feature/common/controller.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/common/controller.js b/eagle-webservice/src/main/webapp/app/public/feature/common/controller.js
index 50f377c..bb3155f 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/common/controller.js
+++ b/eagle-webservice/src/main/webapp/app/public/feature/common/controller.js
@@ -74,7 +74,7 @@
 		$scope.application = Application.current();
 
 		// List policies
-		var _policyList = Entities.queryEntities("AlertDefinitionService", {site: Site.current().tags.site, dataSource: $scope.application.tags.application});
+		var _policyList = Entities.queryEntities("AlertDefinitionService", {site: Site.current().tags.site, application: $scope.application.tags.application});
 		_policyList._promise.then(function() {
 			$.each(_policyList, function(i, policy) {
 				policy.__mailStr = common.getValueByPath(common.parseJSON(policy.notificationDef, {}), "0.recipients", "");
@@ -161,7 +161,7 @@
 			var _endTime = app.time.now().hour(23).minute(59).second(59).millisecond(0);
 			var _startTime = _endTime.clone().subtract(1, "month").hour(0).minute(0).second(0).millisecond(0);
 			var _cond = {
-				dataSource: policy.tags.dataSource,
+				application: policy.tags.application,
 				policyId: policy.tags.policyId,
 				_startTime: _startTime,
 				_endTime: _endTime
@@ -182,7 +182,7 @@
 			// Alert list
 			$scope.alertList = Entities.queryEntities("AlertService", {
 				site: Site.current().tags.site,
-				dataSource: policy.tags.dataSource,
+				application: policy.tags.application,
 				policyId: policy.tags.policyId,
 				_pageSize: MAX_PAGESIZE,
 				_duration: 1000 * 60 * 60 * 24 * 30,
@@ -261,15 +261,15 @@
 		$scope.encodedRowkey = $wrapState.param.filter;
 
 		$scope.step = 0;
-		$scope.dataSources = {};
+		$scope.applications = {};
 		$scope.policy = {};
 
 		// ==========================================
 		// =            Data Preparation            =
 		// ==========================================
 		// Steam list
-		var _streamList = Entities.queryEntities("AlertStreamService", {dataSource: Application.current().tags.application});
-		var _executorList = Entities.queryEntities("AlertExecutorService", {dataSource: Application.current().tags.application});
+		var _streamList = Entities.queryEntities("AlertStreamService", {application: Application.current().tags.application});
+		var _executorList = Entities.queryEntities("AlertExecutorService", {application: Application.current().tags.application});
 		$scope.streamList = _streamList;
 		$scope.executorList = _executorList;
 		$scope.streamReady = false;
@@ -278,7 +278,7 @@
 			// Map executor with stream
 			$.each(_executorList, function(i, executor) {
 				$.each(_streamList, function(j, stream) {
-					if(stream.tags.dataSource === executor.tags.dataSource && stream.tags.streamName === executor.tags.streamName) {
+					if(stream.tags.application === executor.tags.application && stream.tags.streamName === executor.tags.streamName) {
 						stream.alertExecutor = executor;
 						return false;
 					}
@@ -287,7 +287,7 @@
 
 			// Fill stream list
 			$.each(_streamList, function(i, unit) {
-				var _srcStreamList = $scope.dataSources[unit.tags.dataSource] = $scope.dataSources[unit.tags.dataSource] || [];
+				var _srcStreamList = $scope.applications[unit.tags.application] = $scope.applications[unit.tags.application] || [];
 				_srcStreamList.push(unit);
 			});
 
@@ -296,8 +296,8 @@
 			// ==========================================
 			// =                Function                =
 			// ==========================================
-			function _findStream(dataSource, streamName) {
-				var _streamList = $scope.dataSources[dataSource];
+			function _findStream(application, streamName) {
+				var _streamList = $scope.applications[application];
 				if(!_streamList) return null;
 
 				for(var i = 0 ; i < _streamList.length ; i += 1) {
@@ -320,14 +320,14 @@
 					},
 					init: function() {
 						$scope.policy.__.streamName = $scope.policy.__.streamName ||
-							common.array.find($scope.policy.tags.dataSource, _streamList, "tags.dataSource").tags.streamName;
+							common.array.find($scope.policy.tags.application, _streamList, "tags.application").tags.streamName;
 					},
 					nextable: function() {
 						var _streamName = common.getValueByPath($scope.policy, "__.streamName");
 						if(!_streamName) return false;
 
 						// Detect stream in current data source list
-						return !!common.array.find(_streamName, $scope.dataSources[$scope.policy.tags.dataSource], "tags.streamName");
+						return !!common.array.find(_streamName, $scope.applications[$scope.policy.tags.application], "tags.streamName");
 					}
 				},
 
@@ -337,11 +337,11 @@
 					init: function() {
 						// Normal mode will fetch meta list
 						if(!$scope.policy.__.advanced) {
-							var _stream = _findStream($scope.policy.tags.dataSource, $scope.policy.__.streamName);
+							var _stream = _findStream($scope.policy.tags.application, $scope.policy.__.streamName);
 							$scope._stream = _stream;
 
 							if(!_stream.metas) {
-								_stream.metas = Entities.queryEntities("AlertStreamSchemaService", {dataSource: $scope.policy.tags.dataSource, streamName: $scope.policy.__.streamName});
+								_stream.metas = Entities.queryEntities("AlertStreamSchemaService", {application: $scope.policy.tags.application, streamName: $scope.policy.__.streamName});
 								_stream.metas._promise.then(function() {
 									_stream.metas.sort(function(a, b) {
 										if(a.tags.attrName < b.tags.attrName) {
@@ -365,7 +365,7 @@
 						if($scope.policy.__.advanced) {
 							// Check stream source
 							$scope._stream = null;
-							$.each($scope.dataSources[$scope.policy.tags.dataSource], function(i, stream) {
+							$.each($scope.applications[$scope.policy.tags.application], function(i, stream) {
 								if(($scope.policy.__._expression || "").indexOf(stream.tags.streamName) !== -1) {
 									$scope._stream = stream;
 									return false;
@@ -436,15 +436,15 @@
 						prefix: "alertdef",
 						remediationDef: "",
 						tags: {
-							dataSource: Application.current().tags.application,
+							application: Application.current().tags.application,
 							policyType: "siddhiCEPEngine"
 						}
 					};
 
 					// If configured data source
-					if($wrapState.param.dataSrc) {
-						$scope.policy.tags.dataSource = $wrapState.param.dataSrc;
-						if(common.array.find($wrapState.param.dataSrc, Site.current().dataSrcList, "tags.dataSource")) {
+					if($wrapState.param.app) {
+						$scope.policy.tags.application = $wrapState.param.app;
+						if(common.array.find($wrapState.param.app, Site.current().applicationList, "tags.application")) {
 							setTimeout(function() {
 								$scope.changeStep(0, 2, false);
 								$scope.$apply();
@@ -877,7 +877,7 @@
 						alertExecutorId: $scope.policy.tags.alertExecutorId,
 						policyId: $scope.policy.tags.policyId,
 						policyType: "siddhiCEPEngine",
-						dataSource: $scope.policy.tags.dataSource
+						application: $scope.policy.tags.application
 					});
 					_checkList._promise.then(function() {
 						if(_checkList.length) {
@@ -941,7 +941,7 @@
 
 			var _list = Entities.queryEntities("AlertService", {
 				site: Site.current().tags.site,
-				dataSource: $scope.application.tags.application,
+				application: $scope.application.tags.application,
 				hostname: null,
 				_pageSize: MAX_PAGESIZE,
 				_duration: 1000 * 60 * 60 * 24 * 30,

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertDetail.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertDetail.html b/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertDetail.html
index fee5ab1..798ca84 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertDetail.html
+++ b/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertDetail.html
@@ -28,7 +28,7 @@
 
 		<div class="inline-group">
 			<dl><dt>Site</dt><dd>{{alert.tags.site}}</dd></dl>
-			<dl><dt>Data Source</dt><dd>{{alert.tags.dataSource}}</dd></dl>
+			<dl><dt>Data Source</dt><dd>{{alert.tags.application}}</dd></dl>
 		</div>
 		<div class="inline-group">
 			<dl><dt>Alert Time</dt><dd>{{common.format.date(alert.timestamp)}}</dd></dl>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertList.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertList.html b/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertList.html
index 44f5a32..0395b8e 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertList.html
+++ b/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertList.html
@@ -34,7 +34,7 @@
 					<tr>
 						<th width="170" sortpath="timestamp">Alert Time</th>
 						<th width="170" sortpath="alertContext.properties.timestamp">Message Time</th>
-						<th width="105" sortpath="tags.dataSource">Data Source</th>
+						<th width="105" sortpath="tags.application">Application</th>
 						<!--th width="70" sortpath="severity">Type</th-->
 						<th width="150" sortpath="tags.policyId">Policy Name</th>
 						<th width="60" sortpath="alertContext.properties.user">User</th>
@@ -47,7 +47,7 @@
 					<tr ng-class="{info : item.__new}">
 						<td>{{common.format.date(item.timestamp)}}</td>
 						<td>{{common.format.date(item.alertContext.properties.timestamp)}}</td>
-						<td>{{item.tags.dataSource}}</td>
+						<td>{{item.tags.application}}</td>
 						<!--td>{{item.severity}}</td-->
 						<td class="text-nowrap">
 							<a class="fa fa-share-square-o" ng-show="item.tags.policyId"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-webservice/src/main/webapp/app/public/feature/common/page/dataSrcConfig.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/common/page/dataSrcConfig.html b/eagle-webservice/src/main/webapp/app/public/feature/common/page/dataSrcConfig.html
deleted file mode 100644
index ba4f728..0000000
--- a/eagle-webservice/src/main/webapp/app/public/feature/common/page/dataSrcConfig.html
+++ /dev/null
@@ -1,125 +0,0 @@
-<div class="box box-primary" ng-repeat="_site in Site.list">
-	<div class="box-header">
-		<h3 class="box-title">{{_site.name}}</h3>
-		<div class="box-tools pull-right">
-			<button class="btn btn-box-tool" data-widget="collapse">
-				<i class="fa fa-minus"></i>
-			</button>
-			<button class="btn btn-box-tool" ng-click="showSiteEditor(_site)">
-				<i class="fa fa-wrench"></i>
-			</button>
-		</div>
-	</div><!-- /.box-header -->
-	<div class="box-body">
-		<div class="row">
-			<div class="col-md-4" ng-repeat="dataSrc in _site.dataSrcList">
-				<div class="info-box" ng-class="dataSrc.enabled !== false ? 'bg-aqua' : 'bg-gray'">
-					<span class="info-box-icon"><i class="fa fa-suitcase"></i></span>
-					<div class="info-box-content">
-						<a class="fa fa-cog config pull-right" ng-click="showDataSourceEditor(dataSrc)"></a>
-						<span class="info-box-text">{{dataSrc.desc || dataSrc.tags.dataSource}}</span>
-
-						<span class="info-box-number" ng-show="dataSrc.hide"><small>-</small></span>
-						<span class="info-box-number" ng-show="!dataSrc.hide">
-							<span class="fa fa-refresh fa-spin" ng-hide="policyStatistic._promise.$$state.status === 1"></span>
-							<span ng-show="policyStatistic._promise.$$state.status === 1">{{getPolicyCount(_site.name, dataSrc.tags.dataSource)}}</span>
-							<small>Policies</small>
-						</span>
-						<div class="progress">
-							<div class="progress-bar"></div>
-						</div>
-						<span class="progress-description" ng-show="dataSrc.hide"><small>-</small></span>
-						<span class="progress-description" ng-show="!dataSrc.hide">
-							<span class="fa fa-refresh fa-spin" ng-hide="alertStatistic._promise.$$state.status === 1"></span>
-							<span ng-show="alertStatistic._promise.$$state.status === 1">{{getAlertCount(_site.name, dataSrc.tags.dataSource)}}</span>
-							alerts in 30 Days
-						</span>
-					</div><!-- /.info-box-content -->
-				</div>
-			</div>
-		</div>
-	</div>
-</div>
-
-<!-- Modal: Create / Edit site -->
-<div class="modal fade" id="siteMDL" tabindex="-1" role="dialog">
-	<div class="modal-dialog" role="document">
-		<div class="modal-content">
-			<div class="modal-header">
-				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
-					<span aria-hidden="true">&times;</span>
-				</button>
-				<h4 class="modal-title">{{!_siteEntity.srcSite ? 'Create' : 'Config'}} Site</h4>
-			</div>
-			<div class="modal-body">
-				<div class="form-group">
-					<label>* Site Name</label>
-					<input type="text" class="form-control" placeholder="Site name..." ng-model="_siteEntity.name" ng-disabled="!!_siteEntity.srcSite" id="siteName">
-				</div>
-
-				<label>
-					* Data Source
-					<small class="text-muted">at least select 1 source</small>
-				</label>
-				<div class="checkbox" ng-repeat="item in _siteEntity.dataSrcList">
-					<label>
-						<input type="checkbox" value="{{item.name}}"
-							   ng-checked="item.enabled"
-							   ng-click="item.enabled = !item.enabled">
-						{{item.name}}
-					</label>
-				</div>
-			</div>
-			<div class="modal-footer">
-				<button type="button" class="btn btn-default" data-dismiss="modal">
-					Close
-				</button>
-				<button type="button" class="btn btn-primary" ng-click="confirmUpateSite()"
-						ng-disabled="!checkUpdateSite()">
-					{{!_siteEntity.srcSite ? 'Create' : 'Update'}}
-				</button>
-			</div>
-		</div>
-	</div>
-</div>
-
-<!-- Modal: Edit data source -->
-<div class="modal fade" id="dataSrcMDL" tabindex="-1" role="dialog">
-	<div class="modal-dialog" role="document">
-		<div class="modal-content">
-			<div class="modal-header">
-				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
-					<span aria-hidden="true">&times;</span>
-				</button>
-				<h4 class="modal-title">{{_dataSrcEntity.tags.dataSource}}</h4>
-			</div>
-			<div class="modal-body">
-				<div class="checkbox">
-					<label>
-						<input type="checkbox"
-							   ng-checked="_dataSrcEntity.enabled"
-							   ng-click="_dataSrcEntity.enabled = !_dataSrcEntity.enabled">
-						Enabled
-					</label>
-				</div>
-
-				<div class="form-group">
-					<label>Configuration</label>
-					<textarea type="text" class="form-control" placeholder="Data source configuration..." ng-model="_dataSrcEntity.config" id="dataSrcConfig" rows="10"></textarea>
-				</div>
-			</div>
-			<div class="modal-footer">
-				<button type="button" class="btn btn-danger pull-left" ng-click="confirmDeleteDataSource()">
-					Delete Source
-				</button>
-
-				<button type="button" class="btn btn-default" data-dismiss="modal">
-					Close
-				</button>
-				<button type="button" class="btn btn-primary" ng-click="confirmUpateDataSource()" ng-disabled="_dataSrcEntityLock">
-					Update
-				</button>
-			</div>
-		</div>
-	</div>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyDetail.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyDetail.html b/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyDetail.html
index 8670839..0c2bb72 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyDetail.html
+++ b/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyDetail.html
@@ -28,7 +28,7 @@
 		<div class="row">
 			<div class="col-xs-8">
 				<div class="inline-group">
-					<dl><dt>Data Source</dt><dd>{{policy.tags.dataSource}}</dd></dl>
+					<dl><dt>Data Source</dt><dd>{{policy.tags.application}}</dd></dl>
 					<dl><dt>Status</dt><dd>
 						<span ng-show="policy.enabled" class="text-muted"><i class="fa fa-square text-green"></i> Enabled</span>
 						<span ng-show="!policy.enabled" class="text-muted"><i class="fa fa-square text-muted"></i> Disabled</span>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyEdit.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyEdit.html b/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyEdit.html
index e07cb0c..8fe2eb4 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyEdit.html
+++ b/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyEdit.html
@@ -41,16 +41,6 @@
 		<div class="box-body">
 			<!-- ---------------------- Step Body Start ---------------------- -->
 
-			<!-- Step 1: Data Source -->
-			<!--div ng-show="step === 1">
-				<div class="form-group">
-					<label>Select Data Source</label>
-					<select class="form-control" ng-model="policy.tags.dataSource">
-						<option ng-repeat="dataSource in Site.current().dataSrcList" ng-hide="dataSource.hide" value="{{dataSource.tags.dataSource}}">{{dataSource.desc || dataSource.tags.dataSource}}</option>
-					</select>
-				</div>
-			</div-->
-
 			<!-- Step 1: Stream -->
 			<div ng-show="step === 1">
 				<div class="pull-right" ng-show="policy.__.advanced === undefined">
@@ -61,7 +51,7 @@
 				<div class="form-group">
 					<label>Select Stream</label>
 					<select class="form-control" ng-model="policy.__.streamName" ng-show="!policy.__.advanced">
-						<option ng-repeat="stream in dataSources[policy.tags.dataSource]">{{stream.tags.streamName}}</option>
+						<option ng-repeat="stream in applications[policy.tags.application]">{{stream.tags.streamName}}</option>
 					</select>
 					<select class="form-control" ng-show="policy.__.advanced" disabled="disabled">
 						<option>[Advanced Mode]</option>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyList.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyList.html b/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyList.html
index 45d7d02..6081636 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyList.html
+++ b/eagle-webservice/src/main/webapp/app/public/feature/common/page/policyList.html
@@ -37,7 +37,7 @@
 				</div>
 			</div>
 			<div class="col-xs-3 text-right">
-				<a class="btn btn-primary" href="#/common/policyCreate/{{!dataSource ? '' : '?dataSrc=' + dataSource.tags.dataSource}}" ng-show="Auth.isRole('ROLE_ADMIN')">
+				<a class="btn btn-primary" href="#/common/policyCreate/{{!application ? '' : '?app=' + application.tags.application}}" ng-show="Auth.isRole('ROLE_ADMIN')">
 					New Policy
 					<i class="fa fa-plus-circle"> </i>
 				</a>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-webservice/src/main/webapp/app/public/feature/metadata/controller.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/metadata/controller.js b/eagle-webservice/src/main/webapp/app/public/feature/metadata/controller.js
index 2797223..c17d612 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/metadata/controller.js
+++ b/eagle-webservice/src/main/webapp/app/public/feature/metadata/controller.js
@@ -30,7 +30,7 @@
 	// =                          Metadata                          =
 	// ==============================================================
 
-	// ======================= Policy Summary =======================
+	// ======================= Metadata List ========================
 	feature.navItem("streamList", "Metadata", "bullseye");
 	feature.controller('streamList', function(PageConfig, Site, $scope, $q, Application, Entities) {
 		PageConfig.hideSite = true;
@@ -40,25 +40,25 @@
 		$scope._streamEntityLock = false;
 
 		// =========================================== List ===========================================
-		var _streamList = Entities.queryEntities("AlertStreamService", {dataSource: Application.current().tags.application});
-		var _streamSchemaList = Entities.queryEntities("AlertStreamSchemaService", {dataSource: Application.current().tags.application});
+		var _streamList = Entities.queryEntities("AlertStreamService", {application: Application.current().tags.application});
+		var _streamSchemaList = Entities.queryEntities("AlertStreamSchemaService", {application: Application.current().tags.application});
 		$scope.streamList = _streamList;
 		$scope.streamSchemaList = _streamSchemaList;
 
 		_streamList._promise.then(function() {
 			$.each(_streamList, function(i, stream) {
 				stream.metaList = [];
-				$scope.streams[stream.tags.dataSource + "_" + stream.tags.streamName] = stream;
+				$scope.streams[stream.tags.application + "_" + stream.tags.streamName] = stream;
 			});
 		});
 
 		$q.all([_streamList._promise, _streamSchemaList._promise]).then(function() {
 			$.each(_streamSchemaList, function(i, meta) {
-				var _stream = $scope.streams[meta.tags.dataSource + "_" + meta.tags.streamName];
+				var _stream = $scope.streams[meta.tags.application + "_" + meta.tags.streamName];
 				if(_stream) {
 					_stream.metaList.push(meta);
 				} else {
-					console.warn("[Meta] Stream not match:", meta.tags.dataSource + "_" + meta.tags.streamName);
+					console.warn("[Meta] Stream not match:", meta.tags.application + "_" + meta.tags.streamName);
 				}
 			});
 		});

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-webservice/src/main/webapp/app/public/feature/metadata/page/streamList.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/metadata/page/streamList.html b/eagle-webservice/src/main/webapp/app/public/feature/metadata/page/streamList.html
index 9218d8d..806a234 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/metadata/page/streamList.html
+++ b/eagle-webservice/src/main/webapp/app/public/feature/metadata/page/streamList.html
@@ -31,7 +31,7 @@
 					Data Source
 				</dt>
 				<dd>
-					{{stream.tags.dataSource}}
+					{{stream.tags.application}}
 				</dd>
 			</dl>
 			<dl>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-webservice/src/main/webapp/app/public/feature/userProfile/controller.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/userProfile/controller.js b/eagle-webservice/src/main/webapp/app/public/feature/userProfile/controller.js
index f048a85..ed619d3 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/userProfile/controller.js
+++ b/eagle-webservice/src/main/webapp/app/public/feature/userProfile/controller.js
@@ -40,7 +40,7 @@
 
 		// ======================================== Algorithms ========================================
 		$scope.algorithmEntity = {};
-		Entities.queryEntities("AlertDefinitionService", {site: Site.current().tags.site, dataSource: "userProfile"})._promise.then(function(data) {
+		Entities.queryEntities("AlertDefinitionService", {site: Site.current().tags.site, application: "userProfile"})._promise.then(function(data) {
 			$scope.algorithmEntity = common.getValueByPath(data, "obj[0]");
 			$scope.algorithmEntity.policy = common.parseJSON($scope.algorithmEntity.policyDef);
 		});


[2/2] incubator-eagle git commit: EAGLE-177 Replace Legacy "dataSource" field with "application" in all metadata

Posted by qi...@apache.org.
EAGLE-177 Replace Legacy "dataSource" field with "application" in all metadata

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

Author: QingWen, Zhao<qi...@apache.org> jilin, jiang
Reviewer: Ralph, Su
Closes #108


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

Branch: refs/heads/master
Commit: 2b09be95443ae7f2658e772362d5a91b5dd571d6
Parents: d9ef76d
Author: Zhao, Qingwen <qi...@ebay.com>
Authored: Thu Mar 3 17:51:05 2016 +0800
Committer: Zhao, Qingwen <qi...@ebay.com>
Committed: Thu Mar 3 17:51:05 2016 +0800

----------------------------------------------------------------------
 .../src/main/bin/eagle-topology-init.sh         |  53 ++------
 .../bin/hdfs-securitylog-metadata-create.sh     |   8 +-
 .../main/conf/sandbox-hadoopjmx-pipeline.conf   |   2 +-
 .../main/conf/sandbox-hadoopjmx-topology.conf   |   2 +-
 .../sandbox-hbaseSecurityLog-application.conf   |   2 +-
 .../conf/sandbox-hdfsAuditLog-application.conf  |   2 +-
 .../sandbox-hdfsSecurityLog-application.conf    |   2 +-
 .../conf/sandbox-hiveQueryLog-application.conf  |   2 +-
 .../main/conf/sandbox-userprofile-topology.conf |   2 +-
 .../examples/hadoop-metric-policy-create.sh     |   2 +-
 .../src/main/examples/sample-policy-create.sh   |   4 +-
 .../plugin/NotificationPluginManagerImpl.java   |   4 +-
 .../src/test/resources/application.conf         |   2 +-
 .../dedup/AlertDeduplicationExecutorBase.java   |   2 +-
 .../notification/AlertNotificationExecutor.java |   6 +-
 .../siddhi/SiddhiAlertAPIEntityRender.java      |   6 +-
 .../eagle/alert/cep/TestSiddhiEvaluator.java    |   4 +-
 .../dao/TestSiddhiStreamMetadataUtils.java      |   4 +-
 .../alert/dao/TestStreamDefinitionDAOImpl.java  |   2 +-
 .../policy/TestPolicyDistributionUpdater.java   |   4 +-
 .../src/test/resources/application.conf         |   2 +-
 .../src/test/resources/unittest.conf            |   2 +-
 .../src/test/resources/pipeline_1.conf          |   2 +-
 .../src/test/resources/pipeline_2.conf          |   2 +-
 .../src/test/resources/pipeline_3.conf          |   2 +-
 .../src/test/resources/pipeline_4.conf          |   2 +-
 .../src/test/resources/pipeline_5.conf          |   2 +-
 .../src/test/resources/application.conf         |   2 +-
 .../eagle/ml/impl/MLAnomalyCallbackImpl.java    |  10 +-
 .../src/test/resources/application.conf         |   2 +-
 .../alert/entity/AlertDefinitionAPIEntity.java  |   2 +-
 .../eagle/alert/entity/AlertExecutorEntity.java |   2 +-
 .../eagle/alert/entity/AlertStreamEntity.java   |   2 +-
 .../alert/entity/AlertStreamSchemaEntity.java   |   2 +-
 .../eagle/policy/DynamicPolicyLoader.java       |   2 +-
 .../eagle/policy/dao/AlertExecutorDAO.java      |   4 +-
 .../eagle/policy/dao/AlertExecutorDAOImpl.java  |   8 +-
 .../eagle/policy/dao/AlertStreamDAOImpl.java    |   4 +-
 .../eagle/policy/dao/AlertStreamSchemaDAO.java  |   2 +-
 .../policy/dao/AlertStreamSchemaDAOImpl.java    |   4 +-
 .../eagle/policy/dao/PolicyDefinitionDAO.java   |   2 +-
 .../dao/PolicyDefinitionEntityDAOImpl.java      |   8 +-
 .../policy/executor/PolicyProcessExecutor.java  |   8 +-
 .../policy/siddhi/StreamMetadataManager.java    |   4 +-
 .../apache/eagle/policy/dao/TestSchemaDao.java  |   2 +-
 .../eagle/audit/dao/ServiceAuditDAOImpl.java    |   8 +-
 .../common/config/EagleConfigConstants.java     |   3 +
 .../eagle/common/config/EagleConfigHelper.java  |   4 +-
 .../main/resources/application-plugintest.conf  |   2 +-
 .../src/main/resources/application.conf         |   2 +-
 .../gc/executor/GCMetricGeneratorExecutor.java  |   2 +-
 eagle-gc/src/main/resources/application.conf    |   2 +-
 .../src/main/resources/application.conf         |   2 +-
 .../resources/capacityused-policy-import.sh     |   2 +-
 .../src/main/resources/hastate-policy-import.sh |   2 +-
 .../lastcheckpointtime-policy-import.sh         |   2 +-
 .../resources/missingblock-policy-import.sh     |   2 +-
 .../main/resources/namenodelag-policy-import.sh |   2 +-
 .../main/resources/nodecount-policy-import.sh   |   2 +-
 .../resources/safemodecheck-policy-import.sh    |   2 +-
 .../src/main/resources/application.conf         |   2 +-
 .../src/main/resources/application.conf         |   2 +-
 .../src/main/resources/application.conf         |   2 +-
 .../src/main/resources/application.conf         |   2 +-
 .../src/main/resources/application-batch.conf   |   2 +-
 .../src/main/resources/application-stream.conf  |   2 +-
 .../app/public/feature/common/controller.js     |  42 +++----
 .../public/feature/common/page/alertDetail.html |   2 +-
 .../public/feature/common/page/alertList.html   |   4 +-
 .../feature/common/page/dataSrcConfig.html      | 125 -------------------
 .../feature/common/page/policyDetail.html       |   2 +-
 .../public/feature/common/page/policyEdit.html  |  12 +-
 .../public/feature/common/page/policyList.html  |   2 +-
 .../app/public/feature/metadata/controller.js   |  12 +-
 .../feature/metadata/page/streamList.html       |   2 +-
 .../public/feature/userProfile/controller.js    |   2 +-
 76 files changed, 147 insertions(+), 308 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/bin/eagle-topology-init.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/eagle-topology-init.sh b/eagle-assembly/src/main/bin/eagle-topology-init.sh
index 2e0c7b8..5d82efd 100755
--- a/eagle-assembly/src/main/bin/eagle-topology-init.sh
+++ b/eagle-assembly/src/main/bin/eagle-topology-init.sh
@@ -63,17 +63,17 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
 ## AlertStreamService: alert streams generated from data source
 echo ""
 echo "Importing AlertStreamService for HDFS... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream"},"desc":"alert event stream from hdfs audit log"}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream"},"desc":"alert event stream from hdfs audit log"}]'
 
 ## AlertExecutorService: what alert streams are consumed by alert executor
 echo ""
 echo "Importing AlertExecutorService for HDFS... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"dataSource":"hdfsAuditLog","alertExecutorId":"hdfsAuditLogAlertExecutor","streamName":"hdfsAuditLogEventStream"},"desc":"alert executor for hdfs audit log event stream"}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"hdfsAuditLog","alertExecutorId":"hdfsAuditLogAlertExecutor","streamName":"hdfsAuditLogEventStream"},"desc":"alert executor for hdfs audit log event stream"}]'
 
 ## AlertStreamSchemaService: schema for event from alert stream
 echo ""
 echo "Importing AlertStreamSchemaService for HDFS... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"src"},"attrDescription":"source directory or file, such as /tmp","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSResourceResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"dst"},"attrDescription":"destination directory, such as /tmp","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSResourceResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"host"},"attrDescription":"hostname, such as loc
 alhost","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"allowed"},"attrDescription":"true, false or none","attrType":"bool","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"user"},"attrDescription":"process user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"cmd"},"attrDescription":"file/directory operation, such as getfileinfo, open, listStatus and so on","attrType":"string","category":"","attrVal
 ueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSCommandResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"sensitivityType"},"attrDescription":"mark such as AUDITLOG, SECURITYLOG","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSSensitivityTypeResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"securityZone"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":""}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"src"},"attrDescription":"source directory or file, such as /tmp","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSResourceResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"dst"},"attrDescription":"destination directory, such as /tmp","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSResourceResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"host"},"attrDescription":"hostname, such as 
 localhost","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"allowed"},"attrDescription":"true, false or none","attrType":"bool","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"user"},"attrDescription":"process user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"cmd"},"attrDescription":"file/directory operation, such as getfileinfo, open, listStatus and so on","attrType":"string","category":"","
 attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSCommandResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"sensitivityType"},"attrDescription":"mark such as AUDITLOG, SECURITYLOG","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSSensitivityTypeResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"securityZone"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":""}]'
 
 
 #####################################################################
@@ -83,19 +83,19 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
 #### AlertStreamService: alert streams generated from data source
 echo ""
 echo "Importing AlertStreamService for HBASE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream"},"desc":"alert event stream from hbase security audit log"}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream"},"desc":"alert event stream from hbase security audit log"}]'
 
 
 #### AlertExecutorService: what alert streams are consumed by alert executor
 echo ""
 echo "Importing AlertExecutorService for HBASE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"dataSource":"hbaseSecurityLog","alertExecutorId":"hbaseSecurityLogAlertExecutor","streamName":"hbaseSecurityLogEventStream"},"desc":"alert executor for hbase security log event stream"}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"hbaseSecurityLog","alertExecutorId":"hbaseSecurityLogAlertExecutor","streamName":"hbaseSecurityLogEventStream"},"desc":"alert executor for hbase security log event stream"}]'
 
 
 #### AlertStreamSchemaService: schema for event from alert stream
 echo ""
 echo "Importing AlertStreamSchemaService for HBASE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"host"},"attrDescription":"remote ip address to access hbase","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"request"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseRequestResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"status"},"attrDescription":"access status: allowed or denied","attrType":"string","category":"","attrValueResolver":""},{"pre
 fix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"user"},"attrDescription":"hbase user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"scope"},"attrDescription":"the resources which users are then granted specific permissions (Read, Write, Execute, Create, Admin) against","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseMetadataResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"action"},"attrDescripti
 on":"action types, such as read, write, create, execute, and admin","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseActionResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"sensitivityType"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseSensitivityTypeResolver"}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"host"},"attrDescription":"remote ip address to access hbase","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"request"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseRequestResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"status"},"attrDescription":"access status: allowed or denied","attrType":"string","category":"","attrValueResolver":""},{"
 prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"user"},"attrDescription":"hbase user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"scope"},"attrDescription":"the resources which users are then granted specific permissions (Read, Write, Execute, Create, Admin) against","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseMetadataResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"action"},"attrDe
 scription":"action types, such as read, write, create, execute, and admin","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseActionResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"sensitivityType"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseSensitivityTypeResolver"}]'
 
 
 #####################################################################
@@ -105,17 +105,17 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
 ## AlertStreamService: alert streams generated from data source
 echo ""
 echo "Importing AlertStreamService for HIVE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream"},"desc":"alert event stream from hive query"}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream"},"desc":"alert event stream from hive query"}]'
 
 ## AlertExecutorService: what alert streams are consumed by alert executor
 echo ""
 echo "Importing AlertExecutorService for HIVE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"dataSource":"hiveQueryLog","alertExecutorId":"hiveAccessAlertByRunningJob","streamName":"hiveAccessLogStream"},"desc":"alert executor for hive query log event stream"}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"hiveQueryLog","alertExecutorId":"hiveAccessAlertByRunningJob","streamName":"hiveAccessLogStream"},"desc":"alert executor for hive query log event stream"}]'
 
 ## AlertStreamSchemaServiceService: schema for event from alert stream
 echo ""
 echo "Importing AlertStreamSchemaService for HIVE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"process user","attrValueResolver":"","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"user"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"hive sql command, such as SELECT, INSERT and DELETE","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveCommandResolver","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"command"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrDescription":"milliseconds of the datetime","attrValueResolver":"","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"timestamp"}},{"prefix":"alert
 StreamSchema","category":"","attrType":"string","attrDescription":"/database/table/column or /database/table/*","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveMetadataResolver","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"resource"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"mark such as PHONE_NUMBER","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveSensitivityTypeResolver","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"sensitivityType"}}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"process user","attrValueResolver":"","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"user"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"hive sql command, such as SELECT, INSERT and DELETE","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveCommandResolver","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"command"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrDescription":"milliseconds of the datetime","attrValueResolver":"","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"timestamp"}},{"prefix":"al
 ertStreamSchema","category":"","attrType":"string","attrDescription":"/database/table/column or /database/table/*","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveMetadataResolver","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"resource"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"mark such as PHONE_NUMBER","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveSensitivityTypeResolver","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"sensitivityType"}}]'
 
 #####################################################################
 #            Import stream metadata for UserProfile
@@ -125,46 +125,17 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
 echo ""
 echo "Importing AlertDefinitionService for USERPROFILE"
 curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H "Content-Type: application/json"  "http://$EAGLE_SERVICE_HOST:$EAGLE_SERVICE_PORT/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
-     -d '[ { "prefix": "alertdef", "tags": { "site": "sandbox", "dataSource": "userProfile", "alertExecutorId": "userProfileAnomalyDetectionExecutor", "policyId": "userProfile", "policyType": "MachineLearning" }, "desc": "user profile anomaly detection", "policyDef": "{\"type\":\"MachineLearning\",\"alertContext\":{\"site\":\"sandbox\",\"dataSource\":\"userProfile\",\"component\":\"testComponent\",\"description\":\"ML based user profile anomaly detection\",\"severity\":\"WARNING\",\"notificationByEmail\":\"true\"},\"algorithms\":[{\"name\":\"EigenDecomposition\",\"evaluator\":\"org.apache.eagle.security.userprofile.impl.UserProfileAnomalyEigenEvaluator\",\"description\":\"EigenBasedAnomalyDetection\",\"features\":\"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete, setOwner, fsck\"},{\"name\":\"KDE\",\"evaluator\":\"org.apache.eagle.security.userprofile.impl.UserProfileAnomalyKDEEvaluator\",\"description\":\"Densit
 yBasedAnomalyDetection\",\"features\":\"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete, setOwner, fsck\"}]}", "dedupeDef": "{\"alertDedupIntervalMin\":\"0\",\"emailDedupIntervalMin\":\"0\"}", "notificationDef": "", "remediationDef": "", "enabled": true } ]'
+     -d '[ { "prefix": "alertdef", "tags": { "site": "sandbox", "application": "userProfile", "alertExecutorId": "userProfileAnomalyDetectionExecutor", "policyId": "userProfile", "policyType": "MachineLearning" }, "desc": "user profile anomaly detection", "policyDef": "{\"type\":\"MachineLearning\",\"alertContext\":{\"site\":\"sandbox\",\"application\":\"userProfile\",\"component\":\"testComponent\",\"description\":\"ML based user profile anomaly detection\",\"severity\":\"WARNING\",\"notificationByEmail\":\"true\"},\"algorithms\":[{\"name\":\"EigenDecomposition\",\"evaluator\":\"org.apache.eagle.security.userprofile.impl.UserProfileAnomalyEigenEvaluator\",\"description\":\"EigenBasedAnomalyDetection\",\"features\":\"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete, setOwner, fsck\"},{\"name\":\"KDE\",\"evaluator\":\"org.apache.eagle.security.userprofile.impl.UserProfileAnomalyKDEEvaluator\",\"description\":\"Dens
 ityBasedAnomalyDetection\",\"features\":\"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete, setOwner, fsck\"}]}", "dedupeDef": "{\"alertDedupIntervalMin\":\"0\",\"emailDedupIntervalMin\":\"0\"}", "notificationDef": "", "remediationDef": "", "enabled": true } ]'
 
 echo ""
 echo "Importing AlertExecutorService for USERPROFILE"
 curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H "Content-Type: application/json"  "http://$EAGLE_SERVICE_HOST:$EAGLE_SERVICE_PORT/eagle-service/rest/entities?serviceName=AlertExecutorService" \
-      -d '[ { "prefix": "alertExecutor", "tags":{ "site":"sandbox", "dataSource":"userProfile", "alertExecutorId" : "userProfileAnomalyDetectionExecutor", "streamName":"userActivity" }, "desc": "user activity data source" } ]'
+      -d '[ { "prefix": "alertExecutor", "tags":{ "site":"sandbox", "application":"userProfile", "alertExecutorId" : "userProfileAnomalyDetectionExecutor", "streamName":"userActivity" }, "desc": "user activity data source" } ]'
 
 echo ""
 echo "Importing AlertStreamService for USERPROFILE"
 curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H "Content-Type: application/json"  "http://$EAGLE_SERVICE_HOST:$EAGLE_SERVICE_PORT/eagle-service/rest/entities?serviceName=AlertStreamService" \
-     -d '[ { "prefix": "alertStream", "tags": { "streamName": "userActivity", "site":"sandbox", "dataSource":"userProfile" }, "alertExecutorIdList": [ "userProfileAnomalyDetectionExecutor" ] } ]'
-
-######################################################################
-##            Import stream metadata for HADOOP METRIC
-######################################################################
-#
-### AlertDataSource: data sources bound to sites
-#echo "Importing AlertDataSourceService for HADOOP METRIC ... "
-#
-#curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDataSourceService" -d '[{"prefix":"alertDataSource","tags":{"site" : "sandbox", "dataSource":"hadoop"}, "enabled": "true", "config" : "", "desc":"HADOOP"}]'
-#
-#
-### AlertStreamService: alert streams generated from data source
-#echo ""
-#echo "Importing AlertStreamService for HADOOP METRIC ... "
-#curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST \
-#-H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" \
-#-d '[{"prefix":"alertStream","tags":{"dataSource":"hadoop","streamName":"hadoopJmxMetric"},"desc":"hadoop jmx metric stream"},{"prefix":"alertStream","tags":{"dataSource":"hadoop","streamName":"hadoopSysMetric"},"desc":"hadoop system metric stream"}]'
-#
-### AlertExecutorService: what alert streams are consumed by alert executor
-#echo ""
-#echo "Importing AlertExecutorService for HADOOP METRIC ... "
-#curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"dataSource":"hadoop","alertExecutorId":"hadoopJmxMetricExecutor","streamName":"hadoopJmxMetric"},"desc":"alert executor for hadoop jmx stream"}]'
-#curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"dataSource":"hadoop","alertExecutorId":"hadoopSysMetricExecutor","streamName":"hadoopSysMetric"},"desc":"alert executor for hadoop system stream"}]'
-#
-### AlertStreamSchemaService: schema for event from alert stream
-#echo ""
-#echo "Importing AlertStreamSchemaService for HADOOP METRIC ... "
-#curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"tags":{"dataSource":"hadoop","attrName":"host","streamName":"hadoopJmxMetric"},"attrType":"string","attrDescription":"metric host","attrDisplayName":"host"},{"tags":{"dataSource":"hadoop","attrName":"site","streamName":"hadoopJmxMetric"},"attrType":"string","attrDescription":"metric site","attrDisplayName":"site"},{"tags":{"dataSource":"hadoop","attrName":"timestamp","streamName":"hadoopJmxMetric"},"attrType":"long","attrDescription":"metric timestamp","attrDisplayName":"timestamp"},{"tags":{"dataSource":"hadoop","attrName":"value","streamName":"hadoopJmxMetric"},"attrType":"double","attrDescription":"metric value","attrDisplayName":"value"},{"tags":{"dataSource":"hadoop","attrName":"component","streamName":"hadoopJmxMetric"},"attrType":"string","attrDescription":
 "service component","attrDisplayName":"component"},{"tags":{"dataSource":"hadoop","attrName":"metric","streamName":"hadoopJmxMetric"},"attrType":"string","attrDescription":"metric name","attrDisplayName":"metric"}]'
-#curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"tags":{"dataSource":"hadoop","attrName":"host","streamName":"hadoopSysMetric"},"attrType":"string","attrDescription":"metric host","attrDisplayName":"host"},{"tags":{"dataSource":"hadoop","attrName":"site","streamName":"hadoopSysMetric"},"attrType":"string","attrDescription":"metric site","attrDisplayName":"site"},{"tags":{"dataSource":"hadoop","attrName":"timestamp","streamName":"hadoopSysMetric"},"attrType":"long","attrDescription":"metric timestamp","attrDisplayName":"timestamp"},{"tags":{"dataSource":"hadoop","attrName":"value","streamName":"hadoopSysMetric"},"attrType":"double","attrDescription":"metric value","attrDisplayName":"value"},{"tags":{"dataSource":"hadoop","attrName":"component","streamName":"hadoopSysMetric"},"attrType":"string","attrDescription":
 "service component","attrDisplayName":"component"},{"tags":{"dataSource":"hadoop","attrName":"metric","streamName":"hadoopSysMetric"},"attrType":"string","attrDescription":"metric name","attrDisplayName":"metric"}]'
+     -d '[ { "prefix": "alertStream", "tags": { "streamName": "userActivity", "site":"sandbox", "application":"userProfile" }, "alertExecutorIdList": [ "userProfileAnomalyDetectionExecutor" ] } ]'
 
 ## Finished
 echo ""

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/bin/hdfs-securitylog-metadata-create.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/hdfs-securitylog-metadata-create.sh b/eagle-assembly/src/main/bin/hdfs-securitylog-metadata-create.sh
index 7aa09a9..0d50376 100755
--- a/eagle-assembly/src/main/bin/hdfs-securitylog-metadata-create.sh
+++ b/eagle-assembly/src/main/bin/hdfs-securitylog-metadata-create.sh
@@ -21,19 +21,19 @@ echo "Importing metadata for HDFS security log... "
 
 #### AlertStreamService: alert streams generated from data source
 
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"dataSource":"hdfsSecurityLog","streamName":"hdfsSecurityLogEventStream"},"desc":"alert event stream from HDFS security audit log"}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"hdfsSecurityLog","streamName":"hdfsSecurityLogEventStream"},"desc":"alert event stream from HDFS security audit log"}]'
 
 
 #### AlertExecutorService: what alert streams are consumed by alert executor
 
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"dataSource":"hdfsSecurityLog","alertExecutorId":"hdfsSecurityLogAlertExecutor","streamName":"hdfsSecurityLogEventStream"},"desc":"alert executor for HDFS security log event stream"}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"hdfsSecurityLog","alertExecutorId":"hdfsSecurityLogAlertExecutor","streamName":"hdfsSecurityLogEventStream"},"desc":"alert executor for HDFS security log event stream"}]'
 
 
 #### AlertStreamSchemaService: schema for event from alert stream
 
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsSecurityLog","streamName":"hdfsSecurityLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsSecurityLog","streamName":"hdfsSecurityLogEventStream","attrName":"user"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsSecurityLog","streamName":"hdfsSecurityLogEventStream","attrName":"allowed"},"attrDescription":"true, false or none","attrType":"bool","category":"","attrValueResolver":""}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","tags":{"application":"hdfsSecurityLog","streamName":"hdfsSecurityLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsSecurityLog","streamName":"hdfsSecurityLogEventStream","attrName":"user"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsSecurityLog","streamName":"hdfsSecurityLogEventStream","attrName":"allowed"},"attrDescription":"true, false or none","attrType":"bool","category":"","attrValueResolver":""}]'
 
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDataSourceService" -d '[{"prefix":"alertDataSource","tags":{"site":"sandbox","dataSource":"hdfsSecurityLog"},"enabled":"true","desc":"HDFS Security"}]'
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDataSourceService" -d '[{"prefix":"alertDataSource","tags":{"site":"sandbox","application":"hdfsSecurityLog"},"enabled":"true","desc":"HDFS Security"}]'
 
 
 echo ""

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/conf/sandbox-hadoopjmx-pipeline.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-hadoopjmx-pipeline.conf b/eagle-assembly/src/main/conf/sandbox-hadoopjmx-pipeline.conf
index 2a75c59..3f14c47 100644
--- a/eagle-assembly/src/main/conf/sandbox-hadoopjmx-pipeline.conf
+++ b/eagle-assembly/src/main/conf/sandbox-hadoopjmx-pipeline.conf
@@ -20,7 +20,7 @@
 		}
 		eagleProps {
 			"site" : "sandbox"
-			"dataSource": "HADOOP"
+			"application": "HADOOP"
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/conf/sandbox-hadoopjmx-topology.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-hadoopjmx-topology.conf b/eagle-assembly/src/main/conf/sandbox-hadoopjmx-topology.conf
index 9e15fb8..d91ef9f 100644
--- a/eagle-assembly/src/main/conf/sandbox-hadoopjmx-topology.conf
+++ b/eagle-assembly/src/main/conf/sandbox-hadoopjmx-topology.conf
@@ -45,7 +45,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "hadoopJmxMetricDataSource",
+    "application": "hadoopJmxMetricDataSource",
     "dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/conf/sandbox-hbaseSecurityLog-application.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-hbaseSecurityLog-application.conf b/eagle-assembly/src/main/conf/sandbox-hbaseSecurityLog-application.conf
index 9909d75..58468ea 100644
--- a/eagle-assembly/src/main/conf/sandbox-hbaseSecurityLog-application.conf
+++ b/eagle-assembly/src/main/conf/sandbox-hbaseSecurityLog-application.conf
@@ -46,7 +46,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "hbaseSecurityLog",
+    "application": "hbaseSecurityLog",
     "dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/conf/sandbox-hdfsAuditLog-application.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-hdfsAuditLog-application.conf b/eagle-assembly/src/main/conf/sandbox-hdfsAuditLog-application.conf
index 2814890..4634749 100644
--- a/eagle-assembly/src/main/conf/sandbox-hdfsAuditLog-application.conf
+++ b/eagle-assembly/src/main/conf/sandbox-hdfsAuditLog-application.conf
@@ -46,7 +46,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "hdfsAuditLog",
+    "application": "hdfsAuditLog",
   	"dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/conf/sandbox-hdfsSecurityLog-application.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-hdfsSecurityLog-application.conf b/eagle-assembly/src/main/conf/sandbox-hdfsSecurityLog-application.conf
index c70d811..d54e123 100644
--- a/eagle-assembly/src/main/conf/sandbox-hdfsSecurityLog-application.conf
+++ b/eagle-assembly/src/main/conf/sandbox-hdfsSecurityLog-application.conf
@@ -46,7 +46,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "hdfsSecurityLog",
+    "application": "hdfsSecurityLog",
     "dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailHost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/conf/sandbox-hiveQueryLog-application.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-hiveQueryLog-application.conf b/eagle-assembly/src/main/conf/sandbox-hiveQueryLog-application.conf
index f5ee0be..6601aff 100644
--- a/eagle-assembly/src/main/conf/sandbox-hiveQueryLog-application.conf
+++ b/eagle-assembly/src/main/conf/sandbox-hiveQueryLog-application.conf
@@ -36,7 +36,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource" : "hiveQueryLog",
+    "application" : "hiveQueryLog",
     "mailHost" : "atom.xyz.com",
     "mailSmtpPort":"25",
     "mailDebug" : "true",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/conf/sandbox-userprofile-topology.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-userprofile-topology.conf b/eagle-assembly/src/main/conf/sandbox-userprofile-topology.conf
index e955f23..abe8cb8 100644
--- a/eagle-assembly/src/main/conf/sandbox-userprofile-topology.conf
+++ b/eagle-assembly/src/main/conf/sandbox-userprofile-topology.conf
@@ -26,7 +26,7 @@
 	},
 	"eagleProps" : {
 		"site":"sandbox",
-		"dataSource":"userProfile",
+		"application":"userProfile",
 		"eagleService": {
 			"host": "localhost",
 			"port": "9099",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/examples/hadoop-metric-policy-create.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/examples/hadoop-metric-policy-create.sh b/eagle-assembly/src/main/examples/hadoop-metric-policy-create.sh
index fc0b639..9e9e861 100644
--- a/eagle-assembly/src/main/examples/hadoop-metric-policy-create.sh
+++ b/eagle-assembly/src/main/examples/hadoop-metric-policy-create.sh
@@ -28,7 +28,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
        "prefix": "alertdef",
        "tags": {
          "site": "sandbox",
-         "dataSource": "hadoopJmxMetricDataSource",
+         "application": "hadoopJmxMetricDataSource",
          "policyId": "safeModePolicy",
          "alertExecutorId": "hadoopJmxMetricAlertExecutor",
          "policyType": "siddhiCEPEngine"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-assembly/src/main/examples/sample-policy-create.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/examples/sample-policy-create.sh b/eagle-assembly/src/main/examples/sample-policy-create.sh
index 0c014ac..71e099e 100644
--- a/eagle-assembly/src/main/examples/sample-policy-create.sh
+++ b/eagle-assembly/src/main/examples/sample-policy-create.sh
@@ -23,9 +23,9 @@ su hdfs -c "hdfs dfs -touchz /tmp/private"
 #### create hdfs policy sample in sandbox
 echo "create hdfs policy sample in sandbox... "
 curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" -d \
-'[{"tags":{"site":"sandbox","dataSource":"hdfsAuditLog","alertExecutorId":"hdfsAuditLogAlertExecutor","policyId":"viewPrivate","policyType":"siddhiCEPEngine"},"desc":"view private file","policyDef":"{\"type\":\"siddhiCEPEngine\",\"expression\":\"from hdfsAuditLogEventStream[(cmd=='\'open\'') and (src=='\'/tmp/private\'')] select * insert into outputStream\"}","dedupeDef": "{\"alertDedupIntervalMin\":0,\"emailDedupIntervalMin\":1440}","notificationDef": "[{\"subject\":\"just for test\",\"sender\":\"nobody@test.com\",\"recipients\":\"nobody@test.com\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]","remediationDef":"","enabled":true}]'
+'[{"tags":{"site":"sandbox","application":"hdfsAuditLog","alertExecutorId":"hdfsAuditLogAlertExecutor","policyId":"viewPrivate","policyType":"siddhiCEPEngine"},"desc":"view private file","policyDef":"{\"type\":\"siddhiCEPEngine\",\"expression\":\"from hdfsAuditLogEventStream[(cmd=='\'open\'') and (src=='\'/tmp/private\'')] select * insert into outputStream\"}","dedupeDef": "{\"alertDedupIntervalMin\":0,\"emailDedupIntervalMin\":1440}","notificationDef": "[{\"subject\":\"just for test\",\"sender\":\"nobody@test.com\",\"recipients\":\"nobody@test.com\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]","remediationDef":"","enabled":true}]'
 
 #### create hive policy sample in sandbox
 echo "create hive policy sample in sandbox... "
 curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" -d \
-'[{"tags":{"site":"sandbox","dataSource":"hiveQueryLog","alertExecutorId":"hiveAccessAlertByRunningJob","policyId":"queryPhoneNumber","policyType":"siddhiCEPEngine"},"desc":"query sensitive hive data","policyDef":"{\"type\":\"siddhiCEPEngine\",\"expression\":\"from hiveAccessLogStream[(sensitivityType=='\'PHONE_NUMBER\'')] select * insert into outputStream;\"}","dedupeDef": "{\"alertDedupIntervalMin\":0,\"emailDedupIntervalMin\":1440}","notificationDef": "[{\"subject\":\"just for test\",\"sender\":\"nobody@test.com\",\"recipients\":\"nobody@test.com\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]","remediationDef":"","enabled":"true"}]'
+'[{"tags":{"site":"sandbox","application":"hiveQueryLog","alertExecutorId":"hiveAccessAlertByRunningJob","policyId":"queryPhoneNumber","policyType":"siddhiCEPEngine"},"desc":"query sensitive hive data","policyDef":"{\"type\":\"siddhiCEPEngine\",\"expression\":\"from hiveAccessLogStream[(sensitivityType=='\'PHONE_NUMBER\'')] select * insert into outputStream;\"}","dedupeDef": "{\"alertDedupIntervalMin\":0,\"emailDedupIntervalMin\":1440}","notificationDef": "[{\"subject\":\"just for test\",\"sender\":\"nobody@test.com\",\"recipients\":\"nobody@test.com\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]","remediationDef":"","enabled":"true"}]'

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/java/org/apache/eagle/notification/plugin/NotificationPluginManagerImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/java/org/apache/eagle/notification/plugin/NotificationPluginManagerImpl.java b/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/java/org/apache/eagle/notification/plugin/NotificationPluginManagerImpl.java
index 887a6a9..2c77f1f 100644
--- a/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/java/org/apache/eagle/notification/plugin/NotificationPluginManagerImpl.java
+++ b/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/java/org/apache/eagle/notification/plugin/NotificationPluginManagerImpl.java
@@ -50,9 +50,9 @@ public class NotificationPluginManagerImpl implements NotificationPluginManager
         // iterate all policy ids, keep those notification which belong to plugins
         PolicyDefinitionDAO policyDefinitionDao = new PolicyDefinitionEntityDAOImpl(new EagleServiceConnector( config ) , Constants.ALERT_DEFINITION_SERVICE_ENDPOINT_NAME);
         String site = config.getString("eagleProps.site");
-        String dataSource = config.getString("eagleProps.dataSource");
+        String application = config.getString("eagleProps.application");
         try{
-            List<AlertDefinitionAPIEntity> activeAlertDefs = policyDefinitionDao.findActivePolicies( site , dataSource );
+            List<AlertDefinitionAPIEntity> activeAlertDefs = policyDefinitionDao.findActivePolicies( site , application);
             // initialize all loaded plugins
             NotificationPluginLoader.getInstance().init(config);
             for(NotificationPlugin plugin : NotificationPluginLoader.getInstance().getNotificationMapping().values()){

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/test/resources/application.conf b/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/test/resources/application.conf
index d57172b..2c5e770 100644
--- a/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/test/resources/application.conf
+++ b/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/test/resources/application.conf
@@ -46,7 +46,7 @@
   },
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource": "hdfsAuditLog",
+    "application": "hdfsAuditLog",
   	"dataJoinPollIntervalSec" : 30,
     "mailHost" : "mailhost.com",
     "mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/dedup/AlertDeduplicationExecutorBase.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/dedup/AlertDeduplicationExecutorBase.java b/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/dedup/AlertDeduplicationExecutorBase.java
index 6c774ab..051df33 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/dedup/AlertDeduplicationExecutorBase.java
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/dedup/AlertDeduplicationExecutorBase.java
@@ -88,7 +88,7 @@ public abstract class AlertDeduplicationExecutorBase extends JavaStormStreamExec
 	@Override
 	public void init() {		
         String site = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.SITE);
-        String dataSource = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.DATA_SOURCE);
+        String dataSource = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.APPLICATION);
 	    Map<String, Map<String, AlertDefinitionAPIEntity>> initialAlertDefs;	    	    
 	    try {
 	 		initialAlertDefs = dao.findActivePoliciesGroupbyExecutorId(site, dataSource);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/notification/AlertNotificationExecutor.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/notification/AlertNotificationExecutor.java b/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/notification/AlertNotificationExecutor.java
index 332fde4..b024c39 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/notification/AlertNotificationExecutor.java
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/notification/AlertNotificationExecutor.java
@@ -55,10 +55,10 @@ public class AlertNotificationExecutor extends JavaStormStreamExecutor1<String>
 	@Override
 	public void init() {
 		String site = config.getString("eagleProps.site");
-		String dataSource = config.getString("eagleProps.dataSource");
+		String application = config.getString("eagleProps.application");
 		Map<String, Map<String, AlertDefinitionAPIEntity>> initialAlertDefs;
 		try {
-			initialAlertDefs = dao.findActivePoliciesGroupbyExecutorId( site, dataSource );
+			initialAlertDefs = dao.findActivePoliciesGroupbyExecutorId( site, application );
 		}
 		catch (Exception ex) {
 			LOG.error("fail to initialize initialAlertDefs: ", ex);
@@ -66,7 +66,7 @@ public class AlertNotificationExecutor extends JavaStormStreamExecutor1<String>
 		}
 
 		if(initialAlertDefs == null || initialAlertDefs.isEmpty()){
-			LOG.warn("No alert definitions found for site: "+site+", dataSource: "+dataSource);
+			LOG.warn("No alert definitions found for site: "+site+", application: "+ application);
 		}
 		try{
 			notificationManager = new NotificationPluginManagerImpl(config);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/siddhi/SiddhiAlertAPIEntityRender.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/siddhi/SiddhiAlertAPIEntityRender.java b/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/siddhi/SiddhiAlertAPIEntityRender.java
index 254d84c..d1e1bdc 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/siddhi/SiddhiAlertAPIEntityRender.java
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/main/java/org/apache/eagle/alert/siddhi/SiddhiAlertAPIEntityRender.java
@@ -82,19 +82,19 @@ public class SiddhiAlertAPIEntityRender implements ResultRender<AlertDefinitionA
 		String policyId = context.getProperty(Constants.POLICY_ID);
 		String alertMessage = "The Policy \"" + policyId + "\" has been detected with the below information: " + sb.toString() ;
 		String site = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.SITE);
-		String dataSource = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.DATA_SOURCE);
+		String application = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.APPLICATION);
 		String host = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST);
 		Integer port = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT);
 
 		context.addProperty(Constants.ALERT_EVENT, sb.toString());
 		context.addProperty(Constants.ALERT_MESSAGE, alertMessage);
 		context.addProperty(Constants.ALERT_TIMESTAMP_PROPERTY, DateTimeUtil.millisecondsToHumanDateWithSeconds(System.currentTimeMillis()));
-		context.addProperty(EagleConfigConstants.DATA_SOURCE, dataSource);
+		context.addProperty(EagleConfigConstants.APPLICATION, application);
 		context.addProperty(EagleConfigConstants.SITE, site);
 		entity.setTimestamp(timestamp);
 		/** If we need to add severity tag, we should add severity filed in AbstractpolicyDefinition, and pass it down **/
 		tags.put(EagleConfigConstants.SITE, site);
-		tags.put(EagleConfigConstants.DATA_SOURCE, dataSource);
+		tags.put(EagleConfigConstants.APPLICATION, application);
 		tags.put(Constants.SOURCE_STREAMS, context.getProperty(Constants.SOURCE_STREAMS));
 		tags.put(Constants.POLICY_ID, context.getProperty(Constants.POLICY_ID));
 		tags.put(Constants.ALERT_SOURCE, source);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/cep/TestSiddhiEvaluator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/cep/TestSiddhiEvaluator.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/cep/TestSiddhiEvaluator.java
index 3f180ce..602e117 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/cep/TestSiddhiEvaluator.java
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/cep/TestSiddhiEvaluator.java
@@ -46,7 +46,7 @@ public class TestSiddhiEvaluator {
 	public AlertStreamSchemaEntity createStreamMetaEntity(String attrName, String type) {
 		AlertStreamSchemaEntity entity = new AlertStreamSchemaEntity();
 		Map<String, String> tags = new HashMap<String, String>();
-		tags.put("dataSource", "hdfsAuditLog");
+		tags.put("application", "hdfsAuditLog");
 		tags.put("streamName", "hdfsAuditLogEventStream");
 		tags.put("attrName", attrName);
 		entity.setTags(tags);
@@ -59,7 +59,7 @@ public class TestSiddhiEvaluator {
         Config config = ConfigFactory.load("unittest.conf");
 		AlertStreamSchemaDAO streamDao = new AlertStreamSchemaDAOImpl(null, null) {
 			@Override
-			public List<AlertStreamSchemaEntity> findAlertStreamSchemaByDataSource(String dataSource) throws Exception {
+			public List<AlertStreamSchemaEntity> findAlertStreamSchemaByApplication(String dataSource) throws Exception {
 				List<AlertStreamSchemaEntity> list = new ArrayList<AlertStreamSchemaEntity>();
 				list.add(createStreamMetaEntity("cmd", "string"));
 				list.add(createStreamMetaEntity("dst", "string"));

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestSiddhiStreamMetadataUtils.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestSiddhiStreamMetadataUtils.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestSiddhiStreamMetadataUtils.java
index 1a30c71..a2b8a2d 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestSiddhiStreamMetadataUtils.java
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestSiddhiStreamMetadataUtils.java
@@ -36,8 +36,8 @@ public class TestSiddhiStreamMetadataUtils {
         StreamMetadataManager.getInstance().reset();
         StreamMetadataManager.getInstance().init(config, new AlertStreamSchemaDAO() {
             @Override
-            public List<AlertStreamSchemaEntity> findAlertStreamSchemaByDataSource(
-                    String dataSource) {
+            public List<AlertStreamSchemaEntity> findAlertStreamSchemaByApplication(
+                    String application) {
                 return Arrays.asList(generateStreamMetadataAPIEntity("attrName1", "STRING"),
                         generateStreamMetadataAPIEntity("attrName2", "LONG")
                 );

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestStreamDefinitionDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestStreamDefinitionDAOImpl.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestStreamDefinitionDAOImpl.java
index 15c64af..0bbfc4a 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestStreamDefinitionDAOImpl.java
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestStreamDefinitionDAOImpl.java
@@ -49,7 +49,7 @@ public class TestStreamDefinitionDAOImpl {
 	public void test() throws Exception{
         Config config = ConfigFactory.load();
 		AlertStreamSchemaDAO dao = new AlertStreamSchemaDAOImpl(null, null) {
-			public List<AlertStreamSchemaEntity> findAlertStreamSchemaByDataSource(String dataSource) throws Exception {
+			public List<AlertStreamSchemaEntity> findAlertStreamSchemaByApplication(String application) throws Exception {
 				List<AlertStreamSchemaEntity> list = new ArrayList<AlertStreamSchemaEntity>();
 				String programId = "UnitTest";
 				list.add(buildTestStreamDefEntity(programId, "TestStream", "Attr1"));

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/policy/TestPolicyDistributionUpdater.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/policy/TestPolicyDistributionUpdater.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/policy/TestPolicyDistributionUpdater.java
index 6c2cf3b..1fb97fd 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/policy/TestPolicyDistributionUpdater.java
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/policy/TestPolicyDistributionUpdater.java
@@ -71,10 +71,10 @@ public class TestPolicyDistributionUpdater {
             public AlertStreamSchemaDAO getAlertStreamSchemaDAO(Config config){
                 return new AlertStreamSchemaDAO(){
                     @Override
-                    public List<AlertStreamSchemaEntity> findAlertStreamSchemaByDataSource(String dataSource) throws Exception {
+                    public List<AlertStreamSchemaEntity> findAlertStreamSchemaByApplication(String application) throws Exception {
                         AlertStreamSchemaEntity entity = new AlertStreamSchemaEntity();
                         entity.setTags(new HashMap<String, String>(){{
-                            put("dataSource", "UnitTest");
+                            put("application", "UnitTest");
                             put("streamName", "testStream");
                             put("attrName", "name");
                         }});

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/application.conf b/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/application.conf
index c4f261d..524b867 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/application.conf
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/application.conf
@@ -16,7 +16,7 @@
 {
   "eagleProps" : {
     "site" : "sandbox",
-    "dataSource" : "UnitTest",
+    "application" : "UnitTest",
     "eagleService": {
       "host": "localhost",
       "port": 38080,

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/unittest.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/unittest.conf b/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/unittest.conf
index 35672d3..1d18b67 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/unittest.conf
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/unittest.conf
@@ -46,7 +46,7 @@
   },
   "eagleProps" : {
     "site": "site1",
-    "dataSource": "hdfsAuditLog",
+    "application": "hdfsAuditLog",
     "eagleService": {
        "host": "localhost",
        "port": 38080

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_1.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_1.conf b/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_1.conf
index d7a634c..6dddf7a 100644
--- a/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_1.conf
+++ b/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_1.conf
@@ -24,7 +24,7 @@
 		}
 		eagleProps  {
 			"site" : "sandbox"
-			"dataSource": "eventSource"
+			"application": "eventSource"
 			"dataJoinPollIntervalSec" : 30
 			"mailHost" : "mail.host.com"
 			"mailSmtpPort":"25"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_2.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_2.conf b/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_2.conf
index f458464..5e3561a 100644
--- a/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_2.conf
+++ b/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_2.conf
@@ -22,7 +22,7 @@
 		}
 		eagleProps  {
 			"site" : "sandbox"
-			"dataSource": "eventSource"
+			"application": "eventSource"
 			"dataJoinPollIntervalSec" : 30
 			"mailHost" : "mail.host.com"
 			"mailSmtpPort":"25"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_3.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_3.conf b/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_3.conf
index 2ee316c..b1c1955 100644
--- a/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_3.conf
+++ b/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_3.conf
@@ -32,7 +32,7 @@
 		}
 		eagleProps  {
 			"site" : "sandbox"
-			"dataSource": "HADOOP"
+			"application": "HADOOP"
 			"dataJoinPollIntervalSec" : 30
 			"mailHost" : "atom.corp.ebay.com"
 			"mailSmtpPort":"25"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_4.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_4.conf b/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_4.conf
index 9054f8f..9c35456 100644
--- a/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_4.conf
+++ b/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_4.conf
@@ -32,7 +32,7 @@
 		}
 		eagleProps {
 			"site" : "sandbox"
-			"dataSource": "HADOOP"
+			"application": "HADOOP"
 		}
 	}
 	

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_5.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_5.conf b/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_5.conf
index d3e5f1d..85b5334 100644
--- a/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_5.conf
+++ b/eagle-core/eagle-data-process/eagle-stream-pipeline/src/test/resources/pipeline_5.conf
@@ -34,7 +34,7 @@
 		}
 		eagleProps {
 			"site" : "sandbox"
-			"dataSource": "HADOOP"
+			"application": "HADOOP"
 		}
 	}
 	

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/resources/application.conf b/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/resources/application.conf
index 17dc471..87b1947 100644
--- a/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/resources/application.conf
+++ b/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/resources/application.conf
@@ -59,7 +59,7 @@
 	},
 	"eagleProps" : {
 		"site" : "sandbox",
-		"dataSource": "eventSource",
+		"application": "eventSource",
 		"dataJoinPollIntervalSec" : 30,
 		"mailHost" : "mail.host.com",
 		"mailSmtpPort":"25",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLAnomalyCallbackImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLAnomalyCallbackImpl.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLAnomalyCallbackImpl.java
index c74826b..a889361 100644
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLAnomalyCallbackImpl.java
+++ b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLAnomalyCallbackImpl.java
@@ -63,14 +63,14 @@ public class MLAnomalyCallbackImpl implements MLAnomalyCallback {
 
     private AlertAPIEntity renderAlert(MLCallbackResult aResult,PolicyEvaluationContext alertContext){
         String site = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.SITE);
-        String dataSource = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.DATA_SOURCE);
+        String applicatioin = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.APPLICATION);
 
         AlertAPIEntity entity = new AlertAPIEntity();
         entity.setDescription(aResult.toString());
 
         Map<String, String> tags = new HashMap<>();
         tags.put(EagleConfigConstants.SITE, site);
-        tags.put(EagleConfigConstants.DATA_SOURCE, dataSource);
+        tags.put(EagleConfigConstants.APPLICATION, applicatioin);
         tags.put(Constants.SOURCE_STREAMS, (String)alertContext.evaluator.getAdditionalContext().get(Constants.SOURCE_STREAMS));
         tags.put(Constants.POLICY_ID, alertContext.policyId);
         tags.put(Constants.ALERT_SOURCE, source);
@@ -90,14 +90,14 @@ public class MLAnomalyCallbackImpl implements MLAnomalyCallback {
 
         try {
             site = config.getString("eagleProps.site");
-            dataSource = config.getString("eagleProps.dataSource");
-            context.addProperty(EagleConfigConstants.DATA_SOURCE, dataSource);
+            applicatioin = config.getString("eagleProps.application");
+            context.addProperty(EagleConfigConstants.APPLICATION, applicatioin);
             context.addProperty(EagleConfigConstants.SITE, site);
         } catch (Exception ex) {
             LOG.error("site, dataSource not set in config file, ", ex);
         }
 
-        context.addProperty(EagleConfigConstants.DATA_SOURCE, dataSource);
+        context.addProperty(EagleConfigConstants.APPLICATION, applicatioin);
         context.addProperty(EagleConfigConstants.SITE, site);
         context.addProperty(Constants.POLICY_NAME, alertContext.policyId);
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/application.conf b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/application.conf
index 657011c..2125cbc 100644
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/application.conf
+++ b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/application.conf
@@ -32,7 +32,7 @@
     "containsFileHeader": true
   },
   "eagleProps" : {
-    "dataSource" : "hdfsAuditLog-ML",
+    "application" : "hdfsAuditLog-ML",
     "env" : "test",
     "mail.host" : "mailHost.com",
     "mail.debug" : "true",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertDefinitionAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertDefinitionAPIEntity.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertDefinitionAPIEntity.java
index 77aea66..98dc704 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertDefinitionAPIEntity.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertDefinitionAPIEntity.java
@@ -46,7 +46,7 @@ import org.codehaus.jackson.map.annotate.JsonSerialize;
 @Service(Constants.ALERT_DEFINITION_SERVICE_ENDPOINT_NAME)
 @JsonIgnoreProperties(ignoreUnknown = true)
 @TimeSeries(false)
-@Tags({"site", "dataSource", "alertExecutorId", "policyId", "policyType"})
+@Tags({"site", "application", "alertExecutorId", "policyId", "policyType"})
 @Indexes({
 	@Index(name="Index_1_alertExecutorId", columns = { "alertExecutorID" }, unique = true),
 })

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertExecutorEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertExecutorEntity.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertExecutorEntity.java
index ca9d334..692450f 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertExecutorEntity.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertExecutorEntity.java
@@ -32,7 +32,7 @@ import org.codehaus.jackson.map.annotate.JsonSerialize;
 @Service(Constants.ALERT_EXECUTOR_SERVICE_ENDPOINT_NAME)
 @JsonIgnoreProperties(ignoreUnknown = true)
 @TimeSeries(false)
-@Tags({"dataSource", "alertExecutorId", "streamName"})
+@Tags({"application", "alertExecutorId", "streamName"})
 public class AlertExecutorEntity extends TaggedLogAPIEntity{
     @Column("a")
     private String desc;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertStreamEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertStreamEntity.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertStreamEntity.java
index adff3d5..eedbbf7 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertStreamEntity.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertStreamEntity.java
@@ -36,7 +36,7 @@ import org.apache.eagle.log.entity.meta.TimeSeries;
 @Service(Constants.ALERT_STREAM_SERVICE_ENDPOINT_NAME)
 @JsonIgnoreProperties(ignoreUnknown = true)
 @TimeSeries(false)
-@Tags({"dataSource", "streamName"})
+@Tags({"application", "streamName"})
 public class AlertStreamEntity extends TaggedLogAPIEntity{
 	@Column("a")
 	private String desc;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertStreamSchemaEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertStreamSchemaEntity.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertStreamSchemaEntity.java
index 2ba2166..4dd9006 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertStreamSchemaEntity.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertStreamSchemaEntity.java
@@ -41,7 +41,7 @@ import org.apache.eagle.log.entity.meta.TimeSeries;
 @Service(Constants.ALERT_STREAM_SCHEMA_SERVICE_ENDPOINT_NAME)
 @JsonIgnoreProperties(ignoreUnknown = true)
 @TimeSeries(false)
-@Tags({"dataSource", "streamName", "attrName"})
+@Tags({"application", "streamName", "attrName"})
 public class AlertStreamSchemaEntity extends TaggedLogAPIEntity{
 	@Column("a")
 	private String attrType;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/DynamicPolicyLoader.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/DynamicPolicyLoader.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/DynamicPolicyLoader.java
index 7cb8e1f..20da2cf 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/DynamicPolicyLoader.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/DynamicPolicyLoader.java
@@ -190,7 +190,7 @@ public class DynamicPolicyLoader<T extends AbstractPolicyDefinitionEntity> {
 					":" + config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT) );
 			Map<String, Map<String, M>> newAlertDefs = 
 					dao.findActivePoliciesGroupbyExecutorId(config.getString("eagleProps.site"),
-                            config.getString("eagleProps.dataSource"));
+                            config.getString("eagleProps.application"));
 			
 			// compare runtime alertDefs with cachedAlertDefs and figure out what are added/deleted/updated
 			Map<String, Object> added = new HashMap<String, Object>();

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertExecutorDAO.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertExecutorDAO.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertExecutorDAO.java
index 09c6266..03ede74 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertExecutorDAO.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertExecutorDAO.java
@@ -21,6 +21,6 @@ import org.apache.eagle.alert.entity.AlertExecutorEntity;
 import java.util.List;
 
 public interface AlertExecutorDAO {
-    List<AlertExecutorEntity> findAlertExecutorByDataSource(String dataSource) throws Exception;
-    List<AlertExecutorEntity> findAlertExecutor(String dataSource, String alertExecutorId) throws Exception;
+    List<AlertExecutorEntity> findAlertExecutorByDataSource(String application) throws Exception;
+    List<AlertExecutorEntity> findAlertExecutor(String application, String alertExecutorId) throws Exception;
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertExecutorDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertExecutorDAOImpl.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertExecutorDAOImpl.java
index 0b7b9e3..0584fe2 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertExecutorDAOImpl.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertExecutorDAOImpl.java
@@ -39,10 +39,10 @@ public class AlertExecutorDAOImpl implements AlertExecutorDAO{
     }
 
     @Override
-    public List<AlertExecutorEntity> findAlertExecutorByDataSource(String dataSource) throws Exception{
+    public List<AlertExecutorEntity> findAlertExecutorByDataSource(String application) throws Exception{
         try {
             IEagleServiceClient client = new EagleServiceClientImpl(connector);
-            String query = Constants.ALERT_EXECUTOR_SERVICE_ENDPOINT_NAME + "[@dataSource=\"" + dataSource + "\"]{*}";
+            String query = Constants.ALERT_EXECUTOR_SERVICE_ENDPOINT_NAME + "[@application=\"" + application + "\"]{*}";
             GenericServiceAPIResponseEntity<AlertExecutorEntity> response =  client.search()
                     .startTime(0)
                     .endTime(10 * DateUtils.MILLIS_PER_DAY)
@@ -62,10 +62,10 @@ public class AlertExecutorDAOImpl implements AlertExecutorDAO{
     }
 
     @Override
-    public List<AlertExecutorEntity> findAlertExecutor(String dataSource, String alertExecutorId) throws Exception{
+    public List<AlertExecutorEntity> findAlertExecutor(String application, String alertExecutorId) throws Exception{
         try {
             IEagleServiceClient client = new EagleServiceClientImpl(connector);
-            String query = Constants.ALERT_EXECUTOR_SERVICE_ENDPOINT_NAME + "[@dataSource=\"" + dataSource + "\""
+            String query = Constants.ALERT_EXECUTOR_SERVICE_ENDPOINT_NAME + "[@application=\"" + application + "\""
                     + " AND @alertExecutorId=\"" + alertExecutorId + "\""
                     + "]{*}";
             GenericServiceAPIResponseEntity<AlertExecutorEntity> response =  client.search()

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamDAOImpl.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamDAOImpl.java
index 537a62f..c13d8b5 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamDAOImpl.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamDAOImpl.java
@@ -36,10 +36,10 @@ public class AlertStreamDAOImpl implements AlertStreamDAO{
         this.connector = connector;
     }
 
-    public List<AlertStreamEntity> findAlertStreamByDataSource(String dataSource) throws Exception{
+    public List<AlertStreamEntity> findAlertStreamByDataSource(String application) throws Exception{
         try {
             IEagleServiceClient client = new EagleServiceClientImpl(connector);
-            String query = Constants.ALERT_STREAM_SERVICE_ENDPOINT_NAME + "[@dataSource=\"" + dataSource + "\"]{*}";
+            String query = Constants.ALERT_STREAM_SERVICE_ENDPOINT_NAME + "[@application=\"" + application + "\"]{*}";
             GenericServiceAPIResponseEntity<AlertStreamEntity> response =  client.search()
                     .startTime(0)
                     .endTime(10 * DateUtils.MILLIS_PER_DAY)

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2b09be95/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamSchemaDAO.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamSchemaDAO.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamSchemaDAO.java
index 95a2186..f5740f0 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamSchemaDAO.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/dao/AlertStreamSchemaDAO.java
@@ -21,5 +21,5 @@ import java.util.List;
 import org.apache.eagle.alert.entity.AlertStreamSchemaEntity;
 
 public interface AlertStreamSchemaDAO {
-	List<AlertStreamSchemaEntity> findAlertStreamSchemaByDataSource(String dataSource) throws Exception;
+	List<AlertStreamSchemaEntity> findAlertStreamSchemaByApplication(String application) throws Exception;
 }