You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Mahesh Renduchintala <ma...@aline-consulting.com> on 2020/02/29 02:31:55 UTC

Cache ExpirationPolicy

Hi

I have a cache template marked as below in the defaul_config.xml.
I was expecting that table created as such would automatically get deleted from off-heap and backup.
This is because of the expiration policy set as below


However, I observe that these tables are not getting deleted? What am I doing wrong?




        <bean id="cache-template-bean" class="org.apache.ignite.configuration.CacheConfiguration">
            <property name="name" value="SQLTABLE_CACHE_TEMPLATE_TEMP*"/>
            <property name="cacheMode" value="PARTITIONED"/>
            <property name="backups" value="0"/>
            <property name="atomicityMode" value="TRANSACTIONAL"/>
            <property name="writeSynchronizationMode" value="PRIMARY_SYNC"/>
            <property name="statisticsEnabled" value="true"/>
            <property name="defaultLockTimeout" value="5000"/>
            <property name="readFromBackup" value="true"/>
            <property name="rebalanceBatchSize" value="#{4 * 1024 * 1024}"/>
            <property name="expiryPolicyFactory">
                <bean class="javax.cache.expiry.CreatedExpiryPolicy" factory-method="factoryOf">
                    <constructor-arg>
                        <bean class="javax.cache.expiry.Duration">
                            <constructor-arg value="DAYS"/>
                            <constructor-arg value="2"/>
                        </bean>
                    </constructor-arg>
                </bean>
            </property>
            <property name="nodeFilter">
                <bean class="org.apache.ignite.util.AttributeNodeFilter">
                    <constructor-arg>
                        <map>
                            <entry key="ROLE" value="data.compute"/>
                        </map>
                    </constructor-arg>
                </bean>
            </property>
        </bean>
    </list>
</property>


Re: Cache ExpirationPolicy

Posted by Mikael <mi...@telia.com>.
Hi!

Are you talking about the contents of the cache or the cache itself ? 
Ignite does not delete the cache, just the entries.



Den 2020-02-29 kl. 03:31, skrev Mahesh Renduchintala:
> Hi
>
> I have a cache template marked as below in the defaul_config.xml.
> I was expecting that table created as such would automatically get 
> deleted from off-heap and backup.
> This is because of the expiration policy set as below
>
>
> However, I observe that these tables are not getting deleted? What am 
> I doing wrong?
>
>
>
>          <bean id="cache-template-bean" 
> class="org.apache.ignite.configuration.CacheConfiguration">
>              <property name="name" value="SQLTABLE_CACHE_TEMPLATE_TEMP*"/>
>              <property name="cacheMode" value="PARTITIONED"/>
>              <property name="backups" value="0"/>
>              <property name="atomicityMode" value="TRANSACTIONAL"/>
>              <property name="writeSynchronizationMode" value="PRIMARY_SYNC"/>
>              <property name="statisticsEnabled" value="true"/>
>              <property name="defaultLockTimeout" value="5000"/>
>              <property name="readFromBackup" value="true"/>
>              <property name="rebalanceBatchSize" value="#{4 * 1024 * 1024}"/>
> <property name="expiryPolicyFactory">
> <bean class="javax.cache.expiry.CreatedExpiryPolicy" 
> factory-method="factoryOf">
> <constructor-arg>
> <bean class="javax.cache.expiry.Duration">
> <constructor-arg value="DAYS"/>
> <constructor-arg value="2"/>
> </bean>
> </constructor-arg>
> </bean>
> </property>
>              <property name="nodeFilter">
>                  <bean class="org.apache.ignite.util.AttributeNodeFilter">
>                      <constructor-arg>
>                          <map>
>                              <entry key="ROLE" value="data.compute"/>
>                          </map>
>                      </constructor-arg>
>                  </bean>
>              </property>
>          </bean>
>      </list>
> </property>
>