accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/4] git commit: ACCUMULO-3026 UniqueFileReplicator was not being closed
Date Tue, 05 Aug 2014 14:03:53 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master e06e8df82 -> cfe8ee548


ACCUMULO-3026 UniqueFileReplicator was not being closed


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

Branch: refs/heads/master
Commit: c922a94aeaa576a79cb950d7abbbeb9c47c79ae1
Parents: 444a889
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Tue Aug 5 09:58:33 2014 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Tue Aug 5 09:58:33 2014 -0400

----------------------------------------------------------------------
 .../start/classloader/vfs/AccumuloVFSClassLoader.java  | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/c922a94a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
index d4044a5..9f0f650 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
@@ -38,6 +38,7 @@ import org.apache.commons.vfs2.cache.SoftRefFilesCache;
 import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
 import org.apache.commons.vfs2.impl.FileContentInfoFilenameFactory;
 import org.apache.commons.vfs2.impl.VFSClassLoader;
+import org.apache.commons.vfs2.provider.FileReplicator;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.log4j.Logger;
@@ -385,8 +386,18 @@ public class AccumuloVFSClassLoader {
   public static void close() {
     for (WeakReference<DefaultFileSystemManager> vfsInstance : vfsInstances) {
       DefaultFileSystemManager ref = vfsInstance.get();
-      if (ref != null)
+      if (ref != null) {
+        FileReplicator replicator;
+        try {
+          replicator = ref.getReplicator();
+          if (replicator instanceof UniqueFileReplicator) {
+            ((UniqueFileReplicator) replicator).close();
+          }
+        } catch (FileSystemException e) {
+          log.error(e, e);
+        }
         ref.close();
+      }
     }
   }
 }


Mime
View raw message