Package org.jppf.node.protocol
Class JobSLA
- All Implemented Interfaces:
Serializable
This interface represents the Service Level Agreement between a JPPF job and a server.
It determines the state, conditions and order in which a job will be executed.
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Create a copy of this job SLA.Get the class path associated with the job.Get the specification of dependencies for the job.Get the configuration of the node(s) this job should be executed on, forcing a restart of the node with appropriate configuration overrides if there is no such node.Get the expiration schedule for any subset of the job dispatched to a node.Get the global grid execution policy (which applies to the driver).intGet the number of times a dispatched task can expire before it is finally cancelled.intDetermine how many drivers a job can traverse before being executed on a node.intGet the maximum number of groups of master/slaves nodes the job can be executed on at any given time.intGet the maximum number of nodes this job can run on.intGet the naximum number of times a task can resubmit itself viaAbstractTask.setResubmit(boolean).Get the specification of the job persistence in the driver.intGet the priority of this job.Get the strategy used to return the results back to the client.booleanDetermine whether the max resubmits limit for tasks is also applied when tasks are resubmitted due to a node error.booleanDetermine whether the job is a broadcast job.booleanDetermine whether the job should be canceled by the driver if the client gets disconnected.booleanDetermine whether remote class loading is enabled for the job.booleanDetermine whether this job is initially suspended.setApplyMaxResubmitsUponNodeError(boolean applyMaxResubmitsUponNodeError) Specify whether the max resubmits limit for tasks should also be applied when tasks are resubmitted due to a node error.setBroadcastJob(boolean broadcastJob) Specify whether the job is a broadcast job.setCancelUponClientDisconnect(boolean cancelUponClientDisconnect) Specify whether the job should be canceled by the driver if the client gets disconnected.setClassPath(ClassPath classpath) Set the class path associated with the job.setDesiredNodeConfiguration(JPPFNodeConfigSpec nodeConfigurationSpec) Set the configuration of the node(s) this job should be executed on, forcing a restart of the node with appropriate configuration overrides if there is no such node.setDispatchExpirationSchedule(JPPFSchedule schedule) Set the expiration schedule for any subset of the job dispatched to a node.Set the global grid execution policy (which applies to the driver).setMaxDispatchExpirations(int max) Set the number of times a dispatched task can expire before it is finally cancelled.setMaxDriverDepth(int maxDriverDepth) Set how many drivers a job can traverse before being executed on a node.setMaxNodeProvisioningGroups(int maxNodeProvisioningGroups) Set the maximum number of groups of master/slaves nodes the job can be executed on at any given time.setMaxNodes(int maxNodes) Set the maximum number of nodes this job can run on.setMaxTaskResubmits(int maxResubmits) Set the naximum number of times a task can resubmit itself viaAbstractTask.setResubmit(boolean).setPriority(int priority) Set the priority of this job.setRemoteClassLoadingEnabled(boolean enabled) Specify whether remote class loading is enabled for the job.setResultsStrategy(String name) Set the strategy used to return the results back to the client.setSuspended(boolean suspended) Specify whether this job is initially suspended.Methods inherited from class org.jppf.node.protocol.JobCommonSLA
copyTo, getExecutionPolicy, getJobExpirationSchedule, getJobSchedule, getMaxDispatchSize, getPreferencePolicy, isAllowMultipleDispatchesToSameChannel, setAllowMultipleDispatchesToSameChannel, setExecutionPolicy, setJobExpirationSchedule, setJobSchedule, setMaxDispatchSize, setPreferencePolicy
-
Constructor Details
-
JobSLA
public JobSLA()Default constructor.
-
-
Method Details
-
getPriority
public int getPriority()Get the priority of this job.- Returns:
- the priority as an int.
-
setPriority
Set the priority of this job.- Parameters:
priority- the priority as an int.- Returns:
- this SLA, for method call chaining.
-
getMaxNodes
public int getMaxNodes()Get the maximum number of nodes this job can run on.- Returns:
- the number of nodes as an int value.
-
setMaxNodes
Set the maximum number of nodes this job can run on.- Parameters:
maxNodes- the number of nodes as an int value. A value <= 0 means no limit on the number of nodes.- Returns:
- this SLA, for method call chaining.
-
getMaxNodeProvisioningGroupss
public int getMaxNodeProvisioningGroupss()Get the maximum number of groups of master/slaves nodes the job can be executed on at any given time.This setting means that the job can only be executed on at most
maxMasterNodeGroupsmaster nodes and all their slaves.- Returns:
- the number of nodes as an int value.
- Since:
- 5.1
-
setMaxNodeProvisioningGroups
Set the maximum number of groups of master/slaves nodes the job can be executed on at any given time.This setting means that the job can only be executed on at most
maxMasterNodeGroupsmaster nodes and all their slaves.- Parameters:
maxNodeProvisioningGroups- the number of nodes as an int value. A value <= 0 means no limit on the number of nodes. Any value <= 0 will be ignored.- Returns:
- this SLA, for method call chaining.
- Since:
- 5.1
-
isSuspended
public boolean isSuspended()Determine whether this job is initially suspended.- Returns:
- true if the job is suspended, false otherwise.
-
setSuspended
Specify whether this job is initially suspended.- Parameters:
suspended- true if the job is suspended, false otherwise.- Returns:
- this SLA, for method call chaining.
-
isBroadcastJob
public boolean isBroadcastJob()Determine whether the job is a broadcast job.- Returns:
- true for a broadcast job, false otherwise.
-
setBroadcastJob
Specify whether the job is a broadcast job.- Parameters:
broadcastJob- true for a broadcast job, false otherwise.- Returns:
- this SLA, for method call chaining.
-
isCancelUponClientDisconnect
public boolean isCancelUponClientDisconnect()Determine whether the job should be canceled by the driver if the client gets disconnected.- Returns:
trueif the job should be canceled (this is the default),falseotherwise.
-
setCancelUponClientDisconnect
Specify whether the job should be canceled by the driver if the client gets disconnected.- Parameters:
cancelUponClientDisconnect-trueif the job should be canceled,falseotherwise.- Returns:
- this SLA, for method call chaining.
-
getResultsStrategy
Get the strategy used to return the results back to the client.- Returns:
- the name of the strategy to use.
-
setResultsStrategy
Set the strategy used to return the results back to the client.- Parameters:
name- the name of the strategy to use.- Returns:
- this SLA, for method call chaining.
-
getClassPath
Get the class path associated with the job.- Returns:
- an instance of
ClassPath.
-
setClassPath
Set the class path associated with the job.- Parameters:
classpath- an instance ofClassPath.- Returns:
- this SLA, for method call chaining.
-
getDispatchExpirationSchedule
Get the expiration schedule for any subset of the job dispatched to a node.- Returns:
- a
JPPFScheduleinstance.
-
setDispatchExpirationSchedule
Set the expiration schedule for any subset of the job dispatched to a node.- Parameters:
schedule- aJPPFScheduleinstance.- Returns:
- this SLA, for method call chaining.
-
getMaxDispatchExpirations
public int getMaxDispatchExpirations()Get the number of times a dispatched task can expire before it is finally cancelled.- Returns:
- the number of expirations as an int.
-
setMaxDispatchExpirations
Set the number of times a dispatched task can expire before it is finally cancelled.- Parameters:
max- the number of expirations as an int.- Returns:
- this SLA, for method call chaining.
-
getMaxTaskResubmits
public int getMaxTaskResubmits()Get the naximum number of times a task can resubmit itself viaAbstractTask.setResubmit(boolean). The default value is 1, meaning that a task can resubmit itself at most once.- Returns:
- the maximum number of resubmits; a value of 0 or less means tasks in the job cannot be resubmitted.
-
setMaxTaskResubmits
Set the naximum number of times a task can resubmit itself viaAbstractTask.setResubmit(boolean).- Parameters:
maxResubmits- the maximum number of resubmits; a value of 0 or less means tasks in the job cannot be resubmitted.- Returns:
- this SLA, for method call chaining.
-
isApplyMaxResubmitsUponNodeError
public boolean isApplyMaxResubmitsUponNodeError()Determine whether the max resubmits limit for tasks is also applied when tasks are resubmitted due to a node error. This flag is false by default.- Returns:
trueif the max resubmits count is applied upon node errors,falseotherwise.- Since:
- 4.2
-
setApplyMaxResubmitsUponNodeError
Specify whether the max resubmits limit for tasks should also be applied when tasks are resubmitted due to a node error.- Parameters:
applyMaxResubmitsUponNodeError-trueto specify that the max resubmits count is applied upon node errors,falseotherwise.- Returns:
- this SLA, for method call chaining.
- Since:
- 4.2
-
isRemoteClassLoadingEnabled
public boolean isRemoteClassLoadingEnabled()Determine whether remote class loading is enabled for the job. The default value, when not specified viasetRemoteClassLoadingEnabled(boolean), istrue.- Returns:
trueis remote class loading is enabled,falseotherwise.- Since:
- 4.2
-
setRemoteClassLoadingEnabled
Specify whether remote class loading is enabled for the job.- Parameters:
enabled-trueto enable remote class loading,falseto disable it.- Returns:
- this SLA, for method call chaining.
- Since:
- 4.2
-
getGridExecutionPolicy
Get the global grid execution policy (which applies to the driver).- Returns:
- an
ExecutionPolicyobject. - Since:
- 5.2
-
setGridExecutionPolicy
Set the global grid execution policy (which applies to the driver).- Parameters:
policy- anExecutionPolicyobject.- Returns:
- this SLA, for method call chaining.
- Since:
- 5.2
-
getDesiredNodeConfiguration
Get the configuration of the node(s) this job should be executed on, forcing a restart of the node with appropriate configuration overrides if there is no such node.- Returns:
- the desired configuration as a
JPPFNodeConfigSpecobject. - Since:
- 5.2
-
setDesiredNodeConfiguration
Set the configuration of the node(s) this job should be executed on, forcing a restart of the node with appropriate configuration overrides if there is no such node.- Parameters:
nodeConfigurationSpec- the desired configuration as aJPPFNodeConfigSpecobject.- Returns:
- this SLA, for method call chaining.
- Since:
- 5.2
-
getPersistenceSpec
Get the specification of the job persistence in the driver.- Returns:
- a
PersistenceSpecinstance. - Since:
- 6.0
-
copy
Create a copy of this job SLA.- Returns:
- a
JobSLAinstance.
-
getMaxDriverDepth
public int getMaxDriverDepth()Determine how many drivers a job can traverse before being executed on a node. By default, whensetMaxDriverDepth(int)has not yet been called, this method returnsInteger.MAX_VALUE.- Returns:
- the maximum driver depth.
- Since:
- 6.1
-
setMaxDriverDepth
Set how many drivers a job can traverse before being executed on a node. This setting effectively applies in multi-server topologies, when JPPF drivers can offload jobs to one another.- Parameters:
maxDriverDepth- the maximum driver depth to set. Values less than or equal to 0 are ignored.- Returns:
- this SLA, for method call chaining.
- Since:
- 6.1
-
getDependencySpec
Get the specification of dependencies for the job.- Returns:
- a
JobDependencySpecinstance. - Since:
- 6.2
-