hdt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsha...@apache.org
Subject [21/27] git commit: - Fixing cleanup on destory server
Date Thu, 26 Jun 2014 08:36:44 GMT
- Fixing cleanup on destory server


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

Branch: refs/heads/hadoop-eclipse-merge
Commit: bbc139af52c9d43908c4b2f99c02686524b9fd66
Parents: d63110a
Author: Rahul Sharma <rsharma@apache.org>
Authored: Mon Jun 23 13:51:41 2014 +0530
Committer: Rahul Sharma <rsharma@apache.org>
Committed: Mon Jun 23 13:51:41 2014 +0530

----------------------------------------------------------------------
 .../org/apache/hdt/core/internal/hdfs/HDFSManager.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/bbc139af/org.apache.hdt.core/src/org/apache/hdt/core/internal/hdfs/HDFSManager.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.core/src/org/apache/hdt/core/internal/hdfs/HDFSManager.java b/org.apache.hdt.core/src/org/apache/hdt/core/internal/hdfs/HDFSManager.java
index 43ebf1f..8d27d23 100644
--- a/org.apache.hdt.core/src/org/apache/hdt/core/internal/hdfs/HDFSManager.java
+++ b/org.apache.hdt.core/src/org/apache/hdt/core/internal/hdfs/HDFSManager.java
@@ -207,6 +207,7 @@ public class HDFSManager {
 									"HDFS Error", "Unable to create HDFS site :"+e.getMessage());
 						}
 					});
+					deleteServer(getServer(hdfsURI.toString()));
 					return e.getStatus();
 				} finally {
 					monitor.done();
@@ -280,7 +281,17 @@ public class HDFSManager {
 		String projectName = this.serverToProjectMap.remove(server);
 		this.projectToServerMap.remove(projectName);
 		this.uriToServerMap.remove(server.getUri());
+		this.uriToServerCacheMap.remove(server.getUri());
 		HadoopManager.INSTANCE.saveServers();
+		String tmpUri = server.getUri();
+		while (tmpUri != null && uriToServerCacheMap.containsKey(tmpUri)) {
+			uriToServerCacheMap.remove(tmpUri);
+			int lastSlashIndex = tmpUri.lastIndexOf('/');
+			tmpUri = lastSlashIndex < 0 ? null : tmpUri.substring(0, lastSlashIndex);
+		}
+		if(hdfsClientsMap.containsKey(server.getUri().toString())){
+			hdfsClientsMap.remove(server.getUri().toString());
+		}
 	}
 
 	/**


Mime
View raw message