You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/08/10 04:01:21 UTC

[GitHub] [rocketmq] xiaoyaofawai commented on issue #3240: Why is the reading time from consumerQueue O(1)

xiaoyaofawai commented on issue #3240:
URL: https://github.com/apache/rocketmq/issues/3240#issuecomment-895710016


   ConsumeQueue support read data by message index, as you see:
   ![image](https://user-images.githubusercontent.com/12688996/128805753-a9f1e64d-edc6-4120-96b1-c17984d901fc.png)
   ConsumeQueue read data relay on MappedFileQueue, data offset can be calculated by 'startIndex' . the index of MappedFile in MappedFileQueue and the offset of data in MappedFile can be calculated by data offset.The time complexity of these processes is O(1), so the time complexity of reading data by startIndex from ConsumeQueue is O(1)


-- 
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: dev-unsubscribe@rocketmq.apache.org

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