Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-20682

Add configuration options related to hadoop

    XMLWordPrintableJSON

Details

    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

          Activity

            People

              Unassigned Unassigned
              jiang7chengzitc Ruguo Yu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: