Hello!

1) Can you please elaborate? If you set this value in a cache store
factory, it will keep this boolean value and deserialize it when node is
started. I'm not entirely sure if Ignite will store cache store factory or
cache store instance in the persistent cache configuration. My expectation
it's the former, since cassandra data source is initialized dynamically.

2)
                                <property name="dataSource" ref="cassandra"/>
<-- the value of this reference is a distinct object on each node, it is
never replicated over the network nor taken from persistent cache
configuration.
I'm not sure if it's relevant to your use case, I'm just reminding you to
take care of its life cycle.

Does this change work for you?

Regards,
-- 
Ilya Kasnacheev


вт, 12 янв. 2021 г. в 06:30, xmw45688 <xw...@procurant.com>:

> Thanks for your recommendations!
> 1) The dynamicConfigurationReload is not able to reset once
> cacheStoreFactory is cached.  It means that cacheStoreFactory does not read
> this value unless cacheStoreFactory is first instantiated.  Do I miss
> something?  Which factory should I put dynamicConfigurationReload in the
> xml
> configuration file?
>
> 2) can you please elaborate more about your comments "the data source may
> come from local Spring context on each node.".
>
>
>         <bean class="org.apache.ignite.configuration.CacheConfiguration">
>                 <property name="name" value="Uom"/>
>                 <property name="atomicityMode" value="TRANSACTIONAL"/>
>                 <property name="cacheMode" value="REPLICATED"/>
>                 <property name="readThrough" value="true"/>
>                 <property name="writeThrough" value="false"/>
>                 <property name="sqlSchema" value="catalog"/>
>
>                 <property name="cacheStoreFactory">
>                         <bean
> class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
>
>                                 <property name="dynamicConfigurationReload"
> value ="true" />
>                                 <property name="dataSource"
> ref="cassandra"/>
>                                 <property name="persistenceSettingsBean"
> value="catalog_uom_persistence_settings"></property>
>                         </bean>
>                 </pro
>
>
> CassandraCacheStoreFactory changes
>
> private boolean dynamicConfigurationReload;
>
>     /**
>      * @return Persistence settings.
>      */
>     private KeyValuePersistenceSettings getPersistenceSettings() {
>
>               if (!isDynamicConfigurationReload() && 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;
>
>
>     }
>
>
>     public void setDynamicConfigurationReload(boolean
> dynamicConfigurationReload ) {
>         this.dynamicConfigurationReload = dynamicConfigurationReload;
>     }
>
>     public boolean isDynamicConfigurationReload() {
>         return dynamicConfigurationReload;
>     }
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Reply via email to