You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "starmilkxin (via GitHub)" <gi...@apache.org> on 2023/05/13 11:18:05 UTC

[GitHub] [rocketmq-streams] starmilkxin opened a new issue, #289: Why the termination condition is 'start > valueTime - sizeInterval' instead of 'start >= valueTime - sizeInterval' ?

starmilkxin opened a new issue, #289:
URL: https://github.com/apache/rocketmq-streams/issues/289

   ```java
       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;
       }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-streams] ni-ze closed issue #289: Why the termination condition is 'start > valueTime - sizeInterval' instead of 'start >= valueTime - sizeInterval' ?

Posted by "ni-ze (via GitHub)" <gi...@apache.org>.
ni-ze closed issue #289: Why the termination condition is 'start > valueTime - sizeInterval' instead of 'start >= valueTime - sizeInterval' ?
URL: https://github.com/apache/rocketmq-streams/issues/289


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-streams] ni-ze commented on issue #289: Why the termination condition is 'start > valueTime - sizeInterval' instead of 'start >= valueTime - sizeInterval' ?

Posted by "ni-ze (via GitHub)" <gi...@apache.org>.
ni-ze commented on issue #289:
URL: https://github.com/apache/rocketmq-streams/issues/289#issuecomment-1547058579

   if the expression is `>=`, the result of fellow is:
   ![image](https://github.com/apache/rocketmq-streams/assets/31175234/48c1fa6b-8929-437e-9dda-1617ad61e60d)
   
   if the expression is `>`, the result of fellow is:
   ![image](https://github.com/apache/rocketmq-streams/assets/31175234/b984d64a-fb9e-46b8-9ecc-5eb257b98496)
   
   `1970-01-01 08:00:40` must be in one window, so I think `>` is better.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org