aboutsummaryrefslogtreecommitdiff
path: root/weed/mq/balancer/allocate.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-09-18 18:47:34 -0700
committerchrislu <chris.lu@gmail.com>2023-09-18 18:47:34 -0700
commit27af11f1e80d738ed495dfca9766c913fd67a7ca (patch)
treea4a54f1e1211e273bede5ecc39ed9513316c596d /weed/mq/balancer/allocate.go
parent0bb97709d41b1be4c74f01dcc65aac6d5f88bd16 (diff)
downloadseaweedfs-27af11f1e80d738ed495dfca9766c913fd67a7ca.tar.xz
seaweedfs-27af11f1e80d738ed495dfca9766c913fd67a7ca.zip
Revert "Revert "Merge branch 'master' into sub""
This reverts commit 0bb97709d41b1be4c74f01dcc65aac6d5f88bd16.
Diffstat (limited to 'weed/mq/balancer/allocate.go')
-rw-r--r--weed/mq/balancer/allocate.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/weed/mq/balancer/allocate.go b/weed/mq/balancer/allocate.go
new file mode 100644
index 000000000..d594c60fb
--- /dev/null
+++ b/weed/mq/balancer/allocate.go
@@ -0,0 +1,20 @@
+package balancer
+
+import (
+ cmap "github.com/orcaman/concurrent-map/v2"
+ "github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
+)
+
+func allocateTopicPartitions(brokers cmap.ConcurrentMap[string, *BrokerStats], partitionCount int) (assignments []*mq_pb.BrokerPartitionAssignment) {
+ return []*mq_pb.BrokerPartitionAssignment{
+ {
+ LeaderBroker: "localhost:17777",
+ FollowerBrokers: []string{"localhost:17777"},
+ Partition: &mq_pb.Partition{
+ RingSize: MaxPartitionCount,
+ RangeStart: 0,
+ RangeStop: MaxPartitionCount,
+ },
+ },
+ }
+}