public class TaskScheduler extends Object implements org.everit.cluster.invalidationmap.InvalidationMapConfiguration
InvalidationMapCluster.| Constructor and Description |
|---|
TaskScheduler(NodeRegistry nodeRegistry,
org.everit.cluster.invalidationmap.MapInvalidator invalidator,
PingSender pingSender)
Creates the task scheduler.
|
| Modifier and Type | Method and Description |
|---|---|
Runnable |
createInvalidateAfterNodeCrashTask(String nodeName)
Creates the task that performs the local map invalidation.
|
Runnable |
createMessageOrderCheckTask(String nodeName,
long lastPing)
Creates the task that checks whether the got message numbers is in order.
|
Runnable |
createPingSenderTask()
Creates the task that sends a ping message to the members of the cluster.
|
long |
getInvalidateAfterNodeCrashDelay() |
long |
getMessageOrderCheckDelay() |
long |
getPingPeriod() |
void |
scheduleInvalidateOnNodeCrash(String nodeName,
boolean reSchedule)
Schedules the local invalidate on node crash task.
|
void |
scheduleMessageOrderCheck(String nodeName,
long lastPingMessageNumber)
Schedules the message order check task on the node, if previous scheduled task is not executed.
|
void |
schedulePingSender()
Schedules or reschedules the ping sender task.
|
void |
setInvalidateAfterNodeCrashDelay(long invalidateAfterNodeCrashDelay) |
void |
setMessageOrderCheckDelay(long messageOrderCheckDelay) |
void |
setPingPeriod(long period) |
void |
shutdown()
Shutdowns the scheduler.
|
public TaskScheduler(NodeRegistry nodeRegistry, org.everit.cluster.invalidationmap.MapInvalidator invalidator, PingSender pingSender)
nodeRegistry - The node registry.invalidator - The map invalidator.pingSender - The ping sender.public Runnable createInvalidateAfterNodeCrashTask(String nodeName)
nodeName - The name of the node crashed.scheduleInvalidateOnNodeCrash(String, boolean)public Runnable createMessageOrderCheckTask(String nodeName, long lastPing)
nodeName - The name of a suspected node.lastPing - The last ping message number.scheduleMessageOrderCheck(String, long)public Runnable createPingSenderTask()
schedulePingSender()public long getInvalidateAfterNodeCrashDelay()
getInvalidateAfterNodeCrashDelay in interface org.everit.cluster.invalidationmap.InvalidationMapConfigurationpublic long getMessageOrderCheckDelay()
getMessageOrderCheckDelay in interface org.everit.cluster.invalidationmap.InvalidationMapConfigurationpublic long getPingPeriod()
getPingPeriod in interface org.everit.cluster.invalidationmap.InvalidationMapConfigurationpublic void scheduleInvalidateOnNodeCrash(String nodeName, boolean reSchedule)
nodeName - The name of the node on the task will be invoked.reSchedule - Schedules the task if necessary and set to true, cancels the task if
necessary and set to falseInvalidationMapTaskFactory#createInvalidateAfterNodeCrashTask(String)public void scheduleMessageOrderCheck(String nodeName, long lastPingMessageNumber)
nodeName - The name of the node on the message order check will be scheduled.lastPingMessageNumber - The message number of the last ping.InvalidationMapTaskFactory#createMessageOrderCheckTask(String, long)public void schedulePingSender()
InvalidationMapTaskFactory#createPingSenderTask()public void setInvalidateAfterNodeCrashDelay(long invalidateAfterNodeCrashDelay)
setInvalidateAfterNodeCrashDelay in interface org.everit.cluster.invalidationmap.InvalidationMapConfigurationpublic void setMessageOrderCheckDelay(long messageOrderCheckDelay)
setMessageOrderCheckDelay in interface org.everit.cluster.invalidationmap.InvalidationMapConfigurationpublic void setPingPeriod(long period)
setPingPeriod in interface org.everit.cluster.invalidationmap.InvalidationMapConfigurationpublic void shutdown()
Copyright © 2011–2018 Everit Kft.. All rights reserved.