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 Type
    Method
    Description
    void
    Add a channel to the list of idle channels.
    Get the list of idle channels.
    org.jppf.load.balancer.JPPFContext
    Get the corresponding node's context information.
    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.
    void
    Asynchronously remove a channel from the list of idle channels.
    void
    run()
    Perform the assignment of tasks.

    Methods inherited from class org.jppf.utils.concurrent.ThreadSynchronization

    goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUp

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 JPPFContext instance.
    • addIdleChannel

      public void addIdleChannel(BaseNodeContext channel)
      Add a channel to the list of idle channels.
      Parameters:
      channel - the channel to add to the list.
    • removeIdleChannelAsync

      public void removeIdleChannelAsync(BaseNodeContext channel)
      Asynchronously remove a channel from the list of idle channels.
      Parameters:
      channel - the channel to remove from the list.
    • getIdleChannels

      public List<BaseNodeContext> 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.