Package org.jppf.server.protocol
Class AbstractServerJobBase
java.lang.Object
org.jppf.server.protocol.AbstractServerJob
org.jppf.server.protocol.AbstractServerJobBase
- All Implemented Interfaces:
org.jppf.node.protocol.JPPFDistributedJob
- Direct Known Subclasses:
ServerJob
- Author:
- Laurent Cohen, Martin JANDA
-
Field Summary
FieldsModifier and TypeFieldDescriptionSet of all nodes to which this job is dispatched.protected final List<ServerTaskBundleClient>The list of the incoming bundles.protected final org.jppf.io.DataLocationThe data location of the data provider.protected final Map<Integer,ServerTask> The list of the tasks.protected final Map<Long,ServerTaskBundleNode> Set of all dispatched bundles in this job.protected RunnableThe requeue handler.protected final Map<Integer,ServerTask> The list of the tasks.protected final AtomicIntegerTotal number of dispatches in this job.Fields 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
ConstructorsConstructorDescriptionAbstractServerJobBase(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 TypeMethodDescriptionbooleanaddBundle(ServerTaskBundleClient bundle) Add received bundle to this server job.Get list of bundles received from client.org.jppf.io.DataLocationGet the location for data shared between tasks.Get the dispatch set.intGet the number of client bundles.intGet count of channels on which this job is executed.intGet count of dispatches being executed.intgetNbDispatches(String uuid) Get count of dispatches executed on the specified channel.getNodeBundle(long id) Get the node bundle with the specified id from the dispatch set.intintbooleanDFetermine whether this job is in COMPLETED or ENDED state.protected booleanGet indicator whether job has pending tasks.booleanvoidjobDispatched(ServerTaskBundleNode bundle) Called when all or part of a job is dispatched to a node.voidjobReturned(ServerTaskBundleNode bundle) Called when all or part of a job is returned from node.protected booleanmerge(List<ServerTask> taskList, boolean after) Merge this client job wrapper with another.voidsetOnRequeue(Runnable onRequeue) Set the requeue handler.toString()Methods 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
-
Field Details
-
tasks
The list of the tasks. -
clientBundles
The list of the incoming bundles. -
dispatchSet
Set of all dispatched bundles in this job. -
channelSet
Set of all nodes to which this job is dispatched. -
onRequeue
The requeue handler. -
dataProvider
protected final org.jppf.io.DataLocation dataProviderThe data location of the data provider. -
totalDispatches
Total number of dispatches in this job. -
dependendedOnTasks
The list of the tasks.
-
-
Constructor Details
-
AbstractServerJobBase
public AbstractServerJobBase(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
-
getClientBundles
Get list of bundles received from client.- Returns:
- list of bundles received from client.
-
getDataProvider
public org.jppf.io.DataLocation getDataProvider()Get the location for data shared between tasks.- Returns:
- a
DataLocationinstance.
-
getTaskCount
public int getTaskCount()- Specified by:
getTaskCountin interfaceorg.jppf.node.protocol.JPPFDistributedJob- Specified by:
getTaskCountin classAbstractServerJob
-
merge
Merge this client job wrapper with another.- Parameters:
taskList- list of tasks to merge.after- determines whether the tasks from other should be added first or last.- Returns:
truewhen this client job needs to be requeued.
-
jobDispatched
Called when all or part of a job is dispatched to a node.- Parameters:
bundle- the dispatched job.
-
jobReturned
Called when all or part of a job is returned from node.- Parameters:
bundle- the returned job.
-
hasPending
protected boolean hasPending()Get indicator whether job has pending tasks.- Returns:
truewhen job has some pending tasks.
-
setOnRequeue
Set the requeue handler.- Parameters:
onRequeue-Runnableexecuted on requeue.
-
getNbChannels
public int getNbChannels()Get count of channels on which this job is executed.- Returns:
- the number used for job execution.
-
getNbDispatches
Get count of dispatches executed on the specified channel.- Parameters:
uuid- uuid of the channel to check.- Returns:
- the number of dispatches to the channel.
-
getNbDispatches
public int getNbDispatches()Get count of dispatches being executed.- Returns:
- the number of dipatches.
-
getTotalDispatches
public int getTotalDispatches()- Returns:
- the total number of dispatches.
-
getNodeBundle
Get the node bundle with the specified id from the dispatch set.- Parameters:
id- the id of the bundle to find.- Returns:
- a
ServerTaskBundleNodeinstance.
-
getDispatchSet
Get the dispatch set. Used for debugging purposes.- Returns:
- a set of
ServerTaskBundleNodeinstances.
-
addBundle
Add received bundle to this server job.- Parameters:
bundle- the bundle to add.- Returns:
truewhen bundle was added to job.falsewhen job isCOMPLETE.- Throws:
JPPFJobEndedException- if the job is alreadyENDED.
-
hasCompleted
public boolean hasCompleted()DFetermine whether this job is in COMPLETED or ENDED state.- Returns:
trueif this job has completed,falseotherwise.
-
toString
-
getNbBundles
public int getNbBundles()Get the number of client bundles.- Returns:
- the number of bundles as an int.
-
isJobGraphAlreadyHandled
public boolean isJobGraphAlreadyHandled()- Returns:
trueif the job graph is already handled in another driver that dispatched the job,falseotherwise.
-