You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/07/31 10:01:19 UTC

[GitHub] zentol closed pull request #6454: [FLINK-9996][fs] Wrap exceptions during FS creation

zentol closed pull request #6454: [FLINK-9996][fs] Wrap exceptions during FS creation
URL: https://github.com/apache/flink/pull/6454
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/AbstractFileSystemFactory.java b/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/AbstractFileSystemFactory.java
index 201d58049bc..63919bab452 100644
--- a/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/AbstractFileSystemFactory.java
+++ b/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/AbstractFileSystemFactory.java
@@ -51,10 +51,16 @@ public void configure(Configuration config) {
 	public FileSystem create(URI fsUri) throws IOException {
 		LOG.debug("Creating Hadoop file system (backed by " + name + ")");
 		LOG.debug("Loading Hadoop configuration for " + name);
-		org.apache.hadoop.conf.Configuration hadoopConfig = hadoopConfigLoader.getOrLoadHadoopConfig();
-		org.apache.hadoop.fs.FileSystem fs = createHadoopFileSystem();
-		fs.initialize(getInitURI(fsUri, hadoopConfig), hadoopConfig);
-		return new HadoopFileSystem(fs);
+		try {
+			org.apache.hadoop.conf.Configuration hadoopConfig = hadoopConfigLoader.getOrLoadHadoopConfig();
+			org.apache.hadoop.fs.FileSystem fs = createHadoopFileSystem();
+			fs.initialize(getInitURI(fsUri, hadoopConfig), hadoopConfig);
+			return new HadoopFileSystem(fs);
+		} catch (IOException ioe) {
+			throw ioe;
+		} catch (Exception e) {
+			throw new IOException(e.getMessage(), e);
+		}
 	}
 
 	protected abstract org.apache.hadoop.fs.FileSystem createHadoopFileSystem();


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services