You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/03/26 01:35:20 UTC
[06/11] git commit: ACCUMULO-2532 Expand on comment as to why we
create this (otherwise curious) file
ACCUMULO-2532 Expand on comment as to why we create this (otherwise curious) file
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/9678a2c5
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/9678a2c5
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/9678a2c5
Branch: refs/heads/master
Commit: 9678a2c51a33cc8c58969450e81c0acf40714930
Parents: 74ffff1
Author: Josh Elser <el...@apache.org>
Authored: Tue Mar 25 16:09:50 2014 -0700
Committer: Josh Elser <el...@apache.org>
Committed: Tue Mar 25 16:09:50 2014 -0700
----------------------------------------------------------------------
.../src/main/java/org/apache/accumulo/server/util/FileUtil.java | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/9678a2c5/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
index 4fee83d..0f7ac22 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
@@ -96,6 +96,8 @@ public class FileUtil {
fs.mkdirs(result);
// try to reserve the tmp dir
+ // In some versions of hadoop, two clients concurrently trying to create the same directory might both return true
+ // Creating a file is not subject to this, so create a special file to make sure we solely will use this directory
if (!fs.createNewFile(new Path(result, "__reserve")))
result = null;
}