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

Method forEachPageInternal

tx.go:651–664  ·  view source on GitHub ↗
(pgidstack []common.Pgid, fn func(*common.Page, int, []common.Pgid))

Source from the content-addressed store, hash-verified

649}
650
651func (tx *Tx) forEachPageInternal(pgidstack []common.Pgid, fn func(*common.Page, int, []common.Pgid)) {
652 p := tx.page(pgidstack[len(pgidstack)-1])
653
654 // Execute function.
655 fn(p, len(pgidstack)-1, pgidstack)
656
657 // Recursively loop over children.
658 if p.IsBranchPage() {
659 for i := 0; i < int(p.Count()); i++ {
660 elem := p.BranchPageElement(uint16(i))
661 tx.forEachPageInternal(append(pgidstack, elem.Pgid()), fn)
662 }
663 }
664}
665
666// Page returns page information for a given page number.
667// This is only safe for concurrent use when used by a writable transaction.

Callers 1

forEachPageMethod · 0.95

Calls 5

pageMethod · 0.95
IsBranchPageMethod · 0.80
BranchPageElementMethod · 0.80
CountMethod · 0.65
PgidMethod · 0.45

Tested by

no test coverage detected