package routing

import (
	
	
)

// ShardPicker chooses “one arbitrary shard” when the request_policy is
// ReqDefault and the command has no keys.
type ShardPicker interface {
	Next(total int) int // returns an index in [0,total)
}

// StaticShardPicker always returns the same shard index.
type StaticShardPicker struct {
	index int
}

func ( int) *StaticShardPicker {
	return &StaticShardPicker{index: }
}

func ( *StaticShardPicker) ( int) int {
	if  == 0 || .index >=  {
		return 0
	}
	return .index
}

/*───────────────────────────────
   Round-robin (default)
────────────────────────────────*/

type RoundRobinPicker struct {
	cnt atomic.Uint32
}

func ( *RoundRobinPicker) ( int) int {
	if  == 0 {
		return 0
	}
	 := .cnt.Add(1)
	return int(-1) % 
}

/*───────────────────────────────
   Random
────────────────────────────────*/

type RandomPicker struct{}

func (RandomPicker) ( int) int {
	if  == 0 {
		return 0
	}
	return rand.Intn()
}