rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

The indexCount field of the IndexHeader class

Open Dovelol opened this issue 5 years ago • 3 comments

  1. Please describe the issue you observed:

Why the initial value of the indexCount field of the IndexHeader class is 1 instead of 0? In the putKey method of IndexFile class, constant IndexHeader.INDEX_HEADER_SIZE=40-byte, constant this.hashSlotNum * hashSlotSize=20000000-byte, then Index data should start writing data from 20000040 position, but in the source code, data is written starting from 20000060 position. This will result in a 20-byte gap.

I think if the meaning of the indexCount field is the number of index data currently written, then the initial value of indexCount should be 0, so that the indexCount field is increased by 1 after the putkey method. And the indexNum field 2000w also represents the largest number of index data, instead of actually only storing 19999999 index data.

Dovelol avatar Dec 05 '20 16:12 Dovelol

I hava the same question. Why the initial value of the indexCount is not 0? Could anybody tell me?

yyykf avatar Jan 09 '22 08:01 yyykf

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.

github-actions[bot] avatar Jan 10 '23 00:01 github-actions[bot]

This issue was closed because it has been inactive for 3 days since being marked as stale.

github-actions[bot] avatar Jan 14 '23 00:01 github-actions[bot]