Package org.jppf.server.protocol
Class ServerTaskBundleClient
java.lang.Object
org.jppf.server.protocol.ServerTaskBundleClient
Instances of this class group tasks from the same client channel together.
- Author:
- Laurent Cohen, Martin JANDA
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceListener providing a callback to invoke when a task's execution has completed. -
Constructor Summary
ConstructorsConstructorDescriptionServerTaskBundleClient(Collection<ServerTask> tasks, org.jppf.node.protocol.TaskBundle job, org.jppf.io.DataLocation dataProvider) Initialize this task bundle and set its build number.ServerTaskBundleClient(org.jppf.node.protocol.TaskBundle job, org.jppf.io.DataLocation dataProvider, List<org.jppf.io.DataLocation> taskList, boolean forPeer) Initialize this task bundle and set its build number. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener to the list of bundle listeners.voidNotifies that bundle is completely executed.voidcancel()Called when this task bundle is cancelled.List<org.jppf.io.DataLocation>ExtractDataLocationlist from contained tasks.org.jppf.io.DataLocationGet shared data provider for this task.longgetId()Get the unique id for this client bundle.org.jppf.node.protocol.TaskBundlegetJob()Get the job this submission is for.longGet the job received time.longintGet the number of tasks that remain to execute.org.jppf.node.protocol.JobSLAgetSLA()Get the service level agreement between the job and the server.intGet the number of tasks in the bundle.org.jppf.node.protocol.graph.TaskGraphInfoGet the dependencies of the tasks in this bundle.Get the tasks to be executed by the node.int[]getUuid()Get the universal unique id for this bundle.voidSend back the null tasks immediately.booleanGet the cancelled indicator.booleanisDone()Get thedoneindicator.voidRemove a listener from the list of bundle listeners.voidresultReceived(Collection<ServerTask> results) Called to notify that the contained task received result.voidresultReceived(Collection<ServerTask> tasks, Throwable exception) Called to notify that the task received exception during execution.voidsetDependencies(List<org.jppf.io.DataLocation> dependenciesLocations, org.jppf.node.protocol.graph.TaskGraphInfo graphInfo) Set the dependencies of the tasks in this bundle.voidsetJobReceivedTime(long jobReceivedTime) Set the job received time.toString()
-
Constructor Details
-
ServerTaskBundleClient
public ServerTaskBundleClient(org.jppf.node.protocol.TaskBundle job, org.jppf.io.DataLocation dataProvider, List<org.jppf.io.DataLocation> taskList, boolean forPeer) Initialize this task bundle and set its build number.- Parameters:
job- the job to execute.dataProvider- the shared data provider for this task bundle.taskList- the tasks to execute.forPeer- whether the job comes from a peer driver.
-
ServerTaskBundleClient
public ServerTaskBundleClient(Collection<ServerTask> tasks, org.jppf.node.protocol.TaskBundle job, org.jppf.io.DataLocation dataProvider) Initialize this task bundle and set its build number.- Parameters:
tasks- the tasks to execute.job- the job to execute.dataProvider- the shared data provider for this task bundle.
-
-
Method Details
-
getJob
public org.jppf.node.protocol.TaskBundle getJob()Get the job this submission is for.- Returns:
- a
TaskBundleinstance.
-
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.
-
handleNullTasks
public void handleNullTasks()Send back the null tasks immediately. -
resultReceived
Called to notify that the contained task received result.- Parameters:
results- the tasks for which results were received.
-
resultReceived
Called to notify that the task received exception during execution.- Parameters:
tasks- the tasks for which an exception was received.exception- the exception.
-
getJobReceivedTime
public long getJobReceivedTime()Get the job received time.- Returns:
- the time in milliseconds as a long value.
-
setJobReceivedTime
public void setJobReceivedTime(long jobReceivedTime) Set the job received time.- Parameters:
jobReceivedTime- the time in milliseconds as a long value.
-
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.
-
isDone
public boolean isDone()Get thedoneindicator.- Returns:
trueif this client job is done,falseotherwise.
-
getDataLocationList
ExtractDataLocationlist from contained tasks.- Returns:
- the list of
DataLocationinstances.
-
getSLA
public org.jppf.node.protocol.JobSLA getSLA()Get the service level agreement between the job and the server.- Returns:
- an instance of
JobSLA.
-
getUuid
Get the universal unique id for this bundle.- Returns:
- the uuid as a string.
-
getTaskCount
public int getTaskCount()Get the number of tasks in the bundle.- Returns:
- the number of tasks as an int.
-
getPendingTasksCount
public int getPendingTasksCount()Get the number of tasks that remain to execute.- Returns:
- the number of tasks as an int.
-
bundleEnded
public void bundleEnded()Notifies that bundle is completely executed. -
addCompletionListener
Add a listener to the list of bundle listeners.- Parameters:
listener- aServerTaskBundleClient.CompletionListenerinstance.
-
removeCompletionListener
Remove a listener from the list of bundle listeners.- Parameters:
listener- aServerTaskBundleClient.CompletionListenerinstance.
-
toString
-
getId
public long getId()Get the unique id for this client bundle.- Returns:
- the id as a long value.
-
getOriginalBundleId
public long getOriginalBundleId()- Returns:
- the id of the bundle from which this one was created, if any. If this bundle is the roigial one, then its id is returned.
-
getTasksPositions
public int[] getTasksPositions()- Returns:
- the positions of the tasks in this bundle.
-
getTaskGraphInfo
public org.jppf.node.protocol.graph.TaskGraphInfo getTaskGraphInfo()Get the dependencies of the tasks in this bundle.- Returns:
- the list of dependencies.
-
setDependencies
public void setDependencies(List<org.jppf.io.DataLocation> dependenciesLocations, org.jppf.node.protocol.graph.TaskGraphInfo graphInfo) Set the dependencies of the tasks in this bundle.- Parameters:
dependenciesLocations- the list of dependencies.graphInfo- information on the task graph, if any.
-