(pageId common.Pgid, reachable map[common.Pgid]*common.Page, freed map[common.Pgid]bool, kvStringer KVStringer, ch chan error)
| 95 | } |
| 96 | |
| 97 | func (tx *Tx) recursivelyCheckBucketInPage(pageId common.Pgid, reachable map[common.Pgid]*common.Page, freed map[common.Pgid]bool, |
| 98 | kvStringer KVStringer, ch chan error) { |
| 99 | p := tx.page(pageId) |
| 100 | |
| 101 | switch { |
| 102 | case p.IsBranchPage(): |
| 103 | for i := range p.BranchPageElements() { |
| 104 | elem := p.BranchPageElement(uint16(i)) |
| 105 | tx.recursivelyCheckBucketInPage(elem.Pgid(), reachable, freed, kvStringer, ch) |
| 106 | } |
| 107 | case p.IsLeafPage(): |
| 108 | for i := range p.LeafPageElements() { |
| 109 | elem := p.LeafPageElement(uint16(i)) |
| 110 | if elem.IsBucketEntry() { |
| 111 | inBkt := common.NewInBucket(pageId, 0) |
| 112 | tmpBucket := Bucket{ |
| 113 | InBucket: &inBkt, |
| 114 | rootNode: &node{isLeaf: p.IsLeafPage()}, |
| 115 | FillPercent: DefaultFillPercent, |
| 116 | tx: tx, |
| 117 | } |
| 118 | if child := tmpBucket.Bucket(elem.Key()); child != nil { |
| 119 | tx.recursivelyCheckBucket(child, reachable, freed, kvStringer, ch) |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | default: |
| 124 | ch <- fmt.Errorf("unexpected page type (flags: %x) for pgId:%d", p.Flags(), pageId) |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | func (tx *Tx) recursivelyCheckBucket(b *Bucket, reachable map[common.Pgid]*common.Page, freed map[common.Pgid]bool, |
| 129 | kvStringer KVStringer, ch chan error) { |
no test coverage detected