Class AsyncJobScheduler
java.lang.Object
org.jppf.utils.concurrent.ThreadSynchronization
org.jppf.server.nio.nodeserver.async.AsyncJobScheduler
- All Implemented Interfaces:
Runnable
public class AsyncJobScheduler
extends org.jppf.utils.concurrent.ThreadSynchronization
This class ensures that idle nodes get assigned pending tasks in the queue.
-
Field Summary
Fields inherited from class org.jppf.utils.concurrent.ThreadSynchronization
stopped -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIdleChannel(BaseNodeContext channel) Add a channel to the list of idle channels.Get the list of idle channels.org.jppf.load.balancer.JPPFContextGet the corresponding node's context information.static voidpreparePolicy(org.jppf.node.policy.ExecutionPolicy policy, ServerJob job, org.jppf.utils.stats.JPPFStatistics stats, int nbJobNodes) Set the parameters needed as bounded variables for scripted execution policies.voidremoveIdleChannelAsync(BaseNodeContext channel) Asynchronously remove a channel from the list of idle channels.voidrun()Perform the assignment of tasks.Methods inherited from class org.jppf.utils.concurrent.ThreadSynchronization
goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUp
-
Method Details
-
run
public void run()Perform the assignment of tasks. -
getJPPFContext
public org.jppf.load.balancer.JPPFContext getJPPFContext()Get the corresponding node's context information.- Returns:
- a
JPPFContextinstance.
-
addIdleChannel
Add a channel to the list of idle channels.- Parameters:
channel- the channel to add to the list.
-
removeIdleChannelAsync
Asynchronously remove a channel from the list of idle channels.- Parameters:
channel- the channel to remove from the list.
-
getIdleChannels
Get the list of idle channels.- Returns:
- a new copy of the underlying list of idle channels.
-
preparePolicy
public static void preparePolicy(org.jppf.node.policy.ExecutionPolicy policy, ServerJob job, org.jppf.utils.stats.JPPFStatistics stats, int nbJobNodes) Set the parameters needed as bounded variables for scripted execution policies.- Parameters:
policy- the root policy to explore.job- the job containing the sla and metadata.stats- the server statistics.nbJobNodes- the number of nodes the job is already dispatched to.
-