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

Method Check

tx_check.go:21–36  ·  view source on GitHub ↗

Check performs several consistency checks on the database for this transaction. An error is returned if any inconsistency is found. It can be safely run concurrently on a writable transaction. However, this incurs a high cost for large databases and databases with a lot of subbuckets because of cac

(options ...CheckOption)

Source from the content-addressed store, hash-verified

19// It also allows users to provide a customized `KVStringer` implementation,
20// so that bolt can generate human-readable diagnostic messages.
21func (tx *Tx) Check(options ...CheckOption) <-chan error {
22 chkConfig := checkConfig{
23 kvStringer: HexKVStringer(),
24 }
25 for _, op := range options {
26 op(&chkConfig)
27 }
28
29 ch := make(chan error)
30 go func() {
31 // Close the channel to signal completion.
32 defer close(ch)
33 tx.check(chkConfig, ch)
34 }()
35 return ch
36}
37
38func (tx *Tx) check(cfg checkConfig, ch chan error) {
39 defer func() {

Callers 15

CommitMethod · 0.95
TestCursor_QuickCheckFunction · 0.80
TestBucket_Put_SingleFunction · 0.80
TestBucket_Put_MultipleFunction · 0.80
TestBucket_Delete_QuickFunction · 0.80
TestOpen_CheckFunction · 0.80
TestTx_Check_CorruptPageFunction · 0.80
TestTx_Check_PanicFunction · 0.80
checkConsistencyFunction · 0.80
TestTx_Check_ReadOnlyFunction · 0.80

Calls 2

checkMethod · 0.95
HexKVStringerFunction · 0.85

Tested by 15

TestCursor_QuickCheckFunction · 0.64
TestBucket_Put_SingleFunction · 0.64
TestBucket_Put_MultipleFunction · 0.64
TestBucket_Delete_QuickFunction · 0.64
TestOpen_CheckFunction · 0.64
TestTx_Check_CorruptPageFunction · 0.64
TestTx_Check_PanicFunction · 0.64
checkConsistencyFunction · 0.64
TestTx_Check_ReadOnlyFunction · 0.64
TestTxidSortingFunction · 0.64