Package com.azure.compute.batch.models
Class BatchTaskConstraints
java.lang.Object
com.azure.compute.batch.models.BatchTaskConstraints
- All Implemented Interfaces:
com.azure.json.JsonSerializable<BatchTaskConstraints>
public final class BatchTaskConstraints
extends Object
implements com.azure.json.JsonSerializable<BatchTaskConstraints>
Execution constraints to apply to a Task.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BatchTaskConstraints
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of BatchTaskConstraints from the JsonReader.Get the maxTaskRetryCount property: The maximum number of times the Task may be retried.Get the maxWallClockTime property: The maximum elapsed time that the Task may run, measured from the time the Task starts.Get the retentionTime property: The minimum time to retain the Task directory on the Compute Node where it ran, from the time it completes execution.setMaxTaskRetryCount
(Integer maxTaskRetryCount) Set the maxTaskRetryCount property: The maximum number of times the Task may be retried.setMaxWallClockTime
(Duration maxWallClockTime) Set the maxWallClockTime property: The maximum elapsed time that the Task may run, measured from the time the Task starts.setRetentionTime
(Duration retentionTime) Set the retentionTime property: The minimum time to retain the Task directory on the Compute Node where it ran, from the time it completes execution.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
BatchTaskConstraints
public BatchTaskConstraints()Creates an instance of BatchTaskConstraints class.
-
-
Method Details
-
getMaxWallClockTime
Get the maxWallClockTime property: The maximum elapsed time that the Task may run, measured from the time the Task starts. If the Task does not complete within the time limit, the Batch service terminates it. If this is not specified, there is no time limit on how long the Task may run.- Returns:
- the maxWallClockTime value.
-
setMaxWallClockTime
Set the maxWallClockTime property: The maximum elapsed time that the Task may run, measured from the time the Task starts. If the Task does not complete within the time limit, the Batch service terminates it. 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 BatchTaskConstraints object itself.
-
getRetentionTime
Get the retentionTime property: The minimum time to retain the Task directory on the Compute Node where it ran, from the time it completes execution. After this time, the Batch service may delete the Task directory and all its contents. 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.
-
setRetentionTime
Set the retentionTime property: The minimum time to retain the Task directory on the Compute Node where it ran, from the time it completes execution. After this time, the Batch service may delete the Task directory and all its contents. 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 BatchTaskConstraints object itself.
-
getMaxTaskRetryCount
Get the maxTaskRetryCount property: The maximum number of times the Task may be retried. The Batch service retries a Task if its exit code is nonzero. 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.
-
setMaxTaskRetryCount
Set the maxTaskRetryCount property: The maximum number of times the Task may be retried. The Batch service retries a Task if its exit code is nonzero. 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 BatchTaskConstraints object itself.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<BatchTaskConstraints>
- Throws:
IOException
-
fromJson
public static BatchTaskConstraints fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of BatchTaskConstraints from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of BatchTaskConstraints if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException
- If an error occurs while reading the BatchTaskConstraints.
-