Package org.jppf.server.protocol
Class ServerJob
java.lang.Object
org.jppf.server.protocol.AbstractServerJob
org.jppf.server.protocol.AbstractServerJobBase
org.jppf.server.protocol.ServerJob
- All Implemented Interfaces:
org.jppf.node.protocol.JPPFDistributedJob
- Direct Known Subclasses:
ServerJobBroadcast
Server-side representation of a job.
- Author:
- Laurent Cohen, Martin JANDA
-
Field Summary
Fields inherited from class org.jppf.server.protocol.AbstractServerJobBase
channelSet, clientBundles, dataProvider, dependendedOnTasks, dispatchSet, onRequeue, tasks, totalDispatchesFields inherited from class org.jppf.server.protocol.AbstractServerJob
completionBundles, id, job, jobExpired, jobReceivedTime, lock, name, notificationEmitter, onDoneList, pending, queueEntryTime, removalCondition, status, submissionStatus, uuid -
Constructor Summary
ConstructorsConstructorDescriptionServerJob(Lock lock, ServerJobChangeListener notificationEmitter, org.jppf.node.protocol.TaskBundle job, org.jppf.io.DataLocation dataProvider) Initialized client job with task bundle and list of tasks to execute. -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel(JPPFDriver driver, boolean mayInterruptIfRunning) Cancel this job.voidcancelDispatch(ServerTaskBundleNode nodeBundle) Cancel the specified job dispatch.createNodeDispatch(int nbTasks) Make a copy of this client job wrapper containing only the first nbTasks tasks it contains.intorg.jppf.server.job.management.NodeJobInformation[]Get a list of objects describing the nodes to which the whole or part of a job was dispatched.org.jppf.node.protocol.graph.TaskGraphbooleanvoidresultsReceived(ServerTaskBundleNode bundle, Throwable throwable) Called to notify that throwable eventually raised while receiving the results.voidresultsReceived(ServerTaskBundleNode bundle, List<org.jppf.io.DataLocation> results) Called to notify that the results of a number of tasks have been received from the server.voidtaskCompleted(ServerTaskBundleNode bundle, Throwable throwable) Called to notify that the execution of a task has completed.voidupdate(JPPFDriver driver, org.jppf.node.protocol.JobSLA sla, org.jppf.node.protocol.JobMetadata metadata) Update this job with the specified sla and metadata.Methods inherited from class org.jppf.server.protocol.AbstractServerJobBase
addBundle, getClientBundles, getDataProvider, getDispatchSet, getNbBundles, getNbChannels, getNbDispatches, getNbDispatches, getNodeBundle, getTaskCount, getTotalDispatches, hasCompleted, hasPending, isJobGraphAlreadyHandled, jobDispatched, jobReturned, merge, setOnRequeue, toStringMethods inherited from class org.jppf.server.protocol.AbstractServerJob
addOnDone, done, fireJobDispatched, fireJobReturned, fireJobUpdated, getBroadcastUUID, getCompletionBundles, getInitialTaskCount, getJob, getJobReceivedTime, getLock, getMetadata, getName, getQueueEntryTime, getRemovalCondition, getSLA, getSubmissionStatus, getUuid, isCancelled, isJobExpired, isPending, isPersistent, isSuspended, jobExpired, removeOnDone, setCancelled, setJobReceivedTime, setMaxNodes, setMetadata, setName, setPending, setQueueEntryTime, setSLA, setSubmissionStatus, setSuspended, setUuid, updateJobDataLocation, updateStatus
-
Constructor Details
-
ServerJob
public ServerJob(Lock lock, ServerJobChangeListener notificationEmitter, org.jppf.node.protocol.TaskBundle job, org.jppf.io.DataLocation dataProvider) Initialized client job with task bundle and list of tasks to execute.- Parameters:
lock- used to synchronized access to job.notificationEmitter- anChangeListenerinstance that fires job notifications.job- underlying task bundle.dataProvider- the data location of the data provider.
-
-
Method Details
-
createNodeDispatch
Make a copy of this client job wrapper containing only the first nbTasks tasks it contains.- Parameters:
nbTasks- the number of tasks to include in the copy.- Returns:
- a new
ServerJobinstance.
-
resultsReceived
Called to notify that the results of a number of tasks have been received from the server.- Parameters:
bundle- the executing job.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:
bundle- the finished job.throwable- the throwable that was raised while receiving the results.
-
taskCompleted
Called to notify that the execution of a task has completed.- Parameters:
bundle- the completed task.throwable- theExceptionthrown during job execution ornull.
-
cancelDispatch
Cancel the specified job dispatch.- Parameters:
nodeBundle- the dispatch to cancel.
-
cancel
Cancel this job.- Parameters:
driver- reference to the JPPF driver.mayInterruptIfRunning-trueif the job may be interrupted.- Returns:
trueif the job was effectively cncelled,falseif it was already cancelled previously.
-
getNodeJobInformation
public org.jppf.server.job.management.NodeJobInformation[] getNodeJobInformation()Get a list of objects describing the nodes to which the whole or part of a job was dispatched.- Returns:
- array of
NodeManagementInfoinstances.
-
update
public void update(JPPFDriver driver, org.jppf.node.protocol.JobSLA sla, org.jppf.node.protocol.JobMetadata metadata) Update this job with the specified sla and metadata.- Parameters:
driver- reference to the JPPF driver.sla- the SLA to update with.metadata- the metadata to update with.
-
getTaskGraph
public org.jppf.node.protocol.graph.TaskGraph getTaskGraph()- Returns:
- the graph of tasks in the job, if any.
-
hasAvailableGraphNode
public boolean hasAvailableGraphNode()- Returns:
trueif there is a graph and an available node in the graph,falseotherwise.
-
getAvailableGraphNodeCount
public int getAvailableGraphNodeCount()- Returns:
- the number of nodes int he graph that can be executed.
-