piyushnarang commented on a change in pull request #8117: [FLINK-12115] [filesystems]: Add support for AzureFS URL: https://github.com/apache/flink/pull/8117#discussion_r279896298
########## File path: flink-filesystems/flink-azure-fs-hadoop/src/main/java/org/apache/flink/fs/azurefs/AzureFileSystem.java ########## @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.fs.azurefs; + +import org.apache.flink.configuration.Configuration; +import org.apache.flink.core.fs.FileSystemKind; +import org.apache.flink.runtime.fs.hdfs.HadoopFileSystem; +import org.apache.flink.runtime.util.HadoopUtils; + +import org.apache.hadoop.fs.azure.NativeAzureFileSystem; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.net.URI; + +/** + * Azure FileSystem connector for Flink. Based on Azure HDFS support in the + * <a href="https://hadoop.apache.org/docs/current/hadoop-azure/index.html">hadoop-azure</a> module. + */ +public class AzureFileSystem extends HadoopFileSystem { + private static final Logger LOG = LoggerFactory.getLogger(AzureFileSystem.class); + + private static final String[] CONFIG_PREFIXES = { "fs.azure.", "azure." }; + + public AzureFileSystem(URI fsUri, Configuration flinkConfig) throws IOException { + super(createInitializedAzureFS(fsUri, flinkConfig)); + } + + // uri is of the form: wasb(s)://[email protected]/testDir + private static org.apache.hadoop.fs.FileSystem createInitializedAzureFS(URI fsUri, Configuration flinkConfig) throws IOException { + org.apache.hadoop.conf.Configuration hadoopConfig = HadoopUtils.getHadoopConfiguration(flinkConfig); + + copyFlinkToHadoopConfig(flinkConfig, hadoopConfig); Review comment: hmm so I'm wondering if we could push this to a follow up change. The hadoop config loader is in the flink-s3-fs-base module. So we'll have to spin up a new module and refactor things a bit in the s3 code as well. Also if we want to do it correctly, we probably want to use the config loader for the other non-S3 filesystems (like OSS) which are also currently doing things in a similar fashion. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
