eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject incubator-eagle git commit: [EAGLE-46] Fix package name error
Date Fri, 20 Nov 2015 09:13:35 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master b72c796f6 -> d74165fa4


[EAGLE-46] Fix package name error


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

Branch: refs/heads/master
Commit: d74165fa4c82fd698be874ad5dc66a58bd349589
Parents: b72c796
Author: Hao Chen <hao@apache.org>
Authored: Fri Nov 20 17:06:54 2015 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Fri Nov 20 17:12:28 2015 +0800

----------------------------------------------------------------------
 .../entity/repo/EntityRepositoryScanner.java    |  2 +-
 .../eagle/security/hdfs/HDFSAuditLogParser.java |  3 +-
 .../entity/HDFSFileSystemResponseEntity.java    | 48 -----------
 .../security/TestHDFSSecuritylogParser.java     |  2 +-
 eagle-security/eagle-security-hdfs-web/pom.xml  | 10 ---
 .../service/security/hdfs/HDFSFileSystem.java   | 89 --------------------
 .../hdfs/HDFSResourceSensitivityDataJoiner.java | 52 ------------
 .../security/hdfs/HDFSResourceUtils.java        | 43 +---------
 eagle-security/eagle-security-hive-web/pom.xml  | 10 ---
 .../src/main/webapp/WEB-INF/web.xml             |  2 +-
 10 files changed, 6 insertions(+), 255 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/d74165fa/eagle-core/eagle-query/eagle-entity-base/src/main/java/org/apache/eagle/log/entity/repo/EntityRepositoryScanner.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/main/java/org/apache/eagle/log/entity/repo/EntityRepositoryScanner.java
