|
|
||
|---|---|---|
| .. | ||
| src | ||
| README.md | ||
| pom.xml | ||
README.md
Expiration and Eviction Example
In this example we will show you ways to automatically remove data from your region. There are two ways to do this; Expiration and Eviction.
- Expiration removes data after it has existed for a certain amount of time or after it has been unused for a certain amount of time. There are multiple ways to configure Expiration that will be shown in this example.
- Configure an eviction policy on the region using the
@EnableExpirationand@ExpirationPolicyannotations. - Configure a custom eviction policy to extending
CustomExpiry. - Entity defined expiration using the
@IdleTimeoutExpirationand@TimeToLiveExpirationannotations.
- Configure an eviction policy on the region using the
Entity defined expiration has its own test class because it has a lower priority and is trumped by the expiration policy defined on the @EnableExpiration annotation. The polices defined on the @EnableExpiration annotation can be found in ExpirationPolicyConfig.
NOTE: Inorder to see output, you must change the loglevel from "error" to "info" in the logback.xml file located under src/test/resources.