Class JobSLA

All Implemented Interfaces:
Serializable

public class JobSLA extends JobCommonSLA<JobSLA>
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 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

      public JobSLA setPriority(int priority)
      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

      public JobSLA setMaxNodes(int maxNodes)
      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 maxMasterNodeGroups master nodes and all their slaves.

      Returns:
      the number of nodes as an int value.
      Since:
      5.1
    • setMaxNodeProvisioningGroups

      public JobSLA setMaxNodeProvisioningGroups(int maxNodeProvisioningGroups)
      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 maxMasterNodeGroups master 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

      public JobSLA setSuspended(boolean suspended)
      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

      public JobSLA setBroadcastJob(boolean broadcastJob)
      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:
      true if the job should be canceled (this is the default), false otherwise.
    • setCancelUponClientDisconnect

      public JobSLA setCancelUponClientDisconnect(boolean cancelUponClientDisconnect)
      Specify whether the job should be canceled by the driver if the client gets disconnected.
      Parameters:
      cancelUponClientDisconnect - true if the job should be canceled, false otherwise.
      Returns:
      this SLA, for method call chaining.
    • getResultsStrategy

      public String getResultsStrategy()
      Get the strategy used to return the results back to the client.
      Returns:
      the name of the strategy to use.
    • setResultsStrategy

      public JobSLA setResultsStrategy(String name)
      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

      public ClassPath getClassPath()
      Get the class path associated with the job.
      Returns:
      an instance of ClassPath.
    • setClassPath

      public JobSLA setClassPath(ClassPath classpath)
      Set the class path associated with the job.
      Parameters:
      classpath - an instance of ClassPath.
      Returns:
      this SLA, for method call chaining.
    • getDispatchExpirationSchedule

      public JPPFSchedule getDispatchExpirationSchedule()
      Get the expiration schedule for any subset of the job dispatched to a node.
      Returns:
      a JPPFSchedule instance.
    • setDispatchExpirationSchedule

      public JobSLA setDispatchExpirationSchedule(JPPFSchedule schedule)
      Set the expiration schedule for any subset of the job dispatched to a node.
      Parameters:
      schedule - a JPPFSchedule instance.
      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

      public JobSLA setMaxDispatchExpirations(int max)
      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 via AbstractTask.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

      public JobSLA setMaxTaskResubmits(int maxResubmits)
      Set the naximum number of times a task can resubmit itself via AbstractTask.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:
      true if the max resubmits count is applied upon node errors, false otherwise.
      Since:
      4.2
    • setApplyMaxResubmitsUponNodeError

      public JobSLA setApplyMaxResubmitsUponNodeError(boolean applyMaxResubmitsUponNodeError)
      Specify whether the max resubmits limit for tasks should also be applied when tasks are resubmitted due to a node error.
      Parameters:
      applyMaxResubmitsUponNodeError - true to specify that the max resubmits count is applied upon node errors, false otherwise.
      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 via setRemoteClassLoadingEnabled(boolean), is true.
      Returns:
      true is remote class loading is enabled, false otherwise.
      Since:
      4.2
    • setRemoteClassLoadingEnabled

      public JobSLA setRemoteClassLoadingEnabled(boolean enabled)
      Specify whether remote class loading is enabled for the job.
      Parameters:
      enabled - true to enable remote class loading, false to disable it.
      Returns:
      this SLA, for method call chaining.
      Since:
      4.2
    • getGridExecutionPolicy

      public ExecutionPolicy getGridExecutionPolicy()
      Get the global grid execution policy (which applies to the driver).
      Returns:
      an ExecutionPolicy object.
      Since:
      5.2
    • setGridExecutionPolicy

      public JobSLA setGridExecutionPolicy(ExecutionPolicy policy)
      Set the global grid execution policy (which applies to the driver).
      Parameters:
      policy - an ExecutionPolicy object.
      Returns:
      this SLA, for method call chaining.
      Since:
      5.2
    • getDesiredNodeConfiguration

      public JPPFNodeConfigSpec 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 JPPFNodeConfigSpec object.
      Since:
      5.2
    • setDesiredNodeConfiguration

      public JobSLA 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.
      Parameters:
      nodeConfigurationSpec - the desired configuration as a JPPFNodeConfigSpec object.
      Returns:
      this SLA, for method call chaining.
      Since:
      5.2
    • getPersistenceSpec

      public PersistenceSpec getPersistenceSpec()
      Get the specification of the job persistence in the driver.
      Returns:
      a PersistenceSpec instance.
      Since:
      6.0
    • copy

      public JobSLA copy()
      Create a copy of this job SLA.
      Returns:
      a JobSLA instance.
    • getMaxDriverDepth

      public int getMaxDriverDepth()
      Determine how many drivers a job can traverse before being executed on a node. By default, when setMaxDriverDepth(int) has not yet been called, this method returns Integer.MAX_VALUE.
      Returns:
      the maximum driver depth.
      Since:
      6.1
    • setMaxDriverDepth

      public JobSLA setMaxDriverDepth(int maxDriverDepth)
      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

      public JobDependencySpec getDependencySpec()
      Get the specification of dependencies for the job.
      Returns:
      a JobDependencySpec instance.
      Since:
      6.2