Package org.jppf.server.nio.nodeserver
Class NodeReservationHandler
java.lang.Object
org.jppf.server.nio.nodeserver.NodeReservationHandler
Handles the reservation of nodes to jobs that request a specific node configuration.
- Author:
- Laurent Cohen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTypes of transitions for a reservation, applied to a node. -
Constructor Summary
ConstructorsConstructorDescriptionNodeReservationHandler(JPPFDriver driver) Initialize with the specified node server. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoReservation(ServerJob job, BaseNodeContext node) Reserve the specified node for the specified job.intgetNbReservedNodes(String jobUuid) Get the number of nodes reserved for the specified job.Get the UUID of the job for which the specified node has a pending reservation, if any.Get the UUID of the job for which the specified node is reserved, if any.getReadyNodes(String jobUuid) Get the nodes for which the specified job is ready for dispatch.Get the uuids of the jobs for which at least oone node is reserved.Get the uuids of the jobs for which at least oone node is reserved.Get the uuids of the reserved nodes.booleanhasReadyNode(String jobUuid) Determine whether the node with the specified uuid has at leat one reserved node.voidonJobCancelled(ServerJob job) Remove all the node reservations for the specified job that is being cancelled.voidremoveJobReservations(String jobUuid) Remove all the node reservations for the specified job that is being cancelled.voidRemove the job reservation for the specified job, if any.boolean
-
Constructor Details
-
NodeReservationHandler
Initialize with the specified node server.- Parameters:
driver- the JPPF driver.
-
-
Method Details
-
doReservation
Reserve the specified node for the specified job.- Parameters:
job- the job for which the node is to be reserved.node- the node to restart and reserve.
-
removeReservation
Remove the job reservation for the specified job, if any.- Parameters:
node- the node for which to remove the reservation.
-
onJobCancelled
Remove all the node reservations for the specified job that is being cancelled.- Parameters:
job- the job being cancelled.
-
removeJobReservations
Remove all the node reservations for the specified job that is being cancelled.- Parameters:
jobUuid- uuid of the job for which to remove reservations.
-
getPendingJobUUID
Get the UUID of the job for which the specified node has a pending reservation, if any.- Parameters:
node- the node to check.- Returns:
- the UUID of the corresponding job, or
nullif the node doesn't have a pending reservation.
-
getReadyJobUUID
Get the UUID of the job for which the specified node is reserved, if any.- Parameters:
node- the node to check.- Returns:
- the UUID of the corresponding job, or
nullif the node is not reserved.
-
hasReadyNode
Determine whether the node with the specified uuid has at leat one reserved node.- Parameters:
jobUuid- the uuid of the job to check.- Returns:
trueif the job has a t least one reserved node,falseotherwise.
-
getReadyNodes
Get the nodes for which the specified job is ready for dispatch.- Parameters:
jobUuid- the uuid of the job to check.- Returns:
- a collection of node uuids, or
nullif there is no ready node for the job.
-
getNbReservedNodes
Get the number of nodes reserved for the specified job.- Parameters:
jobUuid- the uuid of the jkob to check.- Returns:
- the total number of jobs reserved for the job.
-
transitionReservation
- Parameters:
node- .- Returns:
- .
-
getReservations
Get the uuids of the jobs for which at least oone node is reserved.- Returns:
- a set of job uuids.
-
getReservedJobs
Get the uuids of the jobs for which at least oone node is reserved.- Returns:
- a set of job uuids.
-
getReservedNodes
Get the uuids of the reserved nodes.- Returns:
- a set of node uuids.
-