8
8
package com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.partitionedCache;
9
9
10
10
import com.oracle.coherence.common.base.Blocking;
11
+ import com.oracle.coherence.common.base.TimeHelper;
11
12
import com.oracle.coherence.persistence.PersistentStore;
12
13
import com.tangosol.coherence.component.net.Lease;
13
14
import com.tangosol.coherence.component.net.MemberSet;
@@ -736,6 +737,12 @@ public class Storage
736
737
737
738
private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
738
739
740
+ /**
741
+ * The maximum accepted value used in {#link {@link #scheduleEviction(long)}}.
742
+ * This equals {@link Long#MAX_VALUE} minus millis in one day
743
+ */
744
+ private static final long MAX_EXPIRY = Long.MAX_VALUE - TimeUnit.DAYS.toMillis(1);
745
+
739
746
// Static initializer
740
747
static
741
748
{
@@ -9065,15 +9072,12 @@ protected static void rethrow(Throwable e)
9065
9072
* Schedule to run the eviction task at specified expiry delay
9066
9073
* (cExpiryMillis) if no task is currently scheduled. Cancel the
9067
9074
* existing task and create a new one if new expiry time is sooner than
9068
- * previosely scheduled one.
9075
+ * previously scheduled one.
9069
9076
*
9070
9077
* @param cExpiryMillis expiry delay in millis
9071
9078
*/
9072
9079
public synchronized void scheduleEviction(long cExpiryMillis)
9073
9080
{
9074
- // import Component.Util.DaemonPool as com.tangosol.coherence.component.util.DaemonPool;
9075
- // import com.tangosol.util.Base;
9076
-
9077
9081
com.tangosol.coherence.component.util.DaemonPool pool = getService().getDaemonPool();
9078
9082
9079
9083
if (!pool.isStarted())
@@ -9091,7 +9095,22 @@ public synchronized void scheduleEviction(long cExpiryMillis)
9091
9095
}
9092
9096
9093
9097
long ldtOldNext = task.getEvictionTime();
9094
- long ldtNewNext = Base.getSafeTimeMillis() + cExpiryMillis;
9098
+ long ldtNow = TimeHelper.getSafeTimeMillis();
9099
+ long ldtMax = MAX_EXPIRY - ldtNow;
9100
+
9101
+ long ldtNewNext;
9102
+ long ldtSchedule;
9103
+
9104
+ if (cExpiryMillis < ldtMax)
9105
+ {
9106
+ ldtNewNext = ldtNow + cExpiryMillis;
9107
+ ldtSchedule = cExpiryMillis;
9108
+ }
9109
+ else
9110
+ {
9111
+ ldtNewNext = MAX_EXPIRY;
9112
+ ldtSchedule = MAX_EXPIRY - ldtNow;
9113
+ }
9095
9114
9096
9115
task.setPrune(cExpiryMillis == 0L);
9097
9116
0 commit comments