BatchJobCreateParameters Class
- java.
lang. Object - com.
azure. compute. batch. models. BatchJobCreateParameters
- com.
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 Batch |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Batch |
fromJson(JsonReader jsonReader)
Reads an instance of Batch |
|
Batch |
getAllTasksCompleteMode()
Get the all |
|
List<Environment |
getCommonEnvironmentSettings()
Get the common |
|
Batch |
getConstraints()
Get the constraints property: The execution constraints for the Job. |
| String |
getDisplayName()
Get the display |
| String |
getId()
Get the id property: A string that uniquely identifies the Job within the Account. |
|
Batch |
getJobManagerTask()
Get the job |
|
Batch |
getJobPreparationTask()
Get the job |
|
Batch |
getJobReleaseTask()
Get the job |
| Integer |
getMaxParallelTasks()
Get the max |
|
List<Batch |
getMetadata()
Get the metadata property: A list of name-value pairs associated with the Job as metadata. |
|
Batch |
getNetworkConfiguration()
Get the network |
|
Batch |
getPoolInfo()
Get the pool |
| Integer |
getPriority()
Get the priority property: The priority of the Job. |
|
Batch |
getTaskFailureMode()
Get the task |
| Boolean |
isAllowTaskPreemption()
Get the allow |
| Boolean |
isUsesTaskDependencies()
Get the uses |
|
Batch |
setAllowTaskPreemption(Boolean allowTaskPreemption)
Set the allow |
|
Batch |
setAllTasksCompleteMode(BatchAllTasksCompleteMode allTasksCompleteMode)
Set the all |
|
Batch |
setCommonEnvironmentSettings(List<EnvironmentSetting> commonEnvironmentSettings)
Set the common |
|
Batch |
setConstraints(BatchJobConstraints constraints)
Set the constraints property: The execution constraints for the Job. |
|
Batch |
setDisplayName(String displayName)
Set the display |
|
Batch |
setJobManagerTask(BatchJobManagerTask jobManagerTask)
Set the job |
|
Batch |
setJobPreparationTask(BatchJobPreparationTask jobPreparationTask)
Set the job |
|
Batch |
setJobReleaseTask(BatchJobReleaseTask jobReleaseTask)
Set the job |
|
Batch |
setMaxParallelTasks(Integer maxParallelTasks)
Set the max |
|
Batch |
setMetadata(List<BatchMetadataItem> metadata)
Set the metadata property: A list of name-value pairs associated with the Job as metadata. |
|
Batch |
setNetworkConfiguration(BatchJobNetworkConfiguration networkConfiguration)
Set the network |
|
Batch |
setPriority(Integer priority)
Set the priority property: The priority of the Job. |
|
Batch |
setTaskFailureMode(BatchTaskFailureMode taskFailureMode)
Set the task |
|
Batch |
setUsesTaskDependencies(Boolean usesTaskDependencies)
Set the uses |
|
Json |
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:
Method Details
fromJson
public static BatchJobCreateParameters fromJson(JsonReader jsonReader)
Reads an instance of BatchJobCreateParameters from the JsonReader.
Parameters:
Returns:
Throws:
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:
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:
getConstraints
public BatchJobConstraints getConstraints()
Get the constraints property: The execution constraints for the Job.
Returns:
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:
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:
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:
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:
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:
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:
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:
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:
getPoolInfo
public BatchPoolInfo getPoolInfo()
Get the poolInfo property: The Pool on which the Batch service runs the Job's Tasks.
Returns:
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:
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:
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:
isUsesTaskDependencies
public Boolean isUsesTaskDependencies()
Get the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other. The default is false.
Returns:
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:
Returns:
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:
Returns:
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:
Returns:
setConstraints
public BatchJobCreateParameters setConstraints(BatchJobConstraints constraints)
Set the constraints property: The execution constraints for the Job.
Parameters:
Returns:
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:
Returns:
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:
Returns:
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:
Returns:
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:
Returns:
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:
Returns:
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:
Returns:
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:
Returns:
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:
Returns:
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:
Returns:
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:
Returns: