You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by xmw45688 <xw...@procurant.com> on 2020/12/16 01:29:30 UTC

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Thank you for your answer.  I'm able to load the data from Cassandra to
Ignite Cache stores using Cache.loadfull(....).  This works well for the use
cases where 3rd party persistence store is used first, then Ignite Native
Persistence store is used with 3rd party persistence together later.  

However, the configuration of 3rd party persistence store along with Ignite
Native Persistence store appears to be stored inside the Native Persistence
Store or somewhere, any changes in xml configuration will not propagate to
the 3rd party data store.  For example, adding a new column to an ignite
cache, the data for this newly added column is not saved in the 3rd party
persistence store when the data in is saved into the Ignite Native
Persistence Store.  In order to save the new added data for this new column,
the existing cache need be destroyed and created.  This works for caching
small sets of data.  It's probably not practically to destroy a cache with
huge data set and recreate the cache again. 

I don't know what I've missed, or this is by design.  If it's by design, I'd
like to request an enhance so that the configuration can be dynamically read
from xml file when the Ignite Native Persistence store is configured with a
3rd party store together. 





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

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

Looks overall correct.

Regards,
-- 
Ilya Kasnacheev


чт, 14 янв. 2021 г. в 11:43, xmw45688 <xw...@procurant.com>:

> 1) My testing shows that CassandraCacheStoreFactory is read from xml config
> once if the cache name does not exist in Ignite Persistence. It appears
> that
> CassandraCacheStoreFactory bean is persisted along with cache name in
> Ignite
> Persistence Store, CassandraCacheStoreFactory will not be re-instantiated.
> So I need to pre-decide dynamicConfigurationReload value. Modifying
> dynamicConfigurationReload value later won't take effect at dynamically.
>
> <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>
>                 </property>
> </bean>
>
> 2) Yes, the similar implementation is applied to data source.  Thanks for
> remaindering.
>
> 3) given dynamicConfigurationReload is only loaded once at very first time
> of creating cache, I'm thinking we don't use dynamicConfigurationReload,
> instead implement the following
> 3.1) read data source from the xml config file each time an Ignite server
> starts, if data source is not null, use the latest one, else use the
> existing one.
> 3.2) read persistenceSettingsBean from xml config file each time an Ignite
> server starts, if persistence settings are not null, use the latest one,
> else using the existing one.
> 3.3) obviously, this is aggressive.  But how many times do we start/restart
> an Ignite instance.  The performance impacts are minimal.
>
> if you think it's okay, I start implementing and testing.
> Let me know if you have any other suggestions/recommendations.
>
> Appreciated your help.
> Xinmin
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by xmw45688 <xw...@procurant.com>.
1) My testing shows that CassandraCacheStoreFactory is read from xml config
once if the cache name does not exist in Ignite Persistence. It appears that
CassandraCacheStoreFactory bean is persisted along with cache name in Ignite
Persistence Store, CassandraCacheStoreFactory will not be re-instantiated. 
So I need to pre-decide dynamicConfigurationReload value. Modifying
dynamicConfigurationReload value later won't take effect at dynamically.  

<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>
                </property>
</bean>      

2) Yes, the similar implementation is applied to data source.  Thanks for
remaindering.   

3) given dynamicConfigurationReload is only loaded once at very first time
of creating cache, I'm thinking we don't use dynamicConfigurationReload,
instead implement the following
3.1) read data source from the xml config file each time an Ignite server
starts, if data source is not null, use the latest one, else use the
existing one.
3.2) read persistenceSettingsBean from xml config file each time an Ignite
server starts, if persistence settings are not null, use the latest one,
else using the existing one.
3.3) obviously, this is aggressive.  But how many times do we start/restart
an Ignite instance.  The performance impacts are minimal.  

if you think it's okay, I start implementing and testing.  
Let me know if you have any other suggestions/recommendations.

Appreciated your help.
Xinmin




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

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by Ilya Kasnacheev <il...@gmail.com>.
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/
>

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by 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/

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by Ilya Kasnacheev <il...@gmail.com>.
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 <xw...@procurant.com>:

> 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/
>

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by xmw45688 <xw...@procurant.com>.
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/

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

Ignite will use existing cache configuration if cache is already present.
There's nothing you can do here. This includes the cache store.

However, the cache store may determine what to keep in its serialized form,
and what to re-read/infer every time it is started. So as I have said,
you may improve Cassandra cache store to track environment changes.

Regards,

-- 
Ilya Kasnacheev


вт, 5 янв. 2021 г. в 04:38, xmw45688 <xw...@procurant.com>:

