On Sat, 2013-02-02 at 12:15 +0530, Asankha C. Perera wrote:
> Hi All
>
> The PoolEntry class defines its valid time with the variable "validUnit"
> which I believe should be corrected to "validUntil" ? More, importantly,
> when updating an entry I think the following method should take the
> Math.max of the new expiry time and current validUntil time.. Is that
> correct?
>
> thanks
> asankha
>
> public synchronized void updateExpiry(final long time, final TimeUnit
> tunit) {
> Args.notNull(tunit, "Time unit");
> this.updated = System.currentTimeMillis();
> long newExpiry;
> if (time > 0) {
> newExpiry = this.updated + tunit.toMillis(time);
> } else {
> newExpiry = Long.MAX_VALUE;
> }
> this.expiry = Math.min(newExpiry, this.validUnit);
> }
>
Hi Asankha
Let's say a pool entry is created at 10:00 with the total time to live
of 10 minutes. The validUntil value is set to 10:10. Let's say at 10:05
#updateExpiry takes 10 minutes as input thus making newExpiry equal to
10:15. Should not validUntil still apply and take precedence over
newExpiry?
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]