mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-17 02:06:23 +00:00
log2-based shuffle-sharding validation
This commit is contained in:
committed by
Mike Spreitzer
parent
30af3b3d1d
commit
42f2873e69
@@ -256,12 +256,7 @@ func ValidatePriorityLevelConfigurationStatus(status *flowcontrol.PriorityLevelC
|
||||
|
||||
func validateShuffleShardingParameters(handSize, queues int32) bool {
|
||||
// TODO: performance impact from bit-int multiplication?
|
||||
v := big.NewInt(1)
|
||||
for i := int32(0); i < handSize; i++ {
|
||||
v.Mul(v, big.NewInt(int64(queues-i)))
|
||||
}
|
||||
l := v.BitLen()
|
||||
return l <= maxHashBits
|
||||
return int32(big.NewInt(int64(queues)).BitLen())*handSize <= maxHashBits
|
||||
}
|
||||
|
||||
func hasWildcard(operations []string) bool {
|
||||
|
||||
Reference in New Issue
Block a user