You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Raul Kripalani <ra...@apache.org> on 2015/11/13 18:39:43 UTC

Classloading in Ignite

Hi team,

I'm seeing instances of ClassLoaders being kept as instance variables in
many places. It looks a bit ad-hoc.

What surprises me is that the user-set ClassLoader
(IgniteConfiguration#setClassLoader) is ignored in many places where, in my
opinion, it should be preferred, e.g.:

* Optimized Marshaller
* U.gridClassLoader() and its many usages.
* etc.

Shouldn't Ignite use the user-preferred classloader for everything, and
only fallback to getClass().getClassLoader() and other methods as a default?

Currently the user's ClassLoader is only used from these spots:

* GridDeploymentManager
* GridDeploymentPerVersionStore
* CacheObjectImpl
* GridCacheDeploymentManager

*Raúl Kripalani*
PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
Messaging Engineer
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

Re: Classloading in Ignite

Posted by Alexey Goncharuk <al...@gmail.com>.
Raul,

I agree with you. I remember a discussion like this on the dev list a while
ago, but it looks like it led to nowhere. I created a ticket:
https://issues.apache.org/jira/browse/IGNITE-1930, let's list the desired
scenarios of user class-loading and required changes there.

--AG

2015-11-13 20:39 GMT+03:00 Raul Kripalani <ra...@apache.org>:

> Hi team,
>
> I'm seeing instances of ClassLoaders being kept as instance variables in
> many places. It looks a bit ad-hoc.
>
> What surprises me is that the user-set ClassLoader
> (IgniteConfiguration#setClassLoader) is ignored in many places where, in my
> opinion, it should be preferred, e.g.:
>
> * Optimized Marshaller
> * U.gridClassLoader() and its many usages.
> * etc.
>
> Shouldn't Ignite use the user-preferred classloader for everything, and
> only fallback to getClass().getClassLoader() and other methods as a
> default?
>
> Currently the user's ClassLoader is only used from these spots:
>
> * GridDeploymentManager
> * GridDeploymentPerVersionStore
> * CacheObjectImpl
> * GridCacheDeploymentManager
>
> *Raúl Kripalani*
> PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
> Messaging Engineer
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>