Re: Get TTL of the specific (K,V) entry

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Get TTL of the specific (K,V) entry

Valentin Kulichenko
Cross-posting to dev.

Igniters,

This actually makes sense to me. Why don't we add IgniteCache#ttl(K key)
method that would return current TTL for the key? Looks like this is
already provided by GridCacheMapEntry#ttl() method, so we only need to
properly expose it to public API. Am I right?

If there are no objections, I will create a ticket for this improvement.

-Val

On Wed, Jan 31, 2018 at 9:28 AM, Ariel Tubaltsev <[hidden email]>
wrote:

> Hi Val
>
> Thank you for confirming this.
>
> The use case is to assure correctness of TTL refresh with regard to defined
> expiry policies and especially views, where different views can have
> different expiry policies.
> From what I saw in examples, to validate that TTL was refreshed, we wait
> for
> some period of time and check that entries have gone from the cache. Such
> kind of validation can be cumbersome for long (hours) TTL values.
>
> BR
> Ariel
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: Get TTL of the specific (K,V) entry

Dmitriy Pavlov
Hi,

Previously, in real applications, I needed such information about what is
the remaining lifetime for the object (at least for debug and monitoring).

So I am also +1 for providing such information in the API. Otherwise, user
have to duplicate this information in an entry field.

Sincerely,
Dmitriy Pavlov

ср, 31 янв. 2018 г. в 23:39, Valentin Kulichenko <
[hidden email]>:

> Cross-posting to dev.
>
> Igniters,
>
> This actually makes sense to me. Why don't we add IgniteCache#ttl(K key)
> method that would return current TTL for the key? Looks like this is
> already provided by GridCacheMapEntry#ttl() method, so we only need to
> properly expose it to public API. Am I right?
>
> If there are no objections, I will create a ticket for this improvement.
>
> -Val
>
> On Wed, Jan 31, 2018 at 9:28 AM, Ariel Tubaltsev <[hidden email]>
> wrote:
>
>> Hi Val
>>
>> Thank you for confirming this.
>>
>> The use case is to assure correctness of TTL refresh with regard to
>> defined
>> expiry policies and especially views, where different views can have
>> different expiry policies.
>> From what I saw in examples, to validate that TTL was refreshed, we wait
>> for
>> some period of time and check that entries have gone from the cache. Such
>> kind of validation can be cumbersome for long (hours) TTL values.
>>
>> BR
>> Ariel
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>
>