Hi,
You can create a cache template with expiry set:
<bean
class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="myExpiryTemplate*"/>
<property name="cacheMode" value="PARTITIONED" />
<property name="backups" value="1" />
<property name="expiryPolicyFactory">
<bean class="javax.cache.expiry.CreatedExpiryPolicy"
factory-method="factoryOf">
<constructor-arg>
<bean class="javax.cache.expiry.Duration">
<constructor-arg value="SECONDS"/>
<constructor-arg value="5"/>
</bean>
</constructor-arg>
</bean>
</property>
</bean>
then create a table referencing this template i.e.
CREATE TABLE PERSON (
ID INTEGER PRIMARY KEY,
NAME VARCHAR(100),
) WITH "template=myExpiryTemplate";
insert some data into that table, and it will disappear in 5 seconds.
more info:
expiry policy:
https://www.gridgain.com/docs/8.7.6/developers-guide/memory-architecture/expiry-policies
create table:
https://www.gridgain.com/docs/latest/sql-reference/ddl#create-table
cache template:
https://www.gridgain.com/docs/8.7.6/developers-guide/configuring-caches/configuration-overview#cache-templates
Thanks, Alex
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/