Class BatchJob

java.lang.Object
com.azure.compute.batch.models.BatchJob
All Implemented Interfaces:
com.azure.json.JsonSerializable<BatchJob>

public final class BatchJob extends Object implements com.azure.json.JsonSerializable<BatchJob>
An Azure Batch Job.
  • Constructor Details

    • BatchJob

      public BatchJob(BatchPoolInfo poolInfo)
      Creates an instance of BatchJob class.
      Parameters:
      poolInfo - the poolInfo value to set.
  • Method Details

    • getId

      public String getId()
      Get the id property: A string that uniquely identifies the Job within the Account. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case).
      Returns:
      the id value.
    • getDisplayName

      public String getDisplayName()
      Get the displayName property: The display name for the Job.
      Returns:
      the displayName value.
    • isUsesTaskDependencies

      public Boolean isUsesTaskDependencies()
      Get the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other. The default is false.
      Returns:
      the usesTaskDependencies value.
    • getUrl

      public String getUrl()
      Get the url property: The URL of the Job.
      Returns:
      the url value.
    • getETag

      public String getETag()
      Get the eTag property: The ETag of the Job. This is an opaque string. You can use it to detect whether the Job has changed between requests. In particular, you can be pass the ETag when updating a Job to specify that your changes should take effect only if nobody else has modified the Job in the meantime.
      Returns:
      the eTag value.
    • getLastModified

      public OffsetDateTime getLastModified()
      Get the lastModified property: The last modified time of the Job. This is the last time at which the Job level data, such as the Job state or priority, changed. It does not factor in task-level changes such as adding new Tasks or Tasks changing state.
      Returns:
      the lastModified value.
    • getCreationTime

      public OffsetDateTime getCreationTime()
      Get the creationTime property: The creation time of the Job.
      Returns:
      the creationTime value.
    • getState

      public BatchJobState getState()
      Get the state property: The current state of the Job.
      Returns:
      the state value.
    • getStateTransitionTime

      public OffsetDateTime getStateTransitionTime()
      Get the stateTransitionTime property: The time at which the Job entered its current state.
      Returns:
      the stateTransitionTime value.
    • getPreviousState

      public BatchJobState getPreviousState()
      Get the previousState property: The previous state of the Job. This property is not set if the Job is in its initial Active state.
      Returns:
      the previousState value.
    • getPreviousStateTransitionTime

      public OffsetDateTime getPreviousStateTransitionTime()
      Get the previousStateTransitionTime property: The time at which the Job entered its previous state. This property is not set if the Job is in its initial Active state.
      Returns:
      the previousStateTransitionTime value.
    • getPriority

      public Integer getPriority()
      Get the priority property: The priority of the Job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
      Returns:
      the priority value.
    • setPriority

      public BatchJob setPriority(Integer priority)
      Set the priority property: The priority of the Job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
      Parameters:
      priority - the priority value to set.
      Returns:
      the BatchJob object itself.
    • isAllowTaskPreemption

      public Boolean isAllowTaskPreemption()
      Get the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API.
      Returns:
      the allowTaskPreemption value.
    • setAllowTaskPreemption

      public BatchJob setAllowTaskPreemption(Boolean allowTaskPreemption)
      Set the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API.
      Parameters:
      allowTaskPreemption - the allowTaskPreemption value to set.
      Returns:
      the BatchJob object itself.
    • getMaxParallelTasks

      public Integer getMaxParallelTasks()
      Get the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API.
      Returns:
      the maxParallelTasks value.
    • setMaxParallelTasks

      public BatchJob setMaxParallelTasks(Integer maxParallelTasks)
      Set the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API.
      Parameters:
      maxParallelTasks - the maxParallelTasks value to set.
      Returns:
      the BatchJob object itself.
    • getConstraints

      public BatchJobConstraints getConstraints()
      Get the constraints property: The execution constraints for the Job.
      Returns:
      the constraints value.
    • setConstraints

      public BatchJob setConstraints(BatchJobConstraints constraints)
      Set the constraints property: The execution constraints for the Job.
      Parameters:
      constraints - the constraints value to set.
      Returns:
      the BatchJob object itself.
    • getJobManagerTask

      public BatchJobManagerTask getJobManagerTask()
      Get the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started.
      Returns:
      the jobManagerTask value.
    • getJobPreparationTask

      public BatchJobPreparationTask getJobPreparationTask()
      Get the jobPreparationTask property: The Job Preparation Task. The Job Preparation Task is a special Task run on each Compute Node before any other Task of the Job.
      Returns:
      the jobPreparationTask value.
    • getJobReleaseTask

      public BatchJobReleaseTask getJobReleaseTask()
      Get the jobReleaseTask property: The Job Release Task. The Job Release Task is a special Task run at the end of the Job on each Compute Node that has run any other Task of the Job.
      Returns:
      the jobReleaseTask value.
    • getCommonEnvironmentSettings

      public List<EnvironmentSetting> getCommonEnvironmentSettings()
      Get the commonEnvironmentSettings property: The list of common environment variable settings. These environment variables are set for all Tasks in the Job (including the Job Manager, Job Preparation and Job Release Tasks). Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value.
      Returns:
      the commonEnvironmentSettings value.
    • getPoolInfo

      public BatchPoolInfo getPoolInfo()
      Get the poolInfo property: The Pool settings associated with the Job.
      Returns:
      the poolInfo value.
    • getOnAllTasksComplete

      public OnAllBatchTasksComplete getOnAllTasksComplete()
      Get the onAllTasksComplete property: The action the Batch service should take when all Tasks in the Job are in the completed state. The default is noaction.
      Returns:
      the onAllTasksComplete value.
    • setOnAllTasksComplete

      public BatchJob setOnAllTasksComplete(OnAllBatchTasksComplete onAllTasksComplete)
      Set the onAllTasksComplete property: The action the Batch service should take when all Tasks in the Job are in the completed state. The default is noaction.
      Parameters:
      onAllTasksComplete - the onAllTasksComplete value to set.
      Returns:
      the BatchJob object itself.
    • getOnTaskFailure

      public OnBatchTaskFailure getOnTaskFailure()
      Get the onTaskFailure property: The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction.
      Returns:
      the onTaskFailure value.
    • getNetworkConfiguration

      public BatchJobNetworkConfiguration getNetworkConfiguration()
      Get the networkConfiguration property: The network configuration for the Job.
      Returns:
      the networkConfiguration value.
    • getMetadata

      public List<MetadataItem> getMetadata()
      Get the metadata property: A list of name-value pairs associated with the Job as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
      Returns:
      the metadata value.
    • setMetadata

      public BatchJob setMetadata(List<MetadataItem> metadata)
      Set the metadata property: A list of name-value pairs associated with the Job as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
      Parameters:
      metadata - the metadata value to set.
      Returns:
      the BatchJob object itself.
    • getExecutionInfo

      public BatchJobExecutionInfo getExecutionInfo()
      Get the executionInfo property: The execution information for the Job.
      Returns:
      the executionInfo value.
    • getStats

      public BatchJobStatistics getStats()
      Get the stats property: Resource usage statistics for the entire lifetime of the Job. This property is populated only if the BatchJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes.
      Returns:
      the stats value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<BatchJob>
      Throws:
      IOException
    • fromJson

      public static BatchJob fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of BatchJob from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of BatchJob if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the BatchJob.