> Hi Ilya,
>
> Thanks for your guidance and happy new year!  Sorry for late catchup.
>
> You are right, Ignite Native Persistence does track the changes in class
> definition for "Ignite Native Persistence".  But the configuration to load
> data from Cache to Cassandra store is stored in xml configuration file.
> This configuration xml file is passed at runtime (see the example
> configuration below). When ignite server is stopped, the cache
> configuration
> is gone, not stored in the any place as far as I understand.  When the
> Ignite is restarted, the new xml is passed, there is no previous
> configuration for the old class definition in the xml configuration.
>
> My question - how/where does the ignite server get/read the old class
> definition if this class definition is provided in the most recent xml
> config file?
>
> So what I said is that the Cassandra Store implementation may not need to
> change.  It's the call that reads the xml configuration and stores the data
> in Cassandra Store via Ignite Cache.   If I remove Ignite Native
> configuration ("persistenceEnabled" value="false"), then Ignite server uses
> the xml configuration file passed at runtime.  The Ignite Cache has all new
> class definiton.
>
> I'd like your help to guide me make the changes to read the xml
> configuration at runtime instead of reading the previously cached
> configuration.
>
>
>     <bean id="catalog_uom_persistence_settings"
>
> class="org.apache.ignite.cache.store.cassandra.persistence.KeyValuePersistenceSettings">
>         <constructor-arg type="java.lang.String">
>             <value>
>             </value>
>         </constructor-arg>
>     </bean>
>
>         <bean
> class="org.apache.ignite.configuration.DataStorageConfiguration">
>
>                 <property name="defaultDataRegionConfiguration">
>                         <bean
> class="org.apache.ignite.configuration.DataRegionConfiguration">
>                                 <property name="name"
> value="Default_Region"/>
>                                 <property name="initialSize" value="#{10L
> * 1024 * 1024}"/>
>
>                                 <property name="maxSize" value="#{2L *
> 1024 * 1024 * 1024}"/>
>
>
>                                 <property name="persistenceEnabled"
> value="true"/>
>                         </bean>
>                 </property>
>         </bean>
>
>         <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="indexedTypes">
>                         <list>
>                                 <value
> type="java.lang.Class">java.lang.String</value>
>                                 <value
> type="java.lang.Class">com.procurant.catalog.entity.Uom</value>
>                         </list>
>                 </property>
>                 <property name="cacheStoreFactory">
>                         <bean
> class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
>                                 <property name="dataSource"
> ref="cassandra"/>
>                                 <property name="persistenceSettingsBean"
> value="catalog_uom_persistence_settings"></property>
>                         </bean>
>                 </property>
>         </bean>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by xmw45688 <xw...@procurant.com>.
Hi Ilya,

Thanks for your guidance and happy new year!  Sorry for late catchup. 

You are right, Ignite Native Persistence does track the changes in class
definition for "Ignite Native Persistence".  But the configuration to load
data from Cache to Cassandra store is stored in xml configuration file. 
This configuration xml file is passed at runtime (see the example
configuration below). When ignite server is stopped, the cache configuration
is gone, not stored in the any place as far as I understand.  When the
Ignite is restarted, the new xml is passed, there is no previous
configuration for the old class definition in the xml configuration.  

My question - how/where does the ignite server get/read the old class
definition if this class definition is provided in the most recent xml
config file? 

So what I said is that the Cassandra Store implementation may not need to
change.  It's the call that reads the xml configuration and stores the data
in Cassandra Store via Ignite Cache.   If I remove Ignite Native
configuration ("persistenceEnabled" value="false"), then Ignite server uses
the xml configuration file passed at runtime.  The Ignite Cache has all new
class definiton. 

I'd like your help to guide me make the changes to read the xml
configuration at runtime instead of reading the previously cached
configuration.


    <bean id="catalog_uom_persistence_settings"
class="org.apache.ignite.cache.store.cassandra.persistence.KeyValuePersistenceSettings">
        <constructor-arg type="java.lang.String">
            <value>
            </value>
        </constructor-arg>
    </bean>

	<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
			   
		<property name="defaultDataRegionConfiguration">
			<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
				<property name="name" value="Default_Region"/>
				<property name="initialSize" value="#{10L * 1024 * 1024}"/>
				
				<property name="maxSize" value="#{2L * 1024 * 1024 * 1024}"/>
				
				
				<property name="persistenceEnabled" value="true"/>
			</bean>
		</property>                
	</bean>

	<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="indexedTypes">
			<list>
				<value type="java.lang.Class">java.lang.String</value>
				<value type="java.lang.Class">com.procurant.catalog.entity.Uom</value>
			</list>
		</property>
		<property name="cacheStoreFactory">
			<bean
class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
				<property name="dataSource" ref="cassandra"/>
				<property name="persistenceSettingsBean" 
