K - entry key typeV - entry value typepublic final class SecondsBasedEntryTaskScheduler<K,V> extends Object implements EntryTaskScheduler<K,V>
| Modifier and Type | Field and Description |
|---|---|
static double |
FACTOR |
| Modifier and Type | Method and Description |
|---|---|
ScheduledEntry<K,V> |
cancel(K key)
Cancel all scheduled executions with the given key.
|
void |
cancelAll()
Cancel all scheduled executions
|
int |
cancelIfExists(K key,
V value)
Cancels the scheduled executions for the given key and value if present.
|
ScheduledEntry<K,V> |
get(K key)
Return the entry for the scheduled key.
|
boolean |
isEmpty()
Returns
true if there are no scheduled entries. |
boolean |
schedule(long delayMillis,
K key,
V value)
Schedules (or reschedules) the execution of given entry.
|
String |
toString() |
public static final double FACTOR
ceilToSecond(long),
Constant Field Valuespublic boolean schedule(long delayMillis,
K key,
V value)
EntryTaskSchedulerScheduleType for possible behaviours in such case.schedule in interface EntryTaskScheduler<K,V>delayMillis - milliseconds to delay the execution.key - key of this scheduling.value - user object to pass back when it is time to execute.public ScheduledEntry<K,V> get(K key)
EntryTaskSchedulerget in interface EntryTaskScheduler<K,V>key - the scheduled keyScheduleType.FOR_EACH a random one will be returned,
or null if nothing was scheduled or everything already executed for this keypublic ScheduledEntry<K,V> cancel(K key)
EntryTaskSchedulercancel in interface EntryTaskScheduler<K,V>key - the scheduled keyScheduleType.FOR_EACH a random one will be returned,
or null if nothing was scheduled or everything already executed for this keypublic int cancelIfExists(K key, V value)
EntryTaskSchedulercancelIfExists in interface EntryTaskScheduler<K,V>key - the scheduled keyvalue - the scheduled valuepublic void cancelAll()
EntryTaskSchedulercancelAll in interface EntryTaskScheduler<K,V>public boolean isEmpty()
true if there are no scheduled entries.Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.