[hotfix] Instantiate a HdfsConfiguration in HadoopUtils#getHadoopConfiguration()
Instantiate a HdfsConfiguration as the base configuration when calling HadoopUtils#getHadoopConfiguration() to load the hdfs-site.xml and hdfs-default.xml from the classpath before trying to load an explicitly specified configuration. Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/8198967e Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/8198967e Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/8198967e Branch: refs/heads/master Commit: 8198967eaa6cd8e2a690dd1be31721b25e116d9b Parents: f9b475f Author: Till Rohrmann <[email protected]> Authored: Thu Nov 2 15:04:26 2017 +0100 Committer: Till Rohrmann <[email protected]> Committed: Thu Nov 2 15:04:26 2017 +0100 ---------------------------------------------------------------------- .../main/java/org/apache/flink/runtime/util/HadoopUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/8198967e/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/util/HadoopUtils.java ---------------------------------------------------------------------- diff --git a/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/util/HadoopUtils.java b/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/util/HadoopUtils.java index 8bfcb5c..5b14f43 100644 --- a/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/util/HadoopUtils.java +++ b/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/util/HadoopUtils.java @@ -21,11 +21,11 @@ package org.apache.flink.runtime.util; import org.apache.flink.configuration.ConfigConstants; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hdfs.HdfsConfiguration; import org.apache.hadoop.io.Text; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.TokenIdentifier; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,7 +44,9 @@ public class HadoopUtils { public static Configuration getHadoopConfiguration(org.apache.flink.configuration.Configuration flinkConfiguration) { - Configuration result = new Configuration(); + // Instantiate a HdfsConfiguration to load the hdfs-site.xml and hdfs-default.xml + // from the classpath + Configuration result = new HdfsConfiguration(); boolean foundHadoopConfiguration = false; // We need to load both core-site.xml and hdfs-site.xml to determine the default fs path and
