SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
refactor
chrislu4e17d399a697
diff --git a/weed/mq/balancer/balance.go b/weed/mq/balancer/balance.gonew file mode 100644index 0000000000..5be968399b--- /dev/null+++ b/weed/mq/balancer/balance.go@@ -0,0 +1,26 @@+package balancer++import "github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"++func (b *Balancer) LookupOrAllocateTopicPartitions(topic *mq_pb.Topic, publish bool) ([]*mq_pb.BrokerPartitionAssignment, error) {+ // TODO lock the topic++ // find the topic partitions on the filer+ // if the topic is not found+ // if the request is_for_publish+ // create the topic+ // if the request is_for_subscribe+ // return error not found+ // t := topic.FromPbTopic(request.Topic)+ return []*mq_pb.BrokerPartitionAssignment{+ {+ LeaderBroker: "localhost:17777",+ FollowerBrokers: []string{"localhost:17777"},+ Partition: &mq_pb.Partition{+ RingSize: MaxPartitionCount,+ RangeStart: 0,+ RangeStop: MaxPartitionCount,+ },+ },+ }, nil+}diff --git a/weed/mq/balancer/balancer.go b/weed/mq/balancer/balancer.goindex eb452cce09..1aa47831e4 100644--- a/weed/mq/balancer/balancer.go+++ b/weed/mq/balancer/balancer.go@@ -14,29 +14,6 @@ type Balancer struct {Brokers cmap.ConcurrentMap[string, *BrokerStats]}-func (b *Balancer) LookupOrAllocateTopicPartitions(topic *mq_pb.Topic, publish bool) ([]*mq_pb.BrokerPartitionAssignment, error) {- // TODO lock the topic-- // find the topic partitions on the filer- // if the topic is not found- // if the request is_for_publish- // create the topic- // if the request is_for_subscribe- // return error not found- // t := topic.FromPbTopic(request.Topic)- return []*mq_pb.BrokerPartitionAssignment{- {- LeaderBroker: "localhost:17777",- FollowerBrokers: []string{"localhost:17777"},- Partition: &mq_pb.Partition{- RingSize: MaxPartitionCount,- RangeStart: 0,- RangeStop: MaxPartitionCount,- },- },- }, nil-}-type BrokerStats struct {TopicPartitionCount int32ConsumerCount int32