Closed starmilkxin closed 1 year ago
protected List<Window> calculateWindow(WindowInfo windowInfo, long valueTime) { long sizeInterval = windowInfo.getWindowSize().toMillSecond(); long slideInterval = windowInfo.getWindowSlide().toMillSecond(); List<Window> result = new ArrayList<>((int) (sizeInterval / slideInterval)); long lastStart = valueTime - (valueTime + slideInterval) % slideInterval; for (long start = lastStart; start > valueTime - sizeInterval; start -= slideInterval) { long end = start + sizeInterval; Window window = new Window(start, end); result.add(window); } return result; }
if the expression is >=, the result of fellow is:
>=
if the expression is >, the result of fellow is:
>
1970-01-01 08:00:40 must be in one window, so I think > is better.
1970-01-01 08:00:40