Esempio n. 1
0
func testDump(tc *table.Context) {
	//r, err := tc.DumpDB()
	r, err := tc.DumpTable(1)
	if err != nil {
		fmt.Printf("Dump failed: %s\n", err)
		return
	}

	fmt.Println("Dump result:")
	var idx = 0
	for {
		for _, kv := range r.Kvs {
			fmt.Printf("%02d) %d\t%q\t%d\t%q\t%d\t%q\n", idx,
				kv.TableId, kv.RowKey, kv.ColSpace, kv.ColKey, kv.Score, kv.Value)
			idx++
		}

		if r.End {
			break
		}

		r, err = tc.DumpMore(r)
		if err != nil {
			fmt.Printf("DumpMore failed: %s\n", err)
			return
		}
	}
}