Hi Stephan, I like the idea unify usage of time/duration api. We actually use at least five different classes for this purposes(see below).
One thing I'd like to pick up is that duration configuration in Flink is almost in pattern as "60 s" that fits in the pattern parsed by scala.concurrent.duration.Duration. AFAIK Duration in Java 8 doesn't support this pattern. However, we can solve it by introduce a DurationUtils. Also to clarify, we now have (correct me if any other) java.time.Duration scala.concurrent.duration.Duration scala.concurrent.duration.FiniteDuration org.apache.flink.api.common.time.Time org.apache.flink.streaming.api.windowing.time.Time in use. If we'd prefer java.time.Duration, it is worth to consider whether we unify all of them into Java's Duration, i.e., Java's Duration is the first class time/duration api, while others should be converted into or out from it. Best, tison. Stephan Ewen <se...@apache.org> 于2019年8月23日周五 下午10:45写道: > Hi all! > > Many parts of the code use Flink's "Time" class. The Time really is a "time > interval" or a "Duration". > > Since Java 8, there is a Java class "Duration" that is nice and flexible to > use. > I would suggest we start using Java Duration instead and drop Time as much > as possible in the runtime from now on. > > Maybe even drop that class from the API in Flink 2.0. > > Best, > Stephan >