You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
546 B

  1. package balancer
  2. import (
  3. cmap "github.com/orcaman/concurrent-map/v2"
  4. "github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
  5. )
  6. func allocateTopicPartitions(brokers cmap.ConcurrentMap[string, *BrokerStats], partitionCount int) (assignments []*mq_pb.BrokerPartitionAssignment) {
  7. return []*mq_pb.BrokerPartitionAssignment{
  8. {
  9. LeaderBroker: "localhost:17777",
  10. FollowerBrokers: []string{"localhost:17777"},
  11. Partition: &mq_pb.Partition{
  12. RingSize: MaxPartitionCount,
  13. RangeStart: 0,
  14. RangeStop: MaxPartitionCount,
  15. },
  16. },
  17. }
  18. }