Share via


BatchJob Class

  • java.lang.Object
    • com.azure.compute.batch.models.BatchJob

Implements

public final class BatchJob
implements JsonSerializable<BatchJob>

An Azure Batch Job.

Constructor Summary

Constructor Description
BatchJob(BatchPoolInfo poolInfo)

Creates an instance of BatchJob class.

Method Summary

Modifier and Type Method and Description
static BatchJob fromJson(JsonReader jsonReader)

Reads an instance of BatchJob from the JsonReader.

BatchAllTasksCompleteMode getAllTasksCompleteMode()

Get the allTasksCompleteMode property: The action the Batch service should take when all Tasks in the Job are in the completed state.

List<EnvironmentSetting> getCommonEnvironmentSettings()

Get the commonEnvironmentSettings property: The list of common environment variable settings.

BatchJobConstraints getConstraints()

Get the constraints property: The execution constraints for the Job.

OffsetDateTime getCreationTime()

Get the creationTime property: The creation time of the Job.

String getDisplayName()

Get the displayName property: The display name for the Job.

String getETag()

Get the eTag property: The ETag of the Job.

BatchJobExecutionInfo getExecutionInfo()

Get the executionInfo property: The execution information for the Job.

String getId()

Get the id property: A string that uniquely identifies the Job within the Account.

BatchJobManagerTask getJobManagerTask()

Get the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started.

BatchJobPreparationTask getJobPreparationTask()

Get the jobPreparationTask property: The Job Preparation Task.

BatchJobReleaseTask getJobReleaseTask()

Get the jobReleaseTask property: The Job Release Task.

BatchJobStatistics getJobStatistics()

Get the jobStatistics property: Resource usage statistics for the entire lifetime of the Job.

OffsetDateTime getLastModified()

Get the lastModified property: The last modified time of the Job.

Integer getMaxParallelTasks()

Get the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job.

List<BatchMetadataItem> getMetadata()

Get the metadata property: A list of name-value pairs associated with the Job as metadata.

BatchJobNetworkConfiguration getNetworkConfiguration()

Get the networkConfiguration property: The network configuration for the Job.

BatchPoolInfo getPoolInfo()

Get the poolInfo property: The Pool settings associated with the Job.

BatchJobState getPreviousState()

Get the previousState property: The previous state of the Job.

OffsetDateTime getPreviousStateTransitionTime()

Get the previousStateTransitionTime property: The time at which the Job entered its previous state.

Integer getPriority()

Get the priority property: The priority of the Job.

BatchJobState getState()

Get the state property: The current state of the Job.

OffsetDateTime getStateTransitionTime()

Get the stateTransitionTime property: The time at which the Job entered its current state.

BatchTaskFailureMode getTaskFailureMode()

Get the taskFailureMode property: The action the Batch service should take when any Task in the Job fails.

String getUrl()

Get the url property: The URL of the Job.

Boolean isAllowTaskPreemption()

Get the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs.

Boolean isUsesTaskDependencies()

Get the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other.

BatchJob setAllowTaskPreemption(Boolean allowTaskPreemption)

Set the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs.

BatchJob setAllTasksCompleteMode(BatchAllTasksCompleteMode allTasksCompleteMode)

Set the allTasksCompleteMode property: The action the Batch service should take when all Tasks in the Job are in the completed state.

BatchJob setConstraints(BatchJobConstraints constraints)

Set the constraints property: The execution constraints for the Job.

BatchJob setMaxParallelTasks(Integer maxParallelTasks)

Set the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job.

BatchJob setMetadata(List<BatchMetadataItem> metadata)

Set the metadata property: A list of name-value pairs associated with the Job as metadata.

BatchJob setPriority(Integer priority)

Set the priority property: The priority of the Job.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

BatchJob

public BatchJob(BatchPoolInfo poolInfo)

Creates an instance of BatchJob class.

Parameters:

poolInfo - the poolInfo value to set.

Method Details

fromJson

public static BatchJob fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

getAllTasksCompleteMode

public BatchAllTasksCompleteMode getAllTasksCompleteMode()

Get the allTasksCompleteMode 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 allTasksCompleteMode 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.

getConstraints

public BatchJobConstraints getConstraints()

Get the constraints property: The execution constraints for the Job.

Returns:

the constraints value.

getCreationTime

public OffsetDateTime getCreationTime()

Get the creationTime property: The creation time of the Job.

Returns:

the creationTime value.

getDisplayName

public String getDisplayName()

Get the displayName property: The display name for the Job.

Returns:

the displayName 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.

getExecutionInfo

public BatchJobExecutionInfo getExecutionInfo()

Get the executionInfo property: The execution information for the Job.

Returns:

the executionInfo value.

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.

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.

getJobStatistics

public BatchJobStatistics getJobStatistics()

Get the jobStatistics 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 jobStatistics 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.

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.

getMetadata

public List<BatchMetadataItem> 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.

getNetworkConfiguration

public BatchJobNetworkConfiguration getNetworkConfiguration()

Get the networkConfiguration property: The network configuration for the Job.

Returns:

the networkConfiguration value.

getPoolInfo

public BatchPoolInfo getPoolInfo()

Get the poolInfo property: The Pool settings associated with the Job.

Returns:

the poolInfo 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.

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.

getTaskFailureMode

public BatchTaskFailureMode getTaskFailureMode()

Get the taskFailureMode 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 taskFailureMode value.

getUrl

public String getUrl()

Get the url property: The URL of the Job.

Returns:

the url value.

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.

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.

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.

setAllTasksCompleteMode

public BatchJob setAllTasksCompleteMode(BatchAllTasksCompleteMode allTasksCompleteMode)

Set the allTasksCompleteMode property: The action the Batch service should take when all Tasks in the Job are in the completed state. The default is noaction.

Parameters:

allTasksCompleteMode - the allTasksCompleteMode value to set.

Returns:

the BatchJob object itself.

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.

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.

setMetadata

public BatchJob setMetadata(List<BatchMetadataItem> 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.

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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to