[FLINK-5828] [distributed runtime] Fix initialization of Blob storage directories
Flip the logic (check existence and create directory) to resolve currency problem This closes #3342 Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/20420fc6 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/20420fc6 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/20420fc6 Branch: refs/heads/master Commit: 20420fc6ee153c7171265dda7bf7d593c17fb375 Parents: 70475b3 Author: å£«è¿ <[email protected]> Authored: Fri Feb 17 17:42:22 2017 +0800 Committer: Stephan Ewen <[email protected]> Committed: Sat Feb 18 19:19:34 2017 +0100 ---------------------------------------------------------------------- .../src/main/java/org/apache/flink/runtime/blob/BlobUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/20420fc6/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java b/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java index 136df09..aeaa602 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java @@ -124,7 +124,7 @@ public class BlobUtils { private static File getCacheDirectory(File storageDir) { final File cacheDirectory = new File(storageDir, "cache"); - if (!cacheDirectory.exists() && !cacheDirectory.mkdirs()) { + if (!cacheDirectory.mkdirs() && !cacheDirectory.exists()) { throw new RuntimeException("Could not create cache directory '" + cacheDirectory.getAbsolutePath() + "'."); }
