allocate.go 546 B

1234567891011121314151617181920
  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. }