You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Koado (via GitHub)" <gi...@apache.org> on 2024/03/25 08:08:02 UTC
[I] [Enhancement] use BoundaryType in binarySearchInCQByTime [rocketmq]
Koado opened a new issue, #7961:
URL: https://github.com/apache/rocketmq/issues/7961
### Before Creating the Enhancement Request
- [X] I have confirmed that this should be classified as an enhancement rather than a bug/feature.
### Summary
use BoundaryType in binarySearchInCQByTime, when the target timestsamp does not match an exact offset, return either left offset or right offset depending on the value of BoundaryType.
### Motivation
In the original implementation, if the target timestamp does not match an exact offset, the system compares the absolute value of the difference between the leftOffset's storeTime and the incoming timestamp with the absolute value of the difference between the rightOffset's storeTime and the timestamp. The method will return the offset with the smaller absolute difference as the result.
<img width="917" alt="image" src="https://github.com/apache/rocketmq/assets/34032341/8406dfb9-8821-468c-bea8-7ec1e83f90dd">
When we want to retrieve messages within a certain time range, this implementation may result in obtaining messages that fall outside of the specified time range.
### Describe the Solution You'd Like
use BoundaryType to replace absolute value comparison:
1. When the input time is the start time, pass in BoundaryType.UPPER; when the input time is the end time, pass in BoundaryType.LOWER.
2. If the value of BoundaryType is UPPER, return the right offset. If the value of BoundaryType is LOWER, return the left offset.
### Describe Alternatives You've Considered
No
### Additional Context
_No response_
--
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
Re: [I] [Enhancement] use BoundaryType in binarySearchInCQByTime [rocketmq]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7961:
URL: https://github.com/apache/rocketmq/issues/7961#issuecomment-2756039962
This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.
--
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
Re: [I] [Enhancement] use BoundaryType in binarySearchInCQByTime [rocketmq]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #7961: [Enhancement] use BoundaryType in binarySearchInCQByTime
URL: https://github.com/apache/rocketmq/issues/7961
--
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
Re: [I] [Enhancement] use BoundaryType in binarySearchInCQByTime [rocketmq]
Posted by "Koado (via GitHub)" <gi...@apache.org>.
Koado commented on issue #7961:
URL: https://github.com/apache/rocketmq/issues/7961#issuecomment-2019852186
> Check if the expected behavior is consistent with what is described here.
>
> https://github.com/apache/rocketmq/pull/7965/files
It is consistent. In fact, this change aligns with the binarySearchInQueueByTime method in ConsumeQueue. Regarding the input of LOWER or UPPER, we should pass LOWER when searching for messages at the start time, and pass UPPER when searching for messages at the end time. The description in the main text about this part has been updated.
--
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
Re: [I] [Enhancement] use BoundaryType in binarySearchInCQByTime [rocketmq]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7961:
URL: https://github.com/apache/rocketmq/issues/7961#issuecomment-2764300732
This issue was closed because it has been inactive for 3 days since being marked as stale.
--
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
Re: [I] [Enhancement] use BoundaryType in binarySearchInCQByTime [rocketmq]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on issue #7961:
URL: https://github.com/apache/rocketmq/issues/7961#issuecomment-2019547908
Check if the expected behavior is consistent with what is described here.
https://github.com/apache/rocketmq/pull/7965/files
--
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