Skip to content

Commit

Permalink
[FLINK-9996][fs] Wrap exceptions during FS creation
Browse files Browse the repository at this point in the history
  • Loading branch information
zentol authored Jul 31, 2018
1 parent ad7fd64 commit 2a70d4c
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2a70d4c

Please sign in to comment.