Hi, when running a jar on flink I am trying to replace a class with a subclass at runtime.
Let me explain why I believe this is necessary: I am working on a hadoop abstraction layer for Flink (Google Summer of Code 14) so that the user can run hadoop jobs on it. So currently the user doesn't have to write any specific Flink code apart from the actual endpoint of the application; a FlinkHadoopJobClient.runJob(JobConf); is enough . Ideally, he shouldn't even have to write that. Of course, a hadoop job has a JobClient.runJob(JobConf) which runs hadoop and not a FlinkHadoopJobClient (subclass) which runs flink... I was wondering if there is a mechanism to run a Flink Job with a custom ClassLoader just by specifying it in the config on a per job basis. The proposed classloader is quite simple: Everytime you see a JobClient give a FlinkHadoopJobClient. Delegate every other class to the parent classloader. The problem is that I just can't access the classloader that loads the JobClient (or generally Flink user code). I got it working with javassist (code instrumentation library) but It is very ugly and hacky. I'm sure there is something better. Am I missing of an obvious way to set a classloader for Flink? Or maybe I don't understand the chain of Classloaders here or in general? Thank you in advance, Artem PS. My GSoC progress tracker issue: https://issues.apache.org/jira/browse/FLINK-838
