Package com.azure.compute.batch.models
Class BatchJobConstraints
java.lang.Object
com.azure.compute.batch.models.BatchJobConstraints
- All Implemented Interfaces:
com.azure.json.JsonSerializable<BatchJobConstraints>
public final class BatchJobConstraints
extends Object
implements com.azure.json.JsonSerializable<BatchJobConstraints>
The execution constraints for a Job.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BatchJobConstraints
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of BatchJobConstraints from the JsonReader.Get the maxTaskRetryCount property: The maximum number of times each Task may be retried.Get the maxWallClockTime property: The maximum elapsed time that the Job may run, measured from the time the Job is created.setMaxTaskRetryCount
(Integer maxTaskRetryCount) Set the maxTaskRetryCount property: The maximum number of times each Task may be retried.setMaxWallClockTime
(Duration maxWallClockTime) Set the maxWallClockTime property: The maximum elapsed time that the Job may run, measured from the time the Job is created.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
-
BatchJobConstraints
public BatchJobConstraints()Creates an instance of BatchJobConstraints class.
-
-
Method Details
-
getMaxWallClockTime
Get the maxWallClockTime property: The maximum elapsed time that the Job may run, measured from the time the Job is created. If the Job does not complete within the time limit, the Batch service terminates it and any Tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the Job may run.- Returns:
- the maxWallClockTime value.
-
setMaxWallClockTime
Set the maxWallClockTime property: The maximum elapsed time that the Job may run, measured from the time the Job is created. If the Job does not complete within the time limit, the Batch service terminates it and any Tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the Job may run.- Parameters:
maxWallClockTime
- the maxWallClockTime value to set.- Returns:
- the BatchJobConstraints object itself.
-
getMaxTaskRetryCount
Get the maxTaskRetryCount property: The maximum number of times each 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. The Batch service will try each Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry Tasks. If the maximum retry count is -1, the Batch service retries Tasks without limit. The default value is 0 (no retries).- Returns:
- the maxTaskRetryCount value.
-
setMaxTaskRetryCount
Set the maxTaskRetryCount property: The maximum number of times each 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. The Batch service will try each Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry Tasks. If the maximum retry count is -1, the Batch service retries Tasks without limit. The default value is 0 (no retries).- Parameters:
maxTaskRetryCount
- the maxTaskRetryCount value to set.- Returns:
- the BatchJobConstraints object itself.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<BatchJobConstraints>
- Throws:
IOException
-
fromJson
Reads an instance of BatchJobConstraints from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of BatchJobConstraints 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 BatchJobConstraints.
-