示例#1
0
func split(db *client.DB) {
	for i := 1; i < 10; i++ {
		fmt.Printf("split key: %v\n", i)
		err := db.AdminSplit([]byte(fmt.Sprintf("%d", i)))
		if err != nil {
			panic(fmt.Sprintf("split fail. key: %v, err: %v\n", i, err))
		}
	}
}
// splitRange splits whichever range contains the key on that key.
func splitRange(db *client.DB, key proto.Key) error {
	return db.AdminSplit(key)
}