WindowUtils { public static long getAppWindowDurationMs(OperatorContext context) { return context.getValue(DAGContext.STREAMING_WINDOW_SIZE_MILLIS).longValue() * context.getValue(OperatorContext.APPLICATION_WINDOW_COUNT).longValue(); }  static long getAppWindowDurationMs(OperatorContext context); static long msToAppWindowCount(OperatorContext context, long millis); static long tpsToTpw(OperatorContext context, long tuplesPerSecond);  }
@Test public void getAppWindowDurationMSTest() { OperatorContext context = createOperatorContext(500, 10); long appWindowDuration = WindowUtils.getAppWindowDurationMs(context); Assert.assertEquals(5000L, appWindowDuration); }
@Test public void getAppWindowDurationMSOverflowTest() { OperatorContext context = createOperatorContext(Integer.MAX_VALUE, Integer.MAX_VALUE); long appWindowDuration = WindowUtils.getAppWindowDurationMs(context); Assert.assertEquals(new BigDecimal(Integer.MAX_VALUE).multiply(new BigDecimal(Integer.MAX_VALUE)), new BigDecimal(appWindowDuration)); }