Ejemplo n.º 1
0
// AllVbuckets16 return all vbuckets hosted by all kvnodes
// in sort order. vbuckets are returned as 16-bit values.
func (resp *VbmapResponse) AllVbuckets16() []uint16 {
	vbs := make([]uint16, 0)
	for _, vs := range resp.GetKvvbnos() {
		vbs = append(vbs, c.Vbno32to16(vs.GetVbnos())...)
	}
	vbuckets := c.Vbuckets(vbs)
	sort.Sort(vbuckets)
	return []uint16(vbuckets)
}
Ejemplo n.º 2
0
// AllVbuckets32 return all vbuckets hosted by all kvnodes
// in sort order. vbuckets are returned as 32-bit values.
func (resp *VbmapResponse) AllVbuckets32() []uint32 {
	vbs := make([]uint32, 0)
	for _, vs := range resp.GetKvvbnos() {
		vbs = append(vbs, vs.GetVbnos()...)
	}
	vbuckets := c.Vbuckets(c.Vbno32to16(vbs))
	sort.Sort(vbuckets)
	return vbuckets.To32()
}