mirror of https://github.com/grafana/loki
fix(deps): update module github.com/twmb/franz-go to v1.20.3 (main) (#19812)
Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com> Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>pull/19808/head
parent
26adcdf13f
commit
ceb7c8493c
@ -1,57 +0,0 @@ |
||||
//go:build !go1.19
|
||||
// +build !go1.19
|
||||
|
||||
package kgo |
||||
|
||||
import "sync/atomic" |
||||
|
||||
type atomicBool uint32 |
||||
|
||||
func (b *atomicBool) Store(v bool) { |
||||
if v { |
||||
atomic.StoreUint32((*uint32)(b), 1) |
||||
} else { |
||||
atomic.StoreUint32((*uint32)(b), 0) |
||||
} |
||||
} |
||||
|
||||
func (b *atomicBool) Load() bool { return atomic.LoadUint32((*uint32)(b)) == 1 } |
||||
|
||||
func (b *atomicBool) Swap(v bool) bool { |
||||
var swap uint32 |
||||
if v { |
||||
swap = 1 |
||||
} |
||||
return atomic.SwapUint32((*uint32)(b), swap) == 1 |
||||
} |
||||
|
||||
type atomicI32 int32 |
||||
|
||||
func (v *atomicI32) Add(s int32) int32 { return atomic.AddInt32((*int32)(v), s) } |
||||
func (v *atomicI32) Store(s int32) { atomic.StoreInt32((*int32)(v), s) } |
||||
func (v *atomicI32) Load() int32 { return atomic.LoadInt32((*int32)(v)) } |
||||
func (v *atomicI32) Swap(s int32) int32 { return atomic.SwapInt32((*int32)(v), s) } |
||||
|
||||
type atomicU32 uint32 |
||||
|
||||
func (v *atomicU32) Add(s uint32) uint32 { return atomic.AddUint32((*uint32)(v), s) } |
||||
func (v *atomicU32) Store(s uint32) { atomic.StoreUint32((*uint32)(v), s) } |
||||
func (v *atomicU32) Load() uint32 { return atomic.LoadUint32((*uint32)(v)) } |
||||
func (v *atomicU32) Swap(s uint32) uint32 { return atomic.SwapUint32((*uint32)(v), s) } |
||||
func (v *atomicU32) CompareAndSwap(old, new uint32) bool { |
||||
return atomic.CompareAndSwapUint32((*uint32)(v), old, new) |
||||
} |
||||
|
||||
type atomicI64 int64 |
||||
|
||||
func (v *atomicI64) Add(s int64) int64 { return atomic.AddInt64((*int64)(v), s) } |
||||
func (v *atomicI64) Store(s int64) { atomic.StoreInt64((*int64)(v), s) } |
||||
func (v *atomicI64) Load() int64 { return atomic.LoadInt64((*int64)(v)) } |
||||
func (v *atomicI64) Swap(s int64) int64 { return atomic.SwapInt64((*int64)(v), s) } |
||||
|
||||
type atomicU64 uint64 |
||||
|
||||
func (v *atomicU64) Add(s uint64) uint64 { return atomic.AddUint64((*uint64)(v), s) } |
||||
func (v *atomicU64) Store(s uint64) { atomic.StoreUint64((*uint64)(v), s) } |
||||
func (v *atomicU64) Load() uint64 { return atomic.LoadUint64((*uint64)(v)) } |
||||
func (v *atomicU64) Swap(s uint64) uint64 { return atomic.SwapUint64((*uint64)(v), s) } |
||||
@ -1,14 +0,0 @@ |
||||
//go:build go1.19
|
||||
// +build go1.19
|
||||
|
||||
package kgo |
||||
|
||||
import "sync/atomic" |
||||
|
||||
type ( |
||||
atomicBool struct{ atomic.Bool } |
||||
atomicI32 struct{ atomic.Int32 } |
||||
atomicU32 struct{ atomic.Uint32 } |
||||
atomicI64 struct{ atomic.Int64 } |
||||
atomicU64 struct{ atomic.Uint64 } |
||||
) |
||||
@ -1,28 +0,0 @@ |
||||
//go:build go1.21
|
||||
// +build go1.21
|
||||
|
||||
package sticky |
||||
|
||||
import "slices" |
||||
|
||||
func sortPartNums(ps memberPartitions) { |
||||
slices.Sort(ps) |
||||
} |
||||
|
||||
func (b *balancer) sortMemberByLiteralPartNum(memberNum int) { |
||||
partNums := b.plan[memberNum] |
||||
slices.SortFunc(partNums, func(lpNum, rpNum int32) int { |
||||
ltNum, rtNum := b.partOwners[lpNum], b.partOwners[rpNum] |
||||
li, ri := b.topicInfos[ltNum], b.topicInfos[rtNum] |
||||
lt, rt := li.topic, ri.topic |
||||
lp, rp := lpNum-li.partNum, rpNum-ri.partNum |
||||
if lp < rp { |
||||
return -1 |
||||
} else if lp > rp { |
||||
return 1 |
||||
} else if lt < rt { |
||||
return -1 |
||||
} |
||||
return 1 |
||||
}) |
||||
} |
||||
@ -1,22 +0,0 @@ |
||||
//go:build !go1.21
|
||||
// +build !go1.21
|
||||
|
||||
package sticky |
||||
|
||||
import "sort" |
||||
|
||||
func sortPartNums(partNums memberPartitions) { |
||||
sort.Slice(partNums, func(i, j int) bool { return partNums[i] < partNums[j] }) |
||||
} |
||||
|
||||
func (b *balancer) sortMemberByLiteralPartNum(memberNum int) { |
||||
partNums := b.plan[memberNum] |
||||
sort.Slice(partNums, func(i, j int) bool { |
||||
lpNum, rpNum := partNums[i], partNums[j] |
||||
ltNum, rtNum := b.partOwners[lpNum], b.partOwners[rpNum] |
||||
li, ri := b.topicInfos[ltNum], b.topicInfos[rtNum] |
||||
lt, rt := li.topic, ri.topic |
||||
lp, rp := lpNum-li.partNum, rpNum-ri.partNum |
||||
return lp < rp || (lp == rp && lt < rt) |
||||
}) |
||||
} |
||||
Loading…
Reference in new issue