Ivan Webber
04/05/2023, 9:06 PMorg.apache.hadoop.fs.UnsupportedFileSystemException: No FileSystem for scheme "file"
The full stack trace (see my reply) makes me wonder if it is trying to allocate a local temporary file and failing. I am using the flink-operator and running on an AKS cluster.Ivan Webber
04/05/2023, 9:08 PMIvan Webber
04/05/2023, 11:27 PM2023-04-05 23:15:22,125 WARN org.apache.hadoop.util.NativeCodeLoader [] - Unable to load native-hadoop library for your platform... using builtin-java classes where applicableIvan Webber
04/06/2023, 6:27 PMIvan Webber
04/06/2023, 8:08 PMfs.azure.data.blocks.buffer: "bytebuffer" alone won't fix the problem. I'm getting the following missing dependency errors. I think Flink itself should be providing these classes, so I'm going to switch back to the container I built from source instead of the one where I just replaced the azure-fs-plugin.Ivan Webber
04/06/2023, 9:18 PMIvan Webber
04/06/2023, 10:33 PM<scope>provided tag.Ivan Webber
04/07/2023, 2:39 AM<scope>provided</scope> tags. I use custom KeyProvider implementations, and normally I just copy my fat jar into /opt/flink/plugins/azure-fs-hadoop/ . That has worked fine for reading from Azure, but I was worried it could be causing duplicated classes resulting in the NoClassDefFoundError : "org/apache/hadoop/conf/Configuration", so I made a separate jar with just the KeyProvider classes but then I get errors that my KeyProviders can't be found. I also tried putting my entire jar into the $FLINK_HOME/lib folder (see here), but that didn't help because my KeyProvider classes couldn't be found thereafter. I'll work on that, but my solution worked for reading, so it should work for writing too. Also, the error doesn't match the described classloading problems (docs).
Now I'm thinking that maybe I need to include a Hadoop installation inside my docker image so that Flink can load the missing Configuration class as described here. In the documentation it says the ADLS connector is self-contained (shouldn't need Hadoop), so I don't think I should need to include Hadoop just to use the ADLS connector. Thus, I think perhaps the ADLS connector or my code must be missing the compile dependency that should contain org/apache/hadoop/conf/Configuration .Ivan Webber
04/07/2023, 2:40 AMNoClassDefFoundError : "org/apache/hadoop/conf/Configuration" is there a <scope>compile</scope> dependency that should be added?Ivan Webber
04/07/2023, 2:48 AMflink-gs-fs-hadoop and flink-s3-fs-hadoop seem to have hadoop-common as dependencies while flink-azure-fs-hadoop and flink-oss-fs-hadoop have it excluded but not restored.Ivan Webber
04/07/2023, 11:50 PMIvan Webber
04/12/2023, 9:49 PMfs.azure.data.blocks.buffer: "bytebuffer" it exceeds off-heap memory. If I use fs.azure.data.blocks.buffer: "array" it exceeds heap memory. I almost wonder if there is a leak. In the case it really does need this much memory I need to be able to use the fs.azure.data.blocks.buffer: "disk" option with fs.azure.buffer.dir: local:///mnt/pvc-local/tmp_azure-fs_buffer , but despite setting those values I get the org.apache.hadoop.fs.UnsupportedFileSystemException: No FileSystem for scheme "file" error. I've tried supplying flink.hadoop.fs.file.impl: org.apache.flink.core.fs.local.LocalFileSystem and flink.hadoop.fs.defaultFS: local:// to no effect. I'm wondering if somthing is preventing Flink from configuring Hadoop correctly. This is the PR that introduced the new pattern to Hadoop. I could try an older version of Hadoop.Martijn Visser
04/13/2023, 8:21 AMIvan Webber
04/13/2023, 9:37 PMfs.azure prefixed configs in the flink-conf.yaml. The configuration documentation page says that keys prefixed with hadoop.flink. are supposed to be forwarded to the Hadoop configuration, but the ADLS2 FileSystemFactory doesn't actually load those keys. If I'm reading it correctly now I need to add a hadoop distribution to my docker image and set HADOOP_CLASSPATH to it? I almost went down that road before, but it seemed excessive. An example of a docker image that installs builds on the Flink base image and adds Hadoop would be great (I can make one if nobody has one). That page of documentation could be improved, but thank you for your replyIvan Webber
04/13/2023, 9:52 PMMartijn Visser
04/14/2023, 1:09 PMBoth implementations are self-contained with no dependency footprint, so there is no need to add Hadoop to the classpath to use them.I think the documentation at https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/filesystems/azure/#abfs can be improved to make sure that from Azure, you will need to have Hadoop available on the classpath (or someone needs to help out with changing
flink-azure-fs-hadoop so that it also becomes self-contained and doesn't need Hadoop on the classpath.Ivan Webber
04/17/2023, 7:20 PMorg.apache.flink.fs.azurefs.AbstractAzureFSFactory calls org.apache.flink.runtime.util.HadoopConfigLoader differently than expected, so keys like flink.hadoop.* are not in the config so Hadoop can't find a FileSystem binding for the configured directory and throws the exception. I've read through the Hadoop code so I know it passes the given config all the way down, and it does respond to changes in the options (e.g. using array instead of disk buffering, my current work around). I've been working on an experiment to test my theory by adding fs.file.impl: LocalFileSystem to the config, but it's less of a priority this week since I have a workaround and other responsibilities.