Ignite's data expiry policy specifies the amount of time that must pass before considering an entry as expired. The expiration policies count the time from any of the following three events: creation time, last access time, and last modified time.
The following are the available expiry policies:
- AccessedExpiryPolicy: Defines the expiry duration of a cache entry based on the last time it was accessed. It doesn't consider the update time, only the creation and last access times are considered.
- CreatedExpiryPolicy: Defines the expiry duration of a cache entry based on when it was created.
- EternalExpiryPolicy: Specifies that cache entries won't expire.
- ModifiedExpiryPolicy: Defines the expiry duration of a cache entry based on the last time it was updated—create and update.
- TouchedExpiryPolicy: Defines the expiry duration of a cache entry based on when it was last created, updated, or accessed.
When an entry is expired, it is removed from the heap/Ignite native persistence storage/swap path. However, the third-party persistence store doesn't remove it.
You can find examples of the expiration policy in com.deploy.expire.ExpiryPolicyTest in the Chapter 7 code bundle.