git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FlinkUserClassLoader in AggregateFunction


Hi,

you are right in that you can't get it from the RuntimeContext because AggregateFunction doesn't have access to that. As an alternative, you can use Thread.currentThread().getContextClassLoader(), which always should have the user-code ClassLoader set.

Best,
Aljoscha

On 4. Oct 2018, at 12:14, Chirag Dewan <chirag.dewan22@xxxxxxxx> wrote:

Hi All,

Is there any other way to get hold of the FlinkUserClassLoaderother than the RuntimeContext?

The problem is, AggregateFunction cant be a RichFunction. I understand that's because of the state merging issue(from a thread here earlier). Now, I need DynamicClassLoading in AggregateFunction. And apparently, the only way to get a UserClassLoader is through the RuntimeContext.


Any workaround around this? Or someway I can create my custom UserClassLoader in the AggregateFunction?

Thanks in advance!

Chirag