Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.12.0
-
None
Description
Current, we submit flink job to yarn with run-application target and need to specify some configuration related to hadoop, because we use distributed filesystem similar to Ali oss to storage resources, in this case, we will pass special configuration option and set them to hadoopConfiguration.
In order to solve such problems, we can provide a configuration option prefixed with "flink.hadoop."(such as -Dflink.hadoop.xxx=yyy), and then take it into HadoopConfiguration.
A simple implementation code is as follows:
module: flink-filesystems/flink-hadoop-fs class: org.apache.flink.runtime.util.HadoopUtils //代码占位符 public static Configuration getHadoopConfiguration(org.apache.flink.configuration.Configuration flinkConfiguration) { ...... // Copy any "flink.hadoop.xxx=yyy" flink configuration to hadoop configuration as "xxx=yyy" for (String key : flinkConfiguration.keySet()) { if (key.startsWith("flink.hadoop.")) { result.set(key.substring("flink.hadoop.".length()), flinkConfiguration.getString(key, null)); } } return result; }
Attachments
Issue Links
- duplicates
-
FLINK-16005 Support yarn and hadoop config override
- Closed