eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [2/4] incubator-eagle git commit: EAGLE-130 Eagle Pipeline DSL: Parser, Compiler, Runner
Date Wed, 20 Jan 2016 06:48:22 GMT
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/storm/StormTopologyExecutorImpl.scala
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/storm/StormTopologyExecutorImpl.scala b/eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/storm/StormTopologyExecutorImpl.scala
index 11ec46d..1f753d1 100644
--- a/eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/storm/StormTopologyExecutorImpl.scala
+++ b/eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/storm/StormTopologyExecutorImpl.scala
@@ -23,9 +23,11 @@ import backtype.storm.generated.StormTopology
 import backtype.storm.utils.Utils
 import backtype.storm.{Config, LocalCluster, StormSubmitter}
 import org.apache.eagle.datastream.core.AbstractTopologyExecutor
+import org.slf4j.LoggerFactory
 import org.yaml.snakeyaml.Yaml
 
 case class StormTopologyExecutorImpl(topology: StormTopology, config: com.typesafe.config.Config) extends AbstractTopologyExecutor {
+  val LOG = LoggerFactory.getLogger(classOf[StormTopologyExecutorImpl])
   @throws(classOf[Exception])
   def execute {
     val localMode: Boolean = config.getString("envContextConfig.mode").equalsIgnoreCase("local")
@@ -45,7 +47,10 @@ case class StormTopologyExecutorImpl(topology: StormTopology, config: com.typesa
           val stormConf = yaml.load(inputFileStream).asInstanceOf[java.util.LinkedHashMap[String, Object]]
           if(stormConf != null) conf.putAll(stormConf)
         } catch {
-          case _: Throwable => ()
+          case t: Throwable => {
+            LOG.error(s"Got example $t",t)
+            throw t
+          }
         } finally {
           if(inputFileStream != null) inputFileStream.close()
         }
@@ -54,8 +59,10 @@ case class StormTopologyExecutorImpl(topology: StormTopology, config: com.typesa
 
     val topologyName = config.getString("envContextConfig.topologyName")
     if (!localMode) {
+      LOG.info("Submitting as cluster mode")
       StormSubmitter.submitTopologyWithProgressBar(topologyName, conf, topology)
     } else {
+      LOG.info("Submitting as local mode")
       val cluster: LocalCluster = new LocalCluster
       cluster.submitTopology(topologyName, conf, topology)
       while(true) {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/scala/org/apache/eagle/datastream/TestExecutionEnvironment.scala
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/scala/org/apache/eagle/datastream/TestExecutionEnvironment.scala b/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/scala/org/apache/eagle/datastream/TestExecutionEnvironment.scala
index b43f42e..ccd3deb 100644
--- a/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/scala/org/apache/eagle/datastream/TestExecutionEnvironment.scala
+++ b/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/scala/org/apache/eagle/datastream/TestExecutionEnvironment.scala
@@ -27,7 +27,7 @@ object TestExecutionEnvironment extends App{
   val env0 = ExecutionEnvironments.get[StormExecutionEnvironment]
   println(env0)
   val config = ConfigFactory.load()
-  val env1 = ExecutionEnvironments.get[StormExecutionEnvironment](config)
+  val env1 = ExecutionEnvironments.getWithConfig[StormExecutionEnvironment](config)
   println(env1)
   val env2 = ExecutionEnvironments.get[StormExecutionEnvironment](Array[String]("-D","key=value"))
   println(env2)

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/scala/org/apache/eagle/datastream/TestTypeSafedDSL.scala
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/scala/org/apache/eagle/datastream/TestTypeSafedDSL.scala b/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/scala/org/apache/eagle/datastream/TestTypeSafedDSL.scala
index cf95304..7754765 100644
--- a/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/scala/org/apache/eagle/datastream/TestTypeSafedDSL.scala
+++ b/eagle-core/eagle-data-process/eagle-stream-process-api/src/test/scala/org/apache/eagle/datastream/TestTypeSafedDSL.scala
@@ -18,6 +18,7 @@
 
 package org.apache.eagle.datastream
 
+import org.apache.eagle.datastream.core.StreamContext
 import org.apache.eagle.datastream.storm.StormExecutionEnvironment
 
 /**
@@ -51,8 +52,34 @@ object TestIterableWithGroupBy extends App {
   env.execute()
 }
 
+object TestIterableWithGroupByWithStreamContext extends App {
+  val stream = StreamContext(args)
+
+  val tuples = Seq(
+    Entity("a", 1),
+    Entity("a", 2),
+    Entity("a", 3),
+    Entity("b", 2),
+    Entity("c", 3),
+    Entity("d", 3)
+  )
+
+  stream.from(tuples)
+    .groupByKey(_.name)
+    .map(o => {o.inc += 2;o})
+    .filter(_.name != "b")
+    .filter(_.name != "c")
+    .groupByKey(o=>(o.name,o.value))
+    .map(o => (o.name,o))
+    .map(o => (o._1,o._2.value,o._2.inc))
+    .foreach(println)
+
+  stream.submit[StormExecutionEnvironment]
+}
+
 object TestIterableWithGroupByCircularly extends App{
   val env = ExecutionEnvironments.get[StormExecutionEnvironment](args)
+
   val tuples = Seq(
     Entity("a", 1),
     Entity("a", 2),
@@ -61,6 +88,7 @@ object TestIterableWithGroupByCircularly extends App{
     Entity("c", 3),
     Entity("d", 3)
   )
+
   env.from(tuples,recycle = true)
     .map(o => {o.inc += 2;o})
     .groupByKey(_.name)

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/java/org/apache/eagle/dataproc/util/AbstractConfigOptionParser.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/java/org/apache/eagle/dataproc/util/AbstractConfigOptionParser.java b/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/java/org/apache/eagle/dataproc/util/AbstractConfigOptionParser.java
index 19853ef..f40bb76 100644
--- a/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/java/org/apache/eagle/dataproc/util/AbstractConfigOptionParser.java
+++ b/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/java/org/apache/eagle/dataproc/util/AbstractConfigOptionParser.java
@@ -27,12 +27,12 @@ import java.util.Map;
  */
 public abstract class AbstractConfigOptionParser {
 
-    private final Options options;
+    // private final Options options;
     private final Parser parser;
 
     public AbstractConfigOptionParser(){
         parser = parser();
-        options = options();
+        //options = options();
     }
 
     /**
@@ -63,6 +63,6 @@ public abstract class AbstractConfigOptionParser {
     }
 
     public CommandLine parse(String[] arguments) throws ParseException {
-        return this.parser.parse(this.options,arguments);
+        return this.parser.parse(this.options(),arguments);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/java/org/apache/eagle/dataproc/util/ConfigOptionParser.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/java/org/apache/eagle/dataproc/util/ConfigOptionParser.java b/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/java/org/apache/eagle/dataproc/util/ConfigOptionParser.java
index 0bd7559..bbd4e38 100644
--- a/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/java/org/apache/eagle/dataproc/util/ConfigOptionParser.java
+++ b/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/java/org/apache/eagle/dataproc/util/ConfigOptionParser.java
@@ -40,7 +40,10 @@ public class ConfigOptionParser extends AbstractConfigOptionParser {
     @Override
     public Map<String,String> parseConfig(String[] arguments) throws ParseException {
         CommandLine cmd = parse(arguments);
+        return parseCommand(cmd);
+    }
 
+    protected Map<String,String> parseCommand(CommandLine cmd) throws ParseException {
         Map<String,String> result = new HashMap<>();
         if(cmd.hasOption(CONFIG_OPT_FLAG)){
             String[] values = cmd.getOptionValues(CONFIG_OPT_FLAG);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/Collector.scala
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/Collector.scala b/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/Collector.scala
index 2532063..5361001 100644
--- a/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/Collector.scala
+++ b/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/Collector.scala
@@ -16,6 +16,6 @@
  */
 package org.apache.eagle.datastream
 
-trait Collector[R] {
+trait Collector[-R] {
   def collect(r : R);
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/FlatMapper.scala
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/FlatMapper.scala b/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/FlatMapper.scala
index 8569ae5..ddea46f 100644
--- a/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/FlatMapper.scala
+++ b/eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/FlatMapper.scala
@@ -18,4 +18,8 @@ package org.apache.eagle.datastream
 
 trait FlatMapper[T] extends Serializable {
   def flatMap(input : Seq[AnyRef], collector : Collector[T])
+}
+
+case class FlatMapperWrapper[T](func:(Any,Collector[T]) => Unit) extends FlatMapper[T]{
+  override def flatMap(input: Seq[AnyRef], collector: Collector[T]): Unit = func(input,collector)
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-data-process/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/pom.xml b/eagle-core/eagle-data-process/pom.xml
index 1b9fb57..90b125b 100644
--- a/eagle-core/eagle-data-process/pom.xml
+++ b/eagle-core/eagle-data-process/pom.xml
@@ -15,6 +15,7 @@
   ~ 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>
@@ -29,6 +30,7 @@
         <module>eagle-stream-process-base</module>
     	<module>eagle-storm-jobrunning-spout</module>
     	<module>eagle-job-common</module>
-    <module>eagle-stream-process-api</module>
-  </modules>
+        <module>eagle-stream-process-api</module>
+        <module>eagle-stream-pipeline</module>
+    </modules>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/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 97f18f7..ca9d334 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
@@ -22,6 +22,9 @@ import org.apache.eagle.log.entity.meta.*;
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 
+/**
+ * Stream and Alert executor Id mapping should be automatically created by topology definition
+ */
 @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
 @Table("alertExecutor")
 @ColumnFamily("f")

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/SiddhiPolicyEvaluator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/SiddhiPolicyEvaluator.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/SiddhiPolicyEvaluator.java
index 024e400..13db689 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/SiddhiPolicyEvaluator.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/SiddhiPolicyEvaluator.java
@@ -42,16 +42,16 @@ import java.util.*;
  * during this time, synchronization is important
  */
 public class SiddhiPolicyEvaluator<T extends AbstractPolicyDefinitionEntity, K> implements PolicyEvaluator<T>{
-	
+
 	private final static Logger LOG = LoggerFactory.getLogger(SiddhiPolicyEvaluator.class);
-	
+
 	private volatile SiddhiRuntime siddhiRuntime;
 	private String[] sourceStreams;
 	private boolean needValidation;
 	private String policyId;
 	private Config config;
 	private final static String EXECUTION_PLAN_NAME = "query";
-	
+
 	/**
 	 * everything dependent on policyDef should be together and switched in runtime
 	 */
@@ -63,24 +63,24 @@ public class SiddhiPolicyEvaluator<T extends AbstractPolicyDefinitionEntity, K>
 		List<String> outputFields;
 		String executionPlanName;
 	}
-	
+
 	public SiddhiPolicyEvaluator(Config config, String policyName, AbstractPolicyDefinition policyDef, String[] sourceStreams){
 		this(config, policyName, policyDef, sourceStreams, false);
 	}
-	
+
 	public SiddhiPolicyEvaluator(Config config, String policyId, AbstractPolicyDefinition policyDef, String[] sourceStreams, boolean needValidation){
 		this.config = config;
 		this.policyId = policyId;
 		this.needValidation = needValidation;
-		this.sourceStreams = sourceStreams; 
+		this.sourceStreams = sourceStreams;
 		init(policyDef);
 	}
-	
-	public void init(AbstractPolicyDefinition policyDef){			
+
+	public void init(AbstractPolicyDefinition policyDef){
 		siddhiRuntime = createSiddhiRuntime((SiddhiPolicyDefinition)policyDef);
 	}
 
-	public static String addContextFieldIfNotExist(String expression) {		
+	public static String addContextFieldIfNotExist(String expression) {
 		// select fieldA, fieldB --> select eagleAlertContext, fieldA, fieldB
 		int pos = expression.indexOf("select ") + 7;
 		int index = pos;
@@ -103,7 +103,7 @@ public class SiddhiPolicyEvaluator<T extends AbstractPolicyDefinitionEntity, K>
 
 	private SiddhiRuntime createSiddhiRuntime(SiddhiPolicyDefinition policyDef){
 		SiddhiManager siddhiManager = new SiddhiManager();
-		Map<String, InputHandler> siddhiInputHandlers = new HashMap<String, InputHandler>();
+		Map<String, InputHandler> siddhiInputHandlers = new HashMap<>();
 
 		// compose execution plan sql
 		String executionPlan = policyDef.getExpression();
@@ -120,13 +120,14 @@ public class SiddhiPolicyEvaluator<T extends AbstractPolicyDefinitionEntity, K>
 		}
 
 		ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(executionPlan);
-		
-		for(String sourceStream : sourceStreams){			
+
+		for(String sourceStream : sourceStreams){
 			siddhiInputHandlers.put(sourceStream, executionPlanRuntime.getInputHandler(sourceStream));
 		}
+
 		executionPlanRuntime.start();
 
-		QueryCallback callback = new SiddhiQueryCallbackImpl<T, K>(config, this);		
+		QueryCallback callback = new SiddhiQueryCallbackImpl<T, K>(config, this);
 
 		LOG.info("Siddhi query: " + executionPlan);
 		executionPlanRuntime.addCallback(EXECUTION_PLAN_NAME, callback);
@@ -137,7 +138,7 @@ public class SiddhiPolicyEvaluator<T extends AbstractPolicyDefinitionEntity, K>
 	        field.setAccessible(true);
 	        Query query = (Query)field.get(callback);
 	        List<OutputAttribute> list = query.getSelector().getSelectionList();
-	        for (OutputAttribute output : list) {	        	
+	        for (OutputAttribute output : list) {
 	        	outputFields.add(output.getRename());
 	        }
 		}
@@ -153,7 +154,7 @@ public class SiddhiPolicyEvaluator<T extends AbstractPolicyDefinitionEntity, K>
 		runtime.executionPlanName = executionPlanRuntime.getName();
 		return runtime;
 	}
-	
+
 	/**
 	 * 1. input has 3 fields, first is siddhi context, second is streamName, the last one is map of attribute name/value
 	 * 2. runtime check for input data (This is very expensive, so we ignore for now)
@@ -173,8 +174,13 @@ public class SiddhiPolicyEvaluator<T extends AbstractPolicyDefinitionEntity, K>
 			//insert siddhiAlertContext into the first field
 			List<Object> input = new ArrayList<>();
 			input.add(siddhiAlertContext);
+			// input.add(streamName);
 			putAttrsIntoInputStream(input, streamName, map);
-			siddhiRuntime.siddhiInputHandlers.get(streamName).send(input.toArray(new Object[0]));
+            try {
+                siddhiRuntime.siddhiInputHandlers.get(streamName).send(input.toArray(new Object[0]));
+            }catch (InterruptedException ex){
+                LOG.error("Got exception "+ex.getMessage(),ex);
+            }
 		}
 	}
 
@@ -218,7 +224,7 @@ public class SiddhiPolicyEvaluator<T extends AbstractPolicyDefinitionEntity, K>
 	public void onPolicyUpdate(T newAlertDef) {
 		AbstractPolicyDefinition policyDef = null;
 		try {
-			policyDef = JsonSerDeserUtils.deserialize(newAlertDef.getPolicyDef(), 
+			policyDef = JsonSerDeserUtils.deserialize(newAlertDef.getPolicyDef(),
 					AbstractPolicyDefinition.class, PolicyManager.getInstance().getPolicyModules(newAlertDef.getTags().get(Constants.POLICY_TYPE)));
 		}
 		catch (Exception ex) {
@@ -230,7 +236,7 @@ public class SiddhiPolicyEvaluator<T extends AbstractPolicyDefinitionEntity, K>
 			previous.siddhiManager.getExecutionPlanRuntime(previous.executionPlanName).shutdown();
 		}
 	}
-	
+
 	@Override
 	public void onPolicyDelete(){
 		synchronized(siddhiRuntime){
@@ -239,12 +245,12 @@ public class SiddhiPolicyEvaluator<T extends AbstractPolicyDefinitionEntity, K>
 			LOG.info("Siddhi execution plan " + siddhiRuntime.executionPlanName + " is successfully shutdown ");
 		}
 	}
-	
+
 	@Override
 	public String toString(){
 		return siddhiRuntime.policyDef.toString();
 	}
-	
+
 	public String[] getStreamNames() {
 		return sourceStreams;
 	}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/SiddhiStreamMetadataUtils.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/SiddhiStreamMetadataUtils.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/SiddhiStreamMetadataUtils.java
index f42a021..d14cf83 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/SiddhiStreamMetadataUtils.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/policy/siddhi/SiddhiStreamMetadataUtils.java
@@ -35,7 +35,7 @@ public class SiddhiStreamMetadataUtils {
 	public static SortedMap<String, AlertStreamSchemaEntity> getAttrMap(String streamName) {
 		SortedMap<String, AlertStreamSchemaEntity> map = StreamMetadataManager.getInstance().getMetadataEntityMapForStream(streamName);
 		if(map == null || map.size() == 0){
-			throw new IllegalStateException("alert stream schema should never be empty");
+			throw new IllegalStateException("Alert stream schema should never be empty");
 		}
 		return map;
 	}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-policy/eagle-policy-base/src/main/resources/eagle.siddhiext
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/resources/eagle.siddhiext b/eagle-core/eagle-policy/eagle-policy-base/src/main/resources/eagle.siddhiext
index 1b1183c..2671c31 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/resources/eagle.siddhiext
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/resources/eagle.siddhiext
@@ -1 +1,18 @@
+#
+# 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.
+#
+
 externalTimeBatch=org.apache.eagle.policy.siddhi.extension.ExternalTimeBatchWindowProcessor
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-policy/eagle-policy-base/src/main/resources/str.siddhiext
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/resources/str.siddhiext b/eagle-core/eagle-policy/eagle-policy-base/src/main/resources/str.siddhiext
index 963f311..8c1672b 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/resources/str.siddhiext
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/resources/str.siddhiext
@@ -1,11 +1,12 @@
 #
-# Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+# 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
 #
-# Licensed 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
+#    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,

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-core/eagle-query/eagle-storage-jdbc/src/test/java/org/apache/eagle/storage/jdbc/TestJdbcStorage.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-storage-jdbc/src/test/java/org/apache/eagle/storage/jdbc/TestJdbcStorage.java b/eagle-core/eagle-query/eagle-storage-jdbc/src/test/java/org/apache/eagle/storage/jdbc/TestJdbcStorage.java
index acc8d43..43b3998 100644
--- a/eagle-core/eagle-query/eagle-storage-jdbc/src/test/java/org/apache/eagle/storage/jdbc/TestJdbcStorage.java
+++ b/eagle-core/eagle-query/eagle-storage-jdbc/src/test/java/org/apache/eagle/storage/jdbc/TestJdbcStorage.java
@@ -65,7 +65,7 @@ public class TestJdbcStorage {
         Assert.assertNotNull(result);
     }
 
-    //@Test
+    @Test
     public void testReadByComplexQuery() throws QueryCompileException, IOException {
         RawQuery rawQuery = new RawQuery();
         rawQuery.setQuery("TestTimeSeriesAPIEntity[@cluster=\"cluster\" AND @field4 > 1000 AND @field7 CONTAINS \"subtext\" OR @jobID =\"jobID\" ]{@field1,@field2}");

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-samples/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-samples/pom.xml b/eagle-samples/pom.xml
index 48935d4..f9fedc1 100644
--- a/eagle-samples/pom.xml
+++ b/eagle-samples/pom.xml
@@ -1,20 +1,21 @@
 <?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.
--->
+<<<<<<< HEAD
+  ~ 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">

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/FileSensitivityAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/FileSensitivityAPIEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/FileSensitivityAPIEntity.java
new file mode 100644
index 0000000..9eef192
--- /dev/null
+++ b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/FileSensitivityAPIEntity.java
@@ -0,0 +1,52 @@
+/*
+ * 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.security.entity;
+
+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;
+
+@JsonSerialize(include =  JsonSerialize.Inclusion.NON_NULL)
+@Table("fileSensitivity")
+@ColumnFamily("f")
+@Prefix("fileSensitivity")
+@Service("FileSensitivityService")
+@TimeSeries(false)
+@Tags({"site", "filedir"})
+public class FileSensitivityAPIEntity extends TaggedLogAPIEntity{
+	/**
+	 * sensitivityType can be multi-value attribute, and values can be separated by "|"
+	 */
+	@Column("a")
+	private String sensitivityType;
+
+	public String getSensitivityType() {
+		return sensitivityType;
+	}
+
+	public void setSensitivityType(String sensitivityType) {
+		this.sensitivityType = sensitivityType;
+		valueChanged("sensitivityType");
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/FileStatusEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/FileStatusEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/FileStatusEntity.java
new file mode 100644
index 0000000..6541c8a
--- /dev/null
+++ b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/FileStatusEntity.java
@@ -0,0 +1,176 @@
+/*
+ * 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.security.entity;
+
+import java.io.IOException;
+import java.util.Set;
+
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.permission.FsPermission;
+
+public class FileStatusEntity {
+    //private Path path;
+    private long length;
+    private boolean isdir;
+    private short block_replication;
+    private long blocksize;
+    private long modification_time;
+
+    private long access_time;
+    private FsPermission permission;
+    private String owner;
+    private String group;
+    private Path symlink;
+    private String resource;
+    private String sensitiveType;
+    private Set<String> childSensitiveTypes;
+
+    public FileStatusEntity(){
+
+    }
+
+    public FileStatusEntity(FileStatus status) throws IOException {
+        //this.path = status.getPath();
+        this.length = status.getLen();
+        this.isdir = status.isDirectory();
+        this.block_replication = status.getReplication();
+        this.blocksize = status.getBlockSize();
+        this.modification_time = status.getModificationTime();
+        this.access_time = status.getAccessTime();
+        this.permission = status.getPermission();
+        this.owner = status.getOwner();
+        this.group = status.getGroup();
+        if(status.isSymlink()) {
+            this.symlink = status.getSymlink();
+        }
+    }
+
+    public long getAccess_time() {
+        return access_time;
+    }
+
+    public String getResource() {
+        return resource;
+    }
+
+    public void setResource(String resource) {
+        this.resource = resource;
+    }
+
+    public void setAccess_time(long access_time) {
+        this.access_time = access_time;
+
+    }
+
+    //public Path getPath() {
+    //    return path;
+    //}
+
+    //public void setPath(Path path) {
+    //    this.path = path;
+    //}
+
+    public long getLength() {
+        return length;
+    }
+
+    public void setLength(long length) {
+        this.length = length;
+    }
+
+    public boolean isIsdir() {
+        return isdir;
+    }
+
+    public void setIsdir(boolean isdir) {
+        this.isdir = isdir;
+    }
+
+    public short getBlock_replication() {
+        return block_replication;
+    }
+
+    public void setBlock_replication(short block_replication) {
+        this.block_replication = block_replication;
+    }
+
+    public long getBlocksize() {
+        return blocksize;
+    }
+
+    public void setBlocksize(long blocksize) {
+        this.blocksize = blocksize;
+    }
+
+    public long getModification_time() {
+        return modification_time;
+    }
+
+    public void setModification_time(long modification_time) {
+        this.modification_time = modification_time;
+    }
+
+    public FsPermission getPermission() {
+        return permission;
+    }
+
+    public void setPermission(FsPermission permission) {
+        this.permission = permission;
+    }
+
+    public String getOwner() {
+        return owner;
+    }
+
+    public void setOwner(String owner) {
+        this.owner = owner;
+    }
+
+    public String getGroup() {
+        return group;
+    }
+
+    public void setGroup(String group) {
+        this.group = group;
+    }
+
+    public Path getSymlink() {
+        return symlink;
+    }
+
+    public void setSymlink(Path symlink) {
+        this.symlink = symlink;
+    }
+
+    public String getSensitiveType() {
+        return sensitiveType;
+    }
+
+    public void setSensitiveType(String sensitiveType) {
+        this.sensitiveType = sensitiveType;
+    }
+
+    public Set<String> getChildSensitiveTypes() {
+        return childSensitiveTypes;
+    }
+
+    public void setChildSensitiveTypes(Set<String> childSensitiveTypes) {
+        this.childSensitiveTypes = childSensitiveTypes;
+    }
+    
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HbaseResourceEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HbaseResourceEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HbaseResourceEntity.java
new file mode 100644
index 0000000..deb8364
--- /dev/null
+++ b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HbaseResourceEntity.java
@@ -0,0 +1,105 @@
+/*
+ * 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.security.entity;
+
+import com.google.common.base.Objects;
+
+import java.io.Serializable;
+import java.util.Set;
+
+public class HbaseResourceEntity implements Serializable {
+    private String resource;
+    private String namespace;
+    private String table;
+    private String columnFamily;
+    private String sensitiveType;
+    private Set<String> childSensitiveTypes;
+
+
+
+    public HbaseResourceEntity(String resource, String ns, String table, String cf, String sensitiveType, Set<String> childSensitiveTypes) {
+        this.resource = resource;
+        this.namespace = ns;
+        this.table = table;
+        this.columnFamily = cf;
+        this.sensitiveType = sensitiveType;
+        this.childSensitiveTypes = childSensitiveTypes;
+    }
+
+    public String getResource() {
+        return resource;
+    }
+
+    public void setResource(String resource) {
+        this.resource = resource;
+    }
+
+    public String getNamespace() {
+        return namespace;
+    }
+
+    public void setNamespace(String namespace) {
+        this.namespace = namespace;
+    }
+
+    public String getTable() {
+        return table;
+    }
+
+    public void setTable(String table) {
+        this.table = table;
+    }
+
+    public String getColumnFamily() {
+        return columnFamily;
+    }
+
+    public void setColumnFamily(String columnFamily) {
+        this.columnFamily = columnFamily;
+    }
+
+    public String getSensitiveType() {
+        return sensitiveType;
+    }
+
+    public void setSensitiveType(String sensitiveType) {
+        this.sensitiveType = sensitiveType;
+    }
+
+    public Set<String> getChildSensitiveTypes() {
+        return childSensitiveTypes;
+    }
+
+    public void setChildSensitiveTypes(Set<String> childSensitiveTypes) {
+        this.childSensitiveTypes = childSensitiveTypes;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || getClass() != obj.getClass()) {
+            return false;
+        }
+        final HbaseResourceEntity other = (HbaseResourceEntity) obj;
+        return Objects.equal(this.resource, other.resource)
+                && this.namespace.equals(other.namespace)
+                && this.table.equals(other.table)
+                && this.columnFamily.equals(other.columnFamily)
+                && this.sensitiveType.equals(other.sensitiveType)
+                && this.childSensitiveTypes.containsAll(other.childSensitiveTypes);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HbaseResourceSensitivityAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HbaseResourceSensitivityAPIEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HbaseResourceSensitivityAPIEntity.java
new file mode 100644
index 0000000..551967d
--- /dev/null
+++ b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HbaseResourceSensitivityAPIEntity.java
@@ -0,0 +1,47 @@
+/*
+ * 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.security.entity;
+
+import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
+import org.apache.eagle.log.entity.meta.*;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@Table("hbaseResourceSensitivity")
+@ColumnFamily("f")
+@Prefix("hbaseResourceSensitivity")
+@Service("HbaseResourceSensitivityService")
+@TimeSeries(false)
+@Tags({"site", "hbaseResource"})
+public class HbaseResourceSensitivityAPIEntity extends TaggedLogAPIEntity {
+	private static final long serialVersionUID = 2L;
+	/**
+     * sensitivityType can be multi-value attribute, and values can be separated by "|"
+     */
+    @Column("a")
+    private String sensitivityType;
+
+    public String getSensitivityType() {
+        return sensitivityType;
+    }
+
+    public void setSensitivityType(String sensitivityType) {
+        this.sensitivityType = sensitivityType;
+        valueChanged("sensitivityType");
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HdfsUserCommandPatternEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HdfsUserCommandPatternEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HdfsUserCommandPatternEntity.java
new file mode 100644
index 0000000..e8c7b72
--- /dev/null
+++ b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HdfsUserCommandPatternEntity.java
@@ -0,0 +1,82 @@
+/*
+ *
+ *  * 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.security.entity;
+
+import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
+import org.apache.eagle.log.entity.meta.*;
+
+import java.util.Map;
+
+/**
+ * User command pattern entity to specify Siddhi pattern, field selector and field modifier
+ */
+@Table("hdfsusercommandpattern")
+@ColumnFamily("f")
+@Prefix("hdfsusercommandpattern")
+@Service(HdfsUserCommandPatternEntity.HDFS_USER_COMMAND_PATTERN_SERVICE)
+@TimeSeries(false)
+@Tags({"userCommand"})
+public class HdfsUserCommandPatternEntity extends TaggedLogAPIEntity {
+    public static final String HDFS_USER_COMMAND_PATTERN_SERVICE = "HdfsUserCommandPatternService";
+    @Column("a")
+    private String description;
+    public String getDescription(){
+        return description;
+    }
+    public void setDescription(String description){
+        this.description = description;
+    }
+
+    @Column("b")
+    private String pattern;
+
+    public String getPattern() {
+        return pattern;
+    }
+
+    public void setPattern(String pattern) {
+        this.pattern = pattern;
+        valueChanged("pattern");
+    }
+
+    @Column("c")
+    private Map<String, String> fieldSelector;
+
+    public Map<String, String> getFieldSelector(){
+        return fieldSelector;
+    }
+
+    public void setFieldSelector(Map<String, String> fieldSelector){
+        this.fieldSelector = fieldSelector;
+        valueChanged("fieldSelector");
+    }
+
+    @Column("d")
+    private Map<String, String> fieldModifier;
+
+    public Map<String, String> getFieldModifier(){
+        return fieldModifier;
+    }
+
+    public void setFieldModifier(Map<String, String> fieldModifier){
+        this.fieldModifier = fieldModifier;
+        valueChanged("fieldModifier");
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HiveResourceEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HiveResourceEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HiveResourceEntity.java
new file mode 100644
index 0000000..24f1f97
--- /dev/null
+++ b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HiveResourceEntity.java
@@ -0,0 +1,104 @@
+/*
+ * 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.security.entity;
+
+import com.google.common.base.Objects;
+
+import java.io.Serializable;
+import java.util.Set;
+
+public class HiveResourceEntity implements Serializable {
+    private String resource;
+    private String database;
+    private String table;
+    private String column;
+    private String sensitiveType;
+    private Set<String> childSensitiveTypes;
+
+
+    public Set<String> getChildSensitiveTypes() {
+        return childSensitiveTypes;
+    }
+
+    public void setChildSensitiveTypes(Set<String> childSensitiveTypes) {
+        this.childSensitiveTypes = childSensitiveTypes;
+    }
+
+    public String getResource() {
+        return resource;
+    }
+
+    public void setResource(String resource) {
+        this.resource = resource;
+    }
+
+    public String getDatabase() {
+        return database;
+    }
+
+    public void setDatabase(String database) {
+        this.database = database;
+    }
+
+    public String getTable() {
+        return table;
+    }
+
+    public void setTable(String table) {
+        this.table = table;
+    }
+
+    public String getColumn() {
+        return column;
+    }
+
+    public void setColumn(String column) {
+        this.column = column;
+    }
+
+    public String getSensitiveType() {
+        return sensitiveType;
+    }
+
+    public void setSensitiveType(String sensitiveType) {
+        this.sensitiveType = sensitiveType;
+    }
+
+
+    public HiveResourceEntity(String resource, String database, String table, String column, String sensitiveType, Set<String> childSensitiveTypes) {
+        this.resource = resource;
+        this.database = database;
+        this.table = table;
+        this.column = column;
+        this.sensitiveType = sensitiveType;
+        this.childSensitiveTypes = childSensitiveTypes;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || getClass() != obj.getClass()) {
+            return false;
+        }
+        final HiveResourceEntity other = (HiveResourceEntity) obj;
+        return Objects.equal(this.resource, other.resource)
+                && this.database.equals(other.database)
+                && this.table.equals(other.table)
+                && this.column.equals(other.column)
+                && this.sensitiveType.equals(other.sensitiveType)
+                && this.childSensitiveTypes.containsAll(other.childSensitiveTypes);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HiveResourceSensitivityAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HiveResourceSensitivityAPIEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HiveResourceSensitivityAPIEntity.java
new file mode 100644
index 0000000..aebec8b
--- /dev/null
+++ b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/HiveResourceSensitivityAPIEntity.java
@@ -0,0 +1,53 @@
+/*
+ * 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.security.entity;
+
+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;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@Table("hiveResourceSensitivity")
+@ColumnFamily("f")
+@Prefix("hiveResourceSensitivity")
+@Service("HiveResourceSensitivityService")
+@TimeSeries(false)
+@Tags({"site", "hiveResource"})
+public class HiveResourceSensitivityAPIEntity extends TaggedLogAPIEntity {
+	private static final long serialVersionUID = 1L;
+	/**
+     * sensitivityType can be multi-value attribute, and values can be separated by "|"
+     */
+    @Column("a")
+    private String sensitivityType;
+
+    public String getSensitivityType() {
+        return sensitivityType;
+    }
+
+    public void setSensitivityType(String sensitivityType) {
+        this.sensitivityType = sensitivityType;
+        valueChanged("sensitivityType");
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/IPZoneEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/IPZoneEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/IPZoneEntity.java
new file mode 100644
index 0000000..f944ace
--- /dev/null
+++ b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/IPZoneEntity.java
@@ -0,0 +1,52 @@
+/*
+ * 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.security.entity;
+
+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;
+
+/**
+ * ipranger can be single IP, host or ip with subnet etc.  
+ */
+@JsonSerialize(include =  JsonSerialize.Inclusion.NON_NULL)
+@Table("ipzone")
+@ColumnFamily("f")
+@Prefix("ipzone")
+@Service("IPZoneService")
+@TimeSeries(false)
+@Tags({"iphost"})
+public class IPZoneEntity extends TaggedLogAPIEntity{
+	@Column("a")
+	private String securityZone;
+
+	public String getSecurityZone() {
+		return securityZone;
+	}
+
+	public void setSecurityZone(String securityZone) {
+		this.securityZone = securityZone;
+		valueChanged("securityZone");
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/SecurityEntityRepository.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/SecurityEntityRepository.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/SecurityEntityRepository.java
new file mode 100644
index 0000000..a313983
--- /dev/null
+++ b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/entity/SecurityEntityRepository.java
@@ -0,0 +1,32 @@
+/*
+ * 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.security.entity;
+
+import org.apache.eagle.log.entity.repo.EntityRepository;
+
+
+public class SecurityEntityRepository extends EntityRepository {
+    public SecurityEntityRepository() {
+        entitySet.add(HbaseResourceSensitivityAPIEntity.class);
+        entitySet.add(FileSensitivityAPIEntity.class);
+        entitySet.add(IPZoneEntity.class);
+        entitySet.add(HdfsUserCommandPatternEntity.class);
+        entitySet.add(HiveResourceSensitivityAPIEntity.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseResourceEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseResourceEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseResourceEntity.java
deleted file mode 100644
index 379a52a..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseResourceEntity.java
+++ /dev/null
@@ -1,105 +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.security.hbase;
-
-import com.google.common.base.Objects;
-
-import java.io.Serializable;
-import java.util.Set;
-
-public class HbaseResourceEntity implements Serializable {
-    private String resource;
-    private String namespace;
-    private String table;
-    private String columnFamily;
-    private String sensitiveType;
-    private Set<String> childSensitiveTypes;
-
-
-
-    public HbaseResourceEntity(String resource, String ns, String table, String cf, String sensitiveType, Set<String> childSensitiveTypes) {
-        this.resource = resource;
-        this.namespace = ns;
-        this.table = table;
-        this.columnFamily = cf;
-        this.sensitiveType = sensitiveType;
-        this.childSensitiveTypes = childSensitiveTypes;
-    }
-
-    public String getResource() {
-        return resource;
-    }
-
-    public void setResource(String resource) {
-        this.resource = resource;
-    }
-
-    public String getNamespace() {
-        return namespace;
-    }
-
-    public void setNamespace(String namespace) {
-        this.namespace = namespace;
-    }
-
-    public String getTable() {
-        return table;
-    }
-
-    public void setTable(String table) {
-        this.table = table;
-    }
-
-    public String getColumnFamily() {
-        return columnFamily;
-    }
-
-    public void setColumnFamily(String columnFamily) {
-        this.columnFamily = columnFamily;
-    }
-
-    public String getSensitiveType() {
-        return sensitiveType;
-    }
-
-    public void setSensitiveType(String sensitiveType) {
-        this.sensitiveType = sensitiveType;
-    }
-
-    public Set<String> getChildSensitiveTypes() {
-        return childSensitiveTypes;
-    }
-
-    public void setChildSensitiveTypes(Set<String> childSensitiveTypes) {
-        this.childSensitiveTypes = childSensitiveTypes;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass()) {
-            return false;
-        }
-        final HbaseResourceEntity other = (HbaseResourceEntity) obj;
-        return Objects.equal(this.resource, other.resource)
-                && this.namespace.equals(other.namespace)
-                && this.table.equals(other.table)
-                && this.columnFamily.equals(other.columnFamily)
-                && this.sensitiveType.equals(other.sensitiveType)
-                && this.childSensitiveTypes.containsAll(other.childSensitiveTypes);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseResourceSensitivityAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseResourceSensitivityAPIEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseResourceSensitivityAPIEntity.java
deleted file mode 100644
index 0adfeb4..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseResourceSensitivityAPIEntity.java
+++ /dev/null
@@ -1,47 +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.security.hbase;
-
-import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
-import org.apache.eagle.log.entity.meta.*;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@Table("hbaseResourceSensitivity")
-@ColumnFamily("f")
-@Prefix("hbaseResourceSensitivity")
-@Service("HbaseResourceSensitivityService")
-@TimeSeries(false)
-@Tags({"site", "hbaseResource"})
-public class HbaseResourceSensitivityAPIEntity extends TaggedLogAPIEntity {
-	private static final long serialVersionUID = 2L;
-	/**
-     * sensitivityType can be multi-value attribute, and values can be separated by "|"
-     */
-    @Column("a")
-    private String sensitivityType;
-
-    public String getSensitivityType() {
-        return sensitivityType;
-    }
-
-    public void setSensitivityType(String sensitivityType) {
-        this.sensitivityType = sensitivityType;
-        valueChanged("sensitivityType");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseSecurityEntityRepository.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseSecurityEntityRepository.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseSecurityEntityRepository.java
deleted file mode 100644
index 8777c20..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hbase/HbaseSecurityEntityRepository.java
+++ /dev/null
@@ -1,26 +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.security.hbase;
-
-import org.apache.eagle.log.entity.repo.EntityRepository;
-
-public class HbaseSecurityEntityRepository extends EntityRepository {
-	public HbaseSecurityEntityRepository() {
-		entitySet.add(HbaseResourceSensitivityAPIEntity.class);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/FileSensitivityAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/FileSensitivityAPIEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/FileSensitivityAPIEntity.java
deleted file mode 100644
index 00b6ca7..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/FileSensitivityAPIEntity.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.security.hdfs.entity;
-
-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;
-
-@JsonSerialize(include =  JsonSerialize.Inclusion.NON_NULL)
-@Table("fileSensitivity")
-@ColumnFamily("f")
-@Prefix("fileSensitivity")
-@Service("FileSensitivityService")
-@TimeSeries(false)
-@Tags({"site", "filedir"})
-public class FileSensitivityAPIEntity extends TaggedLogAPIEntity{
-	/**
-	 * sensitivityType can be multi-value attribute, and values can be separated by "|"
-	 */
-	@Column("a")
-	private String sensitivityType;
-
-	public String getSensitivityType() {
-		return sensitivityType;
-	}
-
-	public void setSensitivityType(String sensitivityType) {
-		this.sensitivityType = sensitivityType;
-		valueChanged("sensitivityType");
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/FileStatusEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/FileStatusEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/FileStatusEntity.java
deleted file mode 100644
index 101ac5a..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/FileStatusEntity.java
+++ /dev/null
@@ -1,176 +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.security.hdfs.entity;
-
-import java.io.IOException;
-import java.util.Set;
-
-import org.apache.hadoop.fs.FileStatus;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.fs.permission.FsPermission;
-
-public class FileStatusEntity {
-    //private Path path;
-    private long length;
-    private boolean isdir;
-    private short block_replication;
-    private long blocksize;
-    private long modification_time;
-
-    private long access_time;
-    private FsPermission permission;
-    private String owner;
-    private String group;
-    private Path symlink;
-    private String resource;
-    private String sensitiveType;
-    private Set<String> childSensitiveTypes;
-
-    public FileStatusEntity(){
-
-    }
-
-    public FileStatusEntity(FileStatus status) throws IOException {
-        //this.path = status.getPath();
-        this.length = status.getLen();
-        this.isdir = status.isDirectory();
-        this.block_replication = status.getReplication();
-        this.blocksize = status.getBlockSize();
-        this.modification_time = status.getModificationTime();
-        this.access_time = status.getAccessTime();
-        this.permission = status.getPermission();
-        this.owner = status.getOwner();
-        this.group = status.getGroup();
-        if(status.isSymlink()) {
-            this.symlink = status.getSymlink();
-        }
-    }
-
-    public long getAccess_time() {
-        return access_time;
-    }
-
-    public String getResource() {
-        return resource;
-    }
-
-    public void setResource(String resource) {
-        this.resource = resource;
-    }
-
-    public void setAccess_time(long access_time) {
-        this.access_time = access_time;
-
-    }
-
-    //public Path getPath() {
-    //    return path;
-    //}
-
-    //public void setPath(Path path) {
-    //    this.path = path;
-    //}
-
-    public long getLength() {
-        return length;
-    }
-
-    public void setLength(long length) {
-        this.length = length;
-    }
-
-    public boolean isIsdir() {
-        return isdir;
-    }
-
-    public void setIsdir(boolean isdir) {
-        this.isdir = isdir;
-    }
-
-    public short getBlock_replication() {
-        return block_replication;
-    }
-
-    public void setBlock_replication(short block_replication) {
-        this.block_replication = block_replication;
-    }
-
-    public long getBlocksize() {
-        return blocksize;
-    }
-
-    public void setBlocksize(long blocksize) {
-        this.blocksize = blocksize;
-    }
-
-    public long getModification_time() {
-        return modification_time;
-    }
-
-    public void setModification_time(long modification_time) {
-        this.modification_time = modification_time;
-    }
-
-    public FsPermission getPermission() {
-        return permission;
-    }
-
-    public void setPermission(FsPermission permission) {
-        this.permission = permission;
-    }
-
-    public String getOwner() {
-        return owner;
-    }
-
-    public void setOwner(String owner) {
-        this.owner = owner;
-    }
-
-    public String getGroup() {
-        return group;
-    }
-
-    public void setGroup(String group) {
-        this.group = group;
-    }
-
-    public Path getSymlink() {
-        return symlink;
-    }
-
-    public void setSymlink(Path symlink) {
-        this.symlink = symlink;
-    }
-
-    public String getSensitiveType() {
-        return sensitiveType;
-    }
-
-    public void setSensitiveType(String sensitiveType) {
-        this.sensitiveType = sensitiveType;
-    }
-
-    public Set<String> getChildSensitiveTypes() {
-        return childSensitiveTypes;
-    }
-
-    public void setChildSensitiveTypes(Set<String> childSensitiveTypes) {
-        this.childSensitiveTypes = childSensitiveTypes;
-    }
-    
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HDFSSecurityEntityRepository.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HDFSSecurityEntityRepository.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HDFSSecurityEntityRepository.java
deleted file mode 100644
index 35c3578..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HDFSSecurityEntityRepository.java
+++ /dev/null
@@ -1,27 +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.security.hdfs.entity;
-
-import org.apache.eagle.log.entity.repo.EntityRepository;
-
-public class HDFSSecurityEntityRepository extends EntityRepository {
-	public HDFSSecurityEntityRepository(){
-		entitySet.add(FileSensitivityAPIEntity.class);
-        entitySet.add(IPZoneEntity.class);
-        entitySet.add(HdfsUserCommandPatternEntity.class);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HdfsUserCommandPatternEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HdfsUserCommandPatternEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HdfsUserCommandPatternEntity.java
deleted file mode 100644
index d35719f..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HdfsUserCommandPatternEntity.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.security.hdfs.entity;
-
-import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
-import org.apache.eagle.log.entity.meta.*;
-
-import java.util.Map;
-
-/**
- * User command pattern entity to specify Siddhi pattern, field selector and field modifier
- */
-@Table("hdfsusercommandpattern")
-@ColumnFamily("f")
-@Prefix("hdfsusercommandpattern")
-@Service(HdfsUserCommandPatternEntity.HDFS_USER_COMMAND_PATTERN_SERVICE)
-@TimeSeries(false)
-@Tags({"userCommand"})
-public class HdfsUserCommandPatternEntity extends TaggedLogAPIEntity {
-    public static final String HDFS_USER_COMMAND_PATTERN_SERVICE = "HdfsUserCommandPatternService";
-    @Column("a")
-    private String description;
-    public String getDescription(){
-        return description;
-    }
-    public void setDescription(String description){
-        this.description = description;
-    }
-
-    @Column("b")
-    private String pattern;
-
-    public String getPattern() {
-        return pattern;
-    }
-
-    public void setPattern(String pattern) {
-        this.pattern = pattern;
-        valueChanged("pattern");
-    }
-
-    @Column("c")
-    private Map<String, String> fieldSelector;
-
-    public Map<String, String> getFieldSelector(){
-        return fieldSelector;
-    }
-
-    public void setFieldSelector(Map<String, String> fieldSelector){
-        this.fieldSelector = fieldSelector;
-        valueChanged("fieldSelector");
-    }
-
-    @Column("d")
-    private Map<String, String> fieldModifier;
-
-    public Map<String, String> getFieldModifier(){
-        return fieldModifier;
-    }
-
-    public void setFieldModifier(Map<String, String> fieldModifier){
-        this.fieldModifier = fieldModifier;
-        valueChanged("fieldModifier");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/IPZoneEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/IPZoneEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/IPZoneEntity.java
deleted file mode 100644
index c60724b..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/IPZoneEntity.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.security.hdfs.entity;
-
-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;
-
-/**
- * ipranger can be single IP, host or ip with subnet etc.  
- */
-@JsonSerialize(include =  JsonSerialize.Inclusion.NON_NULL)
-@Table("ipzone")
-@ColumnFamily("f")
-@Prefix("ipzone")
-@Service("IPZoneService")
-@TimeSeries(false)
-@Tags({"iphost"})
-public class IPZoneEntity extends TaggedLogAPIEntity{
-	@Column("a")
-	private String securityZone;
-
-	public String getSecurityZone() {
-		return securityZone;
-	}
-
-	public void setSecurityZone(String securityZone) {
-		this.securityZone = securityZone;
-		valueChanged("securityZone");
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveResourceEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveResourceEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveResourceEntity.java
deleted file mode 100644
index f0e0435..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveResourceEntity.java
+++ /dev/null
@@ -1,104 +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.security.hive.entity;
-
-import com.google.common.base.Objects;
-
-import java.io.Serializable;
-import java.util.Set;
-
-public class HiveResourceEntity implements Serializable {
-    private String resource;
-    private String database;
-    private String table;
-    private String column;
-    private String sensitiveType;
-    private Set<String> childSensitiveTypes;
-
-
-    public Set<String> getChildSensitiveTypes() {
-        return childSensitiveTypes;
-    }
-
-    public void setChildSensitiveTypes(Set<String> childSensitiveTypes) {
-        this.childSensitiveTypes = childSensitiveTypes;
-    }
-
-    public String getResource() {
-        return resource;
-    }
-
-    public void setResource(String resource) {
-        this.resource = resource;
-    }
-
-    public String getDatabase() {
-        return database;
-    }
-
-    public void setDatabase(String database) {
-        this.database = database;
-    }
-
-    public String getTable() {
-        return table;
-    }
-
-    public void setTable(String table) {
-        this.table = table;
-    }
-
-    public String getColumn() {
-        return column;
-    }
-
-    public void setColumn(String column) {
-        this.column = column;
-    }
-
-    public String getSensitiveType() {
-        return sensitiveType;
-    }
-
-    public void setSensitiveType(String sensitiveType) {
-        this.sensitiveType = sensitiveType;
-    }
-
-
-    public HiveResourceEntity(String resource, String database, String table, String column, String sensitiveType, Set<String> childSensitiveTypes) {
-        this.resource = resource;
-        this.database = database;
-        this.table = table;
-        this.column = column;
-        this.sensitiveType = sensitiveType;
-        this.childSensitiveTypes = childSensitiveTypes;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass()) {
-            return false;
-        }
-        final HiveResourceEntity other = (HiveResourceEntity) obj;
-        return Objects.equal(this.resource, other.resource)
-                && this.database.equals(other.database)
-                && this.table.equals(other.table)
-                && this.column.equals(other.column)
-                && this.sensitiveType.equals(other.sensitiveType)
-                && this.childSensitiveTypes.containsAll(other.childSensitiveTypes);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveResourceSensitivityAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveResourceSensitivityAPIEntity.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveResourceSensitivityAPIEntity.java
deleted file mode 100644
index 6086908..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveResourceSensitivityAPIEntity.java
+++ /dev/null
@@ -1,53 +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.security.hive.entity;
-
-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;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@Table("hiveResourceSensitivity")
-@ColumnFamily("f")
-@Prefix("hiveResourceSensitivity")
-@Service("HiveResourceSensitivityService")
-@TimeSeries(false)
-@Tags({"site", "hiveResource"})
-public class HiveResourceSensitivityAPIEntity extends TaggedLogAPIEntity {
-	private static final long serialVersionUID = 1L;
-	/**
-     * sensitivityType can be multi-value attribute, and values can be separated by "|"
-     */
-    @Column("a")
-    private String sensitivityType;
-
-    public String getSensitivityType() {
-        return sensitivityType;
-    }
-
-    public void setSensitivityType(String sensitivityType) {
-        this.sensitivityType = sensitivityType;
-        valueChanged("sensitivityType");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c1485aac/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveSecurityEntityRepository.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveSecurityEntityRepository.java b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveSecurityEntityRepository.java
deleted file mode 100644
index 96164b5..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hive/entity/HiveSecurityEntityRepository.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.security.hive.entity;
-
-import org.apache.eagle.log.entity.repo.EntityRepository;
-
-public class HiveSecurityEntityRepository extends EntityRepository {
-	public HiveSecurityEntityRepository() {
-		entitySet.add(HiveResourceSensitivityAPIEntity.class);
-	}
-}



Mime
View raw message