CloudTask 类

定义

An Azure Batch task. Batch will retry tasks when a recovery operation is triggered on a compute node. Examples of recovery operations include (but are not limited to) when an unhealthy compute node is rebooted or a compute node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all tasks should be idempotent. This means tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running tasks is to use some form of checkpointing.

public class CloudTask
继承
java.lang.Object
CloudTask

方法

affinityInfo()

Get the affinityInfo value.

applicationPackageReferences()

Get application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails.

authenticationTokenSettings()

Get if this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.

commandLine()

Get for multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. 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).

constraints()

Get the constraints value.

containerSettings()

Get if the pool that will run this task has containerConfiguration set, this must be set as well. If the pool that will run this task doesn't have containerConfiguration set, this must not be 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.

creationTime()

Get the creationTime value.

dependsOn()

Get this task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled.

displayName()

Get the display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.

environmentSettings()

Get the environmentSettings value.

eTag()

Get this is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime.

executionInfo()

Get the executionInfo value.

exitConditions()

Get how the Batch service should respond when the task completes.

id()

Get the ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.

lastModified()

Get the lastModified value.

multiInstanceSettings()

Get the multiInstanceSettings value.

nodeInfo()

Get the nodeInfo value.

outputFiles()

Get for multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed.

previousState()

Get this property is not set if the task is in its initial Active state. Possible values include: 'active', 'preparing', 'running', 'completed'.

previousStateTransitionTime()

Get this property is not set if the task is in its initial Active state.

resourceFiles()

Get for multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers.

state()

Get possible values include: 'active', 'preparing', 'running', 'completed'.

stateTransitionTime()

Get the stateTransitionTime value.

stats()

Get the stats value.

url()

Get the url value.

userIdentity()

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

withAffinityInfo(AffinityInformation affinityInfo)

Set the affinityInfo value.

withApplicationPackageReferences(List<ApplicationPackageReference> applicationPackageReferences)

Set application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails.

withAuthenticationTokenSettings(AuthenticationTokenSettings authenticationTokenSettings)

Set if this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.

withCommandLine(String commandLine)

Set for multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. 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).

withConstraints(TaskConstraints constraints)

Set the constraints value.

withContainerSettings(TaskContainerSettings containerSettings)

Set if the pool that will run this task has containerConfiguration set, this must be set as well. If the pool that will run this task doesn't have containerConfiguration set, this must not be 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.

withCreationTime(DateTime creationTime)

Set the creationTime value.

withDependsOn(TaskDependencies dependsOn)

Set this task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled.

withDisplayName(String displayName)

Set the display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.

withEnvironmentSettings(List<EnvironmentSetting> environmentSettings)

Set the environmentSettings value.

withETag(String eTag)

Set this is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime.

withExecutionInfo(TaskExecutionInformation executionInfo)

Set the executionInfo value.

withExitConditions(ExitConditions exitConditions)

Set how the Batch service should respond when the task completes.

withId(String id)

Set the ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.

withLastModified(DateTime lastModified)

Set the lastModified value.

withMultiInstanceSettings(MultiInstanceSettings multiInstanceSettings)

Set the multiInstanceSettings value.

withNodeInfo(ComputeNodeInformation nodeInfo)

Set the nodeInfo value.

withOutputFiles(List<OutputFile> outputFiles)

Set for multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed.

withPreviousState(TaskState previousState)

Set this property is not set if the task is in its initial Active state. Possible values include: 'active', 'preparing', 'running', 'completed'.

withPreviousStateTransitionTime(DateTime previousStateTransitionTime)

Set this property is not set if the task is in its initial Active state.

withResourceFiles(List<ResourceFile> resourceFiles)

Set for multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers.

withState(TaskState state)

Set possible values include: 'active', 'preparing', 'running', 'completed'.

withStateTransitionTime(DateTime stateTransitionTime)

Set the stateTransitionTime value.

withStats(TaskStatistics stats)

Set the stats value.

withUrl(String url)

Set the url value.

withUserIdentity(UserIdentity userIdentity)

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

适用于