value="catalog_uom_persistence_settings"></property>
			</bean>
		</property>
	</bean>



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

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

Why do you think that change should be on Ignite Persistence side? You said
yourself that Ignite Persistence tracks the changes in class definition,
it's the Cassandra store that does not.

Regards,
-- 
Ilya Kasnacheev


ср, 23 дек. 2020 г. в 00:17, xmw45688 <xw...@procurant.com>:

> Thanks for your suggestion, Ilya.  Can you give me a reference to override
> default Cassandra Store implementation?  I thought that the changes would
> be
> on Ignite Persistence side because caching data from standalone Cassandra
> store (with Ignite Persistence) did read configuration including class
> definition from the xml file.
>
> Regards,
> Xinmin
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by xmw45688 <xw...@procurant.com>.
Thanks for your suggestion, Ilya.  Can you give me a reference to override
default Cassandra Store implementation?  I thought that the changes would be
on Ignite Persistence side because caching data from standalone Cassandra
store (with Ignite Persistence) did read configuration including class
definition from the xml file. 

Regards,
Xinmin   



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

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

I think that maybe you could try coding such a cache store which will
update this information. It's just that the default Cassandra store doesn't
seem to.

Regards,
-- 
Ilya Kasnacheev


сб, 19 дек. 2020 г. в 05:17, xmw45688 <xw...@procurant.com>:

> Thanks for your confirmation, Ilya.
>
> I do have a follow-up question for you.
> When Ignite Persistence is used together with Cassandra.  The caches for
> Cassandra table mappings are provided via xml file.  The java class for the
> mappings is for BOTH Ignite Persistence and Cassandra cache store.  When a
> table is changed, the mapping class gets changed, and the cluster is
> started. Why is Ignite Persistence able to use this updated java class
> (added/removed variables from the class) to insert/update data into Ignite
> Persistence stores.  But for Cassandra Store, it appears to use the old
> definition of class.  For this case, what's effort if we want to use the
> new
> class of definition?  Do you think that it's reasonable to read the cache
> configuration (i.e. via xml) dynamically for 3rd party Cache store which
> does if the 3rd party store is used along.  I'm not an expert in java, I
> can
> definitely help (or find a resource to do it) to improve this request.
>
> Pleas let me know if I can submit a feature request.
>
> Appreciate your help.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by xmw45688 <xw...@procurant.com>.
Thanks for your confirmation, Ilya.  

I do have a follow-up question for you. 
When Ignite Persistence is used together with Cassandra.  The caches for
Cassandra table mappings are provided via xml file.  The java class for the
mappings is for BOTH Ignite Persistence and Cassandra cache store.  When a
table is changed, the mapping class gets changed, and the cluster is
started. Why is Ignite Persistence able to use this updated java class
(added/removed variables from the class) to insert/update data into Ignite
Persistence stores.  But for Cassandra Store, it appears to use the old
definition of class.  For this case, what's effort if we want to use the new
class of definition?  Do you think that it's reasonable to read the cache
configuration (i.e. via xml) dynamically for 3rd party Cache store which
does if the 3rd party store is used along.  I'm not an expert in java, I can
definitely help (or find a resource to do it) to improve this request.  

Pleas let me know if I can submit a feature request. 

Appreciate your help.  



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

Re: not able to change keyspace name when Using 3rd Party Persistence (Cassandra) Together with Ignite Native Persistence

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

This is currently by design that cache configuration, of which cache store
configuration is a part, cannot be changed after the cache is started.

Regards,
-- 
Ilya Kasnacheev


ср, 16 дек. 2020 г. в 04:29, xmw45688 <xw...@procurant.com>:

> Thank you for your answer.  I'm able to load the data from Cassandra to
> Ignite Cache stores using Cache.loadfull(....).  This works well for the
> use
> cases where 3rd party persistence store is used first, then Ignite Native
> Persistence store is used with 3rd party persistence together later.
>
> However, the configuration of 3rd party persistence store along with Ignite
> Native Persistence store appears to be stored inside the Native Persistence
> Store or somewhere, any changes in xml configuration will not propagate to
> the 3rd party data store.  For example, adding a new column to an ignite
> cache, the data for this newly added column is not saved in the 3rd party
> persistence store when the data in is saved into the Ignite Native
> Persistence Store.  In order to save the new added data for this new
> column,
> the existing cache need be destroyed and created.  This works for caching
> small sets of data.  It's probably not practically to destroy a cache with
> huge data set and recreate the cache again.
>
> I don't know what I've missed, or this is by design.  If it's by design,
> I'd
> like to request an enhance so that the configuration can be dynamically
> read
> from xml file when the Ignite Native Persistence store is configured with a
> 3rd party store together.
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>