fix compilation
This commit is contained in:
@@ -2,13 +2,13 @@ package pub_client
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"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/pb/mq_pb"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (p *TopicPublisher) Publish(key, value []byte) error {
|
func (p *TopicPublisher) Publish(key, value []byte) error {
|
||||||
hashKey := util.HashToInt32(key) % broker.MaxPartitionCount
|
hashKey := util.HashToInt32(key) % balancer.MaxPartitionCount
|
||||||
if hashKey < 0 {
|
if hashKey < 0 {
|
||||||
hashKey = -hashKey
|
hashKey = -hashKey
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package pub_client
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/rdleal/intervalst/interval"
|
"github.com/rdleal/intervalst/interval"
|
||||||
"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/pb/mq_pb"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
@@ -46,7 +46,7 @@ func (p *TopicPublisher) Connect(bootstrapBroker string) error {
|
|||||||
|
|
||||||
func (p *TopicPublisher) Shutdown() error {
|
func (p *TopicPublisher) Shutdown() error {
|
||||||
|
|
||||||
if clients, found := p.partition2Broker.AllIntersections(0, broker.MaxPartitionCount); found {
|
if clients, found := p.partition2Broker.AllIntersections(0, balancer.MaxPartitionCount); found {
|
||||||
for _, client := range clients {
|
for _, client := range clients {
|
||||||
client.CloseSend()
|
client.CloseSend()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user