Classpath resource loading - should it work

classic Classic list List threaded Threaded
3 messages Options
Aleksei Valikov Aleksei Valikov
Reply | Threaded
Open this post in threaded view
|

Classpath resource loading - should it work

Hi,

I'd like to use the "Zero deployment" feature (https://apacheignite.readme.io/v1.1/docs/zero-deployment).

This works perfect for classes, but what I didn't manage to get working is a simple classpath resource loading, like:

getClass().getResource(scriptResourceFileName)

This gives me a valid URL on the local node but null on remote nodes.

Before I dig myself neck-deep - is it supposed to work? Compared to the distributed classloading, having the IGFS on board this seems to be fairly simple.
I could surely opt to IGFS. It just has a certain appeal to use classpath resources.

Thank you and best wishes,
Alexey
yakov yakov
Reply | Threaded
Open this post in threaded view
|

Re: Classpath resource loading - should it work

Alex, this does not work. Moreover, I dont think it is possible to support this.

I see that getResourceAsStream() should work. You can call it inside your job: getClass().getResourceAsStream(PATH) and it should get resource from remote node and return stream to you.

--Yakov

2015-06-29 13:46 GMT-07:00 Aleksei Valikov <[hidden email]>:
Hi,

I'd like to use the "Zero deployment" feature (https://apacheignite.readme.io/v1.1/docs/zero-deployment).

This works perfect for classes, but what I didn't manage to get working is a simple classpath resource loading, like:

getClass().getResource(scriptResourceFileName)

This gives me a valid URL on the local node but null on remote nodes.

Before I dig myself neck-deep - is it supposed to work? Compared to the distributed classloading, having the IGFS on board this seems to be fairly simple.
I could surely opt to IGFS. It just has a certain appeal to use classpath resources.

Thank you and best wishes,
Alexey

Aleksei Valikov Aleksei Valikov
Reply | Threaded
Open this post in threaded view
|

Re: Classpath resource loading - should it work

Hi,

ok, so getResourceAsStream(...) should work - this would be enough for my purposes. Thank you!

Many thanks and best wishes,
Alexey

On Tue, Jun 30, 2015 at 7:56 PM, Yakov Zhdanov <[hidden email]> wrote:
Alex, this does not work. Moreover, I dont think it is possible to support this.

I see that getResourceAsStream() should work. You can call it inside your job: getClass().getResourceAsStream(PATH) and it should get resource from remote node and return stream to you.

--Yakov

2015-06-29 13:46 GMT-07:00 Aleksei Valikov <[hidden email]>:
Hi,

I'd like to use the "Zero deployment" feature (https://apacheignite.readme.io/v1.1/docs/zero-deployment).

This works perfect for classes, but what I didn't manage to get working is a simple classpath resource loading, like:

getClass().getResource(scriptResourceFileName)

This gives me a valid URL on the local node but null on remote nodes.

Before I dig myself neck-deep - is it supposed to work? Compared to the distributed classloading, having the IGFS on board this seems to be fairly simple.
I could surely opt to IGFS. It just has a certain appeal to use classpath resources.

Thank you and best wishes,
Alexey