flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [3/3] flink git commit: [FLINK-7266] [core] Prevent attempt for parent directory deletion for object stores
Date Fri, 28 Jul 2017 13:34:28 GMT
[FLINK-7266] [core] Prevent attempt for parent directory deletion for object stores

This closes #4397


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

Branch: refs/heads/release-1.3
Commit: 0225db288661846edce25e12d457fb25dfa87827
Parents: 854b053
Author: Stephan Ewen <sewen@apache.org>
Authored: Tue Jul 25 17:26:38 2017 +0200
Committer: Stephan Ewen <sewen@apache.org>
Committed: Fri Jul 28 15:21:42 2017 +0200

----------------------------------------------------------------------
 .../flink/runtime/state/filesystem/FileStateHandle.java   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/0225db28/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FileStateHandle.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FileStateHandle.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FileStateHandle.java
index bdf3f42..7655f0b 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FileStateHandle.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FileStateHandle.java
@@ -20,6 +20,7 @@ package org.apache.flink.runtime.state.filesystem;
 
 import org.apache.flink.core.fs.FSDataInputStream;
 import org.apache.flink.core.fs.FileSystem;
+import org.apache.flink.core.fs.FileSystemKind;
 import org.apache.flink.core.fs.Path;
 import org.apache.flink.runtime.state.StreamStateHandle;
 import org.apache.flink.util.FileUtils;
@@ -77,14 +78,15 @@ public class FileStateHandle implements StreamStateHandle {
 	 */
 	@Override
 	public void discardState() throws Exception {
-
 		FileSystem fs = getFileSystem();
 
 		fs.delete(filePath, false);
 
-		try {
-			FileUtils.deletePathIfEmpty(fs, filePath.getParent());
-		} catch (Exception ignored) {}
+		if (fs.getKind() == FileSystemKind.FILE_SYSTEM) {
+			try {
+				FileUtils.deletePathIfEmpty(fs, filePath.getParent());
+			} catch (Exception ignored) {}
+		}
 	}
 
 	/**


Mime
View raw message