TaskAddParameter Class
- java.
lang. Object - com.
microsoft. azure. batch. protocol. models. TaskAddParameter
- com.
public class TaskAddParameter
An Azure Batch Task to add. Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy 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.
Constructor Summary
Constructor | Description | |
---|---|---|
TaskAddParameter() |
Method Summary
Modifier and Type | Method and Description |
---|---|
Affinity |
affinityInfo()
Get the affinity |
List<Application |
applicationPackageReferences()
Get application packages are downloaded and deployed to a shared directory, not the Task working directory. |
Authentication |
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. |
String |
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. |
Task |
constraints()
Get if you do not specify constraints, the max |
Task |
containerSettings()
Get if the Pool that will run this Task has container |
Task |
dependsOn()
Get this Task will not be scheduled until all Tasks that it depends on have completed successfully. |
String |
displayName()
Get the display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. |
List<Environment |
environmentSettings()
Get the environment |
Exit |
exitConditions()
Get how the Batch service should respond when the Task completes. |
String |
id()
Get the ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. |
Multi |
multiInstanceSettings()
Get the multi |
List<Output |
outputFiles()
Get for multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. |
Integer |
requiredSlots()
Get the default is 1. |
List<Resource |
resourceFiles()
Get for multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is executed. |
User |
userIdentity()
Get if omitted, the Task runs as a non-administrative user unique to the Task. |
Task |
withAffinityInfo(AffinityInformation affinityInfo)
Set the affinity |
Task |
withApplicationPackageReferences(List<ApplicationPackageReference> applicationPackageReferences)
Set application packages are downloaded and deployed to a shared directory, not the Task working directory. |
Task |
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. |
Task |
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. |
Task |
withConstraints(TaskConstraints constraints)
Set if you do not specify constraints, the max |
Task |
withContainerSettings(TaskContainerSettings containerSettings)
Set if the Pool that will run this Task has container |
Task |
withDependsOn(TaskDependencies dependsOn)
Set this Task will not be scheduled until all Tasks that it depends on have completed successfully. |
Task |
withDisplayName(String displayName)
Set the display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. |
Task |
withEnvironmentSettings(List<EnvironmentSetting> environmentSettings)
Set the environment |
Task |
withExitConditions(ExitConditions exitConditions)
Set how the Batch service should respond when the Task completes. |
Task |
withId(String id)
Set the ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. |
Task |
withMultiInstanceSettings(MultiInstanceSettings multiInstanceSettings)
Set the multi |
Task |
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. |
Task |
withRequiredSlots(Integer requiredSlots)
Set the default is 1. |
Task |
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. |
Task |
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
TaskAddParameter
public TaskAddParameter()
Method Details
affinityInfo
public AffinityInformation affinityInfo()
Get the affinityInfo value.
Returns:
applicationPackageReferences
public List
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 Node, and is up to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Package cannot be installed, for example because the package has been deleted or because download failed, the Task fails.
Returns:
authenticationTokenSettings
public AuthenticationTokenSettings 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.
Returns:
commandLine
public String 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/azure/batch/batch-compute-node-environment-variables).
Returns:
constraints
public TaskConstraints constraints()
Get if you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the Job, the maxWallClockTime is infinite, and the retentionTime is 7 days.
Returns:
containerSettings
public TaskContainerSettings 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. 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:
dependsOn
public TaskDependencies 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. If the Job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob.
Returns:
displayName
public String displayName()
Get the display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
Returns:
environmentSettings
public List
Get the environmentSettings value.
Returns:
exitConditions
public ExitConditions exitConditions()
Get how the Batch service should respond when the Task completes.
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. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a Job that differ only by case).
Returns:
multiInstanceSettings
public MultiInstanceSettings multiInstanceSettings()
Get the multiInstanceSettings value.
Returns:
outputFiles
public List
Get for multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed.
Returns:
requiredSlots
public Integer requiredSlots()
Get the default is 1. A Task can only be scheduled to run on a compute node if the node has enough free scheduling slots available. For multi-instance Tasks, this must be 1.
Returns:
resourceFiles
public List
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.
Returns:
userIdentity
public UserIdentity userIdentity()
Get if omitted, the Task runs as a non-administrative user unique to the Task.
Returns:
withAffinityInfo
public TaskAddParameter withAffinityInfo(AffinityInformation affinityInfo)
Set the affinityInfo value.
Parameters:
Returns:
withApplicationPackageReferences
public TaskAddParameter withApplicationPackageReferences(List
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 Node, and is up to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Package cannot be installed, for example because the package has been deleted or because download failed, the Task fails.
Parameters:
Returns:
withAuthenticationTokenSettings
public TaskAddParameter 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.
Parameters:
Returns:
withCommandLine
public TaskAddParameter 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/azure/batch/batch-compute-node-environment-variables).
Parameters:
Returns:
withConstraints
public TaskAddParameter withConstraints(TaskConstraints constraints)
Set if you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the Job, the maxWallClockTime is infinite, and the retentionTime is 7 days.
Parameters:
Returns:
withContainerSettings
public TaskAddParameter 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. 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:
withDependsOn
public TaskAddParameter 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. If the Job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob.
Parameters:
Returns:
withDisplayName
public TaskAddParameter withDisplayName(String displayName)
Set the display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
Parameters:
Returns:
withEnvironmentSettings
public TaskAddParameter withEnvironmentSettings(List
Set the environmentSettings value.
Parameters:
Returns:
withExitConditions
public TaskAddParameter withExitConditions(ExitConditions exitConditions)
Set how the Batch service should respond when the Task completes.
Parameters:
Returns:
withId
public TaskAddParameter withId(String id)
Set 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 a Job that differ only by case).
Parameters:
Returns:
withMultiInstanceSettings
public TaskAddParameter withMultiInstanceSettings(MultiInstanceSettings multiInstanceSettings)
Set the multiInstanceSettings value.
Parameters:
Returns:
withOutputFiles
public TaskAddParameter withOutputFiles(List
Set for multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed.
Parameters:
Returns:
withRequiredSlots
public TaskAddParameter withRequiredSlots(Integer requiredSlots)
Set the default is 1. A Task can only be scheduled to run on a compute node if the node has enough free scheduling slots available. For multi-instance Tasks, this must be 1.
Parameters:
Returns:
withResourceFiles
public TaskAddParameter withResourceFiles(List
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.
Parameters:
Returns:
withUserIdentity
public TaskAddParameter 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