flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [06/10] flink git commit: [FLINK-6541] Improve tmp dir setup in TM/WebMonitor
Date Sun, 25 Jun 2017 11:50:27 GMT
[FLINK-6541] Improve tmp dir setup in TM/WebMonitor


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

Branch: refs/heads/release-1.3
Commit: ff2bb718cd9e87dfe7ab5601e9ff9f7293eb3cfe
Parents: bfba2b1
Author: zentol <chesnay@apache.org>
Authored: Sat May 13 18:09:30 2017 +0200
Committer: zentol <chesnay@apache.org>
Committed: Sun Jun 25 08:55:09 2017 +0200

----------------------------------------------------------------------
 .../apache/flink/runtime/webmonitor/WebRuntimeMonitor.java   | 2 +-
 .../flink/runtime/taskexecutor/TaskManagerServices.java      | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/ff2bb718/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
----------------------------------------------------------------------
diff --git a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
index 5c66545..5edcbe3 100644
--- a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
+++ b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
@@ -175,7 +175,7 @@ public class WebRuntimeMonitor implements WebMonitor {
 			// create storage for uploads
 			this.uploadDir = getUploadDir(config);
 			// the upload directory should either 1. exist and writable or 2. can be created and writable
-			if (!(uploadDir.exists() && uploadDir.canWrite()) && !(uploadDir.mkdir()
&& uploadDir.canWrite())) {
+			if (!(uploadDir.exists() && uploadDir.canWrite()) && !(uploadDir.mkdirs()
&& uploadDir.canWrite())) {
 				throw new IOException(
 					String.format("Jar upload directory %s cannot be created or is not writable.",
 						uploadDir.getAbsolutePath()));

http://git-wip-us.apache.org/repos/asf/flink/blob/ff2bb718/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServices.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServices.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServices.java
index 86a2fdf..1c30ff6 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServices.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServices.java
@@ -603,11 +603,11 @@ public class TaskManagerServices {
 	}
 
 	/**
-	 * Validates that all the directories denoted by the strings do actually exist, are proper
+	 * Validates that all the directories denoted by the strings do actually exist or can be
created, are proper
 	 * directories (not files), and are writable.
 	 *
 	 * @param tmpDirs The array of directory paths to check.
-	 * @throws IOException Thrown if any of the directories does not exist or is not writable
+	 * @throws IOException Thrown if any of the directories does not exist and cannot be created
or is not writable
 	 *                     or is a file, rather than a directory.
 	 */
 	private static void checkTempDirs(String[] tmpDirs) throws IOException {
@@ -615,7 +615,9 @@ public class TaskManagerServices {
 			if (dir != null && !dir.equals("")) {
 				File file = new File(dir);
 				if (!file.exists()) {
-					throw new IOException("Temporary file directory " + file.getAbsolutePath() + " does
not exist.");
+					if (!file.mkdirs()) {
+						throw new IOException("Temporary file directory " + file.getAbsolutePath() + " does
not exist and could not be created.");
+					}
 				}
 				if (!file.isDirectory()) {
 					throw new IOException("Temporary file directory " + file.getAbsolutePath() + " is not
a directory.");


Mime
View raw message