code: func appendBatchBySize(b []batchKeys, region RegionVerID, keys [][]byte, sizeFn func([]byte) int, limit int) []batchKeys {
  	var start, end int
  	for start = 0; start < len(keys); start = end {
  		var size int
  		for end = start; end < len(keys) && size < limit; end++ {
  			size += sizeFn(keys[end])
  		}
  		b = append(b, batchKeys{
  			region: region,
  			keys:   keys[start:end],
  		})
  	}
  	return b
  }
docs: // appendBatchBySize appends keys to []batchKeys. It may split the keys to make
  // sure each batch's size does not exceed the limit.