Package com.azure.compute.batch.models
Class BatchJob
java.lang.Object
com.azure.compute.batch.models.BatchJob
- All Implemented Interfaces:
com.azure.json.JsonSerializable<BatchJob>
An Azure Batch Job.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BatchJob
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of BatchJob from the JsonReader.Get the commonEnvironmentSettings property: The list of common environment variable settings.Get the constraints property: The execution constraints for the Job.Get the creationTime property: The creation time of the Job.Get the displayName property: The display name for the Job.getETag()
Get the eTag property: The ETag of the Job.Get the executionInfo property: The execution information for the Job.getId()
Get the id property: A string that uniquely identifies the Job within the Account.Get the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started.Get the jobPreparationTask property: The Job Preparation Task.Get the jobReleaseTask property: The Job Release Task.Get the lastModified property: The last modified time of the Job.Get the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job.Get the metadata property: A list of name-value pairs associated with the Job as metadata.Get the networkConfiguration property: The network configuration for the Job.Get the onAllTasksComplete property: The action the Batch service should take when all Tasks in the Job are in the completed state.Get the onTaskFailure property: The action the Batch service should take when any Task in the Job fails.Get the poolInfo property: The Pool settings associated with the Job.Get the previousState property: The previous state of the Job.Get the previousStateTransitionTime property: The time at which the Job entered its previous state.Get the priority property: The priority of the Job.getState()
Get the state property: The current state of the Job.Get the stateTransitionTime property: The time at which the Job entered its current state.getStats()
Get the stats property: Resource usage statistics for the entire lifetime of the Job.getUrl()
Get the url property: The URL of the Job.Get the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs.Get the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other.setAllowTaskPreemption
(Boolean allowTaskPreemption) Set the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs.setConstraints
(BatchJobConstraints constraints) Set the constraints property: The execution constraints for the Job.setMaxParallelTasks
(Integer maxParallelTasks) Set the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job.setMetadata
(List<MetadataItem> metadata) Set the metadata property: A list of name-value pairs associated with the Job as metadata.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.setPriority
(Integer priority) Set the priority property: The priority of the Job.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
BatchJob
Creates an instance of BatchJob class.- Parameters:
poolInfo
- the poolInfo value to set.
-
-
Method Details
-
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
Get the displayName property: The display name for the Job.- Returns:
- the displayName value.
-
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
Get the url property: The URL of the Job.- Returns:
- the url value.
-
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
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
Get the creationTime property: The creation time of the Job.- Returns:
- the creationTime value.
-
getState
Get the state property: The current state of the Job.- Returns:
- the state value.
-
getStateTransitionTime
Get the stateTransitionTime property: The time at which the Job entered its current state.- Returns:
- the stateTransitionTime value.
-
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
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
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
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
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
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
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
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
Get the constraints property: The execution constraints for the Job.- Returns:
- the constraints value.
-
setConstraints
Set the constraints property: The execution constraints for the Job.- Parameters:
constraints
- the constraints value to set.- Returns:
- the BatchJob object itself.
-
getJobManagerTask
Get the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started.- Returns:
- the jobManagerTask value.
-
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
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
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
Get the poolInfo property: The Pool settings associated with the Job.- Returns:
- the poolInfo value.
-
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
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
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
Get the networkConfiguration property: The network configuration for the Job.- Returns:
- the networkConfiguration value.
-
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
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
Get the executionInfo property: The execution information for the Job.- Returns:
- the executionInfo value.
-
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
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<BatchJob>
- Throws:
IOException
-
fromJson
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.
-