From 0a851ec00b455c72b405503f6f1f41728b15962e Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 10 Sep 2023 22:01:25 -0700 Subject: [PATCH] Create balancer.go --- weed/mq/balancer/balancer.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 weed/mq/balancer/balancer.go diff --git a/weed/mq/balancer/balancer.go b/weed/mq/balancer/balancer.go new file mode 100644 index 000000000..4d9005e82 --- /dev/null +++ b/weed/mq/balancer/balancer.go @@ -0,0 +1,20 @@ +package balancer + +import cmap "github.com/orcaman/concurrent-map" + +type Balancer struct { + brokers cmap.ConcurrentMap[string, *BrokerStats] +} +type BrokerStats struct { + stats map[TopicPartition]*TopicPartitionStats +} + +type TopicPartition struct { + Topic string + RangeStart int32 + RangeStop int32 +} + +type TopicPartitionStats struct { + Throughput int64 +}