Package org.jppf.server.protocol
Class ServerTaskBundleNode
java.lang.Object
org.jppf.server.protocol.ServerTaskBundleNode
Instances of this class group tasks for the same node channel together.
- Author:
- Martin JANDA
-
Constructor Summary
ConstructorsConstructorDescriptionServerTaskBundleNode(ServerJob job, org.jppf.node.protocol.TaskBundle taskBundle, Collection<ServerTask> taskList) Initialize this task bundle and set its build number. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Called when this task bundle is cancelled.voidCheck the task count in this node bundle is equal to the one in itsJPPFTaskBundle.booleanvoidexpire()Called when this task bundle should be resubmittedorg.jppf.execute.ExecutorChannel<?>Get the channel to which the job is dispatched.Get the client job this submission is fororg.jppf.io.DataLocationGet shared data provider for this task.longFuture<?>Get the future corresponding to the channel dispatch.longgetId()Get the unique id for this node bundle.org.jppf.node.protocol.TaskBundlegetJob()Get the task bundle this node bundle is for.org.jppf.job.JobReturnReasonGet the reason why the task results are reeived.Get the job this node bundle is a dispatch of.intGet the number of tasks in this node bundle.org.jppf.node.protocol.graph.TaskGraphInfoGet the dependencies of the tasks in this bundle.Get the tasks to be executed by the node.inthashCode()booleanGet the cancelled indicator.booleanGet the expired indicator.booleanGet the offline node indicator.booleanGet the requeued indicator.voidjobDispatched(org.jppf.execute.ExecutorChannel<?> channel, Future<?> future) Called when all or part of a job is dispatched to a node.static StringBuild a unique key for a node task bundle with the specified job uuid and node id.static StringmakeKey(ServerTaskBundleNode bundle) Build a unique key for the specified node task bundle.voidresubmit()Called when this task bundle should be resubmittedvoidresultsReceived(Throwable throwable) Called to notify that throwable eventually raised while receiving the results.voidresultsReceived(List<org.jppf.io.DataLocation> results) Called to notify that the results of a number of tasks have been received from the server.voidsetChannel(org.jppf.execute.ExecutorChannel<?> channel) Set the node channel onto this job dispatch.voidsetJobReturnReason(org.jppf.job.JobReturnReason jobReturnReason) Set the reason why the task results are reeived.voidsetOffline(boolean offline) Set the offline node indicator.voidtaskCompleted(Throwable exception) Called to notify that the execution of a task has completed.toString()
-
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
TaskBundleinstance.
-
getServerJob
Get the job this node bundle is a dispatch of.- Returns:
- a
ServerJobinstance.
-
getClientJob
Get the client job this submission is for- Returns:
- a
ServerJobinstance.
-
getDataProvider
public org.jppf.io.DataLocation getDataProvider()Get shared data provider for this task.- Returns:
- a
DataProviderinstance.
-
getTaskList
Get the tasks to be executed by the node.- Returns:
- the tasks as a
Listof 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
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
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
Called to notify that throwable eventually raised while receiving the results.- Parameters:
throwable- the throwable that was raised while receiving the results.
-
taskCompleted
Called to notify that the execution of a task has completed.- Parameters:
exception- theExceptionthrown during job execution ornull.
-
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:
trueif job is requeued,falseotherwise.
-
cancel
public void cancel()Called when this task bundle is cancelled. -
isCancelled
public boolean isCancelled()Get the cancelled indicator.- Returns:
trueif job is cancelled,falseotherwise.
-
isExpired
public boolean isExpired()Get the expired indicator.- Returns:
trueif job dispatch is expired,falseotherwise.
-
getChannel
public org.jppf.execute.ExecutorChannel<?> getChannel()Get the channel to which the job is dispatched.- Returns:
- an
ExecutorChannelinstance.
-
getFuture
Get the future corresponding to the channel dispatch.- Returns:
- a
Futureinstance.
-
checkTaskCount
public void checkTaskCount()Check the task count in this node bundle is equal to the one in itsJPPFTaskBundle. -
getTaskCount
public int getTaskCount()Get the number of tasks in this node bundle.- Returns:
- the number of tasks as an int.
-
toString
-
hashCode
public int hashCode() -
equals
-
getId
public long getId()Get the unique id for this node bundle.- Returns:
- the id as a long value.
-
makeKey
Build a unique key for the specified node task bundle.- Parameters:
bundle- aServerTaskBundleNodeinstance.- Returns:
- a unique key as a string.
-
makeKey
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
JobReturnReasonenum value.
-
setJobReturnReason
public void setJobReturnReason(org.jppf.job.JobReturnReason jobReturnReason) Set the reason why the task results are reeived.- Parameters:
jobReturnReason- aJobReturnReasonenum value.
-
isOffline
public boolean isOffline()Get the offline node indicator.- Returns:
trueif the corresponding node is offline,falseotherwise.
-
setOffline
public void setOffline(boolean offline) Set the offline node indicator.- Parameters:
offline-trueif the corresponding node is offline,falseotherwise.
-
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.
-