Joris van Rooij
09/10/2024, 8:52 AMJoris van Rooij
09/10/2024, 9:19 AMD. Draco O'Brien
09/10/2024, 9:26 AMjar tf flink-azure-fs-hadoop-1.20.0.jar
and checking the class is there.
Even though you’ve placed the JAR in the plugins folder, Flink might not automatically include it in its classpath, especially if you’re running Flink in a custom setup like a VM. Check that Flink is configured to include this plugin directory in its classpath.
Make sure your Flink job’s configuration correctly points to use the ABFS filesystem. In your Flink job’s configuration (flink-conf.yaml or passed as command-line arguments), you should have something like:
fs.default-scheme: abfs
You might also need to configure Hadoop dependencies if your job indirectly uses Hadoop APIs to interact with storage.D. Draco O'Brien
09/10/2024, 9:28 AMJoris van Rooij
09/10/2024, 9:30 AMJoris van Rooij
09/10/2024, 9:37 AMD. Draco O'Brien
09/10/2024, 9:42 AMD. Draco O'Brien
09/10/2024, 9:46 AMmvn dependency:tree
can show you list of dependencies and their versions for flink-azure-fs-hadoop-1.20.0.jarJoris van Rooij
09/10/2024, 10:45 AMD. Draco O'Brien
09/10/2024, 2:11 PMlog4j.logger.org.apache.flink=DEBUG
log4j.logger.org.apache.hadoop=DEBUG
D. Draco O'Brien
09/10/2024, 2:13 PMD. Draco O'Brien
09/10/2024, 2:15 PMD. Draco O'Brien
09/10/2024, 2:18 PMD. Draco O'Brien
09/10/2024, 2:19 PMD. Draco O'Brien
09/10/2024, 2:21 PMlog4j.logger.org.apache.flink.util.ChildFirstClassLoader=DEBUG
to check what the loading issue was.D. Draco O'Brien
09/10/2024, 2:25 PMimport org.apache.flink.util.ChildFirstClassLoader;
import java.net.URLClassLoader;
// assuming your main class or somewhere in the initialization
public class YourFlinkJob {
public static void main(String[] args) throws Exception {
// get the current classloader, assuming it's ChildFirstClassLoader in Flink's context
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl instanceof ChildFirstClassLoader) {
System.out.println("Flink's ClassLoader Debug Information:");
URLClassLoader ucl = (URLClassLoader) cl;
for (URL url : ucl.getURLs()) {
System.out.println(url);
}
// enable debugging for classloading if supported
if (cl instanceof ChildFirstClassLoader) {
((ChildFirstClassLoader) cl).setDebug(true);
}
}
// Rest of your job initialization and execution code...
}
}
This code snippet first retrieves the current thread’s context classloader, which in a Flink environment should be an instance of ChildFirstClassLoader. It then prints out the URLs from which this classloader can load classes, effectively showing the classpath. Additionally, it sets the debug flag to true if the classloader supports it, which can provide additional debug output related to classloading.
Remember to revert these debugging configurations once you’ve diagnosed the issue.D. Draco O'Brien
09/10/2024, 2:27 PM