flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [3/5] flink git commit: [FLINK-4870] Fix path handling in ContinuousFileMonitoringFunction
Date Thu, 05 Jan 2017 14:42:43 GMT
[FLINK-4870] Fix path handling in ContinuousFileMonitoringFunction

This closes #2887.


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

Branch: refs/heads/release-1.2
Commit: 24109cb2692f1f0dd2b9f8c9c8dcc02e55148bab
Parents: bb46fff
Author: zentol <chesnay@apache.org>
Authored: Fri Nov 25 13:27:43 2016 +0100
Committer: zentol <chesnay@apache.org>
Committed: Thu Jan 5 14:01:01 2017 +0100

----------------------------------------------------------------------
 .../api/functions/source/ContinuousFileMonitoringFunction.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/24109cb2/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/ContinuousFileMonitoringFunction.java
----------------------------------------------------------------------
diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/ContinuousFileMonitoringFunction.java
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/ContinuousFileMonitoringFunction.java
index 1ec9a70..e0a042a 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/ContinuousFileMonitoringFunction.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/ContinuousFileMonitoringFunction.java
@@ -38,7 +38,6 @@ import org.slf4j.LoggerFactory;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -187,8 +186,9 @@ public class ContinuousFileMonitoringFunction<OUT>
 
 	@Override
 	public void run(SourceFunction.SourceContext<TimestampedFileInputSplit> context) throws
Exception {
-		FileSystem fileSystem = FileSystem.get(new URI(path));
-		if (!fileSystem.exists(new Path(path))) {
+		Path p = new Path(path);
+		FileSystem fileSystem = FileSystem.get(p.toUri());
+		if (!fileSystem.exists(p)) {
 			throw new FileNotFoundException("The provided file path " + path + " does not exist.");
 		}
 


Mime
View raw message