TaskConstraints Class

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

public class TaskConstraints

Execution constraints to apply to a Task.

Constructor Summary

Constructor Description
TaskConstraints()

Method Summary

Modifier and Type Method and Description
Integer maxTaskRetryCount()

Get note that this value specifically controls the number of retries for the Task executable due to a nonzero exit code.

org.joda.time.Period maxWallClockTime()

Get if this is not specified, there is no time limit on how long the Task may run.

org.joda.time.Period retentionTime()

Get the default is 7 days, i.e.

TaskConstraints withMaxTaskRetryCount(Integer maxTaskRetryCount)

Set note that this value specifically controls the number of retries for the Task executable due to a nonzero exit code.

TaskConstraints withMaxWallClockTime(Period maxWallClockTime)

Set if this is not specified, there is no time limit on how long the Task may run.

TaskConstraints withRetentionTime(Period retentionTime)

Set the default is 7 days, i.e.

Methods inherited from java.lang.Object

Constructor Details

TaskConstraints

public TaskConstraints()

Method Details

maxTaskRetryCount

public Integer maxTaskRetryCount()

Get note that this value specifically controls the number of retries for the Task executable due to a nonzero exit code. The Batch service will try the Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the Task after the first attempt. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries).

Returns:

the maxTaskRetryCount value

maxWallClockTime

public Period maxWallClockTime()

Get if this is not specified, there is no time limit on how long the Task may run.

Returns:

the maxWallClockTime 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

withMaxTaskRetryCount

public TaskConstraints withMaxTaskRetryCount(Integer maxTaskRetryCount)

Set note that this value specifically controls the number of retries for the Task executable due to a nonzero exit code. The Batch service will try the Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the Task after the first attempt. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries).

Parameters:

maxTaskRetryCount - the maxTaskRetryCount value to set

Returns:

the TaskConstraints object itself.

withMaxWallClockTime

public TaskConstraints withMaxWallClockTime(Period maxWallClockTime)

Set if this is not specified, there is no time limit on how long the Task may run.

Parameters:

maxWallClockTime - the maxWallClockTime value to set

Returns:

the TaskConstraints object itself.

withRetentionTime

public TaskConstraints 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 TaskConstraints object itself.

Applies to