[
https://issues.apache.org/jira/browse/FLINK-6842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16076515#comment-16076515
]
ASF GitHub Bot commented on FLINK-6842:
---------------------------------------
Github user greghogan commented on a diff in the pull request:
https://github.com/apache/flink/pull/4219#discussion_r125902757
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFileSystem.java
---
@@ -459,17 +459,14 @@ public boolean isDistributedFS() {
@Override
public Class<?> getHadoopWrapperClassNameForFileSystem(String scheme) {
Configuration hadoopConf = getHadoopConfiguration();
- Class<? extends org.apache.hadoop.fs.FileSystem> clazz;
- // We can activate this block once we drop Hadoop1 support
(only hd2 has the getFileSystemClass-method)
-// try {
-// clazz =
org.apache.hadoop.fs.FileSystem.getFileSystemClass(scheme, hadoopConf);
-// } catch (IOException e) {
-// LOG.info("Flink could not load the Hadoop File system
implementation for scheme "+scheme);
-// return null;
-// }
- clazz = hadoopConf.getClass("fs." + scheme + ".impl", null,
org.apache.hadoop.fs.FileSystem.class);
-
- if (clazz != null && LOG.isDebugEnabled()) {
+ Class<? extends org.apache.hadoop.fs.FileSystem> clazz = null;
+ try {
+ clazz =
org.apache.hadoop.fs.FileSystem.getFileSystemClass(scheme, hadoopConf);
+ } catch (IOException e) {
+ LOG.info("Flink could not load the Hadoop File system
implementation for scheme " + scheme);
+ }
+
+ if(LOG.isDebugEnabled()) {
--- End diff --
Checkstyle is `if (...`. When the `IOException` is caught `clazz` will
still be `null`.
> Uncomment or remove code in HadoopFileSystem
> --------------------------------------------
>
> Key: FLINK-6842
> URL: https://issues.apache.org/jira/browse/FLINK-6842
> Project: Flink
> Issue Type: Improvement
> Components: Local Runtime
> Affects Versions: 1.4.0
> Reporter: Chesnay Schepler
> Assignee: mingleizhang
> Priority: Minor
>
> I've found the following code in
> {{HadoopFileSystem#getHadoopWrapperClassNameForFileSystem}}
> {code}
> Configuration hadoopConf = getHadoopConfiguration();
> Class<? extends org.apache.hadoop.fs.FileSystem> clazz;
> // We can activate this block once we drop Hadoop1 support (only hd2 has the
> getFileSystemClass-method)
> //try {
> // clazz = org.apache.hadoop.fs.FileSystem.getFileSystemClass(scheme,
> hadoopConf);
> //} catch (IOException e) {
> // LOG.info("Flink could not load the Hadoop File system implementation
> for scheme "+scheme);
> // return null;
> //}
> clazz = hadoopConf.getClass("fs." + scheme + ".impl", null,
> org.apache.hadoop.fs.FileSystem.class);
> if (clazz != null && LOG.isDebugEnabled()) {
> LOG.debug("Flink supports {} with the Hadoop file system wrapper, impl
> {}", scheme, clazz);
> }
> return clazz;
> {code}
> Since we don't support hadoop1 anymore the commented code should either be
> activated or removed.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)