wp
This commit is contained in:
@@ -177,7 +177,7 @@ func ReadSnapshot(filePath string) (out ReadSnapshotOut, err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("metricID", metricID)
|
||||
//fmt.Println("metricID", metricID)
|
||||
metricType, err = bin.ReadByte(src)
|
||||
if err != nil {
|
||||
return
|
||||
@@ -187,13 +187,13 @@ func ReadSnapshot(filePath string) (out ReadSnapshotOut, err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("m.MetricType", m.MetricType)
|
||||
fmt.Println("m.FracDigits", m.FracDigits)
|
||||
//fmt.Println("m.MetricType", m.MetricType)
|
||||
//fmt.Println("m.FracDigits", m.FracDigits)
|
||||
m.LastPageNo, err = bin.ReadUint32(src)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("m.LastPageNo", m.LastPageNo)
|
||||
//fmt.Println("m.LastPageNo", m.LastPageNo)
|
||||
m.TimestampsSize, err = bin.ReadUint16AsInt(src)
|
||||
if err != nil {
|
||||
return
|
||||
@@ -202,7 +202,7 @@ func ReadSnapshot(filePath string) (out ReadSnapshotOut, err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("m.TimestampsSize", m.TimestampsSize, "m.ValuesSize", m.ValuesSize)
|
||||
//fmt.Println("m.TimestampsSize", m.TimestampsSize, "m.ValuesSize", m.ValuesSize)
|
||||
err = bin.ReadNInto(src, buf[storage.DataPagePayloadSize-m.TimestampsSize:storage.DataPagePayloadSize])
|
||||
if err != nil {
|
||||
return
|
||||
@@ -211,13 +211,13 @@ func ReadSnapshot(filePath string) (out ReadSnapshotOut, err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Printf("% x\n", buf)
|
||||
//fmt.Printf("% x\n", buf)
|
||||
//
|
||||
levelsCount, err = bin.ReadVarSize(src)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("levels count:", levelsCount)
|
||||
//fmt.Println("levels count:", levelsCount)
|
||||
for range levelsCount {
|
||||
var (
|
||||
buf = make([]byte, storage.IndexPageSize)
|
||||
@@ -227,12 +227,12 @@ func ReadSnapshot(filePath string) (out ReadSnapshotOut, err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("records count:", count)
|
||||
//fmt.Println("records count:", count)
|
||||
err = bin.ReadNInto(src, buf[:count*storage.IndexRecordSize])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Printf("% x\n", buf)
|
||||
//fmt.Printf("% x\n", buf)
|
||||
m.IndexLevelTails = append(m.IndexLevelTails, storage.IndexLevelTail{
|
||||
Buffer: buf,
|
||||
RecordsCount: count,
|
||||
@@ -278,7 +278,7 @@ func writeFreePages(dst io.Writer, frozenPagesCount int, pageNumbers []uint32) (
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("write frozenPagesCount:", frozenPagesCount)
|
||||
//fmt.Println("write frozenPagesCount:", frozenPagesCount)
|
||||
_, err = bin.WriteVarSize(dst, len(pageNumbers))
|
||||
if err != nil {
|
||||
return
|
||||
@@ -301,7 +301,7 @@ func readFreePages(src io.Reader) (_ int, _ []uint32, err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("read frozenPagesCount:", frozenPagesCount)
|
||||
//fmt.Println("read frozenPagesCount:", frozenPagesCount)
|
||||
pageNumbersCount, err := bin.ReadVarSize(src)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user