Hello!
This seems like a valid change, however, there are issues with it: if you
don't have persistence settings files on some nodes, it will cause failure
on these nodes. It may also re-read these files too eagerly in its current
form.
I can totally see how this may be an option to have in the Cassandra cache
store, e.g. dynamicConfigurationReload={true/false} Please note that you
also need to factor in Spring when updating data source life cycle = i.e.
the data source may come from local Spring context on each node.
Feel free to file a ticket and contribute.
Regards,
--
Ilya Kasnacheev
чт, 7 янв. 2021 г. в 05:48, xmw45688 <[email protected]>:
> Thanks for your clarifications, and appreciated your suggestions and
> guidance.
>
> My college and I went to ignite-cassandra module, commented two lines,
> */testing purpose/*, in
>
> org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory.getPersistenceSettings(),
> see the changes below. Removing these two lines is to force Ignite to read
> the configuration settings from the xml at runtime. It looks the change
> works and meets our requirement.
>
> I'm looking for the suggestions and recommendations from Ignite community
> and you, and wondering if we make these changes in Ignite repository. I
> think that it's very useful for our Ignite community.
>
> Similar changes should be applied to
>
> org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory.getDataSource()
>
>
> private KeyValuePersistenceSettings getPersistenceSettings() {
> // comment the two line below for testing purpose.
> // if (persistenceSettings != null)
> // return persistenceSettings;
>
> if (persistenceSettingsBean == null) {
> throw new IllegalStateException("Either persistence settings
> bean or persistence settings itself " +
> "should be specified");
> }
>
> if (appCtx == null) {
> throw new IllegalStateException("Failed to get Cassandra
> persistence settings cause Spring application " +
> "context wasn't injected into CassandraCacheStoreFactory");
> }
>
> Object obj = loadSpringContextBean(appCtx,
> persistenceSettingsBean);
>
> if (!(obj instanceof KeyValuePersistenceSettings)) {
> throw new IllegalStateException("Incorrect persistence settings
> bean '" +
> persistenceSettingsBean + "' specified");
> }
>
> return persistenceSettings = (KeyValuePersistenceSettings)obj;
> }
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>