wp
This commit is contained in:
@@ -22,21 +22,27 @@ const (
|
||||
pageTypeIdx = PageSize - 5
|
||||
|
||||
// index page
|
||||
indexRecordsQtyIdx = PageSize - 8
|
||||
isDataPageNumbersIdx = PageSize - 6
|
||||
indexCRC32Idx = IndexPageSize - 4
|
||||
isLastLevelIdx = IndexPageSize - 5
|
||||
indexRecordsQtyIdx = IndexPageSize - 7
|
||||
|
||||
indexRecordSize = 8
|
||||
|
||||
// data page
|
||||
timestampsSizeIdx = PageSize - 13
|
||||
valuesSizeIdx = PageSize - 11
|
||||
prevPageIdx = PageSize - 9
|
||||
dataCRC32Idx = DataPageSize - 4
|
||||
prevPageIdx = DataPageSize - 8
|
||||
valuesSizeIdx = DataPageSize - 10
|
||||
timestampsSizeIdx = DataPageSize - 12
|
||||
|
||||
timestampSize = 4
|
||||
pairSize = timestampSize + PageNoSize
|
||||
indexFooterIdx = indexRecordsQtyIdx
|
||||
dataFooterIdx = timestampsSizeIdx
|
||||
|
||||
PageSize = 8192
|
||||
PageNoSize = 4
|
||||
PageSize = 8192
|
||||
DataPageSize = 8192
|
||||
IndexPageSize = 1024
|
||||
PageNoSize = 4
|
||||
//
|
||||
DataPagePayloadSize int = dataFooterIdx
|
||||
)
|
||||
@@ -161,7 +167,7 @@ func (s *Atree) findDataPage(rootPageNo uint32, timestamp uint32) (uint32, []byt
|
||||
s.releasePage(indexPageNo)
|
||||
|
||||
// fix
|
||||
if buf[isDataPageNumbersIdx] == 1 {
|
||||
if buf[isLastLevelIdx] == 1 {
|
||||
buf, err := s.fetchDataPage(foundPageNo)
|
||||
if err != nil {
|
||||
return 0, nil, fmt.Errorf("fetchDataPage(%d): %s", foundPageNo, err)
|
||||
@@ -206,7 +212,7 @@ func (s *Atree) FindPathToLastPage(rootPageNo uint32) (_ PathToDataPage, err err
|
||||
foundPageNo := getLastPageNo(buf)
|
||||
|
||||
// fix
|
||||
if buf[isDataPageNumbersIdx] == 1 {
|
||||
if buf[isLastLevelIdx] == 1 {
|
||||
return PathToDataPage{
|
||||
Legs: legs,
|
||||
LastPageNo: foundPageNo,
|
||||
|
||||
Reference in New Issue
Block a user