Browse Source

go fmt

pull/1318/head
Chris Lu 5 years ago
parent
commit
39e72fb23c
  1. 3
      weed/messaging/broker/broker_grpc_server_subscribe.go
  2. 2
      weed/messaging/broker/consistent_distribution.go
  3. 2
      weed/messaging/broker/topic_lock.go
  4. 1
      weed/messaging/msgclient/client.go
  5. 1
      weed/messaging/msgclient/publisher.go
  6. 2
      weed/messaging/msgclient/subscriber.go

3
weed/messaging/broker/broker_grpc_server_subscribe.go

@ -37,8 +37,7 @@ func (broker *MessageBroker) Subscribe(stream messaging_pb.SeaweedMessaging_Subs
// IsTransient: true, // IsTransient: true,
} }
if err = stream.Send(&messaging_pb.BrokerMessage{
}); err != nil {
if err = stream.Send(&messaging_pb.BrokerMessage{}); err != nil {
return err return err
} }

2
weed/messaging/broker/consistent_distribution.go

@ -1,8 +1,8 @@
package broker package broker
import ( import (
"github.com/cespare/xxhash"
"github.com/buraksezer/consistent" "github.com/buraksezer/consistent"
"github.com/cespare/xxhash"
) )
type Member string type Member string

2
weed/messaging/broker/topic_lock.go

@ -16,9 +16,11 @@ type TopicPartition struct {
Topic string Topic string
Partition int32 Partition int32
} }
const ( const (
TopicPartitionFmt = "%s/%s_%02d" TopicPartitionFmt = "%s/%s_%02d"
) )
func (tp *TopicPartition) String() string { func (tp *TopicPartition) String() string {
return fmt.Sprintf(TopicPartitionFmt, tp.Namespace, tp.Topic, tp.Partition) return fmt.Sprintf(TopicPartitionFmt, tp.Namespace, tp.Topic, tp.Partition)
} }

1
weed/messaging/msgclient/client.go

@ -28,7 +28,6 @@ func NewMessagingClient(bootstrapBrokers ...string) *MessagingClient {
} }
} }
func (mc *MessagingClient) findBroker(tp broker.TopicPartition) (*grpc.ClientConn, error) { func (mc *MessagingClient) findBroker(tp broker.TopicPartition) (*grpc.ClientConn, error) {
for _, broker := range mc.bootstrapBrokers { for _, broker := range mc.bootstrapBrokers {

1
weed/messaging/msgclient/publisher.go

@ -16,6 +16,7 @@ type Publisher struct {
messageCount uint64 messageCount uint64
publisherId string publisherId string
} }
/* /*
func (mc *MessagingClient) NewPublisher(publisherId, namespace, topic string) (*Publisher, error) { func (mc *MessagingClient) NewPublisher(publisherId, namespace, topic string) (*Publisher, error) {
// read topic configuration // read topic configuration

2
weed/messaging/msgclient/subscriber.go

@ -5,8 +5,8 @@ import (
"io" "io"
"time" "time"
"google.golang.org/grpc"
"github.com/chrislusf/seaweedfs/weed/pb/messaging_pb" "github.com/chrislusf/seaweedfs/weed/pb/messaging_pb"
"google.golang.org/grpc"
) )
type Subscriber struct { type Subscriber struct {

Loading…
Cancel
Save