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

Method page

tx.go:629–642  ·  view source on GitHub ↗

page returns a reference to the page with a given id. If page has been written to then a temporary buffered page is returned.

(id common.Pgid)

Source from the content-addressed store, hash-verified

627// page returns a reference to the page with a given id.
628// If page has been written to then a temporary buffered page is returned.
629func (tx *Tx) page(id common.Pgid) *common.Page {
630 // Check the dirty pages first.
631 if tx.pages != nil {
632 if p, ok := tx.pages[id]; ok {
633 p.FastCheck(id)
634 return p
635 }
636 }
637
638 // Otherwise return directly from the mmap.
639 p := tx.db.page(id)
640 p.FastCheck(id)
641 return p
642}
643
644// forEachPage iterates over every page within a given page and executes a function.
645func (tx *Tx) forEachPage(pgidnum common.Pgid, fn func(*common.Page, int, []common.Pgid)) {

Callers 11

checkMethod · 0.95
forEachPageInternalMethod · 0.95
spillMethod · 0.45
freeMethod · 0.45
CommitMethod · 0.45
rollbackMethod · 0.45
PageMethod · 0.45
nodeMethod · 0.45
pageNodeMethod · 0.45

Calls 1

FastCheckMethod · 0.80

Tested by

no test coverage detected