Class ServerTaskBundleNode

java.lang.Object
org.jppf.server.protocol.ServerTaskBundleNode

public class ServerTaskBundleNode extends Object
Instances of this class group tasks for the same node channel together.
Author:
Martin JANDA
  • Constructor Summary

    Constructors
    Constructor
    Description
    ServerTaskBundleNode(ServerJob job, org.jppf.node.protocol.TaskBundle taskBundle, Collection<ServerTask> taskList)
    Initialize this task bundle and set its build number.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when this task bundle is cancelled.
    void
    Check the task count in this node bundle is equal to the one in its JPPFTaskBundle.
    boolean
     
    void
    Called when this task bundle should be resubmitted
    org.jppf.execute.ExecutorChannel<?>
    Get the channel to which the job is dispatched.
    Get the client job this submission is for
    org.jppf.io.DataLocation
    Get shared data provider for this task.
    long
     
    Get the future corresponding to the channel dispatch.
    long
    Get the unique id for this node bundle.
    org.jppf.node.protocol.TaskBundle
    Get the task bundle this node bundle is for.
    org.jppf.job.JobReturnReason
    Get the reason why the task results are reeived.
    Get the job this node bundle is a dispatch of.
    int
    Get the number of tasks in this node bundle.
    org.jppf.node.protocol.graph.TaskGraphInfo
    Get the dependencies of the tasks in this bundle.
    Get the tasks to be executed by the node.
    int
     
    boolean
    Get the cancelled indicator.
    boolean
    Get the expired indicator.
    boolean
    Get the offline node indicator.
    boolean
    Get the requeued indicator.
    void
    jobDispatched(org.jppf.execute.ExecutorChannel<?> channel, Future<?> future)
    Called when all or part of a job is dispatched to a node.
    static String
    makeKey(String jobUuid, long bundleId)
    Build a unique key for a node task bundle with the specified job uuid and node id.
    static String
    Build a unique key for the specified node task bundle.
    void
    Called when this task bundle should be resubmitted
    void
    Called to notify that throwable eventually raised while receiving the results.
    void
    resultsReceived(List<org.jppf.io.DataLocation> results)
    Called to notify that the results of a number of tasks have been received from the server.
    void
    setChannel(org.jppf.execute.ExecutorChannel<?> channel)
    Set the node channel onto this job dispatch.
    void
    setJobReturnReason(org.jppf.job.JobReturnReason jobReturnReason)
    Set the reason why the task results are reeived.
    void
    setOffline(boolean offline)
    Set the offline node indicator.
    void
    Called to notify that the execution of a task has completed.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ServerTaskBundleNode

      public ServerTaskBundleNode(ServerJob job, org.jppf.node.protocol.TaskBundle taskBundle, Collection<ServerTask> taskList)
      Initialize this task bundle and set its build number.
      Parameters:
      job - the job to execute.
      taskBundle - the job.
      taskList - the tasks to execute.
  • Method Details

    • getJob

      public org.jppf.node.protocol.TaskBundle getJob()
      Get the task bundle this node bundle is for.
      Returns:
      a TaskBundle instance.
    • getServerJob

      public ServerJob getServerJob()
      Get the job this node bundle is a dispatch of.
      Returns:
      a ServerJob instance.
    • getClientJob

      public ServerJob getClientJob()
      Get the client job this submission is for
      Returns:
      a ServerJob instance.
    • getDataProvider

      public org.jppf.io.DataLocation getDataProvider()
      Get shared data provider for this task.
      Returns:
      a DataProvider instance.
    • getTaskList

      public List<ServerTask> getTaskList()
      Get the tasks to be executed by the node.
      Returns:
      the tasks as a List of arrays of bytes.
    • setChannel

      public void setChannel(org.jppf.execute.ExecutorChannel<?> channel)
      Set the node channel onto this job dispatch.
      Parameters:
      channel - the node to which the job is dispatched.
    • jobDispatched

      public void jobDispatched(org.jppf.execute.ExecutorChannel<?> channel, Future<?> future)
      Called when all or part of a job is dispatched to a node.
      Parameters:
      channel - the node to which the job is dispatched.
      future - future assigned to bundle execution.
    • resultsReceived

      public void resultsReceived(List<org.jppf.io.DataLocation> results)
      Called to notify that the results of a number of tasks have been received from the server.
      Parameters:
      results - the list of tasks whose results have been received from the server.
    • resultsReceived

      public void resultsReceived(Throwable throwable)
      Called to notify that throwable eventually raised while receiving the results.
      Parameters:
      throwable - the throwable that was raised while receiving the results.
    • taskCompleted

      public void taskCompleted(Throwable exception)
      Called to notify that the execution of a task has completed.
      Parameters:
      exception - the Exception thrown during job execution or null.
    • resubmit

      public void resubmit()
      Called when this task bundle should be resubmitted
    • expire

      public void expire()
      Called when this task bundle should be resubmitted
    • isRequeued

      public boolean isRequeued()
      Get the requeued indicator.
      Returns:
      true if job is requeued, false otherwise.
    • cancel

      public void cancel()
      Called when this task bundle is cancelled.
    • isCancelled

      public boolean isCancelled()
      Get the cancelled indicator.
      Returns:
      true if job is cancelled, false otherwise.
    • isExpired

      public boolean isExpired()
      Get the expired indicator.
      Returns:
      true if job dispatch is expired, false otherwise.
    • getChannel

      public org.jppf.execute.ExecutorChannel<?> getChannel()
      Get the channel to which the job is dispatched.
      Returns:
      an ExecutorChannel instance.
    • getFuture

      public Future<?> getFuture()
      Get the future corresponding to the channel dispatch.
      Returns:
      a Future instance.
    • checkTaskCount

      public void checkTaskCount()
      Check the task count in this node bundle is equal to the one in its JPPFTaskBundle.
    • getTaskCount

      public int getTaskCount()
      Get the number of tasks in this node bundle.
      Returns:
      the number of tasks as an int.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getId

      public long getId()
      Get the unique id for this node bundle.
      Returns:
      the id as a long value.
    • makeKey

      public static String makeKey(ServerTaskBundleNode bundle)
      Build a unique key for the specified node task bundle.
      Parameters:
      bundle - a ServerTaskBundleNode instance.
      Returns:
      a unique key as a string.
    • makeKey

      public static String makeKey(String jobUuid, long bundleId)
      Build a unique key for a node task bundle with the specified job uuid and node id.
      Parameters:
      jobUuid - the uuid of the job to which the bundle belongs.
      bundleId - the id of the bundle.
      Returns:
      a unique key as a string.
    • getJobReturnReason

      public org.jppf.job.JobReturnReason getJobReturnReason()
      Get the reason why the task results are reeived.
      Returns:
      a JobReturnReason enum value.
    • setJobReturnReason

      public void setJobReturnReason(org.jppf.job.JobReturnReason jobReturnReason)
      Set the reason why the task results are reeived.
      Parameters:
      jobReturnReason - a JobReturnReason enum value.
    • isOffline

      public boolean isOffline()
      Get the offline node indicator.
      Returns:
      true if the corresponding node is offline, false otherwise.
    • setOffline

      public void setOffline(boolean offline)
      Set the offline node indicator.
      Parameters:
      offline - true if the corresponding node is offline, false otherwise.
    • getDispatchStartTime

      public long getDispatchStartTime()
      Returns:
      the time at which this dispatch started.
    • getTaskGraphInfo

      public org.jppf.node.protocol.graph.TaskGraphInfo getTaskGraphInfo()
      Get the dependencies of the tasks in this bundle.
      Returns:
      the list of dependencies.