eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yonzhang2...@apache.org
Subject [1/2] incubator-eagle git commit: EAGLE-370 absence alert engine absence alert engine
Date Mon, 11 Jul 2016 23:53:49 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/develop 0b77d947a -> 1dffec09c


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/topologies.json
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/topologies.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/topologies.json
new file mode 100644
index 0000000..2726aff
--- /dev/null
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/topologies.json
@@ -0,0 +1,31 @@
+[
+  {
+    "name": "alertUnitTopology_1",
+    "numOfSpout":1,
+    "numOfAlertBolt": 10,
+    "numOfGroupBolt": 4,
+    "spoutId": "alertEngineSpout",
+    "groupNodeIds" : [
+      "streamRouterBolt0",
+      "streamRouterBolt1",
+      "streamRouterBolt2",
+      "streamRouterBolt3"
+    ],
+    "alertBoltIds": [
+      "alertBolt0",
+      "alertBolt1",
+      "alertBolt2",
+      "alertBolt3",
+      "alertBolt4",
+      "alertBolt5",
+      "alertBolt6",
+      "alertBolt7",
+      "alertBolt8",
+      "alertBolt9"
+    ],
+    "pubBoltId" : "alertPublishBolt",
+    "spoutParallelism": 1,
+    "groupParallelism": 1,
+    "alertParallelism": 1
+  }
+]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/nodata/policies.json
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/nodata/policies.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/nodata/policies.json
index 74f3016..a8e4a9c 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/nodata/policies.json
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/nodata/policies.json
@@ -10,12 +10,13 @@
 		],
 		"definition": {
 			"type": "nodataalert",
-			"value": "PT1M,dynamic,1,host"
+			"value": "PT1M,dynamic,1,host",
 		},
 		"partitionSpec": [
 			{
 				"streamId": "noDataAlertStream",
-				"type": "GROUPBY"
+				"type": "GROUPBY",
+				"columns" : ["host"]
 			}
 		],
 		"parallelismHint": 2

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/pom.xml b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/pom.xml
deleted file mode 100644
index 390705d..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/pom.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~    http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.apache.eagle</groupId>
-    <artifactId>eagle-machinelearning-parent</artifactId>
-    <version>0.5.0-incubating-SNAPSHOT</version>
-    <relativePath>../pom.xml</relativePath>
-  </parent>
-  <artifactId>eagle-machinelearning-base</artifactId>
-  <name>eagle-machinelearning-base</name>
-  <url>http://maven.apache.org</url>
-  <dependencies>
-    <dependency>
-    	<groupId>org.apache.eagle</groupId>
-    	<artifactId>eagle-alert-process</artifactId>
-    	<version>${project.version}</version>
-    </dependency>
-  </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLAlgorithmEvaluator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLAlgorithmEvaluator.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLAlgorithmEvaluator.java
deleted file mode 100644
index 800b6e0..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLAlgorithmEvaluator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml;
-
-import com.typesafe.config.Config;
-import org.apache.eagle.dataproc.core.ValuesArray;
-import org.apache.eagle.ml.model.MLAlgorithm;
-import org.apache.eagle.policy.PolicyEvaluationContext;
-
-/**
- * Machine Learning Algorithm Evaluator
- */
-public interface MLAlgorithmEvaluator {
-    /**
-     * Prepare Machine learning algorithm
-     *
-     * @param algorithm MLAlgorithm instance
-     */
-    public void init(MLAlgorithm algorithm, Config config, PolicyEvaluationContext context);
-
-    /**
-     * Evaluate input user profile model
-     *
-     * @param data ValuesArray
-     * @throws Exception
-     */
-	public void evaluate(ValuesArray data) throws Exception;
-
-    /**
-     * Register callback
-     *
-     * @param callbackObj MachineLearningCallback
-     * @throws Exception
-     */
-	public void register(MLAnomalyCallback callbackObj) throws Exception;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLAnomalyCallback.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLAnomalyCallback.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLAnomalyCallback.java
deleted file mode 100644
index 5005c42..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLAnomalyCallback.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml;
-
-import org.apache.eagle.policy.PolicyEvaluationContext;
-import org.apache.eagle.ml.model.MLCallbackResult;
-
-public interface MLAnomalyCallback {
-    /**
-     * @param callbackResult call-backed result
-     * @param alertContext context
-     */
-	void receive(MLCallbackResult callbackResult,PolicyEvaluationContext alertContext);
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLConstants.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLConstants.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLConstants.java
deleted file mode 100644
index 9197d59..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLConstants.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.eagle.ml;
-
-public class MLConstants {
-	public final static String ML_MODEL_SERVICE_NAME = "MLModelService";
-	public final static String ALGORITHM = "algorithm";
-	public final static String USER = "user";
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLModelDAO.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLModelDAO.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLModelDAO.java
deleted file mode 100644
index 13eb7e1..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLModelDAO.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml;
-
-import org.apache.eagle.ml.model.MLModelAPIEntity;
-
-import java.util.List;
-
-public interface MLModelDAO {
-    /**
-     * @param user
-     * @param algorithm
-     * @return
-     */
-	List<MLModelAPIEntity> findMLModelByContext(String user, String algorithm);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLPolicyEvaluator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLPolicyEvaluator.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLPolicyEvaluator.java
deleted file mode 100644
index 36bcaec..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/MLPolicyEvaluator.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml;
-
-import com.typesafe.config.Config;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.eagle.alert.entity.AlertAPIEntity;
-import org.apache.eagle.alert.entity.AlertDefinitionAPIEntity;
-import org.apache.eagle.dataproc.core.JsonSerDeserUtils;
-import org.apache.eagle.dataproc.core.ValuesArray;
-import org.apache.eagle.ml.impl.MLAnomalyCallbackImpl;
-import org.apache.eagle.ml.model.MLAlgorithm;
-import org.apache.eagle.ml.model.MLPolicyDefinition;
-import org.apache.eagle.ml.utils.MLReflectionUtils;
-import org.apache.eagle.policy.PolicyEvaluationContext;
-import org.apache.eagle.policy.PolicyEvaluator;
-import org.apache.eagle.policy.PolicyManager;
-import org.apache.eagle.policy.common.Constants;
-import org.apache.eagle.policy.config.AbstractPolicyDefinition;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.*;
-
-public class MLPolicyEvaluator implements PolicyEvaluator<AlertDefinitionAPIEntity> {
-	private static Logger LOG = LoggerFactory.getLogger(MLPolicyEvaluator.class);
-    private volatile MLRuntime mlRuntime;
-	private Config config;
-	private Map<String,String> context;
-	private final PolicyEvaluationContext<AlertDefinitionAPIEntity, AlertAPIEntity> evalContext;
-
-	private class MLRuntime{
-		MLPolicyDefinition mlPolicyDef;
-		MLAlgorithmEvaluator[] mlAlgorithmEvaluators;
-		List<MLAnomalyCallback> mlAnomalyCallbacks = new ArrayList<>();
-	}
-
-	public MLPolicyEvaluator(Config config, PolicyEvaluationContext<AlertDefinitionAPIEntity, AlertAPIEntity> evalContext, AbstractPolicyDefinition policyDef, String[] sourceStreams){
-		this(config, evalContext, policyDef, sourceStreams, false);
-	}
-
-	/**
-	 * needValidation does not take effect for machine learning use case
-	 * @param policyDef
-	 * @param sourceStreams
-	 * @param needValidation
-	 */
-	public MLPolicyEvaluator(Config config, PolicyEvaluationContext<AlertDefinitionAPIEntity, AlertAPIEntity> evalContext, AbstractPolicyDefinition policyDef, String[] sourceStreams, boolean needValidation){
-		this.config = config;
-		this.evalContext = evalContext;
-        LOG.info("Initializing policy named: " + evalContext.policyId);
-        this.context = new HashMap<>();
-        this.context.put(Constants.SOURCE_STREAMS, StringUtils.join(sourceStreams,","));
-		this.init(policyDef);
-	}
-
-	public void init(AbstractPolicyDefinition policyDef){
-		LOG.info("Initializing MLPolicyEvaluator ...");
-		try{
-			mlRuntime = newMLRuntime((MLPolicyDefinition) policyDef);
-		}catch(Exception e){
-			LOG.error("ML Runtime creation failed: " + e.getMessage());
-		}
-	}
-
-	private MLRuntime newMLRuntime(MLPolicyDefinition mlPolicyDef) {
-		MLRuntime runtime = new MLRuntime();
-
-		try{
-			runtime.mlPolicyDef = mlPolicyDef;
-
-			LOG.info("policydef: " + ((runtime.mlPolicyDef == null)? "policy definition is null": "policy definition is not null"));
-			Properties alertContext = runtime.mlPolicyDef.getContext();
-			LOG.info("alert context received null? " + ((alertContext == null? "yes": "no")));
-			MLAnomalyCallback callbackImpl = new MLAnomalyCallbackImpl(this, config);
-			runtime.mlAnomalyCallbacks.add(callbackImpl);
-
-			MLAlgorithm[] mlAlgorithms = mlPolicyDef.getAlgorithms();
-			runtime.mlAlgorithmEvaluators = new MLAlgorithmEvaluator[mlAlgorithms.length];
-			LOG.info("mlAlgorithms size:: " + mlAlgorithms.length);
-			int i = 0; 
-			for(MLAlgorithm algorithm:mlAlgorithms){
-                MLAlgorithmEvaluator mlAlgorithmEvaluator = MLReflectionUtils.newMLAlgorithmEvaluator(algorithm);
-                mlAlgorithmEvaluator.init(algorithm, config, evalContext);
-				runtime.mlAlgorithmEvaluators[i] =  mlAlgorithmEvaluator;
-				LOG.info("mlAlgorithmEvaluator: " + mlAlgorithmEvaluator.toString());
-						mlAlgorithmEvaluator.register(callbackImpl);
-				i++;
-			}
-		}catch(Exception ex){
-            LOG.error("Failed to create runtime for policy named: "+this.getPolicyName(),ex);
-		}
-		return runtime;
-	}
-	
-	@Override
-	public void evaluate(ValuesArray data) throws Exception {
-		LOG.info("Evaluate called with input: " + data.size());
-		synchronized(mlRuntime){
-			for(MLAlgorithmEvaluator mlAlgorithm:mlRuntime.mlAlgorithmEvaluators){
-				mlAlgorithm.evaluate(data);
-			}
-		}
-	}
-
-	@Override
-	public void onPolicyUpdate(AlertDefinitionAPIEntity newAlertDef) {
-		LOG.info("onPolicyUpdate called");
-		AbstractPolicyDefinition policyDef = null;		
-		try {
-			policyDef = JsonSerDeserUtils.deserialize(newAlertDef.getPolicyDef(), 
-					AbstractPolicyDefinition.class, PolicyManager.getInstance().getPolicyModules(newAlertDef.getTags().get("policyType")));
-		} catch (Exception ex) {
-			LOG.error("initial policy def error, ", ex);
-		}
-		MLRuntime previous = mlRuntime;
-		mlRuntime = newMLRuntime((MLPolicyDefinition) policyDef);
-		synchronized (previous) {
-			previous.mlAnomalyCallbacks = null;
-			previous.mlAlgorithmEvaluators = null;
-			previous.mlPolicyDef = null; 
-		}
-		previous = null;
-	}
-
-	@Override
-	public void onPolicyDelete() {
-		LOG.info("onPolicyDelete called");
-		MLRuntime previous = mlRuntime;
-		synchronized (previous) {
-			previous.mlAnomalyCallbacks = null;
-			previous.mlAlgorithmEvaluators = null;
-			previous.mlPolicyDef = null; 
-		}
-		previous = null;
-	}
-
-    public String getPolicyName() {
-		return evalContext.policyId;
-	}
-	
-	@Override
-	public Map<String, String> getAdditionalContext() {
-		return this.context;
-	}
-	
-	public List<String> getOutputStreamAttrNameList() {
-		return new ArrayList<String>();
-	}
-
-	@Override
-	public boolean isMarkdownEnabled() { return false; }
-
-	@Override
-	public String getMarkdownReason() { return null; }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/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
deleted file mode 100644
index 1e8c013..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLAnomalyCallbackImpl.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml.impl;
-
-import java.lang.management.ManagementFactory;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.eagle.policy.common.Constants;
-import org.apache.eagle.alert.entity.AlertAPIEntity;
-import org.apache.eagle.policy.PolicyEvaluationContext;
-import org.apache.eagle.common.DateTimeUtil;
-import org.apache.eagle.common.config.EagleConfigConstants;
-import org.apache.eagle.common.metric.AlertContext;
-import org.apache.eagle.ml.MLAnomalyCallback;
-import org.apache.eagle.ml.MLPolicyEvaluator;
-import org.apache.eagle.ml.model.MLCallbackResult;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.typesafe.config.Config;
-
-public class MLAnomalyCallbackImpl implements MLAnomalyCallback {
-	private static Logger LOG = LoggerFactory.getLogger(MLAnomalyCallbackImpl.class);
-	private MLPolicyEvaluator mlAlertEvaluator;
-	private Config config;
-
-
-    public static final String source = ManagementFactory.getRuntimeMXBean().getName();
-	
-	public MLAnomalyCallbackImpl(MLPolicyEvaluator mlAlertEvaluator, Config config){
-		this.mlAlertEvaluator = mlAlertEvaluator;
-		this.config = config;
-	}
-
-    /**
-     * TODO: generate alert
-     *
-     * @param aResult
-     * @param alertContext context
-     */
-	@Override
-	public void receive(MLCallbackResult aResult,PolicyEvaluationContext alertContext) {
-		LOG.info("Receive called with : " + aResult.toString());
-        AlertAPIEntity alert = renderAlert(aResult,alertContext);
-        alertContext.alertExecutor.onEvalEvents(alertContext, Arrays.asList(alert));
-	}
-
-    private AlertAPIEntity renderAlert(MLCallbackResult aResult,PolicyEvaluationContext alertContext){
-        String site = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.SITE);
-        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.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);
-        tags.put(Constants.ALERT_EXECUTOR_ID, alertContext.alertExecutor.getExecutorId());
-        entity.setTags(tags);
-
-        entity.setTimestamp(aResult.getTimestamp());
-
-        AlertContext context = new AlertContext();
-
-        if(aResult.getContext() != null) context.addAll(aResult.getContext());
-
-        String alertMessage = "Anomaly activities detected by algorithm ["+aResult.getAlgorithmName()+"] with information: " + aResult.toString() ;
-        context.addProperty(Constants.ALERT_EVENT, aResult.toString());
-        context.addProperty(Constants.ALERT_MESSAGE, alertMessage);
-        context.addProperty(Constants.ALERT_TIMESTAMP_PROPERTY, DateTimeUtil.millisecondsToHumanDateWithSeconds(System.currentTimeMillis()));
-
-        try {
-            site = config.getString("eagleProps.site");
-            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.APPLICATION, applicatioin);
-        context.addProperty(EagleConfigConstants.SITE, site);
-        context.addProperty(Constants.POLICY_NAME, alertContext.policyId);
-
-        entity.setAlertContext(context.toJsonString());
-        return entity;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLModelDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLModelDAOImpl.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLModelDAOImpl.java
deleted file mode 100644
index 1e3067e..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLModelDAOImpl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml.impl;
-
-import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity;
-import org.apache.eagle.ml.MLConstants;
-import org.apache.eagle.ml.MLModelDAO;
-import org.apache.eagle.ml.model.MLModelAPIEntity;
-import org.apache.eagle.service.client.EagleServiceConnector;
-import org.apache.eagle.service.client.IEagleServiceClient;
-import org.apache.eagle.service.client.impl.EagleServiceClientImpl;
-import org.apache.commons.lang.time.DateUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-public class MLModelDAOImpl implements MLModelDAO {
-	private final Logger LOG = LoggerFactory.getLogger(MLModelDAOImpl.class);
-	private final EagleServiceConnector connector;
-
-	public MLModelDAOImpl(EagleServiceConnector connector){
-		this.connector = connector;
-	}
-
-	@Override
-	public List<MLModelAPIEntity> findMLModelByContext(String user, String algorithm) {
-		try {
-			IEagleServiceClient client = new EagleServiceClientImpl(connector);
-			String query = MLConstants.ML_MODEL_SERVICE_NAME + "[@user=\"" + user + "\" AND @algorithm=\""
-						+ algorithm + "\"]{*}";
-			GenericServiceAPIResponseEntity<MLModelAPIEntity> response =  client.search().startTime(0)
-																		                 .endTime(10 * DateUtils.MILLIS_PER_DAY)
-																		                 .pageSize(Integer.MAX_VALUE)
-																		                 .query(query)
-																	                     .send();
-            if(!response.isSuccess()) {
-                LOG.error(String.format("Failed to get model for user: %s, algorithm: %s, due to: %s",user,algorithm,response.getException()));
-            }
-
-            client.close();
-            return response.getObj();
-		} catch (Exception ex) {
-			LOG.info("Got an exception when query machinelearning model service ", ex);
-			throw new IllegalStateException(ex);
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLPolicyEvaluatorServiceProviderImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLPolicyEvaluatorServiceProviderImpl.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLPolicyEvaluatorServiceProviderImpl.java
deleted file mode 100644
index d0ac75f..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/impl/MLPolicyEvaluatorServiceProviderImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml.impl;
-
-import org.apache.eagle.policy.common.Constants;
-import org.apache.eagle.policy.PolicyEvaluator;
-import org.apache.eagle.policy.PolicyEvaluatorServiceProvider;
-import org.apache.eagle.ml.MLPolicyEvaluator;
-import org.apache.eagle.ml.model.MLPolicyDefinition;
-import com.fasterxml.jackson.databind.Module;
-import com.fasterxml.jackson.databind.jsontype.NamedType;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Properties;
-
-public class MLPolicyEvaluatorServiceProviderImpl implements PolicyEvaluatorServiceProvider {
-
-	private final static String ALERT_CONTEXT = "alertContext";
-
-	@Override
-	public String getPolicyType() {
-		return Constants.policyType.MachineLearning.name();
-	}
-
-	@Override
-	public Class<? extends PolicyEvaluator> getPolicyEvaluator() {
-		return MLPolicyEvaluator.class;
-	}
-
-	@Override
-	public List<Module> getBindingModules() {
-		Module module1 = new SimpleModule(Constants.POLICY_DEFINITION).registerSubtypes(new NamedType(MLPolicyDefinition.class, getPolicyType()));
-		Module module2 = new SimpleModule(ALERT_CONTEXT).registerSubtypes(new NamedType(Properties.class, getPolicyType()));
-		return Arrays.asList(module1, module2);
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLAlgorithm.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLAlgorithm.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLAlgorithm.java
deleted file mode 100644
index 24b4bad..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLAlgorithm.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml.model;
-
-import java.io.Serializable;
-
-public class MLAlgorithm implements Serializable {
-    private static final long serialVersionUID = -223531147520123L;
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    private String name;
-    private String evaluator;
-    private String description;
-
-    public String getFeatures() {
-        return features;
-    }
-
-    public void setFeatures(String features) {
-        this.features = features;
-    }
-
-    private String features;
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public String getEvaluator() {
-        return evaluator;
-    }
-
-    public void setEvaluator(String evaluator) {
-        this.evaluator = evaluator;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLCallbackResult.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLCallbackResult.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLCallbackResult.java
deleted file mode 100644
index b457973..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLCallbackResult.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml.model;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public class MLCallbackResult {
-	private boolean isAnomaly;
-	private List<String> feature;
-	private double confidence;
-	private long timestamp;
-	private List<String> datapoints;
-	private String id;
-	private String algorithmName;
-
-    public Map<String, String> getContext() {
-        return context;
-    }
-
-    public void setContext(Map<String, String> context) {
-        this.context = context;
-    }
-
-    public void setAlgorithmName(String algorithmName) {
-        this.algorithmName = algorithmName;
-    }
-
-    private Map<String,String> context;
-
-	public String getAlgorithmName() {
-		return algorithmName;
-	}
-	public void setAlgorithm(String algorithmName) {
-		this.algorithmName = algorithmName;
-	}
-	public MLCallbackResult(){
-		feature = new ArrayList<String>();
-		setDatapoints(new ArrayList<String>());
-	}
-	public boolean isAnomaly() {
-		return isAnomaly;
-	}
-	public void setAnomaly(boolean isAnomaly) {
-		this.isAnomaly = isAnomaly;
-	}
-	public List<String> getFeature() {
-		return feature;
-	}
-	public void setFeature(List<String> feature) {
-		this.feature = feature;
-	}
-
-	private boolean doesFeatureExist(String f){
-		boolean alreadyExist = false;
-		for(String s:feature){
-			if(s.equalsIgnoreCase(f))
-				alreadyExist = true;
-		}
-		return alreadyExist;
-	}
-	public void setFeature(String aFeature) {
-		if(doesFeatureExist(aFeature) == false)
-			feature.add(aFeature);
-	}
-	public double getConfidence() {
-		return confidence;
-	}
-	public void setConfidence(double confidence) {
-		this.confidence = confidence;
-	} 
-	public String toString(){
-		StringBuffer resultStr = new StringBuffer(); 
-		resultStr.append("datapoint :<");
-		int i=0; 
-		for(String d:datapoints){
-			if(i < datapoints.size()-1){
-				resultStr.append(d.trim()); 
-				resultStr.append(",");
-				i++;
-			}else
-				resultStr.append(d.trim());
-		}
-		resultStr.append("> for user: ").append(id).append(" is anomaly: ").append(this.isAnomaly).append(" at timestamp: ").append(this.timestamp);
-		if(this.isAnomaly){
-			//resultStr.append(" with confidence: " + this.confidence);
-			resultStr.append(" with algorithm: " + algorithmName);
-			resultStr.append(" with features: ");
-			int p=0;
-			resultStr.append("["); 
-			for(String s:feature){
-				if(p < feature.size()-1){
-					resultStr.append(s.trim());
-					resultStr.append(",");
-					p++;
-				}else
-					resultStr.append(s.trim());
-			}
-			resultStr.append("]");
-		}
-		return resultStr.toString();
-	}
-	
-	public long getTimestamp() {
-		return timestamp;
-	}
-	public void setTimestamp(long timestamp) {
-		this.timestamp = timestamp;
-	}
-	public List<String> getDatapoints() {
-		return datapoints;
-	}
-	public void setDatapoints(List<String> datapoints) {
-		this.datapoints = datapoints;
-	}
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLEntityRepository.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLEntityRepository.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLEntityRepository.java
deleted file mode 100644
index 883847a..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLEntityRepository.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml.model;
-
-import org.apache.eagle.log.entity.repo.EntityRepository;
-
-public class MLEntityRepository extends EntityRepository {
-	public MLEntityRepository() {
-		entitySet.add(MLModelAPIEntity.class);
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLModelAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLModelAPIEntity.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLModelAPIEntity.java
deleted file mode 100644
index 6f91ca6..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLModelAPIEntity.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml.model;
-
-import org.apache.eagle.ml.MLConstants;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
-import org.apache.eagle.log.entity.meta.Column;
-import org.apache.eagle.log.entity.meta.ColumnFamily;
-import org.apache.eagle.log.entity.meta.Prefix;
-import org.apache.eagle.log.entity.meta.Service;
-import org.apache.eagle.log.entity.meta.Table;
-import org.apache.eagle.log.entity.meta.Tags;
-import org.apache.eagle.log.entity.meta.TimeSeries;
-
-/**
- * DDL for creating the table
- * create 'mlmodel', {NAME => 'f', BLOOMFILTER => 'ROW', VERSIONS => '1', COMPRESSION => 'SNAPPY'}
- */
-@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
-@Table("mlmodel")
-@ColumnFamily("f")
-@Prefix("mlmodel")
-@Service(MLConstants.ML_MODEL_SERVICE_NAME)
-@JsonIgnoreProperties(ignoreUnknown = true)
-@TimeSeries(false)
-@Tags({"site","user", "algorithm"})
-public class MLModelAPIEntity extends TaggedLogAPIEntity{
-	@Column("b")
-	private String content;
-    @Column("c")
-    private long version;
-
-    public String getContent() {
-		return content;
-	}
-
-	public void setContent(String content) {
-		this.content = content;
-		valueChanged("content");
-	}
-
-    public long getVersion() {
-        return version;
-    }
-
-    public void setVersion(long version) {
-        this.version = version;
-        valueChanged("version");
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLPolicyDefinition.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLPolicyDefinition.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLPolicyDefinition.java
deleted file mode 100644
index 70e0f71..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/model/MLPolicyDefinition.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml.model;
-
-import org.apache.eagle.policy.config.AbstractPolicyDefinition;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-
-import java.util.Properties;
-
-/**
- {  
-   "type":"MachineLearning",
-   "context":{
-      "site":"dev",
-      "dataSource":"userprofile"
-      "component":"dev-component",
-      "description":"ML based user profile anomaly detection",
-      "severity":"WARNING",
-      "notificationByEmail":"true"
-   },
-   "algorithms":[
-      {
-         "name":"eagle.security.userprofile.util.EigenBasedAnomalyDetection",
-         "description":"EigenBasedAnomalyDetection",
-         "features":"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete"
-      },
-      {  
-         "name":"eagle.security.userprofile.util.KDEBasedAnomalyDetection",
-         "description":"DensityBasedAnomalyDetection",
-         "features":"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete"
-      }
-   ]
-}
-   version field is used for model update, so eagle framework can understand that something changes.
-
- */
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible=true)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MLPolicyDefinition extends AbstractPolicyDefinition{
-	private String version;
-	private Properties context;
-    private MLAlgorithm[] algorithms;
-
-    public MLAlgorithm[] getAlgorithms() {
-        return algorithms;
-    }
-
-    public void setAlgorithms(MLAlgorithm[] algorithms) {
-        this.algorithms = algorithms;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    public Properties getContext() {
-        return context;
-    }
-
-    public void setContext(Properties context) {
-        this.context = context;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/utils/MLReflectionUtils.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/utils/MLReflectionUtils.java b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/utils/MLReflectionUtils.java
deleted file mode 100644
index fe70165..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/java/org/apache/eagle/ml/utils/MLReflectionUtils.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.ml.utils;
-
-import org.apache.eagle.ml.MLAlgorithmEvaluator;
-import org.apache.eagle.ml.model.MLAlgorithm;
-
-/**
- * @since 8/14/15
- */
-public class MLReflectionUtils {
-    /**
-     * Create a new MLAlgorithmEvaluator based on MLAlgorithm
-     *
-     * @param algorithm MLAlgorithm
-     * @return MLAlgorithmEvaluator object instance
-     * @throws ClassNotFoundException
-     * @throws IllegalAccessException
-     * @throws InstantiationException
-     */
-    public static MLAlgorithmEvaluator newMLAlgorithmEvaluator(MLAlgorithm algorithm) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
-        return (MLAlgorithmEvaluator) Class.forName(algorithm.getEvaluator()).newInstance();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider
deleted file mode 100644
index d7a2754..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/main/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-org.apache.eagle.ml.impl.MLPolicyEvaluatorServiceProviderImpl
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider
deleted file mode 100644
index d7a2754..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-org.apache.eagle.ml.impl.MLPolicyEvaluatorServiceProviderImpl
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/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
deleted file mode 100644
index 2125cbc..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/application.conf
+++ /dev/null
@@ -1,57 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  "envContextConfig" : {
-    "env" : "storm",
-    "topologyName" : "securityLogProcessTopology",
-    "mode" : "local",
-    "parallelismConfig" : {
-    }
-  },
-  "dataSourceConfig": {
-    "flavor" : "stormhdfs",
-    "hdfsConnection" : "10.225.92.42:9000",
-    "hdfsPath" : "/tmp/user1",
-    "copyToPath" : "/Users/user1/Security/hive_files/weeks_file/MLDemo_testing/consolidated",
-    "fileFormat" : "CSV",
-    "typeOperation" : "user profile generation",
-    "userlist": "/UserList.txt",
-    "containsFileHeader": true
-  },
-  "eagleProps" : {
-    "application" : "hdfsAuditLog-ML",
-    "env" : "test",
-    "mail.host" : "mailHost.com",
-    "mail.debug" : "true",
-    "eagleService": {
-      "host": "localhost",
-      "port": 9099,
-      "username": "admin",
-      "password": "secret"
-    }
-  },
-  "alertExecutorConfigs" : {
-     "userAnomalousActivityDetectionAlertExecutor" : {
-       "parallelism" : 2,
-       "partitioner" : "org.apache.eagle.policy.DefaultPolicyPartitioner"
-     }
-  },
-  "dynamicConfigSource" : {
-     "eagleServiceHost" : "localhost",
-     "eagleServicePort" : "8080",
-     "enabled"          : "true"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/log4j.properties b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/log4j.properties
deleted file mode 100644
index 71a5dac..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-log4j.rootLogger=INFO, DRFA, stdout
-eagle.log.dir=./logs
-eagle.log.file=eagle.log
-
-# standard output
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n
-
-# Daily Rolling File Appender
-log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.DRFA.File=${eagle.log.dir}/${eagle.log.file}
-log4j.appender.DRFA.DatePattern=.yyyy-MM-dd
-# 30-day backup
-#log4j.appender.DRFA.MaxBackupIndex=30
-log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
-
-# Pattern format: Date LogLevel LoggerName LogMessage
-log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/ml-policyDef-UserProfile.txt
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/ml-policyDef-UserProfile.txt b/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/ml-policyDef-UserProfile.txt
deleted file mode 100644
index 2f4bcb1..0000000
--- a/eagle-core/eagle-machinelearning/eagle-machinelearning-base/src/test/resources/ml-policyDef-UserProfile.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-{
-   "type":"MachineLearning",
-   "fileTypes":[
-      {
-         "type":"CSV",
-         "containsHeader":"true",
-         "fileParserClass":"eagle.ml.CSVFileFormatParser"
-      }
-   ],
-   "alertContext":{
-      "cluster":"testCluster",
-      "datacenter":"testDataCenter",
-      "component":"testComponent",
-      "description":"ML based user profile anomaly detection",
-      "severity":"WARNING",
-      "notificationByEmail":"true"
-   },
-   "algorithms":[
-      {
-         "name":"org.apache.eagle.security.userprofile.util.EigenBasedAnomalyDetection",
-         "description":"EigenBasedAnomalyDetection",
-         "modelPath":"/models/",
-         "featureSet":"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete, setOwner, fsck",
-         "type":"CSV"
-      },
-      {
-         "name":"org.apache.eagle.security.userprofile.util.KDEBasedAnomalyDetection",
-         "description":"DensityBasedAnomalyDetection",
-         "modelPath":"/models/",
-         "featureSet":"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete, setOwner, fsck",
-         "type":"CSV"
-      }
-   ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/eagle-machinelearning/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-machinelearning/pom.xml b/eagle-core/eagle-machinelearning/pom.xml
deleted file mode 100644
index e79ebfc..0000000
--- a/eagle-core/eagle-machinelearning/pom.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~    http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>eagle-core</artifactId>
-        <groupId>org.apache.eagle</groupId>
-        <version>0.5.0-incubating-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>eagle-machinelearning-parent</artifactId>
-    <packaging>pom</packaging>
-    <modules>
-        <module>eagle-machinelearning-base</module>
-    </modules>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-core/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/pom.xml b/eagle-core/pom.xml
index 9041840..0bcab2a 100644
--- a/eagle-core/pom.xml
+++ b/eagle-core/pom.xml
@@ -39,7 +39,6 @@
         <module>eagle-policy</module>
         <module>eagle-alert-parent</module>
         <module>eagle-query</module>
-   		<module>eagle-machinelearning</module>
         <module>eagle-embed</module>
         <module>eagle-metric</module>
         <module>eagle-application-management</module>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1dffec09/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider
----------------------------------------------------------------------
diff --git a/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider b/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider
index f8794f3..eac2bfd 100644
--- a/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider
+++ b/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.policy.PolicyEvaluatorServiceProvider
@@ -13,5 +13,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-org.apache.eagle.policy.siddhi.SiddhiPolicyEvaluatorServiceProviderImpl
-org.apache.eagle.ml.impl.MLPolicyEvaluatorServiceProviderImpl
\ No newline at end of file
+org.apache.eagle.policy.siddhi.SiddhiPolicyEvaluatorServiceProviderImpl
\ No newline at end of file


Mime
View raw message