示例#1
0
func (t *testMvccSuite) scanRawEngine(c *C, f func([]byte, []byte)) {
	// scan raw db
	var k kv.Key
	var v []byte
	for {
		var err error
		k, v, err = t.s.(*dbStore).db.Seek(k)
		if err != nil {
			break
		}
		f(k, v)
		k = k.Next()
	}
}
示例#2
0
func count(db engine.DB) int {
	var k kv.Key
	totalCnt := 0
	for {
		var err error
		k, _, err = db.Seek(k)
		if err != nil {
			break
		}
		k = k.Next()
		totalCnt++
	}
	return totalCnt
}