Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-15740

Remove Deadline#timeLeft()

    XMLWordPrintableJSON

Details

    Description

      As shown in FLINK-13662, Deadline#timeLeft() is conceptually broken since there is no reliable way to call said method while ensuring that
      a) the value is non-negative (desired since most time-based APIs reject negative values)
      b) the value sign (+,-) corresponds to preceding calls to #hasTimeLeft()

       

      As a result any usage of the following form is unreliable and obfuscating error messages.

      while (deadline.hasTimeLeft()) {
      	doSomething(deadline.timeLeft());
      } 

       

      All existing usage should be migrate to either

      while (deadline.hasTimeLeft()) {
      	doSomething();
      } 

      or

      while (true) {
      	doSomething(deadline.timeLeftIfAny());
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            chesnay Chesnay Schepler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m