This commit is contained in:
2026-06-13 07:13:03 +00:00
parent aca0252cfd
commit 5778782737
10 changed files with 99 additions and 58 deletions

View File

@@ -7,8 +7,8 @@ var (
//PageNoSize = 4
// data page
DataPageSize = 8192
DataPageFooterSize int = 12
DataPageSize = 8192
DataPagePayloadSize int = DataPageSize - DataPageFooterSize
dataCRC32Idx = DataPageSize - 4
@@ -17,13 +17,13 @@ var (
prevPageIdx = DataPageSize - 12
// index page
IndexPageSize = 1024
IndexPageFooterSize = 7
IndexPageSize = 1024
//indexPageIncSize = IndexPageIncSize
indexCRC32Idx = IndexPageSize - 4
indexRecordsCountIdx = IndexPageSize - 6
isZeroLevelIdx = IndexPageSize - 7
indexRecordSize = 8
indexCRC32Idx = IndexPageSize - 4
indexRecordsCountIdx = IndexPageSize - 6
isZeroLevelIdx = IndexPageSize - 7
maxRecordsOnIndexPage = (IndexPageSize - IndexPageFooterSize) / indexRecordSize
// timestampSize = 4
@@ -32,6 +32,12 @@ var (
// dataFooterIdx = timestampsSizeIdx
)
const (
DataPageFooterSize = 12
IndexPageFooterSize = 7
indexRecordSize = 8
)
type IndexRecord struct {
Timestamp uint32
PageNo uint32