aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-01-16 08:40:23 -0800
committerchrislu <chris.lu@gmail.com>2024-01-16 08:40:23 -0800
commitdd1ec70e629418cf07bb30e92f04fd51c44cc459 (patch)
treea374d85a4b7d5dcd9943fac9e3a9cdf7576ca813 /weed
parent1877ce5126c6281f48ad526c6ddf45b28bd0d3e1 (diff)
downloadseaweedfs-dd1ec70e629418cf07bb30e92f04fd51c44cc459.tar.xz
seaweedfs-dd1ec70e629418cf07bb30e92f04fd51c44cc459.zip
rename
Diffstat (limited to 'weed')
-rw-r--r--weed/mq/pub_balancer/allocate.go2
-rw-r--r--weed/mq/pub_balancer/allocate_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/weed/mq/pub_balancer/allocate.go b/weed/mq/pub_balancer/allocate.go
index cf94fec5b..8fa0214ad 100644
--- a/weed/mq/pub_balancer/allocate.go
+++ b/weed/mq/pub_balancer/allocate.go
@@ -8,7 +8,7 @@ import (
"time"
)
-func allocateTopicPartitions(brokers cmap.ConcurrentMap[string, *BrokerStats], partitionCount int32) (assignments []*mq_pb.BrokerPartitionAssignment) {
+func AllocateTopicPartitions(brokers cmap.ConcurrentMap[string, *BrokerStats], partitionCount int32) (assignments []*mq_pb.BrokerPartitionAssignment) {
// divide the ring into partitions
now := time.Now().UnixNano()
rangeSize := MaxPartitionCount / partitionCount
diff --git a/weed/mq/pub_balancer/allocate_test.go b/weed/mq/pub_balancer/allocate_test.go
index a9056cdb9..3a1598fa0 100644
--- a/weed/mq/pub_balancer/allocate_test.go
+++ b/weed/mq/pub_balancer/allocate_test.go
@@ -53,7 +53,7 @@ func testThem(t *testing.T, tests []struct {
}) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- gotAssignments := allocateTopicPartitions(tt.args.brokers, tt.args.partitionCount)
+ gotAssignments := AllocateTopicPartitions(tt.args.brokers, tt.args.partitionCount)
assert.Equal(t, len(tt.wantAssignments), len(gotAssignments))
for i, gotAssignment := range gotAssignments {
assert.Equal(t, tt.wantAssignments[i].LeaderBroker, gotAssignment.LeaderBroker)