Class JobConstraints


  • public class JobConstraints
    extends Object
    The execution constraints for a Job.
    • Constructor Detail

      • JobConstraints

        public JobConstraints()
    • Method Detail

      • maxWallClockTime

        public org.joda.time.Period maxWallClockTime()
        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.
        Returns:
        the maxWallClockTime value
      • withMaxWallClockTime

        public JobConstraints withMaxWallClockTime​(org.joda.time.Period maxWallClockTime)
        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.
        Parameters:
        maxWallClockTime - the maxWallClockTime value to set
        Returns:
        the JobConstraints object itself.
      • maxTaskRetryCount

        public Integer maxTaskRetryCount()
        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).
        Returns:
        the maxTaskRetryCount value
      • withMaxTaskRetryCount

        public JobConstraints withMaxTaskRetryCount​(Integer maxTaskRetryCount)
        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).
        Parameters:
        maxTaskRetryCount - the maxTaskRetryCount value to set
        Returns:
        the JobConstraints object itself.