accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlmar...@apache.org
Subject [1/3] git commit: ACCUMULO-2811: Move directory creation to the constructor so that the directory creation is only attempted once. Check that the directory does not exist first.
Date Fri, 16 May 2014 00:17:38 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6.1-SNAPSHOT ff17423fa -> fd80bc615
  refs/heads/master e0468b2e5 -> 246c415fa


ACCUMULO-2811: Move directory creation to the constructor so that the directory creation is
only attempted once. Check that the directory does not exist first.


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

Branch: refs/heads/1.6.1-SNAPSHOT
Commit: fd80bc61573fa18fe3439b94b4334c3a91e16420
Parents: ff17423
Author: Dave Marion <dlmarion@hotmail.com>
Authored: Thu May 15 20:14:43 2014 -0400
Committer: Dave Marion <dlmarion@hotmail.com>
Committed: Thu May 15 20:14:43 2014 -0400

----------------------------------------------------------------------
 .../accumulo/start/classloader/vfs/UniqueFileReplicator.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/fd80bc61/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
index 29407f9..e11cf47 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
@@ -46,6 +46,8 @@ public class UniqueFileReplicator implements VfsComponent, FileReplicator
{
 
   public UniqueFileReplicator(File tempDir) {
     this.tempDir = tempDir;
+    if (!tempDir.exists() && !tempDir.mkdirs())
+      log.warn("Unexpected error creating directory " + tempDir);
   }
 
   @Override
@@ -53,8 +55,6 @@ public class UniqueFileReplicator implements VfsComponent, FileReplicator
{
     String baseName = srcFile.getName().getBaseName();
 
     try {
-      if (!tempDir.mkdirs())
-        log.warn("Unexpected error creating directory " + tempDir);
       String safeBasename = UriParser.encode(baseName, TMP_RESERVED_CHARS).replace('%', '_');
       File file = File.createTempFile("vfsr_", "_" + safeBasename, tempDir);
       file.deleteOnExit();


Mime
View raw message