mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-28 14:47:16 +00:00
Fix merge of code files (#495)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
parent
d7693ce094
commit
945b0e9e0f
@ -378,12 +378,11 @@ const (
|
||||
// CursorItem is the item in the priority queue used to do merge interation
|
||||
// over storage of a given account
|
||||
type CursorItem struct {
|
||||
t CursorType // Whether this item represents state file or DB record, or tree
|
||||
endTxNum uint64
|
||||
key, val []byte
|
||||
dg *compress.Getter
|
||||
c kv.CursorDupSort
|
||||
valCompressed bool
|
||||
t CursorType // Whether this item represents state file or DB record, or tree
|
||||
endTxNum uint64
|
||||
key, val []byte
|
||||
dg *compress.Getter
|
||||
c kv.CursorDupSort
|
||||
}
|
||||
|
||||
type CursorHeap []*CursorItem
|
||||
|
@ -289,27 +289,19 @@ func (d *Domain) mergeFiles(files [][NumberOfTypes]*filesItem, r DomainRanges, m
|
||||
g.Reset(0)
|
||||
if g.HasNext() {
|
||||
key, _ := g.NextUncompressed()
|
||||
if d.compressVals && fType != EfHistory && item.endTxNum-item.startTxNum > d.aggregationStep {
|
||||
val, _ := g.Next(nil)
|
||||
heap.Push(&cp, &CursorItem{
|
||||
t: FILE_CURSOR,
|
||||
dg: g,
|
||||
key: key,
|
||||
val: val,
|
||||
endTxNum: item.endTxNum,
|
||||
valCompressed: true,
|
||||
})
|
||||
var val []byte
|
||||
if d.compressVals {
|
||||
val, _ = g.Next(nil)
|
||||
} else {
|
||||
val, _ := g.NextUncompressed()
|
||||
heap.Push(&cp, &CursorItem{
|
||||
t: FILE_CURSOR,
|
||||
dg: g,
|
||||
key: key,
|
||||
val: val,
|
||||
endTxNum: item.endTxNum,
|
||||
valCompressed: false,
|
||||
})
|
||||
val, _ = g.NextUncompressed()
|
||||
}
|
||||
heap.Push(&cp, &CursorItem{
|
||||
t: FILE_CURSOR,
|
||||
dg: g,
|
||||
key: key,
|
||||
val: val,
|
||||
endTxNum: item.endTxNum,
|
||||
})
|
||||
}
|
||||
}
|
||||
count := 0
|
||||
@ -335,7 +327,7 @@ func (d *Domain) mergeFiles(files [][NumberOfTypes]*filesItem, r DomainRanges, m
|
||||
}
|
||||
if ci1.dg.HasNext() {
|
||||
ci1.key, _ = ci1.dg.NextUncompressed()
|
||||
if ci1.valCompressed {
|
||||
if d.compressVals {
|
||||
ci1.val, _ = ci1.dg.Next(ci1.val[:0])
|
||||
} else {
|
||||
ci1.val, _ = ci1.dg.NextUncompressed()
|
||||
|
Loading…
Reference in New Issue
Block a user