mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 22:25:03 +08:00
go fmt
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func (b *MessageQueueBroker) PublishFollowMe(c context.Context, request *mq_pb.PublishFollowMeRequest) (*mq_pb.PublishFollowMeResponse, error){
|
||||
func (b *MessageQueueBroker) PublishFollowMe(c context.Context, request *mq_pb.PublishFollowMeRequest) (*mq_pb.PublishFollowMeResponse, error) {
|
||||
glog.V(0).Infof("PublishFollowMe %v", request)
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
@@ -75,7 +75,7 @@ func (b *MessageQueueBroker) doFollowInMemoryMessage(c context.Context, client m
|
||||
}
|
||||
if resp.Message != nil {
|
||||
// process ctrl message or data message
|
||||
switch m:= resp.Message.(type) {
|
||||
switch m := resp.Message.(type) {
|
||||
case *mq_pb.FollowInMemoryMessagesResponse_Data:
|
||||
// process data message
|
||||
print("d")
|
||||
|
@@ -188,8 +188,7 @@ func (b *MessageQueueBroker) FollowInMemoryMessages(req *mq_pb.FollowInMemoryMe
|
||||
// to indicate the follower is connected
|
||||
stream.Send(&mq_pb.FollowInMemoryMessagesResponse{
|
||||
Message: &mq_pb.FollowInMemoryMessagesResponse_Ctrl{
|
||||
Ctrl: &mq_pb.FollowInMemoryMessagesResponse_CtrlMessage{
|
||||
},
|
||||
Ctrl: &mq_pb.FollowInMemoryMessagesResponse_CtrlMessage{},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -200,7 +199,7 @@ func (b *MessageQueueBroker) FollowInMemoryMessages(req *mq_pb.FollowInMemoryMe
|
||||
|
||||
var prevFlushTsNs int64
|
||||
|
||||
_,_, err = localTopicPartition.LogBuffer.LoopProcessLogData(clientName, startPosition, 0, func() bool {
|
||||
_, _, err = localTopicPartition.LogBuffer.LoopProcessLogData(clientName, startPosition, 0, func() bool {
|
||||
if !isConnected {
|
||||
return false
|
||||
}
|
||||
|
@@ -102,7 +102,7 @@ func EnsureAssignmentsToActiveBrokers(activeBrokers cmap.ConcurrentMap[string, *
|
||||
assignment.LeaderBroker = ""
|
||||
count++
|
||||
}
|
||||
for i:=0; i<followerCount; i++ {
|
||||
for i := 0; i < followerCount; i++ {
|
||||
if i >= len(assignment.FollowerBrokers) {
|
||||
count++
|
||||
continue
|
||||
@@ -128,7 +128,7 @@ func EnsureAssignmentsToActiveBrokers(activeBrokers cmap.ConcurrentMap[string, *
|
||||
|
||||
hasEmptyFollowers := false
|
||||
j := 0
|
||||
for ; j<len(assignment.FollowerBrokers); j++ {
|
||||
for ; j < len(assignment.FollowerBrokers); j++ {
|
||||
if assignment.FollowerBrokers[j] == "" {
|
||||
hasChanges = true
|
||||
if i < len(pickedBrokers) {
|
||||
|
Reference in New Issue
Block a user