MCPcopy
hub / github.com/etcd-io/bbolt / reindex

Method reindex

internal/freelist/shared.go:243–255  ·  view source on GitHub ↗

reindex rebuilds the free cache based on available and pending free lists.

()

Source from the content-addressed store, hash-verified

241
242// reindex rebuilds the free cache based on available and pending free lists.
243func (t *shared) reindex() {
244 free := t.freePageIds()
245 pending := t.pendingPageIds()
246 t.cache = make(map[common.Pgid]struct{}, len(free))
247 for _, id := range free {
248 t.cache[id] = struct{}{}
249 }
250 for _, txp := range pending {
251 for _, pendingID := range txp.ids {
252 t.cache[pendingID] = struct{}{}
253 }
254 }
255}
256
257func (t *shared) Read(p *common.Page) {
258 if !p.IsFreelistPage() {

Callers 2

InitMethod · 0.80
InitMethod · 0.80

Calls 2

pendingPageIdsMethod · 0.95
freePageIdsMethod · 0.65

Tested by

no test coverage detected