BatchJobCreateParameters Class

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

Implements

public final class BatchJobCreateParameters
implements JsonSerializable<BatchJobCreateParameters>

Parameters for creating an Azure Batch Job.

Constructor Summary

Constructor Description
BatchJobCreateParameters(String id, BatchPoolInfo poolInfo)

Creates an instance of BatchJobCreateParameters class.

Method Summary

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

Reads an instance of BatchJobCreateParameters 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.

String getDisplayName()

Get the displayName property: The display name 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.

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: (This property is not available by default.

BatchPoolInfo getPoolInfo()

Get the poolInfo property: The Pool on which the Batch service runs the Job's Tasks.

Integer getPriority()

Get the priority property: The priority of the Job.

BatchTaskFailureMode getTaskFailureMode()

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

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.

BatchJobCreateParameters setAllowTaskPreemption(Boolean allowTaskPreemption)

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

BatchJobCreateParameters 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.

BatchJobCreateParameters setCommonEnvironmentSettings(List<EnvironmentSetting> commonEnvironmentSettings)

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

BatchJobCreateParameters setConstraints(BatchJobConstraints constraints)

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

BatchJobCreateParameters setDisplayName(String displayName)

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

BatchJobCreateParameters setJobManagerTask(BatchJobManagerTask jobManagerTask)

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

BatchJobCreateParameters setJobPreparationTask(BatchJobPreparationTask jobPreparationTask)

Set the jobPreparationTask property: The Job Preparation Task.

BatchJobCreateParameters setJobReleaseTask(BatchJobReleaseTask jobReleaseTask)

Set the jobReleaseTask property: The Job Release Task.

BatchJobCreateParameters setMaxParallelTasks(Integer maxParallelTasks)

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

BatchJobCreateParameters setMetadata(List<BatchMetadataItem> metadata)

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

BatchJobCreateParameters setNetworkConfiguration(BatchJobNetworkConfiguration networkConfiguration)

Set the networkConfiguration property: (This property is not available by default.

BatchJobCreateParameters setPriority(Integer priority)

Set the priority property: The priority of the Job.

BatchJobCreateParameters setTaskFailureMode(BatchTaskFailureMode taskFailureMode)

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

BatchJobCreateParameters setUsesTaskDependencies(Boolean usesTaskDependencies)

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

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

BatchJobCreateParameters

public BatchJobCreateParameters(String id, BatchPoolInfo poolInfo)

Creates an instance of BatchJobCreateParameters class.

Parameters:

id - the id value to set.
poolInfo - the poolInfo value to set.

Method Details

fromJson

public static BatchJobCreateParameters fromJson(JsonReader jsonReader)

Reads an instance of BatchJobCreateParameters from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of BatchJobCreateParameters 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. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. 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.

getDisplayName

public String getDisplayName()

Get the displayName property: The display name for the Job. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.

Returns:

the displayName value.

getId

public String getId()

Get the id property: A string that uniquely identifies the Job within the Account. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. 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. If the Job does not specify a Job Manager Task, the user must explicitly add Tasks to the Job. If the Job does specify a Job Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task before scheduling other Tasks in the Job. The Job Manager Task's typical purpose is to control and/or monitor Job execution, for example by deciding what additional Tasks to run, determining when the work is complete, etc. (However, a Job Manager Task is not restricted to these activities - it is a fully-fledged Task in the system and perform whatever actions are required for the Job.) For example, a Job Manager Task might download a file specified as a parameter, analyze the contents of that file and submit additional Tasks based on those contents.

Returns:

the jobManagerTask value.

getJobPreparationTask

public BatchJobPreparationTask getJobPreparationTask()

Get the jobPreparationTask property: The Job Preparation Task. If a Job has a Job Preparation Task, the Batch service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node.

Returns:

the jobPreparationTask value.

getJobReleaseTask

public BatchJobReleaseTask getJobReleaseTask()

Get the jobReleaseTask property: The Job Release Task. A Job Release Task cannot be specified without also specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Nodes that have run the Job Preparation Task. The primary purpose of the Job Release Task is to undo changes to Compute Nodes made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that were started as part of Job preparation.

Returns:

the jobReleaseTask value.

getMaxParallelTasks

public Integer getMaxParallelTasks()

Get the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job. (This property is not available by default. Please contact support for more information) 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: (This property is not available by default. Please contact support for more information) The network configuration for the Job.

Returns:

the networkConfiguration value.

getPoolInfo

public BatchPoolInfo getPoolInfo()

Get the poolInfo property: The Pool on which the Batch service runs the Job's Tasks.

Returns:

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

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.

isAllowTaskPreemption

public Boolean isAllowTaskPreemption()

Get the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs. (This property is not available by default. Please contact support for more information) 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 BatchJobCreateParameters setAllowTaskPreemption(Boolean allowTaskPreemption)

Set the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs. (This property is not available by default. Please contact support for more information) 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 BatchJobCreateParameters object itself.

setAllTasksCompleteMode

public BatchJobCreateParameters 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. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction.

Parameters:

allTasksCompleteMode - the allTasksCompleteMode value to set.

Returns:

the BatchJobCreateParameters object itself.

setCommonEnvironmentSettings

public BatchJobCreateParameters setCommonEnvironmentSettings(List<EnvironmentSetting> commonEnvironmentSettings)

Set 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.

Parameters:

commonEnvironmentSettings - the commonEnvironmentSettings value to set.

Returns:

the BatchJobCreateParameters object itself.

setConstraints

public BatchJobCreateParameters setConstraints(BatchJobConstraints constraints)

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

Parameters:

constraints - the constraints value to set.

Returns:

the BatchJobCreateParameters object itself.

setDisplayName

public BatchJobCreateParameters setDisplayName(String displayName)

Set the displayName property: The display name for the Job. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.

Parameters:

displayName - the displayName value to set.

Returns:

the BatchJobCreateParameters object itself.

setJobManagerTask

public BatchJobCreateParameters setJobManagerTask(BatchJobManagerTask jobManagerTask)

Set the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started. If the Job does not specify a Job Manager Task, the user must explicitly add Tasks to the Job. If the Job does specify a Job Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task before scheduling other Tasks in the Job. The Job Manager Task's typical purpose is to control and/or monitor Job execution, for example by deciding what additional Tasks to run, determining when the work is complete, etc. (However, a Job Manager Task is not restricted to these activities - it is a fully-fledged Task in the system and perform whatever actions are required for the Job.) For example, a Job Manager Task might download a file specified as a parameter, analyze the contents of that file and submit additional Tasks based on those contents.

Parameters:

jobManagerTask - the jobManagerTask value to set.

Returns:

the BatchJobCreateParameters object itself.

setJobPreparationTask

public BatchJobCreateParameters setJobPreparationTask(BatchJobPreparationTask jobPreparationTask)

Set the jobPreparationTask property: The Job Preparation Task. If a Job has a Job Preparation Task, the Batch service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node.

Parameters:

jobPreparationTask - the jobPreparationTask value to set.

Returns:

the BatchJobCreateParameters object itself.

setJobReleaseTask

public BatchJobCreateParameters setJobReleaseTask(BatchJobReleaseTask jobReleaseTask)

Set the jobReleaseTask property: The Job Release Task. A Job Release Task cannot be specified without also specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Nodes that have run the Job Preparation Task. The primary purpose of the Job Release Task is to undo changes to Compute Nodes made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that were started as part of Job preparation.

Parameters:

jobReleaseTask - the jobReleaseTask value to set.

Returns:

the BatchJobCreateParameters object itself.

setMaxParallelTasks

public BatchJobCreateParameters setMaxParallelTasks(Integer maxParallelTasks)

Set the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job. (This property is not available by default. Please contact support for more information) 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 BatchJobCreateParameters object itself.

setMetadata

public BatchJobCreateParameters 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 BatchJobCreateParameters object itself.

setNetworkConfiguration

public BatchJobCreateParameters setNetworkConfiguration(BatchJobNetworkConfiguration networkConfiguration)

Set the networkConfiguration property: (This property is not available by default. Please contact support for more information) The network configuration for the Job.

Parameters:

networkConfiguration - the networkConfiguration value to set.

Returns:

the BatchJobCreateParameters object itself.

setPriority

public BatchJobCreateParameters 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 BatchJobCreateParameters object itself.

setTaskFailureMode

public BatchJobCreateParameters setTaskFailureMode(BatchTaskFailureMode taskFailureMode)

Set 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.

Parameters:

taskFailureMode - the taskFailureMode value to set.

Returns:

the BatchJobCreateParameters object itself.

setUsesTaskDependencies

public BatchJobCreateParameters setUsesTaskDependencies(Boolean usesTaskDependencies)

Set the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other. The default is false.

Parameters:

usesTaskDependencies - the usesTaskDependencies value to set.

Returns:

the BatchJobCreateParameters object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to