Ignite.cache.loadcache.Does this method do Increamental Load?

classic Classic list List threaded Threaded
6 messages Options
nithin91 nithin91
Reply | Threaded
Open this post in threaded view
|

Ignite.cache.loadcache.Does this method do Increamental Load?

Hi

I am trying to load the data into ignite cache using JDBC Pojo Store method
ignite.cache("cacheName").loadCache(null).I have used this method and got
the following results for the following scenarios.

*Scenario-1:Trying to load the same key which is available in cache*

In this case, the value part corresponding to the key is not updated in the
cache based on the latest available record.

*Scenario -2:When loading a key which is not present in cache.*

in this case, it is appending the new key and value pair to the cache and
preserving the old data.


But my doubt is why in scenario-1, it is not  updating the value
corresponding to the when i am  trying to load the same key.

Does this method do incremental load?.
Is this the expected behavior or do i need to set any additional property in
the bean file.Attaching you the bean configuration of the cache.

cache.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/t2737/cache.xml>  









--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
aealexsandrov aealexsandrov
Reply | Threaded
Open this post in threaded view
|

Re: Ignite.cache.loadcache.Does this method do Increamental Load?

Hi,

loadCache - will load all the keys and values from third party store
into Ignite. It can be used for initial loading and for restore of the
Ignite cache.

There are no incremental updates.

In case if you are going to do updates in the third party store not
using Ignite API then you also should do the same for Ignite.

However, you can use read-through and write-through properties. They can
help you to make your updates in 3-rd party store using Ignite API:

https://apacheignite.readme.io/docs/3rd-party-store#section-read-through-and-write-through

BR,
Andrei

3/23/2020 9:34 PM, nithin91 пишет:

> Hi
>
> I am trying to load the data into ignite cache using JDBC Pojo Store method
> ignite.cache("cacheName").loadCache(null).I have used this method and got
> the following results for the following scenarios.
>
> *Scenario-1:Trying to load the same key which is available in cache*
>
> In this case, the value part corresponding to the key is not updated in the
> cache based on the latest available record.
>
> *Scenario -2:When loading a key which is not present in cache.*
>
> in this case, it is appending the new key and value pair to the cache and
> preserving the old data.
>
>
> But my doubt is why in scenario-1, it is not  updating the value
> corresponding to the when i am  trying to load the same key.
>
> Does this method do incremental load?.
> Is this the expected behavior or do i need to set any additional property in
> the bean file.Attaching you the bean configuration of the cache.
>
> cache.xml
> <http://apache-ignite-users.70518.x6.nabble.com/file/t2737/cache.xml>
>
>
>
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Ignite.cache.loadcache.Does this method do Increamental Load?

In reply to this post by nithin91
Hello!

Yes, LoadCache will not overwrite keys with existing values.

Regards,
--
Ilya Kasnacheev


пн, 23 мар. 2020 г. в 21:35, nithin91 <[hidden email]>:
Hi

I am trying to load the data into ignite cache using JDBC Pojo Store method
ignite.cache("cacheName").loadCache(null).I have used this method and got
the following results for the following scenarios.

*Scenario-1:Trying to load the same key which is available in cache*

In this case, the value part corresponding to the key is not updated in the
cache based on the latest available record.

*Scenario -2:When loading a key which is not present in cache.*

in this case, it is appending the new key and value pair to the cache and
preserving the old data.


But my doubt is why in scenario-1, it is not  updating the value
corresponding to the when i am  trying to load the same key.

Does this method do incremental load?.
Is this the expected behavior or do i need to set any additional property in
the bean file.Attaching you the bean configuration of the cache.

cache.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/t2737/cache.xml









--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
nithin91 nithin91
Reply | Threaded
Open this post in threaded view
|

Re: Ignite.cache.loadcache.Does this method do Increamental Load?

Then what is the best way to do perform incremental load.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Ignite.cache.loadcache.Does this method do Increamental Load?

Hello!

You can use Data Streamer with allowOverride flag set can do incremental load with keys replacement. Load cache is tailored for initial loading only.

Of course, you will have to write your own code around Data Streamer.

Regards,
--
Ilya Kasnacheev


пт, 15 мая 2020 г. в 18:53, nithin91 <[hidden email]>:
Then what is the best way to do perform incremental load.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
nithin91 nithin91
Reply | Threaded
Open this post in threaded view
|

Re: Ignite.cache.loadcache.Does this method do Increamental Load?

Thanks for the inputs.It is really helpful.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/