次の方法で共有


JobReleaseTask Class

  • java.lang.Object
    • com.microsoft.azure.batch.protocol.models.JobReleaseTask

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.

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.

List<EnvironmentSetting> environmentSettings()

Get the environmentSettings value.

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 maxWallClockTime value.

List<ResourceFile> 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.e.

UserIdentity userIdentity()

Get if omitted, the Task runs as a non-administrative user unique to the Task.

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.

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.

JobReleaseTask withEnvironmentSettings(List<EnvironmentSetting> environmentSettings)

Set the environmentSettings value.

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.

JobReleaseTask withMaxWallClockTime(Period maxWallClockTime)

Set the maxWallClockTime value.

JobReleaseTask withResourceFiles(List<ResourceFile> resourceFiles)

Set files listed under this element are located in the Task's working directory.

JobReleaseTask withRetentionTime(Period retentionTime)

Set the default is 7 days, i.e.

JobReleaseTask 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/en-us/azure/batch/batch-compute-node-environment-variables).

Returns:

the commandLine value

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:

the containerSettings value

environmentSettings

public List environmentSettings()

Get the environmentSettings value.

Returns:

the environmentSettings value

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:

the id value

maxWallClockTime

public Period maxWallClockTime()

Get the maxWallClockTime value.

Returns:

the maxWallClockTime value

resourceFiles

public List resourceFiles()

Get files listed under this element are located in the Task's working directory.

Returns:

the resourceFiles value

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:

the retentionTime value

userIdentity

public UserIdentity userIdentity()

Get if omitted, the Task runs as a non-administrative user unique to the Task.

Returns:

the userIdentity value

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/en-us/azure/batch/batch-compute-node-environment-variables).

Parameters:

commandLine - the commandLine value to set

Returns:

the JobReleaseTask object itself.

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:

containerSettings - the containerSettings value to set

Returns:

the JobReleaseTask object itself.

withEnvironmentSettings

public JobReleaseTask withEnvironmentSettings(List environmentSettings)

Set the environmentSettings value.

Parameters:

environmentSettings - the environmentSettings value to set

Returns:

the JobReleaseTask object itself.

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:

id - the id value to set

Returns:

the JobReleaseTask object itself.

withMaxWallClockTime

public JobReleaseTask withMaxWallClockTime(Period maxWallClockTime)

Set the maxWallClockTime value.

Parameters:

maxWallClockTime - the maxWallClockTime value to set

Returns:

the JobReleaseTask object itself.

withResourceFiles

public JobReleaseTask withResourceFiles(List resourceFiles)

Set files listed under this element are located in the Task's working directory.

Parameters:

resourceFiles - the resourceFiles value to set

Returns:

the JobReleaseTask object itself.

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:

retentionTime - the retentionTime value to set

Returns:

the JobReleaseTask object itself.

withUserIdentity

public JobReleaseTask withUserIdentity(UserIdentity userIdentity)

Set if omitted, the Task runs as a non-administrative user unique to the Task.

Parameters:

userIdentity - the userIdentity value to set

Returns:

the JobReleaseTask object itself.

Applies to