You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2018/01/05 18:38:48 UTC
[07/19] flink git commit: [hotfix] [core] Improve local fs exists()
performance
[hotfix] [core] Improve local fs exists() performance
This avoids going though an exception in the case of non-existing files.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/4319725c
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/4319725c
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/4319725c
Branch: refs/heads/master
Commit: 4319725cfccd40fb063d126fd5fc36dc5feec158
Parents: 6360875
Author: Stephan Ewen <se...@apache.org>
Authored: Fri Oct 27 19:23:51 2017 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Fri Jan 5 19:38:06 2018 +0100
----------------------------------------------------------------------
.../java/org/apache/flink/core/fs/local/LocalFileSystem.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/4319725c/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java b/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java
index b1eb786..ee2ecbe 100644
--- a/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java
+++ b/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java
@@ -150,6 +150,12 @@ public class LocalFileSystem extends FileSystem {
}
@Override
+ public boolean exists(Path f) throws IOException {
+ final File path = pathToFile(f);
+ return path.exists();
+ }
+
+ @Override
public FileStatus[] listStatus(final Path f) throws IOException {
final File localf = pathToFile(f);