Neron
Neron

Reputation: 1578

Coherence Flush Delay Setting

I want a cache that checks its own items if they are expired or not. My cache config is below:

<?xml version="1.0" encoding="UTF-8"?>
<cache-config>
    <caching-scheme-mapping>
        <cache-mapping>
            <cache-name>subscriberinfo</cache-name>
            <scheme-name>distributed-scheme</scheme-name>
        </cache-mapping>
    </caching-scheme-mapping>

    <caching-schemes>

        <distributed-scheme>
            <scheme-name>distributed-scheme</scheme-name>
            <lease-granularity>member</lease-granularity>
            <service-name>DistributedCache</service-name>
            <serializer>
                <instance>
                    <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                    <init-params>
                        <init-param>
                            <param-type>String</param-type>
                            <param-value>rbm-shovel-pof-config.xml</param-value>
                        </init-param>
                    </init-params>                
                </instance>    
            </serializer>  
            <backing-map-scheme>
                <local-scheme>
                    <unit-calculator>BINARY</unit-calculator>
                    <expiry-delay>24h</expiry-delay>
                    <flush-delay>180</flush-delay>
                </local-scheme>
            </backing-map-scheme>
            <autostart>true</autostart>
        </distributed-scheme>
    </caching-schemes>
</cache-config>

But the thing is, flush-delay can not be set. Any ideas?

Thanks

Upvotes: 1

Views: 2488

Answers (3)

cpurdy
cpurdy

Reputation: 1236

Coherence deprecated the FlushDelay and related settings in 3.5. All of that work is done automatically now:

  • Expired items are automatically removed, and the eviction / expiry events are raised accordingly

  • You will never see expired data in the cache; even if you try to access it just as it expires, the expiry will occur as an event before the data access occurs

  • Eviction (for memory limits) is now done asynchronously, so that the "sharp edges" of the side-effects of eviction (such as event storms) are spread out across natural cycles (with the cycle length calculated based on the estimated rate of eviction)

I hope that helps.

For the sake of full disclosure, I work at Oracle. The opinions and views expressed in this post are my own, and do not necessarily reflect the opinions or views of my employer.

Upvotes: 1

JLM
JLM

Reputation: 599

which version of Coherence do you use ?

In Coherence 3.7, the flush-delay has been removed from dtd as deprecated since version 3.5. Flushing is just active when inserting new objects (have a look at eviction-policy) or accessing expired objects (look at expiry-delay).

Upvotes: 1

Kumar225
Kumar225

Reputation: 227

But the thing is, flush-delay can not be set. Any ideas?

What do you mean by this? Does the system throw errors or the expired items not getting removed from cache. Based on the configuration you have, the entry should be removed from cache after 24hours and 180seconds since last update to the entry.

Upvotes: 0

Related Questions