b/eagle-core/eagle-query/eagle-entity-base/src/main/java/org/apache/eagle/log/entity/repo/EntityRepositoryScanner.java
index 28f2c73..a6421a4 100644
--- a/eagle-core/eagle-query/eagle-entity-base/src/main/java/org/apache/eagle/log/entity/repo/EntityRepositoryScanner.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/main/java/org/apache/eagle/log/entity/repo/EntityRepositoryScanner.java
@@ -63,7 +63,7 @@ public final class EntityRepositoryScanner {
 
 		@Override
 		protected void query() {
-			select().from("eagle").returning(
+			select().from("org.apache.eagle").returning(
 			allExtending(EntityRepository.class));
 		}
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/d74165fa/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/HDFSAuditLogParser.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/HDFSAuditLogParser.java
b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/HDFSAuditLogParser.java
index ac57855..ed6d6bb 100644
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/HDFSAuditLogParser.java
+++ b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/HDFSAuditLogParser.java
@@ -16,8 +16,9 @@
  */
 package org.apache.eagle.security.hdfs;
 
-import eagle.security.util.LogParseUtil;
+
 import org.apache.eagle.common.DateTimeUtil;
+import org.apache.eagle.security.util.LogParseUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/d74165fa/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HDFSFileSystemResponseEntity.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HDFSFileSystemResponseEntity.java
b/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HDFSFileSystemResponseEntity.java
deleted file mode 100644
index 305073a..0000000
--- a/eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/hdfs/entity/HDFSFileSystemResponseEntity.java
+++ /dev/null
@@ -1,48 +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.util.List;
-import java.util.Map;
-
-import org.apache.hadoop.fs.FileStatus;
-
-/**
- * HDFS File System Response Entity
- */
-public class HDFSFileSystemResponseEntity {
-
-	private Map<String , List<String>>  subDirectoriesMap; // This map used for
ChildSensitivity Types determination
-	private List<FileStatus> fileList;
-	
-	public Map<String, List<String>> getSubDirectoriesMap() {
-		return subDirectoriesMap;
-	}
-	public void setSubDirectoriesMap(Map<String, List<String>> subDirectoriesMap)
{
-		this.subDirectoriesMap = subDirectoriesMap;
-	}
-	public List<FileStatus> getFileList() {
-		return fileList;
-	}
-	public void setFileList(List<FileStatus> fileList) {
-		this.fileList = fileList;
-	}
-	
-	
-	
-	
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/d74165fa/eagle-security/eagle-security-hdfs-securitylog/src/test/java/eagle/security/TestHDFSSecuritylogParser.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hdfs-securitylog/src/test/java/eagle/security/TestHDFSSecuritylogParser.java
b/eagle-security/eagle-security-hdfs-securitylog/src/test/java/eagle/security/TestHDFSSecuritylogParser.java
index a9fe6be..4c79f86 100644
--- a/eagle-security/eagle-security-hdfs-securitylog/src/test/java/eagle/security/TestHDFSSecuritylogParser.java
+++ b/eagle-security/eagle-security-hdfs-securitylog/src/test/java/eagle/security/TestHDFSSecuritylogParser.java
@@ -30,7 +30,7 @@ public class TestHDFSSecuritylogParser {
 
     @Test
     public void test() throws ParseException {
-        String msg = "2015-11-18 08:41:10,200 INFO SecurityLogger.org.apache.hadoop.security.authorize.ServiceAuthorizationManager:
Authorization failed for hbase (auth:SIMPLE) for protocol=interface org.apache.hadoop.hdfs.protocol.ClientProtocol";
+        String msg = "2015-11-18 08:41:10,200 INFO SecurityLogger.org.apache.hadoop.security.authorize.ServiceAuthorizationManager:
Authorization successful for hbase (auth:SIMPLE) for protocol=interface org.apache.hadoop.hdfs.protocol.ClientProtocol";
 
         HDFSSecurityLogParser parser = new HDFSSecurityLogParser();
         HDFSSecurityLogObject obj = parser.parse(msg);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/d74165fa/eagle-security/eagle-security-hdfs-web/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hdfs-web/pom.xml b/eagle-security/eagle-security-hdfs-web/pom.xml
index 984422f..dcf48de 100644
--- a/eagle-security/eagle-security-hdfs-web/pom.xml
+++ b/eagle-security/eagle-security-hdfs-web/pom.xml
@@ -60,16 +60,6 @@
           <artifactId>eagle-security-common</artifactId>
           <version>${project.version}</version>
       </dependency>
-      <dependency>
-          <groupId>eagle</groupId>
-          <artifactId>eagle-alert-process</artifactId>
-          <version>${project.version}</version>
-      </dependency>
-      <dependency>
-          <groupId>eagle</groupId>
-          <artifactId>eagle-alert-service</artifactId>
-          <version>${project.version}</version>
-      </dependency>
   </dependencies>
 </project>
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/d74165fa/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSFileSystem.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSFileSystem.java
b/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSFileSystem.java
index aa2e9aa..9a17075 100644
--- a/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSFileSystem.java
+++ b/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSFileSystem.java
@@ -16,15 +16,10 @@
  */
 package org.apache.eagle.service.security.hdfs;
 
-import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
-import org.apache.eagle.security.hdfs.entity.HDFSFileSystemResponseEntity;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -91,67 +86,6 @@ public class HDFSFileSystem {
 		return Arrays.asList(listStatus);
 	}
 
-	
-	/**
-	 * Browse Resources of passed Path and its sub directories
-	 * Note :: Sub directories only to determine the Sensitivity Type of Root Directories
-	 * @param filePath
-	 * @return fileSystemResponseObj{ with SubDirectoryMap and ListOf FileStatus}
-	 * @throws Exception
-	 */
-	public HDFSFileSystemResponseEntity browseResources ( String filePath ) throws Exception
-	{
-		LOG.info("HDFS File Path   :  "+filePath +"   and EndPoint  : "+hdfsEndPoint);
-		FileSystem hdfsFileSystem = null;
-        FileStatus[]  listStatus;
-        HDFSFileSystemResponseEntity response = new HDFSFileSystemResponseEntity();
-        Map< String , List<String> > subdirectoriesMap = new HashMap< String
, List<String> >();
-        try {
-			Configuration config = createConfig();
-			hdfsFileSystem = getFileSystem(config);
-			Path path  = new Path(filePath);
-			listStatus = hdfsFileSystem.listStatus( path );	
-			LOG.info(" Browsing Sub Directories .... ");
-			// Browse Sub- directories
-			for( FileStatus fileStatus : listStatus )
-			{
-				FileStatus[] fileStatusList = null;
-				if( fileStatus.isDirectory() )
-					fileStatusList = hdfsFileSystem.listStatus(new Path(fileStatus.getPath().toUri().getPath())
);
-				
-				if( fileStatusList != null && fileStatusList.length > 0 )
-					subdirectoriesMap.put(fileStatus.getPath().toUri().getPath(), /*  Key would be Parent
*/
-								          getSubDirectories( fileStatusList )  /*  Value Would be Child Paths */);
-			}			
-			response.setFileList(Arrays.asList(listStatus));
-			response.setSubDirectoriesMap(subdirectoriesMap);
-			
-		} catch ( Exception ex ) {
-			LOG.error(" Exception when browsing files for the path " +filePath , ex.getMessage() );
-			throw new Exception(" Exception When browsing Files/Directories in HDFS .. Message : 
"+ex.getMessage());
-		} finally {
-			 //Close the file system
-			if( hdfsFileSystem != null ) hdfsFileSystem.close();
-		}        
-        return response;
-	}
-	
-	/**
-	 * Browse only Sub-directories 
-	 * @param listStatus
-	 * @return
-	 * @throws FileNotFoundException
-	 * @throws IOException
-	 */
-	public List<String>  getSubDirectories(FileStatus[] listStatus) throws IOException
{
-		List<String> list  = new ArrayList<>();
-		for( FileStatus fileStatus : listStatus )
-		{	
-			if( fileStatus.isDirectory() )
-				list.add(fileStatus.getPath().toUri().getPath());
-		}
-		return list;
-	}
 
 	/**
 	 * Create Config Object
@@ -163,28 +97,5 @@ public class HDFSFileSystem {
 		return config;
 	}
 
-	public static void main(String[] args) throws IOException {
-		Configuration config =  new Configuration();
-		config.set("fs.defaultFS", "hdfs://127.0.0.1:9000");
-		FileSystem hdfsFileSystem  = FileSystem.get(config);
-		Path filePath = new Path("hdfs://127.0.0.1:9000/user");
-		//FileStatus[]  listStatus = hdfsFileSystem.listStatus( filePath );
-		//System.out.println(status1);
-		//RemoteIterator<LocatedFileStatus> locatedFileStatus = hdfsFileSystem.listFiles(filePath,
true);
-		/*RemoteIterator<LocatedFileStatus> locatedFileStatus = hdfsFileSystem.listLocatedStatus(filePath);
-		while( locatedFileStatus.hasNext() )
-		{
-			LocatedFileStatus status = locatedFileStatus.next();
-			System.out.println(status.getPath().toUri());
-			
-		}*/
-		
-		FileStatus[]  listStatus = hdfsFileSystem.listStatus( filePath );
-		for( FileStatus status : listStatus )
-		{
-			System.out.println(status.getPath().toUri().getPath());
-			//System.out.println(status.getPath().toUri().getPath());
-		}
-	}
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/d74165fa/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSResourceSensitivityDataJoiner.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSResourceSensitivityDataJoiner.java
b/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSResourceSensitivityDataJoiner.java
index 032dee5..8ffe3a0 100644
--- a/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSResourceSensitivityDataJoiner.java
+++ b/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSResourceSensitivityDataJoiner.java
@@ -68,58 +68,6 @@ public class HDFSResourceSensitivityDataJoiner {
 		}
 		return result;
 	}
-	
-	
-	/**
-	 * Checks if the file Path comes under Sensitivity Category if yes append the Sensitivity
Type at the End
-	 * @param site
-	 * @return filePathListWithSensitivityTpe
-	 */
-	
-//	public List<FileStatusEntity>  joinFileSensitivity( String site , HDFSFileSystemResponseEntity
response ) {
-//        List<FileStatusEntity> result = new ArrayList<>();
-//        List<FileStatus> fileStatuses = response.getFileList();
-//        HDFSResourceSensitivityService sensitivityService = new HDFSResourceSensitivityService();
-//        Map<String, String>  sensitivityMap = sensitivityService.getFileSensitivityMapBySite(site);
-//        LOG.info("Joining Resource with Sensitivity data ..");
-//        Map<String , List<String>>  subDirectories = response.getSubDirectoriesMap();
-//        for( FileStatus fileStatus : fileStatuses ) {
-//            String resource = fileStatus.getPath().toUri().getPath();
-//            FileStatusEntity entity;
-//			try {
-//				entity = new FileStatusEntity(fileStatus);
-//				entity.setResource(resource);
-//	            entity.setSensitiveType(sensitivityMap.get(resource));
-//	            if(subDirectories.containsKey(resource))
-//	            	entity.setChildSensitivityTypes(getChildSensitivityTypes(resource, subDirectories.get(resource)
, sensitivityMap ));
-//			} catch (IOException e) {
-//				LOG.error(" Exception when joining FileSensitivity .. Error Message : "+e.getMessage());
-//			}
-//
-//		}
-//		return result;
-//	}
-
-	/**
-	 * Check the resource has any child , if it has child then Fetch the Sensitivity Type of
Each Child
-	 *  
-	 * @param directory
-	 * @param fileStatuses
-	 * @param sensitivityMap
-	 * @return childSensitivityTypes
-	 */
-//	public Set<String>  getChildSensitivityTypes( String resource, List<String>
directories  , Map<String,String> _sensitivityMap )
-//	{
-//		// Check the passed directory has any child directory
-//		Set<String>  childSensitivityTypes = new HashSet<String>();
-//		for(String directory : directories )
-//		{
-//			// Use String.startWith to determine the child directory
-//			if( _sensitivityMap.containsKey(directory) )
-//				childSensitivityTypes.add(_sensitivityMap.get(directory));
-//		}
-//		return childSensitivityTypes;
-//	}
 		
 	/**
 	 * Fetch the Sensitivity Types by applying RegExp Pattern 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/d74165fa/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSResourceUtils.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSResourceUtils.java
b/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSResourceUtils.java
index cb20728..7d57ef7 100644
--- a/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSResourceUtils.java
+++ b/eagle-security/eagle-security-hdfs-web/src/main/java/org/apache/eagle/service/security/hdfs/HDFSResourceUtils.java
@@ -16,11 +16,9 @@
  */
 package org.apache.eagle.service.security.hdfs;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.eagle.service.generic.ListQueryResource;
-import org.apache.hadoop.fs.FileStatus;
 
 import org.apache.eagle.alert.entity.AlertDataSourceEntity;
 import org.apache.eagle.log.entity.ListQueryAPIResponseEntity;
@@ -60,44 +58,5 @@ public class HDFSResourceUtils {
 			
 		return false;
 	}
-	
-	/**
-	 * Filter Only directories 
-	 * @param fileStatuses
-	 * @return
-	 */
-	public static List<String> filterDirectories( List<FileStatus> fileStatuses)
-	{
-		List<String> directories  = new ArrayList<>();
-		for(FileStatus fileStatus : fileStatuses )
-		{
-			if( fileStatus.isDirectory() )
-				directories.add(fileStatus.getPath().toUri().getPath());
-			
-		}
-		return directories;
-	}
-	
-	
-	/**
-	 * Returns the filtered data by applyin RegExp
-	 * @param regExp
-	 * @param data
-	 * @return
-	 */
-	public static List<String> filterCollectionUsingRegEx( String regExp , List<String>
data )
-	{
-		 // No regular expressions filtering needed
-        if (regExp == null || regExp.isEmpty()) {
-            return data;
-        }
-        
-        List<String> filteredElems = new ArrayList<String>();
-        for( String path : data )
-        {
-        	if( path.matches(regExp) )
-        			filteredElems.add(path);
-        }       
-		return filteredElems;
-	}
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/d74165fa/eagle-security/eagle-security-hive-web/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hive-web/pom.xml b/eagle-security/eagle-security-hive-web/pom.xml
index 0286963..1bfae49 100644
--- a/eagle-security/eagle-security-hive-web/pom.xml
+++ b/eagle-security/eagle-security-hive-web/pom.xml
@@ -60,16 +60,6 @@
           <version>${project.version}</version>
       </dependency>
       <dependency>
-          <groupId>eagle</groupId>
-          <artifactId>eagle-alert-process</artifactId>
-          <version>${project.version}</version>
-      </dependency>
-      <dependency>
-          <groupId>eagle</groupId>
-          <artifactId>eagle-alert-service</artifactId>
-          <version>${project.version}</version>
-      </dependency>
-      <dependency>
           <groupId>org.apache.hive</groupId>
           <artifactId>hive-jdbc</artifactId>
       </dependency>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/d74165fa/eagle-webservice/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/WEB-INF/web.xml b/eagle-webservice/src/main/webapp/WEB-INF/web.xml
index f9a5061..21850de 100644
--- a/eagle-webservice/src/main/webapp/WEB-INF/web.xml
+++ b/eagle-webservice/src/main/webapp/WEB-INF/web.xml
@@ -29,7 +29,7 @@
 		<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
 		<init-param>
 			<param-name>com.sun.jersey.config.property.packages</param-name>
-			<param-value>eagle.service;org.codehaus.jackson.jaxrs</param-value>
+			<param-value>org.apache.eagle.service;org.codehaus.jackson.jaxrs</param-value>
 		</init-param>
         <!--init-param> <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
             <param-value>true</param-value> </init-param -->


Mime
View raw message