broker report stats to balancer

This commit is contained in:
chrislu
2023-09-16 23:00:51 -07:00
parent a1cb49d078
commit a65088d739
11 changed files with 645 additions and 470 deletions

View File

@@ -2,13 +2,13 @@ package pub_client
import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/mq/broker"
"github.com/seaweedfs/seaweedfs/weed/mq/balancer"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
)
func (p *TopicPublisher) Publish(key, value []byte) error {
hashKey := util.HashToInt32(key) % broker.MaxPartitionCount
hashKey := util.HashToInt32(key) % balancer.MaxPartitionCount
if hashKey < 0 {
hashKey = -hashKey
}