You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Ariel Tubaltsev <tu...@gmail.com> on 2018/01/30 19:18:53 UTC
Get TTL of the specific (K,V) entry
Hi
I'm wondering if there is a way to get TTL of specific (K,V) entry,
something similar to Redis TTL:
https://redis.io/commands/ttl
Thank you
Ariel
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Get TTL of the specific (K,V) entry
Posted by vkulichenko <va...@gmail.com>.
Created a ticket for this improvement:
https://issues.apache.org/jira/browse/IGNITE-7641
-Val
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Get TTL of the specific (K,V) entry
Posted by Dmitry Pavlov <dp...@gmail.com>.
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 <
valentin.kulichenko@gmail.com>:
> 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 <tu...@gmail.com>
> 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/
>>
>
>
Re: Get TTL of the specific (K,V) entry
Posted by Dmitry Pavlov <dp...@gmail.com>.
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 <
valentin.kulichenko@gmail.com>:
> 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 <tu...@gmail.com>
> 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/
>>
>
>
Re: Get TTL of the specific (K,V) entry
Posted by Valentin Kulichenko <va...@gmail.com>.
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 <tu...@gmail.com>
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/
>
Re: Get TTL of the specific (K,V) entry
Posted by Valentin Kulichenko <va...@gmail.com>.
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 <tu...@gmail.com>
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/
>
Re: Get TTL of the specific (K,V) entry
Posted by Ariel Tubaltsev <tu...@gmail.com>.
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/
Re: Get TTL of the specific (K,V) entry
Posted by vkulichenko <va...@gmail.com>.
Ariel,
There is no way to do this with the current API. What is the use case for
this?
-Val
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/