How to use different ExpiryPolicy for different keys on the same cache?

classic Classic list List threaded Threaded
5 messages Options
李玉珏@163 李玉珏@163
Reply | Threaded
Open this post in threaded view
|

How to use different ExpiryPolicy for different keys on the same cache?

Hi,

How to use different ExpiryPolicy for different keys on the same cache?

Alexandr Shapkin Alexandr Shapkin
Reply | Threaded
Open this post in threaded view
|

Re: How to use different ExpiryPolicy for different keys on the same cache?

You can use withExpiryPolicy method to create different cache instances.

Something like
ignite.cache(name).withExpiryPolicy(plc1)
ignite.cache(name).withExpiryPolicy(plc2)


On Sat, Oct 19, 2019, 15:51 李玉珏@163 <[hidden email]> wrote:
Hi,

How to use different ExpiryPolicy for different keys on the same cache?

Alex Shapkin
李玉珏@163 李玉珏@163
Reply | Threaded
Open this post in threaded view
|

Re: How to use different ExpiryPolicy for different keys on the same cache?

Hi,

On the following page:

https://apacheignite-net.readme.io/docs/expiry-policies

It seems that the document is wrong?
在 2019/10/19 下午9:24, Aleksandr Shapkin 写道:
You can use withExpiryPolicy method to create different cache instances.

Something like
ignite.cache(name).withExpiryPolicy(plc1)
ignite.cache(name).withExpiryPolicy(plc2)


On Sat, Oct 19, 2019, 15:51 李玉珏@163 <[hidden email]> wrote:
Hi,

How to use different ExpiryPolicy for different keys on the same cache?

Evgeniy Rudenko Evgeniy Rudenko
Reply | Threaded
Open this post in threaded view
|

Re: How to use different ExpiryPolicy for different keys on the same cache?

Doc is correct. Each ExpiryPolicy contains 3 methods that define it's behaviour based on used operation:
getExpiryForCreation()
getExpiryForAccess()
getExpiryForUpdate()

On Sun, Oct 20, 2019 at 3:20 AM 李玉珏@163 <[hidden email]> wrote:

Hi,

On the following page:

https://apacheignite-net.readme.io/docs/expiry-policies

It seems that the document is wrong?
在 2019/10/19 下午9:24, Aleksandr Shapkin 写道:
You can use withExpiryPolicy method to create different cache instances.

Something like
ignite.cache(name).withExpiryPolicy(plc1)
ignite.cache(name).withExpiryPolicy(plc2)


On Sat, Oct 19, 2019, 15:51 李玉珏@163 <[hidden email]> wrote:
Hi,

How to use different ExpiryPolicy for different keys on the same cache?



--
Best regards,
Evgeniy
李玉珏@163 李玉珏@163
Reply | Threaded
Open this post in threaded view
|

Re: How to use different ExpiryPolicy for different keys on the same cache?

Oh, I see. Thank you.

在 2019/10/21 下午4:30, Evgeniy Rudenko 写道:
Doc is correct. Each ExpiryPolicy contains 3 methods that define it's behaviour based on used operation:
getExpiryForCreation()
getExpiryForAccess()
getExpiryForUpdate()

On Sun, Oct 20, 2019 at 3:20 AM 李玉珏@163 <[hidden email]> wrote:

Hi,

On the following page:

https://apacheignite-net.readme.io/docs/expiry-policies

It seems that the document is wrong?
在 2019/10/19 下午9:24, Aleksandr Shapkin 写道:
You can use withExpiryPolicy method to create different cache instances.

Something like
ignite.cache(name).withExpiryPolicy(plc1)
ignite.cache(name).withExpiryPolicy(plc2)


On Sat, Oct 19, 2019, 15:51 李玉珏@163 <[hidden email]> wrote:
Hi,

How to use different ExpiryPolicy for different keys on the same cache?



--
Best regards,
Evgeniy