coral-beam-runtime/src/main/java/com/linkedin/beam/excution/BeamExecUtil.java
public static boolean isExpired(long begin, long end, int timeGranularity, int duration) {
    final Calendar beginCal = roundUpTimeInCalendar(begin, 1, timeGranularity);
    final Calendar endCal = roundUpTimeInCalendar(end, 1, timeGranularity);
    beginCal.add(timeGranularity, duration - 1);
    return beginCal.before(endCal);
  }
/**
   * Checks if end time is expired from the begin time after a duration.
   *
   * Example:
   * - 2019/03/20 23:59, 2019/03/21 00:00, DATE, 1 - true
   * - 2019/03/20 23:59, 2019/03/21 00:00, MINUTE, 2 - false
   * - 2019/03/21 00:00, 2019/03/21 23:59, DAY, 1 - false
   * - 2019/03/21 00:59, 2019/03/21 01:00, HOUR_OF_DAY, 2 - false
   *
   * @param begin begin time
   * @param end end time
   * @param timeGranularity Time granularity unit (in {{@link Calendar}}, from HOUR_OF_DAY to MILLISECOND)
   *                        for rounding up and comparison
   * @param duration Duration (within time granularity) for expiration
   * @return true iff end time is expired
   */
Checks if end time is expired from the begin time after a duration.


Checks if end time is expired from the begin time after a duration .
public static boolean isExpired(long begin, long end, int timeGranularity, int duration) {
    final Calendar beginCal = roundUpTimeInCalendar(begin, 1, timeGranularity);
    final Calendar endCal = roundUpTimeInCalendar(end, 1, timeGranularity);
    beginCal.add(timeGranularity, duration - 1);
    return beginCal.before(endCal);
  }
public static boolean isExpired ( long begin , long end , int timeGranularity , int duration ) { final Calendar beginCal = roundUpTimeInCalendar ( begin , 1 , timeGranularity ) ; final Calendar endCal = roundUpTimeInCalendar ( end , 1 , timeGranularity ) ; beginCal . add ( timeGranularity , duration - 1 ) ; return beginCal . before ( endCal ) ; }
Checks if end time is expired from the begin time after a duration.
Checks if end time is expired from the begin time after a duration .