View Javadoc
1   // Copyright (c) Microsoft Corporation. All rights reserved.
2   // Licensed under the MIT License.
3   // Code generated by Microsoft (R) AutoRest Code Generator
4   
5   package com.microsoft.azure.batch.protocol.models;
6   
7   import org.joda.time.Period;
8   import com.fasterxml.jackson.annotation.JsonProperty;
9   
10  /**
11   * The execution constraints for a job.
12   */
13  public class JobConstraints {
14      /**
15       * The maximum elapsed time that the job may run, measured from the time
16       * the job is created.
17       * If the job does not complete within the time limit, the Batch service
18       * terminates it and any tasks that are still running. In this case, the
19       * termination reason will be MaxWallClockTimeExpiry. If this property is
20       * not specified, there is no time limit on how long the job may run.
21       */
22      @JsonProperty(value = "maxWallClockTime")
23      private Period maxWallClockTime;
24  
25      /**
26       * The maximum number of times each task may be retried. The Batch service
27       * retries a task if its exit code is nonzero.
28       * Note that this value specifically controls the number of retries. The
29       * Batch service will try each task once, and may then retry up to this
30       * limit. For example, if the maximum retry count is 3, Batch tries a task
31       * up to 4 times (one initial try and 3 retries). If the maximum retry
32       * count is 0, the Batch service does not retry tasks. If the maximum retry
33       * count is -1, the Batch service retries tasks without limit. The default
34       * value is 0 (no retries).
35       */
36      @JsonProperty(value = "maxTaskRetryCount")
37      private Integer maxTaskRetryCount;
38  
39      /**
40       * Get 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.
41       *
42       * @return the maxWallClockTime value
43       */
44      public Period maxWallClockTime() {
45          return this.maxWallClockTime;
46      }
47  
48      /**
49       * Set 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.
50       *
51       * @param maxWallClockTime the maxWallClockTime value to set
52       * @return the JobConstraints object itself.
53       */
54      public JobConstraints withMaxWallClockTime(Period maxWallClockTime) {
55          this.maxWallClockTime = maxWallClockTime;
56          return this;
57      }
58  
59      /**
60       * Get 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).
61       *
62       * @return the maxTaskRetryCount value
63       */
64      public Integer maxTaskRetryCount() {
65          return this.maxTaskRetryCount;
66      }
67  
68      /**
69       * Set 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).
70       *
71       * @param maxTaskRetryCount the maxTaskRetryCount value to set
72       * @return the JobConstraints object itself.
73       */
74      public JobConstraints withMaxTaskRetryCount(Integer maxTaskRetryCount) {
75          this.maxTaskRetryCount = maxTaskRetryCount;
76          return this;
77      }
78  
79  }