JobReleaseTask Class
- java.
lang. Object - com.
microsoft. azure. batch. protocol. models. JobReleaseTask
- com.
public class JobReleaseTask
A Job Release Task to run on Job completion on any Compute Node where the Job has run. The Job Release Task runs when the Job ends, because of one of the following: The user calls the Terminate Job API, or the Delete Job API while the Job is still active, the Job's maximum wall clock time constraint is reached, and the Job is still active, or the Job's Job Manager Task completed, and the Job is configured to terminate when the Job Manager completes. The Job Release Task runs on each Node where Tasks of the Job have run and the Job Preparation Task ran and completed. If you reimage a Node after it has run the Job Preparation Task, and the Job ends without any further Tasks of the Job running on that Node (and hence the Job Preparation Task does not re-run), then the Job Release Task does not run on that Compute Node. If a Node reboots while the Job Release Task is still running, the Job Release Task runs again when the Compute Node starts up. The Job is not marked as complete until all Job Release Tasks have completed. The Job Release Task runs in the background. It does not occupy a scheduling slot; that is, it does not count towards the taskSlotsPerNode limit specified on the Pool.
Constructor Summary
Constructor | Description | |
---|---|---|
JobReleaseTask() |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
commandLine()
Get the command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. |
Task |
containerSettings()
Get when this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. |
List<Environment |
environmentSettings()
Get the environment |
String |
id()
Get the ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. |
org.joda.time.Period |
maxWallClockTime()
Get the max |
List<Resource |
resourceFiles()
Get files listed under this element are located in the Task's working directory. |
org.joda.time.Period |
retentionTime()
Get the default is 7 days, i. |
User |
userIdentity()
Get if omitted, the Task runs as a non-administrative user unique to the Task. |
Job |
withCommandLine(String commandLine)
Set the command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. |
Job |
withContainerSettings(TaskContainerSettings containerSettings)
Set when this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. |
Job |
withEnvironmentSettings(List<EnvironmentSetting> environmentSettings)
Set the environment |
Job |
withId(String id)
Set the ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. |
Job |
withMaxWallClockTime(Period maxWallClockTime)
Set the max |
Job |
withResourceFiles(List<ResourceFile> resourceFiles)
Set files listed under this element are located in the Task's working directory. |
Job |
withRetentionTime(Period retentionTime)
Set the default is 7 days, i. |
Job |
withUserIdentity(UserIdentity userIdentity)
Set if omitted, the Task runs as a non-administrative user unique to the Task. |
Methods inherited from java.lang.Object
Constructor Details
JobReleaseTask
public JobReleaseTask()
Method Details
commandLine
public String commandLine()
Get the command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
Returns:
containerSettings
public TaskContainerSettings containerSettings()
Get when this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files.
Returns:
environmentSettings
public List
Get the environmentSettings value.
Returns:
id
public String id()
Get the ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other Task in the Job can have the same ID as the Job Release Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).
Returns:
maxWallClockTime
public Period maxWallClockTime()
Get the maxWallClockTime value.
Returns:
resourceFiles
public List
Get files listed under this element are located in the Task's working directory.
Returns:
retentionTime
public Period retentionTime()
Get the default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted.
Returns:
userIdentity
public UserIdentity userIdentity()
Get if omitted, the Task runs as a non-administrative user unique to the Task.
Returns:
withCommandLine
public JobReleaseTask withCommandLine(String commandLine)
Set the command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
Parameters:
Returns:
withContainerSettings
public JobReleaseTask withContainerSettings(TaskContainerSettings containerSettings)
Set when this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files.
Parameters:
Returns:
withEnvironmentSettings
public JobReleaseTask withEnvironmentSettings(List
Set the environmentSettings value.
Parameters:
Returns:
withId
public JobReleaseTask withId(String id)
Set the ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other Task in the Job can have the same ID as the Job Release Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).
Parameters:
Returns:
withMaxWallClockTime
public JobReleaseTask withMaxWallClockTime(Period maxWallClockTime)
Set the maxWallClockTime value.
Parameters:
Returns:
withResourceFiles
public JobReleaseTask withResourceFiles(List
Set files listed under this element are located in the Task's working directory.
Parameters:
Returns:
withRetentionTime
public JobReleaseTask withRetentionTime(Period retentionTime)
Set the default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted.
Parameters:
Returns:
withUserIdentity
public JobReleaseTask withUserIdentity(UserIdentity userIdentity)
Set if omitted, the Task runs as a non-administrative user unique to the Task.
Parameters:
Returns:
Applies to
Azure SDK for Java