Browse Source

go fmt

pull/5890/head
chrislu 7 months ago
parent
commit
cdeaaf95b4
  1. 6
      weed/mq/broker/broker_server.go
  2. 8
      weed/mq/client/cmd/weed_sub_kv/subscriber_kv.go
  3. 8
      weed/mq/client/cmd/weed_sub_record/subscriber_record.go
  4. 2
      weed/mq/client/sub_client/on_each_partition.go
  5. 14
      weed/mq/client/sub_client/subscriber.go

6
weed/mq/broker/broker_server.go

@ -44,9 +44,9 @@ type MessageQueueBroker struct {
currentFiler pb.ServerAddress currentFiler pb.ServerAddress
localTopicManager *topic.LocalTopicManager localTopicManager *topic.LocalTopicManager
PubBalancer *pub_balancer.PubBalancer PubBalancer *pub_balancer.PubBalancer
lockAsBalancer *cluster.LiveLock
SubCoordinator *sub_coordinator.SubCoordinator
accessLock sync.Mutex
lockAsBalancer *cluster.LiveLock
SubCoordinator *sub_coordinator.SubCoordinator
accessLock sync.Mutex
fca *sub_coordinator.FilerClientAccessor fca *sub_coordinator.FilerClientAccessor
} }

8
weed/mq/client/cmd/weed_sub_kv/subscriber_kv.go

@ -14,10 +14,10 @@ import (
) )
var ( var (
namespace = flag.String("ns", "test", "namespace")
t = flag.String("topic", "test", "topic")
seedBrokers = flag.String("brokers", "localhost:17777", "seed brokers")
maxPartitionCount = flag.Int("maxPartitionCount", 3, "max partition count")
namespace = flag.String("ns", "test", "namespace")
t = flag.String("topic", "test", "topic")
seedBrokers = flag.String("brokers", "localhost:17777", "seed brokers")
maxPartitionCount = flag.Int("maxPartitionCount", 3, "max partition count")
perPartitionConcurrency = flag.Int("perPartitionConcurrency", 1, "per partition concurrency") perPartitionConcurrency = flag.Int("perPartitionConcurrency", 1, "per partition concurrency")
clientId = flag.Uint("client_id", uint(util.RandomInt32()), "client id") clientId = flag.Uint("client_id", uint(util.RandomInt32()), "client id")

8
weed/mq/client/cmd/weed_sub_record/subscriber_record.go

@ -16,10 +16,10 @@ import (
) )
var ( var (
namespace = flag.String("ns", "test", "namespace")
t = flag.String("topic", "test", "topic")
seedBrokers = flag.String("brokers", "localhost:17777", "seed brokers")
maxPartitionCount = flag.Int("maxPartitionCount", 3, "max partition count")
namespace = flag.String("ns", "test", "namespace")
t = flag.String("topic", "test", "topic")
seedBrokers = flag.String("brokers", "localhost:17777", "seed brokers")
maxPartitionCount = flag.Int("maxPartitionCount", 3, "max partition count")
perPartitionConcurrency = flag.Int("perPartitionConcurrency", 1, "per partition concurrency") perPartitionConcurrency = flag.Int("perPartitionConcurrency", 1, "per partition concurrency")
clientId = flag.Uint("client_id", uint(util.RandomInt32()), "client id") clientId = flag.Uint("client_id", uint(util.RandomInt32()), "client id")

2
weed/mq/client/sub_client/on_each_partition.go

@ -65,7 +65,7 @@ func (sub *TopicSubscriber) onEachPartition(assigned *mq_pb.BrokerPartitionAssig
select { select {
case <-stopCh: case <-stopCh:
break break
case ack := <- partitionOffsetChan:
case ack := <-partitionOffsetChan:
subscribeClient.SendMsg(&mq_pb.SubscribeMessageRequest{ subscribeClient.SendMsg(&mq_pb.SubscribeMessageRequest{
Message: &mq_pb.SubscribeMessageRequest_Ack{ Message: &mq_pb.SubscribeMessageRequest_Ack{
Ack: &mq_pb.SubscribeMessageRequest_AckMessage{ Ack: &mq_pb.SubscribeMessageRequest_AckMessage{

14
weed/mq/client/sub_client/subscriber.go

@ -27,16 +27,16 @@ type OnEachMessageFunc func(key, value []byte) (err error)
type OnCompletionFunc func() type OnCompletionFunc func()
type TopicSubscriber struct { type TopicSubscriber struct {
SubscriberConfig *SubscriberConfiguration
ContentConfig *ContentConfiguration
SubscriberConfig *SubscriberConfiguration
ContentConfig *ContentConfiguration
brokerPartitionAssignmentChan chan *mq_pb.SubscriberToSubCoordinatorResponse brokerPartitionAssignmentChan chan *mq_pb.SubscriberToSubCoordinatorResponse
brokerPartitionAssignmentAckChan chan *mq_pb.SubscriberToSubCoordinatorRequest brokerPartitionAssignmentAckChan chan *mq_pb.SubscriberToSubCoordinatorRequest
OnEachMessageFunc OnEachMessageFunc OnEachMessageFunc OnEachMessageFunc
OnCompletionFunc OnCompletionFunc
bootstrapBrokers []string
waitForMoreMessage bool
activeProcessors map[topic.Partition]*ProcessorState
activeProcessorsLock sync.Mutex
OnCompletionFunc OnCompletionFunc
bootstrapBrokers []string
waitForMoreMessage bool
activeProcessors map[topic.Partition]*ProcessorState
activeProcessorsLock sync.Mutex
} }
func NewTopicSubscriber(bootstrapBrokers []string, subscriber *SubscriberConfiguration, content *ContentConfiguration) *TopicSubscriber { func NewTopicSubscriber(bootstrapBrokers []string, subscriber *SubscriberConfiguration, content *ContentConfiguration) *TopicSubscriber {

Loading…
Cancel
Save