You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by daniels <ra...@gmail.com> on 2017/08/11 12:49:31 UTC

PeerClassLoading example using cacheLoaders

 I use the caching of ignite with cacheLoaderFactories. And I met the
perrClassLoading problem.
I  want not   to copy that classes to all nodes. 
 Now i want not to use cacheLoaderFactories.What methods will you offer to
replace them so that there doesn't come the problem of peerclasLoading?

My cache creation looks like this

ignite.getOrCreateCache((CacheConfiguration<K, V>) new CacheConfiguration<>(
                cacheConfiguration).setName(cacheName)
                .setCacheLoaderFactory(factory)
                .setReadThrough(true)
                .setExpiryPolicyFactory(EternalExpiryPolicy.factoryOf()))




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/PeerClassLoading-example-using-cacheLoaders-tp16136.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: PeerClassLoading example using cacheLoaders

Posted by Razmik Mkrtchyan <ra...@gmail.com>.
Thank you, very much.

On Aug 14, 2017 22:22, "afedotov" <al...@gmail.com> wrote:

> Hi,
>
> You are right, *load* method is called when there is a miss in a cache.
> putIfAbsent is supported by IgniteCache out of the box. I'm afraid that
> there is no simple way to achieve what
> a CacheStore offers. With any other approach, you would have to sacrifice
> read/write-through behavior.
>
>
> Kind regards,
> Alex.
>
> On Sat, Aug 12, 2017 at 8:39 AM, daniels [via Apache Ignite Users] <[hidden
> email] <http:///user/SendEmail.jtp?type=node&node=16177&i=0>> wrote:
>
>> Thank you,very much.
>>
>> And one more question, The  load method  of cacheLoader is called when I
>> do get from cache with the key which does not exists. Isn't it?
>>
>>  Isnt it solution without passing chacheLoader   -I do get and if the key
>> is  absent ,do put that key in the cache,in other words do  putIfAbsent but
>>  in my code ?
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://apache-ignite-users.70518.x6.nabble.com/PeerClassLoad
>> ing-example-using-cacheLoaders-tp16136p16149.html
>> To start a new topic under Apache Ignite Users, email [hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=16177&i=1>
>> To unsubscribe from Apache Ignite Users, click here.
>> NAML
>> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
> ------------------------------
> View this message in context: Re: PeerClassLoading example using
> cacheLoaders
> <http://apache-ignite-users.70518.x6.nabble.com/PeerClassLoading-example-using-cacheLoaders-tp16136p16177.html>
> Sent from the Apache Ignite Users mailing list archive
> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>

Re: PeerClassLoading example using cacheLoaders

Posted by afedotov <al...@gmail.com>.
Hi,

You are right, *load* method is called when there is a miss in a cache.
putIfAbsent is supported by IgniteCache out of the box. I'm afraid that
there is no simple way to achieve what
a CacheStore offers. With any other approach, you would have to sacrifice
read/write-through behavior.


Kind regards,
Alex.

On Sat, Aug 12, 2017 at 8:39 AM, daniels [via Apache Ignite Users] <
ml+s70518n16149h53@n6.nabble.com> wrote:

> Thank you,very much.
>
> And one more question, The  load method  of cacheLoader is called when I
> do get from cache with the key which does not exists. Isn't it?
>
>  Isnt it solution without passing chacheLoader   -I do get and if the key
> is  absent ,do put that key in the cache,in other words do  putIfAbsent but
>  in my code ?
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/PeerClassLoading-example-
> using-cacheLoaders-tp16136p16149.html
> To start a new topic under Apache Ignite Users, email
> ml+s70518n1h65@n6.nabble.com
> To unsubscribe from Apache Ignite Users, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/PeerClassLoading-example-using-cacheLoaders-tp16136p16177.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: PeerClassLoading example using cacheLoaders

Posted by daniels <ra...@gmail.com>.
Thank you,very much.

And one more question, The  load method  of cacheLoader is called when I do
get from cache with the key which does not exists. Isn't it?
 
 Isnt it solution without passing chacheLoader   -I do get and if the key is 
absent ,do put that key in the cache,in other words do  putIfAbsent but  in
my code ?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/PeerClassLoading-example-using-cacheLoaders-tp16136p16149.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: PeerClassLoading example using cacheLoaders

Posted by vkulichenko <va...@gmail.com>.
If you have a custom implementation of CacheLoader, you need to deploy this
implementation on all nodes. I'm afraid, there is no workaround.

Note that Ignite provides CacheStore implementations for RDBMS [1] and
Cassandra [2] out of the box, so there is a chance that you don't need
custom one in the first place.

[1] https://apacheignite.readme.io/docs/3rd-party-store#cachejdbcpojostore
[2]
https://apacheignite.readme.io/docs/3rd-party-store#cassandra-cache-store

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/PeerClassLoading-example-using-cacheLoaders-tp16136p16145.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: PeerClassLoading example using cacheLoaders

Posted by daniels <ra...@gmail.com>.
Hi
I know it. I  dont want   to copy that classes to all nodes.Therefore I dont
want to use chackeLoaderFactories. I am searching other solution. Now I want
to remove loaders. How to organize my cache creation without loaders,but
keep the  logic in loaders,where to put that logic

Thank you






--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/PeerClassLoading-example-using-cacheLoaders-tp16136p16139.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: PeerClassLoading example using cacheLoaders

Posted by afedotov <al...@gmail.com>.
Hi,

Peer class loading works only for compute closures and tasks as described
here <https://apacheignite.readme.io/docs/zero-deployment>.
it's not applicable for configuration classes or cache entries, so you have
to copy that classes to all nodes.


Kind regards,
Alex.

On Fri, Aug 11, 2017 at 3:49 PM, daniels [via Apache Ignite Users] <
ml+s70518n16136h50@n6.nabble.com> wrote:

>  I use the caching of ignite with cacheLoaderFactories. And I met the
> perrClassLoading problem.
> I  want not   to copy that classes to all nodes.
>  Now i want not to use cacheLoaderFactories.What methods will you offer to
> replace them so that there doesn't come the problem of peerclasLoading?
>
> My cache creation looks like this
>
> ignite.getOrCreateCache((CacheConfiguration<K, V>) new
> CacheConfiguration<>(
>                 cacheConfiguration).setName(cacheName)
>                 .setCacheLoaderFactory(factory)
>                 .setReadThrough(true)
>                 .setExpiryPolicyFactory(EternalExpiryPolicy.factoryOf()))
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/PeerClassLoading-example-
> using-cacheLoaders-tp16136.html
> To start a new topic under Apache Ignite Users, email
> ml+s70518n1h65@n6.nabble.com
> To unsubscribe from Apache Ignite Users, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/PeerClassLoading-example-using-cacheLoaders-tp16136p16137.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.