CacheStore and native persistence - mixed up

classic Classic list List threaded Threaded
2 messages Options
merysoft merysoft
Reply | Threaded
Open this post in threaded view
|

CacheStore and native persistence - mixed up

Hi,

 

I have successfully generated a project by the web console (Ignite 2.7) and started to use it from Java.

I’ve used the spring based server factory; were able to start the server, load data from the DB (MSSQL) in a controlled fashion using LoadCaches() – so that part is fine, I get data for approx 10 different caches / tables, even the total of approx 90M records if I want.

 

I have also successfully initialized Ignite Native persistence, so after using LoadCaches()with some different settings (having different directories set for the native persistence) I can ”play” with 1k or 90M records later on locally.

 

However, due to the mix-up of CacheStore and the datastorageConfiguration (for the persistence), I get this message for all of my caches:

”Both Ignite native persistence and CacheStore are configured for cache …”

 

My question: what would be right scenario to have the data loaded from DB and the one stored using native persistence be separated?

 

Of course if I do not configure the persistence, I will get no warning. So, in order to have access to the natively persisted data later on independently (and with no warnings), do I need to configure new caches configured only to N. P. store and copy (clone) the data from the cacheStore? Or is there any easier way?

 

IN other words, I would like to have a ”detached” server node, being the data loaded form the DB natively persisted, with indexes etc.; being able to start it without a warning later on, and the bext step would be to start updating it based using sources (nodes).

 

I am sorry, it might be trivial – but could not find a (simple) solution yet.

 

Thanks,

Laszlo


smime.p7s (7K) Download Attachment
Karun Chand Karun Chand
Reply | Threaded
Open this post in threaded view
|

Re: CacheStore and native persistence - mixed up

Hi Laszlo,

Going by the warning message you see - ”Both Ignite native persistence and CacheStore are configured for cache …”, what is probably happening is that you might have enabled native persistence and also provided a CacheConfiguration with a cache factory that can both read and write from an RDBMS. So Ignite gets confused where to store the data - the RDBMS or disk (native persistence). Which probably why you are seeing that error message. 

If I understand your question correctly, you want the data loaded from RDBMS and then stored natively on disk on your server nodes. Am I right? If that is what you want, you need to use a CacheLoadOnlyStoreAdapter which, as the name says, is used only for loading data and not storing data. You use that to load data from your database and then just enable native persistence in the configuration. You should then be good to go. Let me know if this helps you or if there is anything else you were looking for.


On Mon, Feb 11, 2019 at 4:44 AM Laszlo Merenyi <[hidden email]> wrote:

Hi,

 

I have successfully generated a project by the web console (Ignite 2.7) and started to use it from Java.

I’ve used the spring based server factory; were able to start the server, load data from the DB (MSSQL) in a controlled fashion using LoadCaches() – so that part is fine, I get data for approx 10 different caches / tables, even the total of approx 90M records if I want.

 

I have also successfully initialized Ignite Native persistence, so after using LoadCaches()with some different settings (having different directories set for the native persistence) I can ”play” with 1k or 90M records later on locally.

 

However, due to the mix-up of CacheStore and the datastorageConfiguration (for the persistence), I get this message for all of my caches:

”Both Ignite native persistence and CacheStore are configured for cache …”

 

My question: what would be right scenario to have the data loaded from DB and the one stored using native persistence be separated?

 

Of course if I do not configure the persistence, I will get no warning. So, in order to have access to the natively persisted data later on independently (and with no warnings), do I need to configure new caches configured only to N. P. store and copy (clone) the data from the cacheStore? Or is there any easier way?

 

IN other words, I would like to have a ”detached” server node, being the data loaded form the DB natively persisted, with indexes etc.; being able to start it without a warning later on, and the bext step would be to start updating it based using sources (nodes).

 

I am sorry, it might be trivial – but could not find a (simple) solution yet.

 

Thanks,

Laszlo