You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by go...@apache.org on 2021/10/11 06:31:35 UTC
[incubator-inlong] branch master updated: Revert "[INLONG-624] Go
SDK support for TubeMQ (#1609)" (#1610)
This is an automated email from the ASF dual-hosted git repository.
gosonzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 55dc243 Revert "[INLONG-624] Go SDK support for TubeMQ (#1609)" (#1610)
55dc243 is described below
commit 55dc243156f8ff1895fa0609ec6291301fd55bab
Author: gosonzhang <46...@qq.com>
AuthorDate: Mon Oct 11 14:31:08 2021 +0800
Revert "[INLONG-624] Go SDK support for TubeMQ (#1609)" (#1610)
This reverts commit 72c69aa8658e0d7b0e86be4887d42b2c2be073ab.
---
.licenserc.yaml | 6 -
.../tubemq-client-go/client/consumer.go | 48 -
.../tubemq-client-go/client/consumer_impl.go | 750 ---
.../tubemq-client-go/client/heartbeat.go | 276 --
.../tubemq-client-go/client/message.go | 27 -
.../tubemq-client-go/client/peer.go | 26 -
.../tubemq-client-go/client/version.go | 22 -
.../tubemq-client-go/codec/codec.go | 51 -
.../tubemq-client-go/codec/tubemq_codec.go | 304 --
.../tubemq-client-go/codec/tubemq_codec_test.go | 73 -
.../tubemq-client-go/config/config.go | 548 ---
.../tubemq-client-go/config/config_test.go | 119 -
.../tubemq-client-go/errs/errs.go | 95 -
.../tubemq-client-go/example/consumer.go | 70 -
.../example/multi_routine_consumer.go | 122 -
.../tubemq-client-go/flowctrl/handler.go | 465 --
.../tubemq-client-go/flowctrl/item.go | 133 -
.../tubemq-client-go/flowctrl/result.go | 52 -
.../tubemq-client-twins/tubemq-client-go/go.mod | 27 -
.../tubemq-client-twins/tubemq-client-go/go.sum | 82 -
.../tubemq-client-go/log/config.go | 41 -
.../tubemq-client-go/log/log.go | 113 -
.../tubemq-client-go/log/log_test.go | 57 -
.../tubemq-client-go/log/logger.go | 78 -
.../tubemq-client-go/log/warpper_zaplog.go | 305 --
.../tubemq-client-go/metadata/consumer_event.go | 79 -
.../tubemq-client-go/metadata/metadata.go | 67 -
.../tubemq-client-go/metadata/node.go | 115 -
.../tubemq-client-go/metadata/partition.go | 228 -
.../tubemq-client-go/metadata/subscribe_info.go | 90 -
.../tubemq-client-go/multiplexing/multiplexing.go | 445 --
.../multiplexing/multlplexing_test.go | 144 -
.../tubemq-client-go/protocol/BrokerService.pb.go | 1557 ------
.../tubemq-client-go/protocol/MasterService.pb.go | 5147 --------------------
.../tubemq-client-go/protocol/RPC.pb.go | 640 ---
.../tubemq-client-go/remote/remote.go | 552 ---
.../tubemq-client-go/rpc/broker.go | 252 -
.../tubemq-client-go/rpc/client.go | 97 -
.../tubemq-client-go/rpc/master.go | 195 -
.../tubemq-client-go/selector/ip_selector.go | 83 -
.../tubemq-client-go/selector/ip_selector_test.go | 111 -
.../tubemq-client-go/selector/selector.go | 59 -
.../tubemq-client-go/sub/info.go | 204 -
.../tubemq-client-go/tdmsg/bin_msg.go | 128 -
.../tubemq-client-go/tdmsg/td_msg.go | 393 --
.../tubemq-client-go/transport/client.go | 90 -
.../tubemq-client-go/util/util.go | 162 -
pom.xml | 5 -
48 files changed, 14733 deletions(-)
diff --git a/.licenserc.yaml b/.licenserc.yaml
index 18579df..2e4b4ab 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -84,10 +84,4 @@ header:
- '**/tubemq-client-cpp/src/buffer.h'
- '**/tubemq-client-cpp/third_party/**'
- # Go mod
- - '**/tubemq-client-go/go.mod'
-
- # Go sum
- - '**/tubemq-client-go/go.sum'
-
comment: on-failure
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/consumer.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/consumer.go
deleted file mode 100644
index f6c8a51..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/consumer.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Package client defines the api and information
-// which can be exposed to user.
-package client
-
-import (
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/remote"
-)
-
-// ConsumerResult of a consumption.
-type ConsumerResult struct {
- TopicName string
- ConfirmContext string
- PeerInfo *PeerInfo
- Messages []*Message
-}
-
-var clientID uint64
-
-// Consumer is an interface that abstracts behavior of TubeMQ's consumer
-type Consumer interface {
- // GetMessage receive a single message.
- GetMessage() (*ConsumerResult, error)
- // Confirm the consumption of a message.
- Confirm(confirmContext string, consumed bool) (*ConsumerResult, error)
- // GetCurrConsumedInfo returns the consumptions of the consumer.
- GetCurrConsumedInfo() map[string]*remote.ConsumerOffset
- // Close closes the consumer client and release the resources.
- Close()
- // GetClientID returns the clientID of the consumer.
- GetClientID() string
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/consumer_impl.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/consumer_impl.go
deleted file mode 100644
index 56fe31d..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/consumer_impl.go
+++ /dev/null
@@ -1,750 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package client
-
-import (
- "context"
- "encoding/binary"
- "fmt"
- "hash/crc32"
- "os"
- "strconv"
- "strings"
- "sync"
- "sync/atomic"
- "time"
-
- "github.com/golang/protobuf/proto"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/config"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/errs"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/log"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/metadata"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/multiplexing"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/protocol"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/remote"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/rpc"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/selector"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/sub"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/transport"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/util"
-)
-
-const (
- consumeStatusNormal = 0
- consumeStatusFromMax = 1
- consumeStatusFromMaxAlways = 2
- msgFlagIncProperties = 0x01
-)
-
-type consumer struct {
- clientID string
- config *config.Config
- subInfo *sub.SubInfo
- rmtDataCache *remote.RmtDataCache
- visitToken int64
- authorizedInfo string
- nextAuth2Master int32
- nextAuth2Broker int32
- master *selector.Node
- client rpc.RPCClient
- selector selector.Selector
- lastMasterHb int64
- masterHBRetry int
- heartbeatManager *heartbeatManager
- unreportedTimes int
- done chan struct{}
- closeOnce sync.Once
-}
-
-// NewConsumer returns a consumer which is constructed by a given config.
-func NewConsumer(config *config.Config) (Consumer, error) {
- if err := config.ValidateConsumer(); err != nil {
- return nil, err
- }
- log.Infof("The config of the consumer is %s", config)
- selector, err := selector.Get("ip")
- if err != nil {
- return nil, err
- }
-
- clientID := newClient(config.Consumer.Group)
- pool := multiplexing.NewPool()
- opts := &transport.Options{}
- if config.Net.TLS.Enable {
- opts.TLSEnable = true
- opts.CACertFile = config.Net.TLS.CACertFile
- opts.TLSCertFile = config.Net.TLS.TLSCertFile
- opts.TLSKeyFile = config.Net.TLS.TLSKeyFile
- opts.TLSServerName = config.Net.TLS.TLSServerName
- }
- client := rpc.New(pool, opts, config)
- r := remote.NewRmtDataCache()
- r.SetConsumerInfo(clientID, config.Consumer.Group)
- c := &consumer{
- config: config,
- clientID: clientID,
- subInfo: sub.NewSubInfo(config),
- rmtDataCache: r,
- selector: selector,
- client: client,
- visitToken: util.InvalidValue,
- unreportedTimes: 0,
- done: make(chan struct{}),
- }
- c.subInfo.SetClientID(clientID)
- hbm := newHBManager(c)
- c.heartbeatManager = hbm
- err = c.register2Master(true)
- if err != nil {
- return nil, err
- }
- c.heartbeatManager.registerMaster(c.master.Address)
- go c.processRebalanceEvent()
- log.Infof("[CONSUMER] start consumer success, client=%s", clientID)
- return c, nil
-}
-
-func (c *consumer) register2Master(needChange bool) error {
- if needChange {
- node, err := c.selector.Select(c.config.Consumer.Masters)
- if err != nil {
- return err
- }
- c.master = node
- }
- retryCount := 0
- for {
- rsp, err := c.sendRegRequest2Master()
- if err != nil || !rsp.GetSuccess() {
- if err != nil {
- log.Errorf("[CONSUMER]register2Master error %s", err.Error())
- } else if rsp.GetErrCode() == errs.RetConsumeGroupForbidden || rsp.GetErrCode() == errs.RetConsumeContentForbidden {
- log.Warnf("[CONSUMER] register2master(%s) failure exist register, client=%s, error: %s", c.master.Address, c.clientID, rsp.GetErrMsg())
- return errs.New(rsp.GetErrCode(), rsp.GetErrMsg())
- }
-
- if !c.master.HasNext {
- if err != nil {
- return err
- }
- if rsp != nil {
- log.Errorf("[CONSUMER] register2master(%s) failure exist register, client=%s, error: %s", c.master.Address, c.clientID, rsp.GetErrMsg())
- }
- break
- }
- retryCount++
- log.Warnf("[CONSUMER] register2master(%s) failure, client=%s, retry count=%d", c.master.Address, c.clientID, retryCount)
- if c.master, err = c.selector.Select(c.config.Consumer.Masters); err != nil {
- return err
- }
- continue
- }
- log.Infof("register2Master response %s", rsp.String())
-
- c.masterHBRetry = 0
- c.processRegisterResponseM2C(rsp)
- break
- }
- return nil
-}
-
-func (c *consumer) sendRegRequest2Master() (*protocol.RegisterResponseM2C, error) {
- ctx, cancel := context.WithTimeout(context.Background(), c.config.Net.ReadTimeout)
- defer cancel()
-
- m := &metadata.Metadata{}
- node := &metadata.Node{}
- node.SetHost(util.GetLocalHost())
- node.SetAddress(c.master.Address)
- auth := &protocol.AuthenticateInfo{}
- if c.needGenMasterCertificateInfo(true) {
- util.GenMasterAuthenticateToken(auth, c.config.Net.Auth.UserName, c.config.Net.Auth.Password)
- }
- m.SetNode(node)
- sub := &metadata.SubscribeInfo{}
- sub.SetGroup(c.config.Consumer.Group)
- m.SetSubscribeInfo(sub)
-
- rsp, err := c.client.RegisterRequestC2M(ctx, m, c.subInfo, c.rmtDataCache)
- return rsp, err
-}
-
-func (c *consumer) processRegisterResponseM2C(rsp *protocol.RegisterResponseM2C) {
- if !rsp.GetNotAllocated() {
- c.subInfo.CASIsNotAllocated(1, 0)
- }
- if rsp.GetDefFlowCheckId() != 0 || rsp.GetGroupFlowCheckId() != 0 {
- if rsp.GetDefFlowCheckId() != 0 {
- c.rmtDataCache.UpdateDefFlowCtrlInfo(rsp.GetDefFlowCheckId(), rsp.GetDefFlowControlInfo())
- }
- qryPriorityID := c.rmtDataCache.GetQryPriorityID()
- if rsp.GetQryPriorityId() != 0 {
- qryPriorityID = rsp.GetQryPriorityId()
- }
- c.rmtDataCache.UpdateGroupFlowCtrlInfo(qryPriorityID, rsp.GetGroupFlowCheckId(), rsp.GetGroupFlowControlInfo())
- }
- if rsp.GetAuthorizedInfo() != nil {
- c.processAuthorizedToken(rsp.GetAuthorizedInfo())
- }
- c.lastMasterHb = time.Now().UnixNano() / int64(time.Millisecond)
-}
-
-func (c *consumer) processAuthorizedToken(info *protocol.MasterAuthorizedInfo) {
- atomic.StoreInt64(&c.visitToken, info.GetVisitAuthorizedToken())
- c.authorizedInfo = info.GetAuthAuthorizedToken()
-}
-
-// GetMessage implementation of TubeMQ consumer.
-func (c *consumer) GetMessage() (*ConsumerResult, error) {
- err := c.checkPartitionErr()
- if err != nil {
- return nil, err
- }
- partition, bookedTime, err := c.rmtDataCache.SelectPartition()
- if err != nil {
- return nil, err
- }
- confirmContext := partition.GetPartitionKey() + "@" + strconv.FormatInt(bookedTime, 10)
- isFiltered := c.subInfo.IsFiltered(partition.GetTopic())
- pi := &PeerInfo{
- BrokerHost: partition.GetBroker().GetHost(),
- PartitionID: uint32(partition.GetPartitionID()),
- PartitionKey: partition.GetPartitionKey(),
- CurrOffset: util.InvalidValue,
- }
- m := &metadata.Metadata{}
- node := &metadata.Node{}
- node.SetHost(util.GetLocalHost())
- node.SetAddress(partition.GetBroker().GetAddress())
- m.SetNode(node)
- sub := &metadata.SubscribeInfo{}
- sub.SetGroup(c.config.Consumer.Group)
- sub.SetPartition(partition)
- m.SetSubscribeInfo(sub)
-
- ctx, cancel := context.WithTimeout(context.Background(), c.config.Net.ReadTimeout)
- defer cancel()
- rsp, err := c.client.GetMessageRequestC2B(ctx, m, c.subInfo, c.rmtDataCache)
- if err != nil {
- log.Infof("[CONSUMER]GetMessage error %s", err.Error())
- if err := c.rmtDataCache.ReleasePartition(true, isFiltered, confirmContext, false); err != nil {
- log.Errorf("[CONSUMER]GetMessage release partition error %s", err.Error())
- return nil, err
- }
- return nil, err
- }
- cs := &ConsumerResult{
- TopicName: partition.GetTopic(),
- ConfirmContext: confirmContext,
- PeerInfo: pi,
- }
- msgs, err := c.processGetMessageRspB2C(pi, isFiltered, partition, confirmContext, rsp)
- if err != nil {
- return cs, err
- }
- cs.Messages = msgs
- return cs, err
-}
-
-// Confirm implementation of TubeMQ consumer.
-func (c *consumer) Confirm(confirmContext string, consumed bool) (*ConsumerResult, error) {
- partitionKey, bookedTime, err := util.ParseConfirmContext(confirmContext)
- if err != nil {
- return nil, errs.New(errs.RetBadRequest, "illegel confirm_context content: unregular confirm_context value format")
- }
- topic, err := parsePartitionKeyToTopic(partitionKey)
- if err != nil {
- return nil, errs.New(errs.RetBadRequest, err.Error())
- }
- if !c.rmtDataCache.IsPartitionInUse(partitionKey, bookedTime) {
- return nil, errs.New(errs.RetErrConfirmTimeout, "The confirm_context's value invalid!")
- }
- partition := c.rmtDataCache.GetPartition(partitionKey)
- if partition == nil {
- return nil, errs.New(errs.RetErrConfirmTimeout, "Not found the partition by confirm_context!")
- }
-
- rsp, err := c.sendConfirmReq2Broker(partition)
- if err != nil {
- log.Infof("[CONSUMER]Confirm error %s", err.Error())
- return nil, err
- }
-
- pi := &PeerInfo{
- BrokerHost: partition.GetBroker().GetHost(),
- PartitionID: uint32(partition.GetPartitionID()),
- PartitionKey: partition.GetPartitionKey(),
- CurrOffset: util.InvalidValue,
- }
- cs := &ConsumerResult{
- TopicName: partition.GetTopic(),
- PeerInfo: pi,
- }
- if !rsp.GetSuccess() {
- return cs, errs.New(rsp.GetErrCode(), rsp.GetErrMsg())
- }
- currOffset := rsp.GetCurrOffset()
- c.rmtDataCache.BookPartitionInfo(partitionKey, currOffset, util.InvalidValue)
- err = c.rmtDataCache.ReleasePartition(true, c.subInfo.IsFiltered(topic), confirmContext, consumed)
- return cs, err
-}
-
-func (c *consumer) sendConfirmReq2Broker(partition *metadata.Partition) (*protocol.CommitOffsetResponseB2C, error) {
- m := &metadata.Metadata{}
- node := &metadata.Node{}
- node.SetHost(util.GetLocalHost())
- node.SetAddress(partition.GetBroker().GetAddress())
- m.SetNode(node)
- sub := &metadata.SubscribeInfo{}
- sub.SetGroup(c.config.Consumer.Group)
- sub.SetPartition(partition)
- m.SetSubscribeInfo(sub)
-
- ctx, cancel := context.WithTimeout(context.Background(), c.config.Net.ReadTimeout-500)
- defer cancel()
-
- rsp, err := c.client.CommitOffsetRequestC2B(ctx, m, c.subInfo)
- return rsp, err
-}
-
-func parsePartitionKeyToTopic(partitionKey string) (string, error) {
- pos1 := strings.Index(partitionKey, ":")
- if pos1 == -1 {
- return "", fmt.Errorf("illegel confirm_context content: unregular index key value format")
- }
- topic := partitionKey[pos1+1:]
- pos2 := strings.LastIndex(topic, ":")
- if pos2 == -1 {
- return "", fmt.Errorf("illegel confirm_context content: unregular index's topic key value format")
- }
- topic = topic[:pos2]
- return topic, nil
-}
-
-// GetCurrConsumedInfo implementation of TubeMQ consumer.
-func (c *consumer) GetCurrConsumedInfo() map[string]*remote.ConsumerOffset {
- partitionOffset := c.rmtDataCache.GetCurPartitionOffset()
- consumedInfo := make(map[string]*remote.ConsumerOffset, len(partitionOffset))
- for partitionKey, offset := range partitionOffset {
- co := &remote.ConsumerOffset{
- PartitionKey: partitionKey,
- CurrOffset: offset.CurrOffset,
- MaxOffset: offset.MaxOffset,
- UpdateTime: offset.UpdateTime,
- }
- consumedInfo[partitionKey] = co
- }
- return consumedInfo
-}
-
-// GetClientID implementation of TubeMQ consumer.
-func (c *consumer) GetClientID() string {
- return c.clientID
-}
-
-// Close implementation of TubeMQ consumer.
-func (c *consumer) Close() {
- c.closeOnce.Do(func() {
- log.Infof("[CONSUMER]Begin to close consumer, client=%s", c.clientID)
- close(c.done)
- c.heartbeatManager.close()
- c.close2Master()
- c.closeAllBrokers()
- c.client.Close()
- log.Infof("[CONSUMER]Consumer has been closed successfully, client=%s", c.clientID)
- })
-}
-
-func (c *consumer) processRebalanceEvent() {
- log.Info("[CONSUMER]Rebalance event Handler starts!")
- for {
- select {
- case event, ok := <-c.rmtDataCache.EventCh:
- if ok {
- c.rmtDataCache.ClearEvent()
- switch event.GetEventType() {
- case metadata.Disconnect, metadata.OnlyDisconnect:
- c.disconnect2Broker(event)
- c.rmtDataCache.OfferEventResult(event)
- case metadata.Connect, metadata.OnlyConnect:
- c.connect2Broker(event)
- c.rmtDataCache.OfferEventResult(event)
- }
- }
- case <-c.done:
- log.Infof("[CONSUMER]Rebalance done, client=%s", c.clientID)
- log.Info("[CONSUMER] Rebalance event Handler stopped!")
- return
- }
- }
-}
-
-func (c *consumer) disconnect2Broker(event *metadata.ConsumerEvent) {
- log.Tracef("[disconnect2Broker] begin to process disconnect event, client=%s", c.clientID)
- subscribeInfo := event.GetSubscribeInfo()
- if len(subscribeInfo) > 0 {
- removedPartitions := make(map[*metadata.Node][]*metadata.Partition)
- c.rmtDataCache.RemoveAndGetPartition(subscribeInfo, c.config.Consumer.RollbackIfConfirmTimeout, removedPartitions)
- if len(removedPartitions) > 0 {
- c.unregister2Broker(removedPartitions)
- }
- }
- event.SetEventStatus(metadata.Done)
- log.Tracef("[disconnect2Broker] disconnect event finished, client=%s", c.clientID)
-}
-
-func (c *consumer) unregister2Broker(unRegPartitions map[*metadata.Node][]*metadata.Partition) {
- if len(unRegPartitions) == 0 {
- return
- }
-
- for _, partitions := range unRegPartitions {
- for _, partition := range partitions {
- log.Tracef("unregister2Brokers, partition key=%s", partition.GetPartitionKey())
- c.sendUnregisterReq2Broker(partition)
- }
- }
-}
-
-func (c *consumer) sendUnregisterReq2Broker(partition *metadata.Partition) {
- ctx, cancel := context.WithTimeout(context.Background(), c.config.Net.ReadTimeout)
- defer cancel()
-
- m := &metadata.Metadata{}
- node := &metadata.Node{}
- node.SetHost(util.GetLocalHost())
- node.SetAddress(partition.GetBroker().GetAddress())
- m.SetNode(node)
- m.SetReadStatus(1)
- sub := &metadata.SubscribeInfo{}
- sub.SetGroup(c.config.Consumer.Group)
- sub.SetConsumerID(c.clientID)
- sub.SetPartition(partition)
- m.SetSubscribeInfo(sub)
- auth := c.genBrokerAuthenticInfo(true)
- c.subInfo.SetAuthorizedInfo(auth)
-
- rsp, err := c.client.UnregisterRequestC2B(ctx, m, c.subInfo)
- if err != nil {
- log.Errorf("[CONSUMER] fail to unregister partition %s, error %s", partition, err.Error())
- return
- }
- if !rsp.GetSuccess() {
- log.Errorf("[CONSUMER] fail to unregister partition %s, err code: %d, error msg %s", partition, rsp.GetErrCode(), rsp.GetErrMsg())
- }
-}
-
-func (c *consumer) connect2Broker(event *metadata.ConsumerEvent) {
- log.Tracef("[connect2Broker] connect event begin, client=%s", c.clientID)
- if len(event.GetSubscribeInfo()) > 0 {
- unsubPartitions := c.rmtDataCache.FilterPartitions(event.GetSubscribeInfo())
- if len(unsubPartitions) > 0 {
- for _, partition := range unsubPartitions {
- node := &metadata.Node{}
- node.SetHost(util.GetLocalHost())
- node.SetAddress(partition.GetBroker().GetAddress())
-
- rsp, err := c.sendRegisterReq2Broker(partition, node)
- if err != nil {
- log.Warnf("[connect2Broker] error %s", err.Error())
- continue
- }
- if !rsp.GetSuccess() {
- log.Warnf("[connect2Broker] err code:%d, err msg: %s", rsp.GetErrCode(), rsp.GetErrMsg())
- return
- }
-
- c.rmtDataCache.AddNewPartition(partition)
- c.heartbeatManager.registerBroker(partition.GetBroker())
- }
- }
- }
- c.subInfo.SetNotFirstRegistered()
- event.SetEventStatus(metadata.Done)
- log.Tracef("[connect2Broker] connect event finished, client ID=%s", c.clientID)
-}
-
-func (c *consumer) sendRegisterReq2Broker(partition *metadata.Partition, node *metadata.Node) (*protocol.RegisterResponseB2C, error) {
- ctx, cancel := context.WithTimeout(context.Background(), c.config.Net.ReadTimeout)
- defer cancel()
-
- m := &metadata.Metadata{}
- m.SetNode(node)
- sub := &metadata.SubscribeInfo{}
- sub.SetGroup(c.config.Consumer.Group)
- sub.SetConsumerID(c.clientID)
- sub.SetPartition(partition)
- m.SetSubscribeInfo(sub)
- isFirstRegister := c.rmtDataCache.IsFirstRegister(partition.GetPartitionKey())
- m.SetReadStatus(c.getConsumeReadStatus(isFirstRegister))
- auth := c.genBrokerAuthenticInfo(true)
- c.subInfo.SetAuthorizedInfo(auth)
-
- rsp, err := c.client.RegisterRequestC2B(ctx, m, c.subInfo, c.rmtDataCache)
- return rsp, err
-}
-
-func newClient(group string) string {
- return group + "_" +
- util.GetLocalHost() + "-" +
- strconv.Itoa(os.Getpid()) + "-" +
- strconv.Itoa(int(time.Now().Unix()*1000)) + "-" +
- strconv.Itoa(int(atomic.AddUint64(&clientID, 1))) + "-" +
- "go-" +
- tubeMQClientVersion
-}
-
-func (c *consumer) genBrokerAuthenticInfo(force bool) *protocol.AuthorizedInfo {
- needAdd := false
- auth := &protocol.AuthorizedInfo{
- VisitAuthorizedToken: proto.Int64(atomic.LoadInt64(&c.visitToken)),
- }
- if c.config.Net.Auth.Enable {
- if force {
- needAdd = true
- atomic.StoreInt32(&c.nextAuth2Broker, 0)
- } else if atomic.LoadInt32(&c.nextAuth2Broker) == 1 {
- if atomic.CompareAndSwapInt32(&c.nextAuth2Broker, 1, 0) {
- needAdd = true
- }
- }
- if needAdd {
- authToken := util.GenBrokerAuthenticateToken(c.config.Net.Auth.UserName, c.config.Net.Auth.Password)
- auth.AuthAuthorizedToken = proto.String(authToken)
- }
- }
- return auth
-}
-
-func (c *consumer) needGenMasterCertificateInfo(force bool) bool {
- needAdd := false
- if c.config.Net.Auth.Enable {
- if force {
- needAdd = true
- atomic.StoreInt32(&c.nextAuth2Master, 0)
- } else if atomic.LoadInt32(&c.nextAuth2Master) == 1 {
- if atomic.CompareAndSwapInt32(&c.nextAuth2Master, 1, 0) {
- needAdd = true
- }
- }
- if needAdd {
- }
- }
- return needAdd
-}
-
-func (c *consumer) getConsumeReadStatus(isFirstReg bool) int32 {
- readStatus := consumeStatusNormal
- if isFirstReg {
- if c.config.Consumer.ConsumePosition == 0 {
- readStatus = consumeStatusFromMax
- log.Infof("[Consumer From Max Offset], client=%s", c.clientID)
- } else if c.config.Consumer.ConsumePosition > 0 {
- readStatus = consumeStatusFromMaxAlways
- log.Infof("[Consumer From Max Offset Always], client=%s", c.clientID)
- }
- }
- return int32(readStatus)
-}
-
-func (c *consumer) checkPartitionErr() error {
- startTime := time.Now().UnixNano() / int64(time.Millisecond)
- for {
- ret := c.rmtDataCache.GetCurConsumeStatus()
- if ret == 0 {
- return nil
- }
- if c.config.Consumer.MaxPartCheckPeriod >= 0 &&
- time.Now().UnixNano()/int64(time.Millisecond)-startTime >= c.config.Consumer.MaxPartCheckPeriod.Milliseconds() {
- switch ret {
- case errs.RetErrNoPartAssigned:
- return errs.ErrNoPartAssigned
- case errs.RetErrAllPartInUse:
- return errs.ErrAllPartInUse
- case errs.RetErrAllPartWaiting:
- return errs.ErrAllPartWaiting
- }
- }
- time.Sleep(c.config.Consumer.PartCheckSlice)
- }
-}
-
-func (c *consumer) processGetMessageRspB2C(pi *PeerInfo, filtered bool, partition *metadata.Partition, confirmContext string, rsp *protocol.GetMessageResponseB2C) ([]*Message, error) {
- limitDlt := int64(300)
- escLimit := rsp.GetEscFlowCtrl()
- now := time.Now().UnixNano() / int64(time.Millisecond)
- switch rsp.GetErrCode() {
- case errs.RetSuccess:
- dataDleVal := util.InvalidValue
- if rsp.GetCurrDataDlt() >= 0 {
- dataDleVal = rsp.GetCurrDataDlt()
- }
- currOffset := util.InvalidValue
- if rsp.GetCurrOffset() >= 0 {
- currOffset = rsp.GetCurrOffset()
- }
- maxOffset := util.InvalidValue
- if rsp.GetMaxOffset() >= 0 {
- maxOffset = rsp.GetMaxOffset()
- }
- msgSize, msgs := c.convertMessages(filtered, partition.GetTopic(), rsp)
- c.rmtDataCache.BookPartitionInfo(partition.GetPartitionKey(), currOffset, maxOffset)
- cd := metadata.NewConsumeData(now, 200, escLimit, int32(msgSize), 0, dataDleVal, rsp.GetRequireSlow())
- c.rmtDataCache.BookConsumeData(partition.GetPartitionKey(), cd)
- pi.CurrOffset = currOffset
- pi.MaxOffset = maxOffset
- log.Tracef("[CONSUMER] getMessage count=%ld, from %s, client=%s", len(msgs), partition.GetPartitionKey(), c.clientID)
- return msgs, nil
- case errs.RetErrHBNoNode, errs.RetCertificateFailure, errs.RetErrDuplicatePartition:
- partitionKey, _, err := util.ParseConfirmContext(confirmContext)
- if err != nil {
- return nil, err
- }
- c.rmtDataCache.RemovePartition([]string{partitionKey})
- return nil, errs.New(rsp.GetErrCode(), rsp.GetErrMsg())
- case errs.RetErrConsumeSpeedLimit:
- defDltTime := int64(rsp.GetMinLimitTime())
- if defDltTime == 0 {
- defDltTime = c.config.Consumer.MsgNotFoundWait.Milliseconds()
- }
- cd := metadata.NewConsumeData(now, rsp.GetErrCode(), false, 0, limitDlt, defDltTime, rsp.GetRequireSlow())
- c.rmtDataCache.BookPartitionInfo(partition.GetPartitionKey(), util.InvalidValue, util.InvalidValue)
- c.rmtDataCache.BookConsumeData(partition.GetPartitionKey(), cd)
- c.rmtDataCache.ReleasePartition(true, filtered, confirmContext, false)
- return nil, errs.New(rsp.GetErrCode(), rsp.GetErrMsg())
- case errs.RetErrNotFound:
- limitDlt = c.config.Consumer.MsgNotFoundWait.Milliseconds()
- case errs.RetErrForbidden:
- limitDlt = 2000
- case errs.RetErrMoved:
- limitDlt = 200
- case errs.RetErrServiceUnavailable:
- }
- if rsp.GetErrCode() != errs.RetSuccess {
- cd := metadata.NewConsumeData(now, rsp.GetErrCode(), false, 0, limitDlt, util.InvalidValue, rsp.GetRequireSlow())
- c.rmtDataCache.BookPartitionInfo(partition.GetPartitionKey(), util.InvalidValue, util.InvalidValue)
- c.rmtDataCache.BookConsumeData(partition.GetPartitionKey(), cd)
- c.rmtDataCache.ReleasePartition(true, filtered, confirmContext, false)
- return nil, errs.New(rsp.GetErrCode(), rsp.GetErrMsg())
- }
- return nil, errs.New(rsp.GetErrCode(), rsp.GetErrMsg())
-}
-
-func (c *consumer) convertMessages(filtered bool, topic string, rsp *protocol.GetMessageResponseB2C) (int, []*Message) {
- msgSize := 0
- if len(rsp.GetMessages()) == 0 {
- return msgSize, nil
- }
-
- msgs := make([]*Message, 0, len(rsp.GetMessages()))
- for _, m := range rsp.GetMessages() {
- checkSum := uint64(crc32.Update(0, crc32.IEEETable, m.GetPayLoadData())) & 0x7FFFFFFF
- if int32(checkSum) != m.GetCheckSum() {
- continue
- }
- readPos := 0
- payLoadData := m.GetPayLoadData()
- dataLen := len(payLoadData)
- var properties map[string]string
- if m.GetFlag()&msgFlagIncProperties == 1 {
- if len(payLoadData) < 4 {
- continue
- }
- attrLen := int(binary.BigEndian.Uint32(payLoadData[:4]))
- readPos += 4
- dataLen -= 4
- if attrLen > dataLen {
- continue
- }
-
- attribute := payLoadData[readPos : readPos+attrLen]
- readPos += attrLen
- dataLen -= attrLen
- properties = util.SplitToMap(string(attribute), ",", "=")
- if filtered {
- topicFilters := c.subInfo.GetTopicFilters()
- if msgKey, ok := properties["$msgType$"]; ok {
- if filters, ok := topicFilters[topic]; ok {
- found := false
- for _, filter := range filters {
- if filter == msgKey {
- found = true
- break
- }
- }
- if !found {
- continue
- }
- }
- }
- }
- }
- msg := &Message{
- Topic: topic,
- Flag: m.GetFlag(),
- ID: m.GetMessageId(),
- Properties: properties,
- DataLen: int32(dataLen),
- Data: payLoadData[readPos:],
- }
- msgs = append(msgs, msg)
- msgSize += dataLen
- }
- return msgSize, msgs
-}
-
-func (c *consumer) close2Master() {
- log.Infof("[CONSUMER] close2Master begin, client=%s", c.clientID)
- ctx, cancel := context.WithTimeout(context.Background(), c.config.Net.ReadTimeout)
- defer cancel()
-
- m := &metadata.Metadata{}
- node := &metadata.Node{}
- node.SetHost(util.GetLocalHost())
- node.SetAddress(c.master.Address)
- m.SetNode(node)
- sub := &metadata.SubscribeInfo{}
- sub.SetGroup(c.config.Consumer.Group)
- m.SetSubscribeInfo(sub)
- mci := &protocol.MasterCertificateInfo{}
- auth := &protocol.AuthenticateInfo{}
- if c.needGenMasterCertificateInfo(true) {
- util.GenMasterAuthenticateToken(auth, c.config.Net.Auth.UserName, c.config.Net.Auth.Password)
- }
- c.subInfo.SetMasterCertificateInfo(mci)
- rsp, err := c.client.CloseRequestC2M(ctx, m, c.subInfo)
- if err != nil {
- log.Errorf("[CONSUMER] fail to close master, error: %s", err.Error())
- return
- }
- if !rsp.GetSuccess() {
- log.Errorf("[CONSUMER] fail to close master, error code: %d, error msg: %s", rsp.GetErrCode(), rsp.GetErrMsg())
- return
- }
- log.Infof("[CONSUMER] close2Master finished, client=%s", c.clientID)
-}
-
-func (c *consumer) closeAllBrokers() {
- log.Infof("[CONSUMER] closeAllBrokers begin, client=%s", c.clientID)
- partitions := c.rmtDataCache.GetAllClosedBrokerParts()
- if len(partitions) > 0 {
- c.unregister2Broker(partitions)
- }
- log.Infof("[CONSUMER] closeAllBrokers end, client=%s", c.clientID)
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/heartbeat.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/heartbeat.go
deleted file mode 100644
index a4918f5..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/heartbeat.go
+++ /dev/null
@@ -1,276 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package client
-
-import (
- "context"
- "strings"
- "sync"
- "sync/atomic"
- "time"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/errs"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/log"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/metadata"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/protocol"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/util"
-)
-
-type heartbeatMetadata struct {
- numConnections int
- timer *time.Timer
-}
-
-type heartbeatManager struct {
- consumer *consumer
- heartbeats map[string]*heartbeatMetadata
- mu sync.Mutex
-}
-
-func newHBManager(consumer *consumer) *heartbeatManager {
- return &heartbeatManager{
- consumer: consumer,
- heartbeats: make(map[string]*heartbeatMetadata),
- }
-}
-
-func (h *heartbeatManager) registerMaster(address string) {
- h.mu.Lock()
- defer h.mu.Unlock()
- if _, ok := h.heartbeats[address]; !ok {
- h.heartbeats[address] = &heartbeatMetadata{
- numConnections: 1,
- timer: time.AfterFunc(h.consumer.config.Heartbeat.Interval/2, h.consumerHB2Master),
- }
- }
- hm := h.heartbeats[address]
- hm.numConnections++
-}
-
-func (h *heartbeatManager) registerBroker(broker *metadata.Node) {
- h.mu.Lock()
- defer h.mu.Unlock()
-
- if _, ok := h.heartbeats[broker.GetAddress()]; !ok {
- h.heartbeats[broker.GetAddress()] = &heartbeatMetadata{
- numConnections: 1,
- timer: time.AfterFunc(h.consumer.config.Heartbeat.Interval, func() { h.consumerHB2Broker(broker) }),
- }
- }
- hm := h.heartbeats[broker.GetAddress()]
- hm.numConnections++
-}
-
-func (h *heartbeatManager) consumerHB2Master() {
- if time.Now().UnixNano()/int64(time.Millisecond)-h.consumer.lastMasterHb > 30000 {
- h.consumer.rmtDataCache.HandleExpiredPartitions(h.consumer.config.Consumer.MaxConfirmWait)
- }
- m := &metadata.Metadata{}
- node := &metadata.Node{}
- node.SetHost(util.GetLocalHost())
- node.SetAddress(h.consumer.master.Address)
- m.SetNode(node)
- sub := &metadata.SubscribeInfo{}
- sub.SetGroup(h.consumer.config.Consumer.Group)
- m.SetSubscribeInfo(sub)
- auth := &protocol.AuthenticateInfo{}
- if h.consumer.needGenMasterCertificateInfo(true) {
- util.GenMasterAuthenticateToken(auth, h.consumer.config.Net.Auth.UserName, h.consumer.config.Net.Auth.Password)
- }
- h.consumer.unreportedTimes++
- if h.consumer.unreportedTimes > h.consumer.config.Consumer.MaxSubInfoReportInterval {
- m.SetReportTimes(true)
- h.consumer.unreportedTimes = 0
- }
-
- rsp, err := h.sendHeartbeatC2M(m)
- if err != nil {
- log.Errorf("consumer hb err %s", err.Error())
- h.consumer.masterHBRetry++
- } else {
- if !rsp.GetSuccess() {
- h.consumer.masterHBRetry++
- if rsp.GetErrCode() == errs.RetErrHBNoNode || strings.Index(rsp.GetErrMsg(), "StandbyException") != -1 {
- log.Warnf("[CONSUMER] hb2master found no-node or standby, re-register, client=%s", h.consumer.clientID)
- address := h.consumer.master.Address
- go func() {
- err := h.consumer.register2Master(rsp.GetErrCode() != errs.RetErrHBNoNode)
- if err != nil {
- return
- }
- h.resetMasterHeartbeat()
- }()
- if rsp.GetErrCode() != errs.RetErrHBNoNode {
- h.mu.Lock()
- defer h.mu.Unlock()
- hm := h.heartbeats[address]
- hm.numConnections--
- if hm.numConnections == 0 {
- delete(h.heartbeats, address)
- }
- return
- }
- log.Warnf("[CONSUMER] heartBeat2Master failure to (%s) : %s, client=%s", h.consumer.master.Address, rsp.GetErrMsg(), h.consumer.clientID)
- return
- }
- }
- }
- h.consumer.masterHBRetry = 0
- h.processHBResponseM2C(rsp)
- h.resetMasterHeartbeat()
-}
-
-func (h *heartbeatManager) resetMasterHeartbeat() {
- h.mu.Lock()
- defer h.mu.Unlock()
- hm := h.heartbeats[h.consumer.master.Address]
- hm.timer.Reset(h.nextHeartbeatInterval())
-}
-
-func (h *heartbeatManager) sendHeartbeatC2M(m *metadata.Metadata) (*protocol.HeartResponseM2C, error) {
- ctx, cancel := context.WithTimeout(context.Background(), h.consumer.config.Net.ReadTimeout)
- defer cancel()
- rsp, err := h.consumer.client.HeartRequestC2M(ctx, m, h.consumer.subInfo, h.consumer.rmtDataCache)
- return rsp, err
-}
-
-func (h *heartbeatManager) processHBResponseM2C(rsp *protocol.HeartResponseM2C) {
- h.consumer.masterHBRetry = 0
- if !rsp.GetNotAllocated() {
- h.consumer.subInfo.CASIsNotAllocated(1, 0)
- }
- if rsp.GetDefFlowCheckId() != 0 || rsp.GetGroupFlowCheckId() != 0 {
- if rsp.GetDefFlowCheckId() != 0 {
- h.consumer.rmtDataCache.UpdateDefFlowCtrlInfo(rsp.GetDefFlowCheckId(), rsp.GetDefFlowControlInfo())
- }
- qryPriorityID := h.consumer.rmtDataCache.GetQryPriorityID()
- if rsp.GetQryPriorityId() != 0 {
- qryPriorityID = rsp.GetQryPriorityId()
- }
- h.consumer.rmtDataCache.UpdateGroupFlowCtrlInfo(qryPriorityID, rsp.GetGroupFlowCheckId(), rsp.GetGroupFlowControlInfo())
- }
- if rsp.GetAuthorizedInfo() != nil {
- h.consumer.processAuthorizedToken(rsp.GetAuthorizedInfo())
- }
- if rsp.GetRequireAuth() {
- atomic.StoreInt32(&h.consumer.nextAuth2Master, 1)
- }
- if rsp.GetEvent() != nil {
- event := rsp.GetEvent()
- subscribeInfo := make([]*metadata.SubscribeInfo, 0, len(event.GetSubscribeInfo()))
- for _, sub := range event.GetSubscribeInfo() {
- s, err := metadata.NewSubscribeInfo(sub)
- if err != nil {
- continue
- }
- subscribeInfo = append(subscribeInfo, s)
- }
- e := metadata.NewEvent(event.GetRebalanceId(), event.GetOpType(), subscribeInfo)
- h.consumer.rmtDataCache.OfferEventAndNotify(e)
- }
-}
-
-func (h *heartbeatManager) nextHeartbeatInterval() time.Duration {
- interval := h.consumer.config.Heartbeat.Interval
- if h.consumer.masterHBRetry >= h.consumer.config.Heartbeat.MaxRetryTimes {
- interval = h.consumer.config.Heartbeat.AfterFail
- }
- return interval
-}
-
-func (h *heartbeatManager) consumerHB2Broker(broker *metadata.Node) {
- h.mu.Lock()
- defer h.mu.Unlock()
-
- partitions := h.consumer.rmtDataCache.GetPartitionByBroker(broker)
- if len(partitions) == 0 {
- h.resetBrokerTimer(broker)
- return
- }
-
- rsp, err := h.sendHeartbeatC2B(broker)
- if err != nil {
- log.Warnf("[Heartbeat2Broker] request network to failure %s", err.Error())
- h.resetBrokerTimer(broker)
- return
- }
- partitionKeys := make([]string, 0, len(partitions))
- if rsp.GetErrCode() == errs.RetCertificateFailure {
- for _, partition := range partitions {
- partitionKeys = append(partitionKeys, partition.GetPartitionKey())
- }
- log.Warnf("[Heartbeat2Broker] request (%s) CertificateFailure", broker.GetAddress())
- h.consumer.rmtDataCache.RemovePartition(partitionKeys)
- }
- if rsp.GetSuccess() && rsp.GetHasPartFailure() {
- for _, fi := range rsp.GetFailureInfo() {
- pos := strings.Index(fi, ":")
- if pos == -1 {
- continue
- }
- partition, err := metadata.NewPartition(fi[pos+1:])
- if err != nil {
- continue
- }
- log.Tracef("[Heartbeat2Broker] found partition(%s) hb failure!", partition.GetPartitionKey())
- partitionKeys = append(partitionKeys, partition.GetPartitionKey())
- }
- h.consumer.rmtDataCache.RemovePartition(partitionKeys)
- }
- log.Tracef("[Heartbeat2Broker] out hb response process, add broker(%s) timer!", broker.GetAddress())
- h.resetBrokerTimer(broker)
-}
-
-func (h *heartbeatManager) sendHeartbeatC2B(broker *metadata.Node) (*protocol.HeartBeatResponseB2C, error) {
- m := &metadata.Metadata{}
- m.SetReadStatus(h.consumer.getConsumeReadStatus(false))
- m.SetNode(broker)
- sub := &metadata.SubscribeInfo{}
- sub.SetGroup(h.consumer.config.Consumer.Group)
- m.SetSubscribeInfo(sub)
- auth := h.consumer.genBrokerAuthenticInfo(true)
- h.consumer.subInfo.SetAuthorizedInfo(auth)
- ctx, cancel := context.WithTimeout(context.Background(), h.consumer.config.Net.ReadTimeout)
- defer cancel()
- rsp, err := h.consumer.client.HeartbeatRequestC2B(ctx, m, h.consumer.subInfo, h.consumer.rmtDataCache)
- return rsp, err
-}
-
-func (h *heartbeatManager) resetBrokerTimer(broker *metadata.Node) {
- interval := h.consumer.config.Heartbeat.Interval
- partitions := h.consumer.rmtDataCache.GetPartitionByBroker(broker)
- if len(partitions) == 0 {
- delete(h.heartbeats, broker.GetAddress())
- } else {
- hm := h.heartbeats[broker.GetAddress()]
- hm.timer.Reset(interval)
- }
-}
-
-func (h *heartbeatManager) close() {
- h.mu.Lock()
- defer h.mu.Unlock()
-
- for _, heartbeat := range h.heartbeats {
- if !heartbeat.timer.Stop() {
- <-heartbeat.timer.C
- }
- heartbeat.timer = nil
- }
- h.heartbeats = nil
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/message.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/message.go
deleted file mode 100644
index 22a02fb..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/message.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package client
-
-type Message struct {
- Topic string
- Data []byte
- DataLen int32
- ID int64
- Flag int32
- Properties map[string]string
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/peer.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/peer.go
deleted file mode 100644
index 9a44218..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/peer.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package client
-
-type PeerInfo struct {
- PartitionID uint32
- BrokerHost string
- PartitionKey string
- CurrOffset int64
- MaxOffset int64
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/version.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/version.go
deleted file mode 100644
index fad542e..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/client/version.go
+++ /dev/null
@@ -1,22 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package client
-
-const (
- tubeMQClientVersion = "0.1.0"
-)
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/codec/codec.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/codec/codec.go
deleted file mode 100644
index e902280..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/codec/codec.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Package codec defines the encoding and decoding logic between TubeMQ.
-// If the protocol of encoding and decoding is changed, only this package
-// will need to be changed.
-package codec
-
-// Response is the abstraction of the transport response.
-type Response interface {
- // GetSerialNo returns the `serialNo` of the corresponding request.
- GetSerialNo() uint32
- // GetBuffer returns the body of the response.
- GetBuffer() []byte
-}
-
-// Decoder is the abstraction of the decoder which is used to decode the response.
-type Decoder interface {
- // Decode will decode the response to frame head and body.
- Decode() (Response, error)
-}
-
-// RPCRequest represents the RPC request protocol.
-type RPCRequest interface {
- // GetSerialNo returns the `serialNo` of the corresponding request.
- GetSerialNo() uint32
- // Marshal marshals the RPCRequest to bytes.
- Marshal() ([]byte, error)
-}
-
-// RPCResponse represents the RPC response from TubeMQ.
-type RPCResponse interface {
- // Unmarshal unmarshals the bytes array.
- Unmarshal([]byte) error
- // GetDebugMsg returns the debug msg.
- GetDebugMsg() string
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/codec/tubemq_codec.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/codec/tubemq_codec.go
deleted file mode 100644
index 8fb9cc2..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/codec/tubemq_codec.go
+++ /dev/null
@@ -1,304 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Package codec defines the encoding and decoding logic between TubeMQ.
-// If the protocol of encoding and decoding is changed, only this package
-// will need to be changed.
-package codec
-
-import (
- "bufio"
- "bytes"
- "encoding/binary"
- "errors"
- "io"
- "math"
- "sync/atomic"
-
- "github.com/golang/protobuf/proto"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/protocol"
-)
-
-const (
- // RPCProtocolBeginToken is the default begin token of TubeMQ RPC protocol.
- RPCProtocolBeginToken uint32 = 0xFF7FF4FE
- // RPCMaxBufferSize is the default max buffer size the RPC response.
- RPCMaxBufferSize int = 8192
- frameHeadLen uint32 = 12
- maxBufferSize int = 128 * 1024
- defaultMsgSize int = 4096
- dataLen uint32 = 4
- listSizeLen uint32 = 4
- serialNoLen uint32 = 4
- beginTokenLen uint32 = 4
-)
-
-var serialNo uint32
-
-func NewSerialNo() uint32 {
- return atomic.AddUint32(&serialNo, 1)
-}
-
-// TubeMQDecoder is the implementation of the decoder of response from TubeMQ.
-type TubeMQDecoder struct {
- reader io.Reader
- msg []byte
-}
-
-// New will return a default TubeMQDecoder.
-func New(reader io.Reader) *TubeMQDecoder {
- bufferReader := bufio.NewReaderSize(reader, maxBufferSize)
- return &TubeMQDecoder{
- msg: make([]byte, defaultMsgSize),
- reader: bufferReader,
- }
-}
-
-// Decode will decode the response from TubeMQ to Response according to
-// the RPC protocol of TubeMQ.
-func (t *TubeMQDecoder) Decode() (Response, error) {
- var num int
- var err error
- if num, err = io.ReadFull(t.reader, t.msg[:frameHeadLen]); err != nil {
- return nil, err
- }
- if num != int(frameHeadLen) {
- return nil, errors.New("framer: read frame header num invalid")
- }
- if binary.BigEndian.Uint32(t.msg[:beginTokenLen]) != RPCProtocolBeginToken {
- return nil, errors.New("framer: read framer rpc protocol begin token not match")
- }
- serialNo := binary.BigEndian.Uint32(t.msg[beginTokenLen : beginTokenLen+serialNoLen])
- listSize := binary.BigEndian.Uint32(t.msg[beginTokenLen+serialNoLen : beginTokenLen+serialNoLen+listSizeLen])
- totalLen := int(frameHeadLen)
- for i := 0; i < int(listSize); i++ {
- size := make([]byte, 4)
- n, err := io.ReadFull(t.reader, size)
- if err != nil {
- return nil, err
- }
- if n != int(dataLen) {
- return nil, errors.New("framer: read invalid size")
- }
-
- s := int(binary.BigEndian.Uint32(size))
- if totalLen+s > len(t.msg) {
- data := t.msg[:totalLen]
- t.msg = make([]byte, int(math.Max(float64(2*len(t.msg)), float64(totalLen+s))))
- copy(t.msg, data)
- }
-
- if num, err = io.ReadFull(t.reader, t.msg[totalLen:totalLen+s]); err != nil {
- return nil, err
- }
- if num != s {
- return nil, errors.New("framer: read invalid data")
- }
- totalLen += s
- }
-
- data := make([]byte, totalLen-int(frameHeadLen))
- copy(data, t.msg[frameHeadLen:totalLen])
-
- return &TubeMQResponse{
- serialNo: serialNo,
- Buffer: data,
- }, nil
-}
-
-// TubeMQRequest is the implementation of TubeMQ request.
-type TubeMQRequest struct {
- serialNo uint32
- req []byte
-}
-
-// TubeMQResponse is the TubeMQ implementation of Response.
-type TubeMQResponse struct {
- serialNo uint32
- Buffer []byte
-}
-
-// GetSerialNo will return the SerialNo of Response.
-func (t TubeMQResponse) GetSerialNo() uint32 {
- return t.serialNo
-}
-
-// GetBuffer will return the body of Response.
-func (t TubeMQResponse) GetBuffer() []byte {
- return t.Buffer
-}
-
-// TubeMQRPCRequest represents the request protocol of TubeMQ.
-type TubeMQRPCRequest struct {
- serialNo uint32
- RpcHeader *protocol.RpcConnHeader
- RequestHeader *protocol.RequestHeader
- RequestBody *protocol.RequestBody
- Body proto.Message
-}
-
-func NewRPCRequest() *TubeMQRPCRequest {
- return &TubeMQRPCRequest{
- serialNo: NewSerialNo(),
- }
-}
-
-// GetSerialNo returns the serialNo.
-func (t *TubeMQRPCRequest) GetSerialNo() uint32 {
- return t.serialNo
-}
-
-// Marshal marshals the RPCRequest to bytes according to the TubeMQ RPC protocol.
-func (t *TubeMQRPCRequest) Marshal() ([]byte, error) {
- reqBodyBuf, err := proto.Marshal(t.Body)
- if err != nil {
- return nil, err
- }
- t.RequestBody.Request = reqBodyBuf
-
- data, err := encodeRequest(t)
- if err != nil {
- return nil, err
- }
-
- contentLen := len(data)
- listSize := calcBlockCount(contentLen)
-
- buf := bytes.NewBuffer(make([]byte, 0, int(frameHeadLen)+listSize*(RPCMaxBufferSize)))
-
- if err := binary.Write(buf, binary.BigEndian, RPCProtocolBeginToken); err != nil {
- return nil, err
- }
- if err := binary.Write(buf, binary.BigEndian, t.GetSerialNo()); err != nil {
- return nil, err
- }
- if err := binary.Write(buf, binary.BigEndian, uint32(listSize)); err != nil {
- return nil, err
- }
-
- begin := 0
- for i := 0; i < listSize; i++ {
- blockLen := contentLen - i*RPCMaxBufferSize
- if blockLen > RPCMaxBufferSize {
- blockLen = RPCMaxBufferSize
- }
- if err := binary.Write(buf, binary.BigEndian, uint32(blockLen)); err != nil {
- return nil, err
- }
- if err := binary.Write(buf, binary.BigEndian, data[begin:begin+blockLen]); err != nil {
- return nil, err
- }
- begin += blockLen
- }
- return buf.Bytes(), nil
-}
-
-func encodeRequest(req *TubeMQRPCRequest) ([]byte, error) {
- rpcHeader, err := writeDelimitedTo(req.RpcHeader)
- if err != nil {
- return nil, err
- }
- requestHeader, err := writeDelimitedTo(req.RequestHeader)
- if err != nil {
- return nil, err
- }
- requestBody, err := writeDelimitedTo(req.RequestBody)
- if err != nil {
- return nil, err
- }
- return append(append(rpcHeader, requestHeader...), requestBody...), nil
-}
-
-func calcBlockCount(contentSize int) int {
- blockCount := contentSize / RPCMaxBufferSize
- remained := contentSize % RPCMaxBufferSize
- if remained > 0 {
- blockCount++
- }
- return blockCount
-}
-
-func writeDelimitedTo(msg proto.Message) ([]byte, error) {
- dataLen := proto.EncodeVarint(uint64(proto.Size(msg)))
- data, err := proto.Marshal(msg)
- if err != nil {
- return nil, err
- }
- return append(dataLen, data...), nil
-}
-
-// TubeMQRPCResponse represents the response protocol of TubeMQ.
-type TubeMQRPCResponse struct {
- RpcHeader *protocol.RpcConnHeader
- ResponseHeader *protocol.ResponseHeader
- ResponseBody *protocol.RspResponseBody
- ResponseException *protocol.RspExceptionBody
-}
-
-// GetDebugMsg returns the debug msg of TubeMQ RPC protocol.
-func (t *TubeMQRPCResponse) GetDebugMsg() string {
- return t.ResponseException.String()
-}
-
-// Unmarshal unmarshals the Response to RPCResponse according to the TubeMQ RPC protocol.
-func (t *TubeMQRPCResponse) Unmarshal(data []byte) error {
- rpcHeader := &protocol.RpcConnHeader{}
- data, err := readDelimitedFrom(data, rpcHeader)
- if err != nil {
- return err
- }
- rspHeader := &protocol.ResponseHeader{}
- data, err = readDelimitedFrom(data, rspHeader)
- if err != nil {
- return err
- }
-
- t.RpcHeader = rpcHeader
- t.ResponseHeader = rspHeader
-
- if rspHeader.GetStatus() != protocol.ResponseHeader_SUCCESS {
- rspException := &protocol.RspExceptionBody{}
- data, err = readDelimitedFrom(data, rspException)
- if err != nil {
- return err
- }
- t.ResponseException = rspException
- return nil
- }
-
- rspBody := &protocol.RspResponseBody{}
- data, err = readDelimitedFrom(data, rspBody)
- if err != nil {
- return err
- }
- t.ResponseBody = rspBody
- return nil
-}
-
-func readDelimitedFrom(data []byte, msg proto.Message) ([]byte, error) {
- size, n := proto.DecodeVarint(data)
- if size == 0 && n == 0 {
- return nil, errors.New("decode: invalid data len")
- }
-
- if err := proto.Unmarshal(data[n:n+int(size)], msg); err != nil {
- return nil, err
- }
-
- return data[int(size)+n:], nil
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/codec/tubemq_codec_test.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/codec/tubemq_codec_test.go
deleted file mode 100644
index 5072e8c..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/codec/tubemq_codec_test.go
+++ /dev/null
@@ -1,73 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package codec
-
-import (
- "testing"
-
- "github.com/golang/protobuf/proto"
- "github.com/stretchr/testify/assert"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/protocol"
-)
-
-func TestBasicEncodingDecoding(t *testing.T) {
- // Test encode and decode Request
- rpcHeader := &protocol.RpcConnHeader{
- Flag: proto.Int32(1),
- TraceId: proto.Int64(1),
- SpanId: proto.Int64(1),
- ParentId: proto.Int64(1),
- }
- reqHeader := &protocol.RequestHeader{
- ServiceType: proto.Int32(1),
- ProtocolVer: proto.Int32(3),
- }
- reqBody := &protocol.RequestBody{
- Method: proto.Int32(1),
- Timeout: proto.Int64(1000),
- Request: []byte("Hello world!"),
- }
- req := &TubeMQRPCRequest{
- RpcHeader: rpcHeader,
- RequestHeader: reqHeader,
- RequestBody: reqBody,
- }
- b, err := encodeRequest(req)
- assert.Nil(t, err)
-
- decodedRPCHeader := &protocol.RpcConnHeader{}
- b, err = readDelimitedFrom(b, decodedRPCHeader)
- assert.Nil(t, err)
- assert.Equal(t, rpcHeader.Flag, decodedRPCHeader.Flag)
- assert.Equal(t, rpcHeader.TraceId, decodedRPCHeader.TraceId)
- assert.Equal(t, rpcHeader.SpanId, decodedRPCHeader.SpanId)
- assert.Equal(t, rpcHeader.ParentId, decodedRPCHeader.ParentId)
-
- decodedReqHeader := &protocol.RequestHeader{}
- b, err = readDelimitedFrom(b, decodedReqHeader)
- assert.Nil(t, err)
- assert.Equal(t, reqHeader.ServiceType, decodedReqHeader.ServiceType)
- assert.Equal(t, reqHeader.ProtocolVer, decodedReqHeader.ProtocolVer)
-
- decodedReqBody := &protocol.RequestBody{}
- b, err = readDelimitedFrom(b, decodedReqBody)
- assert.Equal(t, reqBody.Method, decodedReqBody.Method)
- assert.Equal(t, reqBody.Timeout, decodedReqBody.Timeout)
- assert.Equal(t, reqBody.Request, decodedReqBody.Request)
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/config/config.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/config/config.go
deleted file mode 100644
index 4d9aec4..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/config/config.go
+++ /dev/null
@@ -1,548 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Package config defines the all the TubeMQ configuration options.
-package config
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "net/url"
- "strconv"
- "strings"
- "time"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/errs"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/util"
-)
-
-const (
- MaxRPCTimeout = 300000 * time.Millisecond
- MinRPCTimeout = 8000 * time.Millisecond
- MaxSessionKeyLen = 1024
- MaxGroupLen = 1024
- MaxTopicLen = 64
- MaxFilterLen = 256
- MaxFilterItemCount = 500
-)
-
-// Config defines multiple configuration options.
-// Refer to: https://github.com/apache/incubator-inlong/blob/3249de37acf054a9c43677131cfbb09fc6d366d1/tubemq-client/src/main/java/org/apache/tubemq/client/config/ConsumerConfig.java
-type Config struct {
- // Net is the namespace for network-level properties used by broker and Master.
- Net struct {
- // ReadTimeout represents how long to wait for a response.
- ReadTimeout time.Duration
- // TLS based authentication with broker and master.
- TLS struct {
- // Enable represents whether or not to use TLS.
- Enable bool
- // CACertFile for TLS.
- CACertFile string
- // TLSCertFile for TLS.
- TLSCertFile string
- // TLSKeyFile for TLS.
- TLSKeyFile string
- // TTSServerName for TLS.
- TLSServerName string
- }
- // Auth represents the account based authentication with broker and master.
- Auth struct {
- // Enable represents whether or not to use authentication.
- Enable bool
- // Username for authentication.
- UserName string
- // Password for authentication.
- Password string
- }
- }
-
- // Consumer is the namespace for configuration related to consume messages,
- // used by the consumer
- Consumer struct {
- // Masters is the addresses of master.
- Masters string
- // Topics of the consumption.
- Topics []string
- // TopicFilters is the map of topic to filters.
- TopicFilters map[string][]string
- // PartitionOffset is the map of partition to its corresponding offset.
- PartitionOffset map[string]int64
- // ConsumerPosition is the initial offset to use if no offset was previously committed.
- ConsumePosition int
- // Group is the consumer group name.
- Group string
- // BoundConsume represents whether or not to specify the offset.
- BoundConsume bool
- // SessionKey is defined by the client.
- // The session key will be the same in a batch.
- SessionKey string
- // SourceCount is the number of consumers in a batch.
- SourceCount int
- // SelectBig specifies if multiple consumers want to reset the offset of the same partition,
- // whether or not to use the biggest offset.
- // The server will use the biggest offset if set, otherwise the server will use the smallest offset.
- SelectBig bool
- // RollbackIfConfirmTimeout represents if the confirm request timeouts,
- // whether or not this batch of data should be considered as successful.
- // This batch of data will not be considered as successful if set.
- RollbackIfConfirmTimeout bool
- // MaxSubInfoReportInterval is maximum interval for the client to report subscription information.
- MaxSubInfoReportInterval int
- // MaxPartCheckPeriod is the maximum interval to check the partition.
- MaxPartCheckPeriod time.Duration
- // PartCheckSlice is the interval to check the partition.
- PartCheckSlice time.Duration
- // MsgNotFoundWait is the maximum wait time the offset of a partition has reached the maximum offset.
- MsgNotFoundWait time.Duration
- // RebConfirmWait represents how long to wait
- // when the server is rebalancing and the partition is being occupied by the client.
- RebConfirmWait time.Duration
- // MaxConfirmWait is the maximum wait time a partition consumption command is released.
- MaxConfirmWait time.Duration
- // ShutdownRebWait represents how long to wait when shutdown is called and the server is rebalancing.
- ShutdownRebWait time.Duration
- }
-
- // Heartbeat is the namespace for configuration related to heartbeat messages,
- // used by the consumer
- Heartbeat struct {
- // Interval represents how frequently to send heartbeat.
- Interval time.Duration
- // MaxRetryTimes is the total number of times to retry sending heartbeat.
- MaxRetryTimes int
- // AfterFail is the heartbeat timeout after a heartbeat failure.
- AfterFail time.Duration
- }
-}
-
-// NewDefaultConfig returns a default config of the client.
-func NewDefaultConfig() *Config {
- c := &Config{}
-
- c.Net.ReadTimeout = 15000 * time.Millisecond
- c.Net.TLS.Enable = false
- c.Net.Auth.Enable = false
- c.Net.Auth.UserName = ""
- c.Net.Auth.Password = ""
-
- c.Consumer.Group = ""
- c.Consumer.BoundConsume = false
- c.Consumer.SessionKey = ""
- c.Consumer.SourceCount = 0
- c.Consumer.SelectBig = true
- c.Consumer.ConsumePosition = 0
- c.Consumer.RollbackIfConfirmTimeout = true
- c.Consumer.MaxSubInfoReportInterval = 6
- c.Consumer.MaxPartCheckPeriod = 60000 * time.Millisecond
- c.Consumer.PartCheckSlice = 300 * time.Millisecond
- c.Consumer.MsgNotFoundWait = 400 * time.Millisecond
- c.Consumer.RebConfirmWait = 3000 * time.Millisecond
- c.Consumer.MaxConfirmWait = 60000 * time.Millisecond
- c.Consumer.ShutdownRebWait = 10000 * time.Millisecond
-
- c.Heartbeat.Interval = 10000 * time.Millisecond
- c.Heartbeat.MaxRetryTimes = 5
- c.Heartbeat.AfterFail = 60000 * time.Millisecond
-
- return c
-}
-
-func New(opts ...Option) *Config {
- c := NewDefaultConfig()
- for _, o := range opts {
- o(c)
- }
- return c
-}
-
-func (c *Config) String() string {
- bytes, err := json.Marshal(c)
- if err != nil {
- return err.Error()
- }
- return string(bytes)
-}
-
-func (c *Config) ValidateConsumer() error {
- if c.Net.Auth.Enable {
- if len(c.Net.Auth.UserName) == 0 {
- return errs.New(errs.RetInvalidConfig, "illegal parameter: usrName is empty")
- }
- if len(c.Net.Auth.Password) == 0 {
- return errs.New(errs.RetInvalidConfig, "illegal password: password is empty")
- }
- }
-
- if c.Net.TLS.Enable {
- if len(c.Net.TLS.CACertFile) == 0 {
- return errs.New(errs.RetInvalidConfig, "illegal tls CACert file: CACert file is empty")
- }
- }
-
- err := c.validateMaster()
- if err != nil {
- return errs.New(errs.RetInvalidConfig, err.Error())
- }
-
- err = c.validateGroup(c.Consumer.Group)
- if err != nil {
- return errs.New(errs.RetInvalidConfig, err.Error())
- }
-
- err = c.validateTopicFilters()
- if err != nil {
- return errs.New(errs.RetInvalidConfig, err.Error())
- }
-
- if c.Consumer.BoundConsume {
- err = c.validateSessionKey()
- if err != nil {
- return err
- }
- err = c.validatePartOffset()
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-func (c *Config) validateMaster() error {
- if len(c.Consumer.Masters) == 0 {
- return errors.New("illegal parameter: len of masters is 0")
- }
- if len(util.SplitToMap(c.Consumer.Masters, ",", ":")) == 0 {
- return errs.New(errs.RetInvalidConfig, "illegal parameter: unrecognized master addresses information")
- }
- return nil
-}
-
-func (c *Config) validateSessionKey() error {
- if len(c.Consumer.SessionKey) == 0 {
- return errs.New(errs.RetInvalidConfig, "illegal parameter: session key is empty")
- }
- if len(c.Consumer.SessionKey) > MaxSessionKeyLen {
- return errs.New(errs.RetInvalidConfig, fmt.Sprintf("illegal parameter: session_key's length over max length %d", MaxSessionKeyLen))
- }
- return nil
-}
-
-func (c *Config) validatePartOffset() error {
- for partition, offset := range c.Consumer.PartitionOffset {
- s := strings.Split(partition, ":")
- if len(s) != 3 {
- return errs.New(errs.RetInvalidConfig, fmt.Sprintf("illegal parameter: partOffset's key %s which should be a:b:c", partition))
- }
- if _, ok := c.Consumer.TopicFilters[s[1]]; !ok {
- return errs.New(errs.RetInvalidConfig, fmt.Sprintf("illegal parameter: %s topic %s not included in topicFilter's topic list", partition, s[1]))
- }
- if strings.Index(partition, ",") != -1 {
- return errs.New(errs.RetInvalidConfig, fmt.Sprintf("illegal parameter: key %s include ,", partition))
- }
- if offset < 0 {
- return errs.New(errs.RetInvalidConfig, fmt.Sprintf("illegal parameter: partition %s's offset must >= 0, value is %d", partition, offset))
- }
- }
- return nil
-}
-
-func (c *Config) validateTopicFilters() error {
- for topic, filters := range c.Consumer.TopicFilters {
- if len(topic) > MaxTopicLen {
- return errs.New(errs.RetInvalidConfig, fmt.Sprintf("Check parameter topicFilters error: topic's length over max length %d", MaxTopicLen))
- }
- if valid, err := util.IsValidString(topic); !valid {
- return errs.New(errs.RetInvalidConfig, err.Error())
- }
- for _, filter := range filters {
- if len(filter) == 0 {
- return errs.New(errs.RetInvalidConfig, fmt.Sprintf("Checassert.Nil(t, c.ValidateConsumer())k parameter topicFilters error: topic %s's filter is empty", topic))
- }
- if len(filter) > MaxFilterLen {
- return errs.New(errs.RetInvalidConfig, fmt.Sprintf("Check parameter topicFilters error: topic %s's filter's length over max length %d", topic, MaxFilterLen))
- }
- if valid, err := util.IsValidFilterItem(filter); !valid {
- return errs.New(errs.RetInvalidConfig, err.Error())
- }
- }
- if len(filters) > MaxFilterLen {
- return errs.New(errs.RetInvalidConfig, fmt.Sprintf("Check parameter topicFilters error: topic %s's filter item over max item count %d", topic, MaxFilterLen))
- }
- }
- return nil
-}
-
-func (c *Config) validateGroup(group string) error {
- if len(group) == 0 {
- return errs.New(errs.RetInvalidConfig, "group name is empty")
- }
- if len(group) > MaxGroupLen {
- return errs.New(errs.RetInvalidConfig, fmt.Sprintf("illegal parameter: %s over max length, the max allowed length is %d", group, MaxGroupLen))
- }
- if valid, err := util.IsValidString(group); !valid {
- return errs.New(errs.RetInvalidConfig, err.Error())
- }
- return nil
-}
-
-// ParseAddress parses the address to user-defined config.
-func ParseAddress(address string) (config *Config, err error) {
- c := NewDefaultConfig()
-
- tokens := strings.SplitN(address, "?", 2)
- if len(tokens) != 2 {
- return nil, fmt.Errorf("address format invalid: address: %v, token: %v", address, tokens)
- }
-
- c.Consumer.Masters = tokens[0]
-
- tokens = strings.Split(tokens[1], "&")
- if len(tokens) == 0 {
- return nil, fmt.Errorf("address formata invalid: Masters: %v with empty params", config.Consumer.Masters)
- }
-
- for _, token := range tokens {
- values := strings.SplitN(token, "=", 2)
- if len(values) != 2 {
- return nil, fmt.Errorf("address format invalid, key=value missing: %v", values)
- }
-
- values[1], _ = url.QueryUnescape(values[1])
- if err := getConfigFromToken(c, values); err != nil {
- return nil, err
- }
- }
- return c, nil
-}
-
-func getConfigFromToken(config *Config, values []string) error {
- var err error
- switch values[0] {
- case "readTimeout":
- config.Net.ReadTimeout, err = parseDuration(values[1])
- case "tlsEnable":
- config.Net.TLS.Enable, err = strconv.ParseBool(values[1])
- case "CACertFile":
- config.Net.TLS.CACertFile = values[1]
- case "tlsCertFile":
- config.Net.TLS.TLSCertFile = values[1]
- case "tlsKeyFile":
- config.Net.TLS.TLSKeyFile = values[1]
- case "tlsServerName":
- config.Net.TLS.TLSServerName = values[1]
- case "group":
- config.Consumer.Group = values[1]
- case "topics":
- topicFilters := strings.Split(values[1], ";")
- config.Consumer.TopicFilters = make(map[string][]string)
- for _, topicFilter := range topicFilters {
- tf := strings.Split(topicFilter, "@")
- config.Consumer.Topics = append(config.Consumer.Topics, tf[0])
- if len(tf) > 1 {
- filters := strings.Split(tf[1], ",")
- config.Consumer.TopicFilters[tf[0]] = filters
- }
- }
- case "consumePosition":
- config.Consumer.ConsumePosition, err = strconv.Atoi(values[1])
- case "boundConsume":
- config.Consumer.BoundConsume, err = strconv.ParseBool(values[1])
- case "sessionKey":
- config.Consumer.SessionKey = values[1]
- case "sourceCount":
- config.Consumer.SourceCount, err = strconv.Atoi(values[1])
- case "selectBig":
- config.Consumer.SelectBig, err = strconv.ParseBool(values[1])
- case "rollbackIfConfirmTimeout":
- config.Consumer.RollbackIfConfirmTimeout, err = strconv.ParseBool(values[1])
- case "maxSubInfoReportInterval":
- config.Consumer.MaxSubInfoReportInterval, err = strconv.Atoi(values[1])
- case "maxPartCheckPeriod":
- config.Consumer.MaxPartCheckPeriod, err = parseDuration(values[1])
- case "partCheckSlice":
- config.Consumer.PartCheckSlice, err = parseDuration(values[1])
- case "msgNotFoundWait":
- config.Consumer.MsgNotFoundWait, err = parseDuration(values[1])
- case "rebConfirmWait":
- config.Consumer.RebConfirmWait, err = parseDuration(values[1])
- case "maxConfirmWait":
- config.Consumer.MaxConfirmWait, err = parseDuration(values[1])
- case "shutdownRebWait":
- config.Consumer.ShutdownRebWait, err = parseDuration(values[1])
- case "heartbeatInterval":
- config.Heartbeat.Interval, err = parseDuration(values[1])
- case "heartbeatMaxRetryTimes":
- config.Heartbeat.MaxRetryTimes, err = strconv.Atoi(values[1])
- case "heartbeatAfterFail":
- config.Heartbeat.AfterFail, err = parseDuration(values[1])
- case "authEnable":
- config.Net.Auth.Enable, err = strconv.ParseBool(values[1])
- case "authUserName":
- config.Net.Auth.UserName = values[1]
- case "authPassword":
- config.Net.Auth.Password = values[1]
- default:
- return fmt.Errorf("address format invalid, unknown keys: %v", values[0])
- }
- if err != nil {
- return fmt.Errorf("address format invalid(%v) err:%s", values[0], err.Error())
- }
- return err
-}
-
-func parseDuration(val string) (time.Duration, error) {
- maxWait, err := strconv.Atoi(val)
- if err != nil {
- return 0, err
- }
- return time.Duration(maxWait) * time.Millisecond, err
-}
-
-type Option func(*Config)
-
-func WithMaxPartCheckPeriod(d time.Duration) Option {
- return func(c *Config) {
- c.Consumer.MaxPartCheckPeriod = d
- }
-}
-
-func WithPartCheckSlice(d time.Duration) Option {
- return func(c *Config) {
- c.Consumer.PartCheckSlice = d
- }
-}
-
-func WithMsgNotFoundWait(d time.Duration) Option {
- return func(c *Config) {
- c.Consumer.MsgNotFoundWait = d
- }
-}
-
-func WithMaxSubInfoReportInterval(i int) Option {
- return func(c *Config) {
- c.Consumer.MaxSubInfoReportInterval = i
- }
-}
-
-func WithRebConfirmWait(d time.Duration) Option {
- return func(c *Config) {
- c.Consumer.RebConfirmWait = d
- }
-}
-
-func WithMaxConfirmWait(d time.Duration) Option {
- return func(c *Config) {
- c.Consumer.MaxConfirmWait = d
- }
-}
-
-func WithShutdownRebWait(d time.Duration) Option {
- return func(c *Config) {
- c.Consumer.ShutdownRebWait = d
- }
-}
-
-func WithTopicFilters(topicFilters map[string][]string) Option {
- return func(c *Config) {
- c.Consumer.TopicFilters = topicFilters
- for topic := range c.Consumer.TopicFilters {
- topic = strings.TrimSpace(topic)
- }
- }
-}
-
-func WithSourceCount(count int) Option {
- return func(c *Config) {
- c.Consumer.SourceCount = count
- }
-}
-
-func WithSelectBig(selectBig bool) Option {
- return func(c *Config) {
- c.Consumer.SelectBig = selectBig
- }
-}
-
-func WithPartOffsets(partOffsets map[string]int64) Option {
- return func(c *Config) {
- c.Consumer.PartitionOffset = partOffsets
- }
-}
-
-func WithAuth(enable bool, userName string, password string) Option {
- return func(c *Config) {
- c.Net.Auth.Enable = enable
- c.Net.Auth.UserName = strings.TrimSpace(userName)
- c.Net.Auth.Password = strings.TrimSpace(password)
- }
-}
-
-func WithTLS(enable bool, certFile, keyFile, caFile, serverName string) Option {
- return func(c *Config) {
- c.Net.TLS.Enable = enable
- c.Net.TLS.TLSCertFile = strings.TrimSpace(certFile)
- c.Net.TLS.TLSKeyFile = strings.TrimSpace(keyFile)
- c.Net.TLS.CACertFile = strings.TrimSpace(caFile)
- c.Net.TLS.TLSServerName = strings.TrimSpace(serverName)
- }
-}
-
-func WithGroup(group string) Option {
- return func(c *Config) {
- c.Consumer.Group = strings.TrimSpace(group)
- }
-}
-
-func WithTopics(topics []string) Option {
- return func(c *Config) {
- c.Consumer.Topics = topics
- c.Consumer.TopicFilters = make(map[string][]string)
- for _, topic := range c.Consumer.Topics {
- c.Consumer.TopicFilters[topic] = nil
- }
- }
-}
-
-func WithConsumerMasters(masters string) Option {
- return func(c *Config) {
- c.Consumer.Masters = strings.TrimSpace(masters)
- }
-}
-
-func WithRPCReadTimeout(d time.Duration) Option {
- return func(c *Config) {
- if d >= MaxRPCTimeout {
- c.Net.ReadTimeout = MaxRPCTimeout
- } else if d <= MinRPCTimeout {
- c.Net.ReadTimeout = MinRPCTimeout
- } else {
- c.Net.ReadTimeout = d
- }
- }
-}
-
-func WithBoundConsume(sessionKey string, sourceCount int, selectBig bool, partOffset map[string]int64) Option {
- return func(c *Config) {
- c.Consumer.BoundConsume = true
- c.Consumer.SessionKey = strings.TrimSpace(sessionKey)
- c.Consumer.SourceCount = sourceCount
- c.Consumer.SelectBig = selectBig
- c.Consumer.PartitionOffset = partOffset
- }
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/config/config_test.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/config/config_test.go
deleted file mode 100644
index 4ea819c..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/config/config_test.go
+++ /dev/null
@@ -1,119 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package config
-
-import (
- "testing"
- "time"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestParseAddress(t *testing.T) {
- address := "127.0.0.1:9092,127.0.0.1:9093?topics=Topic1@12312323,1212;Topic2@121212,2321323&group=Group&tlsEnable=false&msgNotFoundWait=10000&heartbeatMaxRetryTimes=6"
- topicFilters := make(map[string][]string)
- topicFilters["Topic1"] = []string{"12312323", "1212"}
- topicFilters["Topic2"] = []string{"121212", "2321323"}
- c, err := ParseAddress(address)
- assert.Nil(t, err)
- assert.Equal(t, c.Consumer.Masters, "127.0.0.1:9092,127.0.0.1:9093")
- assert.Equal(t, c.Consumer.Topics, []string{"Topic1", "Topic2"})
- assert.Equal(t, c.Consumer.TopicFilters, topicFilters)
- assert.Equal(t, c.Consumer.Group, "Group")
- assert.Equal(t, c.Consumer.MsgNotFoundWait, 10000*time.Millisecond)
-
- assert.Equal(t, c.Net.TLS.Enable, false)
-
- assert.Equal(t, c.Heartbeat.MaxRetryTimes, 6)
-
- address = ""
- _, err = ParseAddress(address)
- assert.NotNil(t, err)
-
- address = "127.0.0.1:9092,127.0.0.1:9093?topics=Topic&ttt"
- _, err = ParseAddress(address)
- assert.NotNil(t, err)
-
- address = "127.0.0.1:9092,127.0.0.1:9093?topics=Topic&ttt=ttt"
- _, err = ParseAddress(address)
- assert.NotNil(t, err)
-}
-
-func TestValidateGroup(t *testing.T) {
- config := NewDefaultConfig()
- err := config.validateGroup("")
- assert.NotNil(t, err)
- err = config.validateGroup("123-456[]")
- assert.NotNil(t, err)
- err = config.validateGroup("test123_456")
- assert.Nil(t, err)
- group := ""
- for i := 0; i < 1025; i++ {
- group += "t"
- }
- err = config.validateGroup(group)
- assert.NotNil(t, group)
-}
-
-func TestValidateConsumer(t *testing.T) {
- c := NewDefaultConfig()
-
- assert.NotNil(t, c.ValidateConsumer())
- WithConsumerMasters("masters")(c)
- assert.NotNil(t, c.ValidateConsumer())
-
- WithConsumerMasters("127.0.0.1:8000")(c)
- WithGroup("test-group")(c)
- assert.NotNil(t, c.ValidateConsumer())
-
- WithGroup("test_group")(c)
- assert.Nil(t, c.ValidateConsumer())
-
- WithTopics([]string{"topic1", "topic2"})(c)
- assert.Nil(t, c.ValidateConsumer())
-
- WithTopics([]string{"1topic, topic2"})(c)
- assert.NotNil(t, c.ValidateConsumer())
-
- topicFilters := map[string][]string{"1topic": {"filter1", "filter2"}, "topic2": {"filter3", "filter4"}}
- WithTopicFilters(topicFilters)(c)
- assert.NotNil(t, c.ValidateConsumer())
-
- topicFilters = map[string][]string{"topic1": {"-=-", "filter2"}, "topic2": {"filter3", "filter4"}}
- WithTopicFilters(topicFilters)(c)
- assert.NotNil(t, c.ValidateConsumer())
-
- topicFilters = map[string][]string{"topic1": {"filter1", "filter2"}, "topic2": {"filter3", "filter4"}}
- WithTopicFilters(topicFilters)(c)
- assert.Nil(t, c.ValidateConsumer())
-
- partitionOffset := map[string]int64{"181895251:test_1": 0, "181895251:test_2": 10}
- WithBoundConsume("", 0, true, partitionOffset)(c)
- assert.NotNil(t, c.ValidateConsumer())
-
- WithBoundConsume("11", 0, true, partitionOffset)(c)
- assert.NotNil(t, c.ValidateConsumer())
-
- partitionOffset = map[string]int64{"181895251:test_1:1": 0, "181895251:test_2:2": 10}
- WithBoundConsume("11", 0, true, partitionOffset)(c)
- assert.NotNil(t, c.ValidateConsumer())
-
- partitionOffset = map[string]int64{"181895251:topic1:1": 0, "181895251:topic2:2": 10}
- WithBoundConsume("11", 0, true, partitionOffset)(c)
- assert.Nil(t, c.ValidateConsumer())
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/errs/errs.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/errs/errs.go
deleted file mode 100644
index ac8167e..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/errs/errs.go
+++ /dev/null
@@ -1,95 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Package errs defines the TubeMQ error codes and TubeMQ error msg.
-package errs
-
-import (
- "fmt"
-)
-
-const (
- // RetMarshalFailure represents the error code of marshal error.
- RetMarshalFailure = 1
- // RetResponseException represents the error code of response exception.
- RetResponseException = 2
- // RetUnMarshalFailure represents the error code of unmarshal error.
- RetUnMarshalFailure = 3
- // RetAssertionFailure represents the error code of assertion error.
- RetAssertionFailure = 4
- // RetRequestFailure represents the error code of request error.
- RetRequestFailure = 5
- // RetSelectorNotExist represents the selector not exists.
- RetSelectorNotExist = 6
- // RetInvalidNodeString represents the node string is invalid.
- RetInvalidNodeString = 7
- // RetInvalidPartitionString represents the partition string is invalid.
- RetInvalidPartitionString = 8
- // RetInvalidSubscribeInfoString represents the subscribeInfo string is invalid.
- RetInvalidSubscribeInfoString = 9
- // RetInvalidConfig represents the config setting is invalid.
- RetInvalidConfig = 10
- // RetTDMsgParseFailure represents the error code of td msg parse error.
- RetTDMsgParseFailure = 11
- RetSuccess = 200
- RetErrMoved = 301
- RetBadRequest = 400
- RetErrForbidden = 403
- RetErrNotFound = 404
- RetErrNoPartAssigned = 406
- RetErrAllPartWaiting = 407
- RetErrAllPartInUse = 408
- RetErrHBNoNode = 411
- RetErrDuplicatePartition = 412
- RetCertificateFailure = 415
- RetConsumeGroupForbidden = 450
- RetConsumeContentForbidden = 455
- RetErrServiceUnavailable = 503
- RetErrConsumeSpeedLimit = 550
- RetErrConfirmTimeout = 2004
-)
-
-// ErrAssertionFailure represents RetAssertionFailure error.
-var (
- ErrAssertionFailure = New(RetAssertionFailure, "AssertionFailure")
- ErrNoPartAssigned = New(RetErrNoPartAssigned, "No partition info in local cache, please retry later!")
- ErrAllPartWaiting = New(RetErrAllPartWaiting, "All partitions reach max position, please retry later!")
- ErrAllPartInUse = New(RetErrAllPartInUse, "No idle partition to consume, please retry later!")
- ErrInvalidNodeString = New(RetInvalidNodeString, "Node string should have format: node_id:host:port")
- ErrInvalidPartitionString = New(RetInvalidPartitionString, "Partition string should have format: broker_info#topic:partitionId")
- ErrInvalidSubscribeInfoString = New(RetInvalidSubscribeInfoString, "SubscribeInfo string should have format: consumerId@group#broker_info#topic:partitionId")
-)
-
-// Error provides a TubeMQ-specific error container
-type Error struct {
- Code int32
- Msg string
-}
-
-// Error() implements the Error interface.
-func (e *Error) Error() string {
- return fmt.Sprintf("code: %d, msg:%s", e.Code, e.Msg)
-}
-
-// New returns a self-defined error.
-func New(code int32, msg string) error {
- err := &Error{
- Code: code,
- Msg: msg,
- }
- return err
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/example/consumer.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/example/consumer.go
deleted file mode 100644
index 55512b2..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/example/consumer.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package main
-
-import (
- "time"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/client"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/config"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/log"
-)
-
-func main() {
- // Example for using config directly
- // topicFilters := map[string][]string{"topic1": {"filter1", "filter2"}, "topic2": {"filter3", "filter4"}}
- // partitionOffset := map[string]int64{"181895251:topic1:1": 0, "181895251:topic2:2": 10}
- // cfg := config.New(config.WithMasters("127.0.0.1:8099"),
- // config.WithGroup("group"),
- // For topic filters
- // config.WithTopicFilters(topicFilters),
- // For bound consume
- // config.WithBoundConsume("ss", 1, true, partitionOffset))
-
- // Example for parseAddress
- cfg, err := config.ParseAddress("9.23.27.160:8099?topics=test_1&group=test_group")
- // For topic filter
- // cfg, err := config.ParseAddress("9.23.27.160:8099?topics=Topic1@12312323,1212;Topic2@121212,2321323&group=test_group")
- if err != nil {
- log.Errorf("Failed to parse address", err.Error())
- panic(err)
- }
- c, err := client.NewConsumer(cfg)
- if err != nil {
- log.Errorf("new consumer error %s", err.Error())
- panic(err)
- }
- start := time.Now()
- for {
- elapsed := time.Since(start)
- if elapsed >= 10*time.Minute {
- break
- }
- cr, err := c.GetMessage()
- if err != nil {
- log.Errorf("Get message error %s", err.Error())
- continue
- }
- cr, err = c.Confirm(cr.ConfirmContext, true)
- if err != nil {
- log.Errorf("Confirm error %s", err.Error())
- continue
- }
- }
- c.Close()
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/example/multi_routine_consumer.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/example/multi_routine_consumer.go
deleted file mode 100644
index 6ae2e32..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/example/multi_routine_consumer.go
+++ /dev/null
@@ -1,122 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package main
-
-import (
- "sync"
- "sync/atomic"
- "time"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/client"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/config"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/log"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/tdmsg"
-)
-
-var lastPrintTime int64
-var lastMsgCount int64
-var lastPrintCount int64
-
-func main() {
- // Example for using config directly
- // cfg := config.NewDefaultConfig()
- // For topic filter
- // cfg.Consumer.TopicFilters = map[string][]string{"topic1": {"filter1", "filter2"}, "topic2": {"filter3", "filter4"}}
- // For part offset
- // cfg.Consumer.PartitionOffset = map[string]int64{"181895251:test_1": 0, "181895251:test_2": 10}
-
- // Example for parseAddress
- cfg, err := config.ParseAddress("9.23.27.160:8099?topics=test_1&group=test_group")
- // For topic filter
- // cfg, err := config.ParseAddress("9.23.27.160:8099?topics=Topic1@12312323,1212;Topic2@121212,2321323&group=test_group")
- if err != nil {
- log.Errorf("Failed to parse address", err.Error())
- panic(err)
- }
- c, err := client.NewConsumer(cfg)
- if err != nil {
- log.Errorf("new consumer error %s", err.Error())
- panic(err)
- }
- numGoRoutine := 15
- var wg sync.WaitGroup
- for i := 0; i < numGoRoutine; i++ {
- wg.Add(1)
- go func(i int) {
- defer wg.Done()
- start := time.Now()
- for {
- elapsed := time.Since(start)
- if elapsed >= 10*time.Minute {
- break
- }
- cr, err := c.GetMessage()
- if err != nil {
- log.Errorf("Go routine %d, Get message error %s", i, err.Error())
- continue
- }
- cr, err = c.Confirm(cr.ConfirmContext, true)
- if err != nil {
- log.Errorf("Go routine %d, Confirm error %s", i, err.Error())
- continue
- }
- //parseRawTypeMsg(int64(len(cr.Messages)))
- parseTDMsgTypeMsg(cr.Messages)
- }
- log.Infof("Go routine %d finished", i)
- }(i)
- }
- wg.Wait()
- c.Close()
-}
-
-func parseRawTypeMsg(cnt int64) {
- lastTime := atomic.LoadInt64(&lastPrintTime)
- atomic.AddInt64(&lastMsgCount, cnt)
- curCount := atomic.LoadInt64(&lastMsgCount)
- curTime := time.Now().UnixNano() / int64(time.Second)
- if curCount-atomic.LoadInt64(&lastPrintCount) >= 50000 || curTime-lastTime > 90 {
- atomic.StoreInt64(&lastPrintTime, curTime)
- log.Infof("Current time %d Current message count=%d", curTime, atomic.LoadInt64(&lastMsgCount))
- atomic.StoreInt64(&lastPrintCount, curCount)
- }
-}
-
-func parseTDMsgTypeMsg(messages []*client.Message) {
- for _, message := range messages {
- log.Infof("Message id is %d, topic is %s", message.ID, message.Topic)
- msg, err := tdmsg.New(message.Data)
- if err != nil {
- log.Errorf("fail to parse td msg")
- break
- }
- for attr, items := range msg.Attr2Data {
- if attrs, err := msg.ParseAttrValue(attr); err != nil {
- log.Errorf("parse attribute error, attr is %s, reason is %s", attr, err.Error())
- } else {
- log.Infof("parsed attrs %v", attrs)
- for k, v := range attrs {
- log.Infof("key is %s, value is %s", k, v)
- }
- }
- for _, item := range items {
- log.Infof("parsed msg data %v", item)
- }
- }
- }
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/flowctrl/handler.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/flowctrl/handler.go
deleted file mode 100644
index 88e1c83..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/flowctrl/handler.go
+++ /dev/null
@@ -1,465 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Package flowctrl defines the rule and handle logic of flow control.
-package flowctrl
-
-import (
- "encoding/json"
- "fmt"
- "math"
- "sort"
- "strconv"
- "strings"
- "sync"
- "sync/atomic"
- "time"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/log"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/util"
-)
-
-type RuleHandler struct {
- lastUpdate int64
- flowCtrlInfo string
- qrypriorityID int64
- dataSizeLimit int64
- flowCtrlID int64
- minZeroCount int64
- minDataDltLimit int64
- dataLimitStartTime int64
- dataLimitEndTime int64
- configMu sync.Mutex
- flowCtrlRules map[int32][]*Item
- flowCtrlItem *Item
-}
-
-// NewRuleHandler returns the a default RuleHandler.
-func NewRuleHandler() *RuleHandler {
- return &RuleHandler{
- flowCtrlID: util.InvalidValue,
- minZeroCount: math.MaxInt64,
- qrypriorityID: util.InvalidValue,
- minDataDltLimit: math.MaxInt64,
- dataLimitStartTime: 2500,
- dataLimitEndTime: util.InvalidValue,
- lastUpdate: time.Now().UnixNano() / int64(time.Millisecond),
- flowCtrlItem: NewItem(),
- }
-}
-
-// GetQryPriorityID returns the qrypriorityID.
-func (h *RuleHandler) GetQryPriorityID() int64 {
- return atomic.LoadInt64(&h.qrypriorityID)
-}
-
-// GetFlowCtrID returns the flowCtrlID.
-func (h *RuleHandler) GetFlowCtrID() int64 {
- return atomic.LoadInt64(&h.flowCtrlID)
-}
-
-// SetQryPriorityID sets the qrypriorityID
-func (h *RuleHandler) SetQryPriorityID(qryPriorityID int64) {
- atomic.StoreInt64(&h.qrypriorityID, qryPriorityID)
-}
-
-// UpdateDefFlowCtrlInfo updates the flow control information.
-func (h *RuleHandler) UpdateDefFlowCtrlInfo(isDefault bool, qrypriorityID int64, flowCtrlID int64, info string) error {
- curFlowCtrlID := atomic.LoadInt64(&h.flowCtrlID)
- if curFlowCtrlID == flowCtrlID {
- return nil
- }
- var flowCtrlItems map[int32][]*Item
- var err error
- if len(info) > 0 {
- flowCtrlItems, err = parseFlowCtrlInfo(info)
- if err != nil {
- return err
- }
- }
- h.configMu.Lock()
- defer h.configMu.Unlock()
- h.clearStatisticData()
- atomic.StoreInt64(&h.flowCtrlID, flowCtrlID)
- atomic.StoreInt64(&h.qrypriorityID, qrypriorityID)
- if len(flowCtrlItems) == 0 {
- h.flowCtrlRules = make(map[int32][]*Item)
- info = ""
- } else {
- h.flowCtrlRules = flowCtrlItems
- h.flowCtrlInfo = info
- h.initStatisticData()
- }
- h.lastUpdate = time.Now().UnixNano() / int64(time.Millisecond)
- if isDefault {
- log.Infof("[Flow Ctrl] Default FlowCtrl's flow ctrl id from %d to %d", curFlowCtrlID, flowCtrlID)
- } else {
- log.Infof("[Flow Ctrl] Group FlowCtrl's flow ctrl id from %d to %d", curFlowCtrlID, flowCtrlID)
- }
- return nil
-}
-
-func (h *RuleHandler) initStatisticData() {
- for id, rules := range h.flowCtrlRules {
- if id == 0 {
- for _, rule := range rules {
- if rule.tp != 0 {
- continue
- }
-
- if rule.datadlt < atomic.LoadInt64(&h.minDataDltLimit) {
- atomic.StoreInt64(&h.minDataDltLimit, rule.datadlt)
- }
- if rule.startTime < atomic.LoadInt64(&h.dataLimitStartTime) {
- atomic.StoreInt64(&h.dataLimitStartTime, rule.startTime)
- }
- if rule.endTime > atomic.LoadInt64(&h.dataLimitEndTime) {
- atomic.StoreInt64(&h.dataLimitEndTime, rule.endTime)
- }
- }
- }
- if id == 1 {
- for _, rule := range rules {
- if rule.tp != 1 {
- continue
- }
- if rule.zeroCnt < atomic.LoadInt64(&h.minZeroCount) {
- atomic.StoreInt64(&h.minZeroCount, rule.zeroCnt)
- }
- }
- }
- if id == 3 {
- for _, rule := range rules {
- if rule.tp != 3 {
- continue
- }
- h.flowCtrlItem.SetTp(RequestFrequencyControl)
- h.flowCtrlItem.SetDataSizeLimit(rule.dataSizeLimit)
- h.flowCtrlItem.SetFreqLimit(rule.freqMsLimit)
- h.flowCtrlItem.SetZeroCnt(rule.zeroCnt)
- }
- }
- }
-}
-
-func (h *RuleHandler) clearStatisticData() {
- atomic.StoreInt64(&h.minZeroCount, util.InvalidValue)
- atomic.StoreInt64(&h.minDataDltLimit, math.MaxInt64)
- atomic.StoreInt64(&h.qrypriorityID, util.InvalidValue)
- atomic.StoreInt64(&h.dataSizeLimit, 2500)
- atomic.StoreInt64(&h.dataLimitEndTime, util.InvalidValue)
- h.flowCtrlItem.clear()
-}
-
-// GetCurDataLimit returns the flow control result based on lastDataDlt.
-func (h *RuleHandler) GetCurDataLimit(lastDataDlt int64) *Result {
- l := time.FixedZone("GMT", 3600*8)
- now := time.Now()
- hour := now.In(l).Hour()
- min := now.In(l).Minute()
- curTime := int64(hour*100 + min)
- if lastDataDlt < atomic.LoadInt64(&h.minDataDltLimit) ||
- curTime < atomic.LoadInt64(&h.dataLimitStartTime) ||
- curTime > atomic.LoadInt64(&h.dataLimitEndTime) {
- return nil
- }
- h.configMu.Lock()
- defer h.configMu.Unlock()
- if _, ok := h.flowCtrlRules[0]; !ok {
- return nil
- }
- for _, rule := range h.flowCtrlRules[0] {
- result := rule.GetDataLimit(lastDataDlt, curTime)
- if result != nil {
- return result
- }
- }
- return nil
-}
-
-// GetFilterCtrlItem returns the flow control item.
-func (h *RuleHandler) GetFilterCtrlItem() *Item {
- h.configMu.Lock()
- defer h.configMu.Unlock()
- return h.flowCtrlItem
-}
-
-// GetCurFreqLimitTime returns curFreqLimitTime.
-func (h *RuleHandler) GetCurFreqLimitTime(msgZeroCnt int32, receivedLimit int64) int64 {
- limitData := receivedLimit
- if int64(msgZeroCnt) < atomic.LoadInt64(&h.minZeroCount) {
- return limitData
- }
- h.configMu.Lock()
- defer h.configMu.Unlock()
- if _, ok := h.flowCtrlRules[1]; !ok {
- return limitData
- }
- for _, rule := range h.flowCtrlRules[1] {
- limit := rule.getFreLimit(msgZeroCnt)
- if limit >= 0 {
- limitData = limit
- break
- }
- }
- return limitData
-}
-
-// GetMinZeroCnt returns the minZeroCount.
-func (h *RuleHandler) GetMinZeroCnt() int64 {
- return atomic.LoadInt64(&h.minZeroCount)
-}
-
-func parseFlowCtrlInfo(info string) (map[int32][]*Item, error) {
- if len(info) == 0 {
- return nil, nil
- }
- var docs []map[string]interface{}
- if err := json.Unmarshal([]byte(info), &docs); err != nil {
- return nil, err
- }
- flowCtrlMap := make(map[int32][]*Item)
- for _, doc := range docs {
- if _, ok := doc["type"]; !ok {
- return nil, fmt.Errorf("field not existed")
- }
- tp, err := parseInt(doc, "type", false, util.InvalidValue)
- if err != nil {
- return nil, err
- }
-
- if tp < 0 || tp > 3 {
- return nil, fmt.Errorf("illegal value, not required value content")
- }
-
- rule, err := parseRule(doc)
- if err != nil {
- return nil, err
- }
- switch tp {
- case 1:
- flowCtrlItems, err := parseFreqLimit(rule)
- if err != nil {
- return nil, err
- }
- flowCtrlMap[1] = flowCtrlItems
- case 3:
- flowCtrlItems, err := parseLowFetchLimit(rule)
- if err != nil {
- return nil, err
- }
- flowCtrlMap[3] = flowCtrlItems
- case 0:
- flowCtrlItems, err := parseDataLimit(rule)
- if err != nil {
- return nil, err
- }
- flowCtrlMap[0] = flowCtrlItems
- }
- }
- return flowCtrlMap, nil
-}
-
-func parseRule(doc map[string]interface{}) ([]interface{}, error) {
- if _, ok := doc["rule"]; !ok {
- return nil, fmt.Errorf("rule field not existed")
- }
- if _, ok := doc["rule"].([]interface{}); !ok {
- return nil, fmt.Errorf("rule should be interface")
- }
- v := doc["rule"].([]interface{})
- return v, nil
-}
-
-func parseDataLimit(rules []interface{}) ([]*Item, error) {
- items := make([]*Item, 0, len(rules))
- for i, rule := range rules {
- if _, ok := rule.(map[string]interface{}); !ok {
- return nil, fmt.Errorf("rule should be a map")
- }
- v := rule.(map[string]interface{})
- start, err := parseTime(v, "start")
- if err != nil {
- return nil, err
- }
- end, err := parseTime(v, "end")
- if err != nil {
- return nil, err
- }
- if start > end {
- return nil, fmt.Errorf("start value must lower than the End value in index(%d) of data limit rule", i)
- }
- datadlt, err := parseInt(v, "dltInM", false, -1)
- if err != nil {
- return nil, fmt.Errorf("dltInM key is required in index(%d) of data limit rule", i)
- }
- datadlt = datadlt * 1024 * 204
- dataSizeLimit, err := parseInt(v, "limitInM", false, -1)
- if err != nil {
- return nil, fmt.Errorf("limitInM key is required in index(%d) of data limit rule", i)
- }
- if dataSizeLimit < 0 {
- return nil, fmt.Errorf("limitInM value must over than equal or bigger than zero in index(%d) of data limit rule", i)
- }
- dataSizeLimit = dataSizeLimit * 1024 * 1024
- freqMsLimit, err := parseInt(v, "freqInMs", false, -1)
- if err != nil {
- return nil, fmt.Errorf("freqInMs key is required in index((%d) of data limit rule", i)
- }
- if freqMsLimit < 200 {
- return nil, fmt.Errorf("freqInMs value must over than equal or bigger than 200 in index(%d) of data limit rule", i)
- }
- item := NewItem()
- item.SetTp(CurrentLimit)
- item.SetStartTime(start)
- item.SetEndTime(end)
- item.SetDatadlt(datadlt)
- item.SetDataSizeLimit(dataSizeLimit)
- item.SetFreqLimit(freqMsLimit)
- items = append(items, item)
- }
- if len(items) > 0 {
- sort.Slice(items, func(i, j int) bool {
- return items[i].startTime <= items[j].startTime
- })
- }
- return items, nil
-}
-
-func parseLowFetchLimit(rules []interface{}) ([]*Item, error) {
- items := make([]*Item, 0, len(rules))
- for _, rule := range rules {
- var filterFreqMs int64
- var err error
- if _, ok := rule.(map[string]interface{}); !ok {
- return nil, fmt.Errorf("rule should be a map")
- }
- v := rule.(map[string]interface{})
- if _, ok := v["filterFreqInMs"]; ok {
- filterFreqMs, err = parseInt(v, "filterFreqInMs", false, -1)
- if err != nil {
- return nil, fmt.Errorf("decode failure: %s of filterFreqInMs field in parse low fetch limit", err.Error())
- }
- }
- if filterFreqMs < 0 || filterFreqMs > 300000 {
- return nil, fmt.Errorf("decode failure: filterFreqInMs value must in [0, 300000] in index(%d) of low fetch limit rule", filterFreqMs)
- }
-
- var minFilteFreqMs int64
- if _, ok := v["minDataFilterFreqInMs"]; ok {
- minFilteFreqMs, err = parseInt(v, "minDataFilterFreqInMs", false, -1)
- if err != nil {
- return nil, fmt.Errorf("decode failure: %s of minDataFilterFreqInMs field in parse low fetch limit", err.Error())
- }
- }
- if minFilteFreqMs < 0 || minFilteFreqMs > 300000 {
- return nil, fmt.Errorf("decode failure: minDataFilterFreqInMs value must in [0, 300000] in index(%d) of low fetch limit rule", filterFreqMs)
- }
- if minFilteFreqMs < filterFreqMs {
- return nil, fmt.Errorf("decode failure: minDataFilterFreqInMs must lower than filterFreqInMs in index(%d) of low fetch limit rule", filterFreqMs)
- }
- var normFreqMs int64
- if _, ok := v["normFreqInMs"]; ok {
- normFreqMs, err = parseInt(v, "normFreqInMs", false, -1)
- if err != nil {
- return nil, fmt.Errorf("decode failure: %s of normFreqInMs field in parse low fetch limit", err.Error())
- }
- if normFreqMs < 0 || normFreqMs > 30000 {
- return nil, fmt.Errorf("decode failure: normFreqInMs value must in [0, 300000] in index(%d) of low fetch limit rule", filterFreqMs)
- }
- }
- item := NewItem()
- item.SetTp(RequestFrequencyControl)
- item.SetDataSizeLimit(normFreqMs)
- item.SetFreqLimit(filterFreqMs)
- item.SetZeroCnt(minFilteFreqMs)
- items = append(items, item)
- }
- return items, nil
-}
-
-func parseFreqLimit(rules []interface{}) ([]*Item, error) {
- items := make([]*Item, 0, len(rules))
- for _, rule := range rules {
- if _, ok := rule.(map[string]interface{}); !ok {
- return nil, fmt.Errorf("rule should be a map")
- }
- v := rule.(map[string]interface{})
- zeroCnt, err := parseInt(v, "zeroCnt", false, util.InvalidValue)
- if err != nil {
- return nil, err
- }
- freqLimit, err := parseInt(v, "freqInMs", false, util.InvalidValue)
- if err != nil {
- return nil, err
- }
- item := NewItem()
- item.SetTp(FrequencyLimit)
- item.SetZeroCnt(zeroCnt)
- item.SetFreqLimit(freqLimit)
- items = append(items, item)
- }
- if len(items) > 0 {
- sort.Slice(items, func(i, j int) bool {
- return items[i].zeroCnt > items[j].zeroCnt
- })
- }
- return items, nil
-}
-
-func parseInt(doc map[string]interface{}, key string, compare bool, required int64) (int64, error) {
- if _, ok := doc[key]; !ok {
- return util.InvalidValue, fmt.Errorf("field not existed")
- }
- if _, ok := doc[key].(float64); !ok {
- return util.InvalidValue, fmt.Errorf("illegal value, must be int type")
- }
- v := doc[key].(float64)
- if compare && int64(v) != required {
- return util.InvalidValue, fmt.Errorf("illegal value, not required value content")
- }
- return int64(v), nil
-}
-
-func parseTime(doc map[string]interface{}, key string) (int64, error) {
- if _, ok := doc[key]; !ok {
- return util.InvalidValue, fmt.Errorf("field %s not existed", key)
- }
- if _, ok := doc[key].(string); !ok {
- return util.InvalidValue, fmt.Errorf("field %s must be int type", key)
- }
- s := doc[key].(string)
- pos1 := strings.Index(s, ":")
- if pos1 == -1 {
- return util.InvalidValue, fmt.Errorf("field %s must be 'aa:bb' and 'aa','bb' must be int value format", key)
- }
- h, err := strconv.Atoi(s[:pos1])
- if err != nil {
- return util.InvalidValue, err
- }
- if h < 0 || h > 24 {
- return util.InvalidValue, fmt.Errorf("field %s -hour value must in [0,23]", key)
- }
- m, err := strconv.Atoi(s[pos1+1:])
- if err != nil {
- return util.InvalidValue, err
- }
- if m < 0 || m > 59 {
- return util.InvalidValue, fmt.Errorf("field %s -minute value must in [0,59]", key)
- }
- return int64(h*100 + m), nil
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/flowctrl/item.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/flowctrl/item.go
deleted file mode 100644
index 63c9162..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/flowctrl/item.go
+++ /dev/null
@@ -1,133 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package flowctrl
-
-import (
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/util"
-)
-
-const (
- CurrentLimit = iota
- FrequencyLimit
- SSDTransfer
- RequestFrequencyControl
-)
-
-// Item defines a flow control item.
-type Item struct {
- tp int32
- startTime int64
- endTime int64
- datadlt int64
- dataSizeLimit int64
- freqMsLimit int64
- zeroCnt int64
-}
-
-// NewItem returns a default flow control item.
-func NewItem() *Item {
- return &Item{
- startTime: 2500,
- endTime: util.InvalidValue,
- datadlt: util.InvalidValue,
- dataSizeLimit: util.InvalidValue,
- freqMsLimit: util.InvalidValue,
- zeroCnt: util.InvalidValue,
- }
-}
-
-// SetTp sets the type.
-func (i *Item) SetTp(tp int32) {
- i.tp = tp
-}
-
-// SetStartTime sets the startTime.
-func (i *Item) SetStartTime(startTime int64) {
- i.startTime = startTime
-}
-
-// SetEndTime sets the endTime.
-func (i *Item) SetEndTime(endTime int64) {
- i.endTime = endTime
-}
-
-// SetDatadlt sets the datadlt.
-func (i *Item) SetDatadlt(datadlt int64) {
- i.datadlt = datadlt
-}
-
-// SetDataSizeLimit sets the dataSizeLimit.
-func (i *Item) SetDataSizeLimit(dataSizeLimit int64) {
- i.dataSizeLimit = dataSizeLimit
-}
-
-// SetFreqLimit sets the freqLimit.
-func (i *Item) SetFreqLimit(freqLimit int64) {
- i.freqMsLimit = freqLimit
-}
-
-// SetZeroCnt sets the zeroCnt.
-func (i *Item) SetZeroCnt(zeroCnt int64) {
- i.zeroCnt = zeroCnt
-}
-
-func (i *Item) clear() {
- i.tp = 0
- i.startTime = 2500
- i.endTime = util.InvalidValue
- i.datadlt = util.InvalidValue
- i.dataSizeLimit = util.InvalidValue
- i.freqMsLimit = util.InvalidValue
- i.zeroCnt = util.InvalidValue
-}
-
-// GetDataLimit returns the flow control result.
-func (i *Item) GetDataLimit(dlt int64, time int64) *Result {
- if i.tp != 0 || dlt <= i.datadlt {
- return nil
- }
- if time < i.startTime || time > i.endTime {
- return nil
- }
- return NewResult(i.dataSizeLimit, int32(i.freqMsLimit))
-}
-
-// GetFreqMsLimit returns the freqMsLimit.
-func (i *Item) GetFreqMsLimit() int64 {
- return i.freqMsLimit
-}
-
-func (i *Item) getFreLimit(cnt int32) int64 {
- if i.tp != 1 {
- return -1
- }
- if int64(cnt) >= i.zeroCnt {
- return i.freqMsLimit
- }
- return -1
-}
-
-// GetDataSizeLimit returns the dataSizeLimit.
-func (i *Item) GetDataSizeLimit() int64 {
- return i.dataSizeLimit
-}
-
-// GetZeroCnt returns the zeroCnt.
-func (i *Item) GetZeroCnt() int64 {
- return i.zeroCnt
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/flowctrl/result.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/flowctrl/result.go
deleted file mode 100644
index eda3477..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/flowctrl/result.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package flowctrl
-
-// Result defines a flow control result.
-type Result struct {
- dataSizeLimit int64
- freqMsLimit int32
-}
-
-// NewResult returns a new flow control result.
-func NewResult(dataSizeLimit int64, freqMsLimit int32) *Result {
- return &Result{
- dataSizeLimit: dataSizeLimit,
- freqMsLimit: freqMsLimit,
- }
-}
-
-// SetDataSizeLimit sets the dataSizeLimit.
-func (r *Result) SetDataSizeLimit(dataSizeLimit int64) {
- r.dataSizeLimit = dataSizeLimit
-}
-
-// SetFreqMsLimit sets the freqMsLimit.
-func (r *Result) SetFreqMsLimit(freqMsLimit int32) {
- r.freqMsLimit = freqMsLimit
-}
-
-// GetDataSizeLimit returns the dataSizeLimit.
-func (r *Result) GetDataSizeLimit() int64 {
- return r.dataSizeLimit
-}
-
-// GetFreqMsLimit returns the freqMsLimit.
-func (r *Result) GetFreqMsLimit() int64 {
- return int64(r.freqMsLimit)
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/go.mod b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/go.mod
deleted file mode 100644
index 13e5dfd..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/go.mod
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-// <p>
-// http://www.apache.org/licenses/LICENSE-2.0
-// <p>
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-module github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go
-
-go 1.14
-
-require (
- github.com/golang/protobuf v1.4.3
- github.com/golang/snappy v0.0.4
- github.com/stretchr/testify v1.7.0
- go.uber.org/zap v1.16.0
- google.golang.org/protobuf v1.23.0
- gopkg.in/natefinch/lumberjack.v2 v2.0.0
-)
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/go.sum b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/go.sum
deleted file mode 100644
index 3e89521..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/go.sum
+++ /dev/null
@@ -1,82 +0,0 @@
-github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
-github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
-github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
-github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
-github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
-github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
-github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
-github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
-github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
-github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
-github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
-github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
-github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
-github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
-github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
-go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
-go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
-go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
-go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
-go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
-go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM=
-go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs=
-golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs=
-golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
-google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
-google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
-google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
-google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
-google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
-google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
-gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
-gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
-gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
-honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/config.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/config.go
deleted file mode 100644
index 0c3ea36..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/config.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package log
-
-// OutputConfig defines the output config which can be reconfigured by user.
-type OutputConfig struct {
- // LogPath is the path for the log.
- LogPath string
- // Level is the log level.
- Level string
- // MaxSize is the max size for a rolling log.
- MaxSize int
- // MaxBackups is the maximum number of old log files to retain.
- MaxBackups int
- // MaxAge is the maximum number of days to retain old log files based on the
- // timestamp encoded in their filename.
- MaxAge int
-}
-
-var defaultConfig = &OutputConfig{
- LogPath: "../log/tubemq.log",
- MaxSize: 100,
- MaxBackups: 5,
- MaxAge: 3,
- Level: "error",
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/log.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/log.go
deleted file mode 100644
index 472b126..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/log.go
+++ /dev/null
@@ -1,113 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Package log defines the logger for the sdk.
-package log
-
-var traceEnabled = false
-
-// EnableTrace enables trace level log.
-func EnableTrace() {
- traceEnabled = true
-}
-
-var defaultLogger = newDefaultLogger()
-
-func newDefaultLogger() Logger {
- return newZapLog(defaultConfig)
-}
-
-// NewLogger will return a configured zap logger.
-func NewLogger(config *OutputConfig) Logger {
- defaultLogger = newZapLog(config)
- return defaultLogger
-}
-
-// SetLogger sets the default logger to the given logger.
-func SetLogger(logger Logger) {
- defaultLogger = logger
-}
-
-// WithFields is the proxy to call the WithFields of defaultLogger.
-func WithFields(fields ...string) Logger {
- return defaultLogger.WithFields(fields...)
-}
-
-// Trace logs to TRACE level log. Arguments are handled in the manner of fmt.Print.
-func Trace(args ...interface{}) {
- if traceEnabled {
- defaultLogger.Trace(args...)
- }
-}
-
-// Tracef logs to TRACE level log. Arguments are handled in the manner of fmt.Printf.
-func Tracef(format string, args ...interface{}) {
- if traceEnabled {
- defaultLogger.Tracef(format, args...)
- }
-}
-
-// Debug logs to DEBUG level log. Arguments are handled in the manner of fmt.Print.
-func Debug(args ...interface{}) {
- defaultLogger.Debug(args...)
-}
-
-// Debugf logs to DEBUG level log. Arguments are handled in the manner of fmt.Printf.
-func Debugf(format string, args ...interface{}) {
- defaultLogger.Debugf(format, args...)
-}
-
-// Info logs to INFO level log. Arguments are handled in the manner of fmt.Print.
-func Info(args ...interface{}) {
- defaultLogger.Info(args...)
-}
-
-// Infof logs to INFO level log. Arguments are handled in the manner of fmt.Print.
-func Infof(format string, args ...interface{}) {
- defaultLogger.Infof(format, args...)
-}
-
-// Warn logs to WARNING level log. Arguments are handled in the manner of fmt.Print.
-func Warn(args ...interface{}) {
- defaultLogger.Warn(args...)
-}
-
-// Warnf logs to WARNING level log. Arguments are handled in the manner of fmt.Printf.
-func Warnf(format string, args ...interface{}) {
- defaultLogger.Warnf(format, args...)
-}
-
-// Error logs to ERROR level log. Arguments are handled in the manner of fmt.Print.
-func Error(args ...interface{}) {
- defaultLogger.Error(args...)
-}
-
-// Errorf logs to ERROR level log. Arguments are handled in the manner of fmt.Printf.
-func Errorf(format string, args ...interface{}) {
- defaultLogger.Errorf(format, args...)
-}
-
-// Fatal logs to ERROR level log. Arguments are handled in the manner of fmt.Print.
-// that all Fatal logs will exit with os.Exit(1).
-func Fatal(args ...interface{}) {
- defaultLogger.Fatal(args...)
-}
-
-// Fatalf logs to ERROR level log. Arguments are handled in the manner of fmt.Printf.
-func Fatalf(format string, args ...interface{}) {
- defaultLogger.Fatalf(format, args...)
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/log_test.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/log_test.go
deleted file mode 100644
index 3815862..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/log_test.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package log
-
-import (
- "bufio"
- "io"
- "os"
- "regexp"
- "strings"
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestDefaultLog(t *testing.T) {
- config := defaultConfig
- Errorf("HelloWorld")
- f, err := os.Open(config.LogPath)
- defer f.Close()
- assert.Nil(t, err)
- r := bufio.NewReader(f)
- lines := 0
- for {
- content, _, err := r.ReadLine()
- if err == io.EOF {
- break
- }
- assert.Nil(t, err)
- words := strings.Fields(string(content))
- assert.Equal(t, len(words), 5)
- assert.Regexp(t, regexp.MustCompile(`[\d]{4}-[\d]{2}-[\d]{2}`), words[0])
- assert.Regexp(t, regexp.MustCompile(`[\d]{2}:[\d]{2}:[\d]{2}`), words[1])
- assert.Equal(t, "ERROR", words[2])
- assert.Regexp(t, regexp.MustCompile(`[\w]+/[\w]+.go:[\d]+`), words[3])
- assert.Equal(t, "HelloWorld", words[4])
- lines++
- }
- assert.Equal(t, 1, lines)
- err = os.Remove(config.LogPath)
- assert.Nil(t, err)
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/logger.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/logger.go
deleted file mode 100644
index d2edc0d..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/logger.go
+++ /dev/null
@@ -1,78 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package log
-
-// Level log level
-type Level int
-
-// log level const
-const (
- LevelNil Level = iota
- LevelTrace
- LevelDebug
- LevelInfo
- LevelWarn
- LevelError
- LevelFatal
-)
-
-// LevelNames log level name map
-var LevelNames = map[string]Level{
- "trace": LevelTrace,
- "debug": LevelDebug,
- "info": LevelInfo,
- "warn": LevelWarn,
- "error": LevelError,
- "fatal": LevelFatal,
-}
-
-type Logger interface {
- // Trace logs to TRACE log. Arguments are handled in the manner of fmt.Print.
- Trace(args ...interface{})
- // Tracef logs to TRACE log. Arguments are handled in the manner of fmt.Printf.
- Tracef(format string, args ...interface{})
- // Debug logs to DEBUG log. Arguments are handled in the manner of fmt.Print.
- Debug(args ...interface{})
- // Debugf logs to DEBUG log. Arguments are handled in the manner of fmt.Printf.
- Debugf(format string, args ...interface{})
- // Info logs to INFO log. Arguments are handled in the manner of fmt.Print.
- Info(args ...interface{})
- // Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf.
- Infof(format string, args ...interface{})
- // Warn logs to WARNING log. Arguments are handled in the manner of fmt.Print.
- Warn(args ...interface{})
- // Warnf logs to WARNING log. Arguments are handled in the manner of fmt.Printf.
- Warnf(format string, args ...interface{})
- // Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.
- Error(args ...interface{})
- // Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
- Errorf(format string, args ...interface{})
- // Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print.
- // that all Fatal logs will exit with os.Exit(1).
- // Implementations may also call os.Exit() with a non-zero exit code.
- Fatal(args ...interface{})
- // Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
- Fatalf(format string, args ...interface{})
-
- // Sync calls the underlying Core's Sync method, flushing any buffered log entries.
- // Applications should take care to call Sync before exiting
- Sync() error
-
- // // WithFields sets the user-defined data to the log and return a new Logger.
- WithFields(fields ...string) Logger
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/warpper_zaplog.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/warpper_zaplog.go
deleted file mode 100644
index 1961bc6..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/log/warpper_zaplog.go
+++ /dev/null
@@ -1,305 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package log
-
-import (
- "fmt"
- "time"
-
- "go.uber.org/zap"
- "go.uber.org/zap/zapcore"
- "gopkg.in/natefinch/lumberjack.v2"
-)
-
-type zapLog struct {
- logger *zap.Logger
-}
-
-var levelToZapLevel = map[Level]zapcore.Level{
- LevelTrace: zapcore.DebugLevel,
- LevelDebug: zapcore.DebugLevel,
- LevelInfo: zapcore.InfoLevel,
- LevelWarn: zapcore.WarnLevel,
- LevelError: zapcore.ErrorLevel,
- LevelFatal: zapcore.FatalLevel,
-}
-
-func newZapLog(c *OutputConfig) Logger {
- core := newFileCore(c)
- logger := zap.New(
- zapcore.NewTee(core),
- zap.AddCallerSkip(2),
- zap.AddCaller(),
- )
- return &zapLog{logger: logger}
-}
-
-func newFileCore(c *OutputConfig) zapcore.Core {
- w := zapcore.AddSync(&lumberjack.Logger{
- Filename: c.LogPath,
- MaxSize: c.MaxSize, // megabytes
- MaxBackups: c.MaxBackups,
- MaxAge: c.MaxAge, // days
- })
-
- core := zapcore.NewCore(
- newDefaultEncoder(),
- w,
- levelToZapLevel[LevelNames[c.Level]],
- )
- return core
-}
-
-func newDefaultEncoder() zapcore.Encoder {
- encoderCfg := zapcore.EncoderConfig{
- TimeKey: "T",
- LevelKey: "L",
- NameKey: "N",
- CallerKey: "C",
- MessageKey: "M",
- StacktraceKey: "S",
- LineEnding: zapcore.DefaultLineEnding,
- EncodeLevel: zapcore.CapitalLevelEncoder,
- EncodeTime: newDefaultTimeEncoder(),
- EncodeDuration: zapcore.StringDurationEncoder,
- EncodeCaller: zapcore.ShortCallerEncoder,
- }
- encoder := zapcore.NewConsoleEncoder(encoderCfg)
- return encoder
-}
-
-func newDefaultTimeEncoder() zapcore.TimeEncoder {
- return func(t time.Time, enc zapcore.PrimitiveArrayEncoder) {
- enc.AppendByteString(defaultTimeFormat(t))
- }
-}
-
-func defaultTimeFormat(t time.Time) []byte {
- t = t.Local()
- year, month, day := t.Date()
- hour, minute, second := t.Clock()
- micros := t.Nanosecond() / 1000
-
- buf := make([]byte, 23)
- buf[0] = byte((year/1000)%10) + '0'
- buf[1] = byte((year/100)%10) + '0'
- buf[2] = byte((year/10)%10) + '0'
- buf[3] = byte(year%10) + '0'
- buf[4] = '-'
- buf[5] = byte((month)/10) + '0'
- buf[6] = byte((month)%10) + '0'
- buf[7] = '-'
- buf[8] = byte((day)/10) + '0'
- buf[9] = byte((day)%10) + '0'
- buf[10] = ' '
- buf[11] = byte((hour)/10) + '0'
- buf[12] = byte((hour)%10) + '0'
- buf[13] = ':'
- buf[14] = byte((minute)/10) + '0'
- buf[15] = byte((minute)%10) + '0'
- buf[16] = ':'
- buf[17] = byte((second)/10) + '0'
- buf[18] = byte((second)%10) + '0'
- buf[19] = '.'
- buf[20] = byte((micros/100000)%10) + '0'
- buf[21] = byte((micros/10000)%10) + '0'
- buf[22] = byte((micros/1000)%10) + '0'
- return buf
-}
-
-// ZapLogWrapper implements Logger interface
-// based on the underlying zapLog.
-type ZapLogWrapper struct {
- l *zapLog
-}
-
-// GetLogger returns the wrapped zap looger.
-func (z *ZapLogWrapper) GetLogger() Logger {
- return z.l
-}
-
-// Trace logs to TRACE log, Arguments are handled in the manner of fmt.Print
-func (z *ZapLogWrapper) Trace(args ...interface{}) {
- z.l.Trace(args...)
-}
-
-// Tracef logs to TRACE log, Arguments are handled in the manner of fmt.Printf
-func (z *ZapLogWrapper) Tracef(format string, args ...interface{}) {
- z.l.Tracef(format, args...)
-}
-
-// Debug logs to DEBUG log, Arguments are handled in the manner of fmt.Print
-func (z *ZapLogWrapper) Debug(args ...interface{}) {
- z.l.Debug(args...)
-}
-
-// Debugf logs to DEBUG log, Arguments are handled in the manner of fmt.Printf
-func (z *ZapLogWrapper) Debugf(format string, args ...interface{}) {
- z.l.Debugf(format, args...)
-}
-
-// Info logs to INFO log, Arguments are handled in the manner of fmt.Print
-func (z *ZapLogWrapper) Info(args ...interface{}) {
- z.l.Info(args...)
-}
-
-// Infof logs to INFO log, Arguments are handled in the manner of fmt.Printf
-func (z *ZapLogWrapper) Infof(format string, args ...interface{}) {
- z.l.Infof(format, args...)
-}
-
-// Warn logs to WARNING log, Arguments are handled in the manner of fmt.Print
-func (z *ZapLogWrapper) Warn(args ...interface{}) {
- z.l.Warn(args...)
-}
-
-// Warnf logs to WARNING log, Arguments are handled in the manner of fmt.Printf
-func (z *ZapLogWrapper) Warnf(format string, args ...interface{}) {
- z.l.Warnf(format, args...)
-}
-
-// Error logs to ERROR log, Arguments are handled in the manner of fmt.Print
-func (z *ZapLogWrapper) Error(args ...interface{}) {
- z.l.Error(args...)
-}
-
-// Errorf logs to ERROR log, Arguments are handled in the manner of fmt.Printf
-func (z *ZapLogWrapper) Errorf(format string, args ...interface{}) {
- z.l.Errorf(format, args...)
-}
-
-// Fatal logs to FATAL log, Arguments are handled in the manner of fmt.Print
-func (z *ZapLogWrapper) Fatal(args ...interface{}) {
- z.l.Fatal(args...)
-}
-
-// Fatalf logs to FATAL log, Arguments are handled in the manner of fmt.Printf
-func (z *ZapLogWrapper) Fatalf(format string, args ...interface{}) {
- z.l.Fatalf(format, args...)
-}
-
-// Sync calls the zap defaultLogger's Sync method, flushing any buffered log entries.
-// Applications should take care to call Sync before exiting.
-func (z *ZapLogWrapper) Sync() error {
- return z.l.Sync()
-}
-
-// WithFields sets the user-defined data to the log and return a new Logger.
-func (z *ZapLogWrapper) WithFields(fields ...string) Logger {
- return z.l.WithFields(fields...)
-}
-
-// WithFields sets the user-defined data to the log and return a new Logger.
-func (l *zapLog) WithFields(fields ...string) Logger {
- zapfields := make([]zap.Field, len(fields)/2)
- for index := range zapfields {
- zapfields[index] = zap.String(fields[2*index], fields[2*index+1])
- }
-
- return &ZapLogWrapper{l: &zapLog{logger: l.logger.With(zapfields...)}}
-}
-
-// Trace logs to TRACE log, Arguments are handled in the manner of fmt.Print.
-func (l *zapLog) Trace(args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.DebugLevel) {
- l.logger.Debug(fmt.Sprint(args...))
- }
-}
-
-// Tracef logs to TRACE log, Arguments are handled in the manner of fmt.Printf.
-func (l *zapLog) Tracef(format string, args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.DebugLevel) {
- l.logger.Debug(fmt.Sprintf(format, args...))
- }
-}
-
-// Info logs to Debug log, Arguments are handled in the manner of fmt.Print
-func (l *zapLog) Debug(args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.DebugLevel) {
- l.logger.Debug(fmt.Sprint(args...))
- }
-}
-
-// Info logs to Debug log, Arguments are handled in the manner of fmt.Printf
-func (l *zapLog) Debugf(format string, args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.DebugLevel) {
- l.logger.Debug(fmt.Sprintf(format, args...))
- }
-}
-
-// Info logs to INFO log, Arguments are handled in the manner of fmt.Print
-func (l *zapLog) Info(args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.InfoLevel) {
- l.logger.Info(fmt.Sprint(args...))
- }
-}
-
-// Infof logs to INFO log, Arguments are handled in the manner of fmt.Printf
-func (l *zapLog) Infof(format string, args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.InfoLevel) {
- l.logger.Info(fmt.Sprintf(format, args...))
- }
-}
-
-// Warn logs to WARNING log, Arguments are handled in the manner of fmt.Print
-func (l *zapLog) Warn(args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.WarnLevel) {
- l.logger.Warn(fmt.Sprint(args...))
- }
-}
-
-// Warnf logs to WARNING log, Arguments are handled in the manner of fmt.Printf
-func (l *zapLog) Warnf(format string, args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.WarnLevel) {
- l.logger.Warn(fmt.Sprintf(format, args...))
- }
-}
-
-// Error logs to ERROR log, Arguments are handled in the manner of fmt.Print
-func (l *zapLog) Error(args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.ErrorLevel) {
- l.logger.Error(fmt.Sprint(args...))
- }
-}
-
-// Errorf logs to ERROR log, Arguments are handled in the manner of fmt.Printf
-func (l *zapLog) Errorf(format string, args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.ErrorLevel) {
- l.logger.Error(fmt.Sprintf(format, args...))
- }
-}
-
-// Fatal logs to FATAL log, Arguments are handled in the manner of fmt.Print
-func (l *zapLog) Fatal(args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.FatalLevel) {
- l.logger.Fatal(fmt.Sprint(args...))
- }
-}
-
-// Fatalf logs to FATAL log, Arguments are handled in the manner of fmt.Printf
-func (l *zapLog) Fatalf(format string, args ...interface{}) {
- if l.logger.Core().Enabled(zapcore.FatalLevel) {
- l.logger.Fatal(fmt.Sprintf(format, args...))
- }
-}
-
-// Sync calls the zap defaultLogger's Sync method, flushing any buffered log entries.
-// Applications should take care to call Sync before exiting.
-func (l *zapLog) Sync() error {
- return l.logger.Sync()
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/consumer_event.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/consumer_event.go
deleted file mode 100644
index 6be1393..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/consumer_event.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package metadata
-
-const (
- Disconnect = 2
- OnlyDisconnect = 20
- Connect = 1
- OnlyConnect = 10
-)
-
-const (
- Todo = 0
- Processing = 1
- Done = 2
- Unknown = -1
- Failed = -2
-)
-
-// ConsumerEvent represents the metadata of a consumer event
-type ConsumerEvent struct {
- rebalanceID int64
- eventType int32
- eventStatus int32
- subscribeInfo []*SubscribeInfo
-}
-
-func NewEvent(rebalanceID int64, eventType int32, subscribeInfo []*SubscribeInfo) *ConsumerEvent {
- return &ConsumerEvent{
- rebalanceID: rebalanceID,
- eventType: eventType,
- subscribeInfo: subscribeInfo,
- }
-}
-
-// GetRebalanceID returns the rebalanceID of a consumer event.
-func (c *ConsumerEvent) GetRebalanceID() int64 {
- return c.rebalanceID
-}
-
-// GetEventType returns the event type of a consumer event.
-func (c *ConsumerEvent) GetEventType() int32 {
- return c.eventType
-}
-
-// GetEventStatus returns the event status of a consumer event.
-func (c *ConsumerEvent) GetEventStatus() int32 {
- return c.eventStatus
-}
-
-// SetEventType sets the event type.
-func (c *ConsumerEvent) SetEventType(eventType int32) {
- c.eventType = eventType
-}
-
-// SetEventStatus sets the event status.
-func (c *ConsumerEvent) SetEventStatus(eventStatus int32) {
- c.eventStatus = eventStatus
-}
-
-// GetSubscribeInfo returns the list of SubscribeInfo of a consumer event.
-func (c *ConsumerEvent) GetSubscribeInfo() []*SubscribeInfo {
- return c.subscribeInfo
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/metadata.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/metadata.go
deleted file mode 100644
index 5ee20c0..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/metadata.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Package metadata defines all the metadata of the TubeMQ broker and producer.
-package metadata
-
-// Metadata represents the metadata of
-type Metadata struct {
- node *Node
- subscribeInfo *SubscribeInfo
- readStatus int32
- reportTimes bool
-}
-
-// GetNode returns the node of the metadata.
-func (m *Metadata) GetNode() *Node {
- return m.node
-}
-
-// GetSubscribeInfo returns the SubscribeInfo of the metadata.
-func (m *Metadata) GetSubscribeInfo() *SubscribeInfo {
- return m.subscribeInfo
-}
-
-// GetReadStatus returns the read status.
-func (m *Metadata) GetReadStatus() int32 {
- return m.readStatus
-}
-
-// GetReportTimes returns the report times.
-func (m *Metadata) GetReportTimes() bool {
- return m.reportTimes
-}
-
-// SetNode sets the node.
-func (m *Metadata) SetNode(node *Node) {
- m.node = node
-}
-
-// SetSubscribeInfo sets the subscribeInfo.
-func (m *Metadata) SetSubscribeInfo(sub *SubscribeInfo) {
- m.subscribeInfo = sub
-}
-
-// ReadStatus sets the status.
-func (m *Metadata) SetReadStatus(status int32) {
- m.readStatus = status
-}
-
-// SetReportTimes sets the reportTimes.
-func (m *Metadata) SetReportTimes(reportTimes bool) {
- m.reportTimes = reportTimes
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/node.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/node.go
deleted file mode 100644
index 1232ea4..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/node.go
+++ /dev/null
@@ -1,115 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package metadata
-
-import (
- "strconv"
- "strings"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/errs"
-)
-
-// Node represents the metadata of a node.
-type Node struct {
- id uint32
- host string
- port uint32
- address string
-}
-
-// NewNode constructs a node from a given string.
-// If the given string is invalid, it will return error.
-// The format of node string: nodeID:host:port
-func NewNode(isBroker bool, node string) (*Node, error) {
- res := strings.Split(node, ":")
- if len(res) == 1 {
- return nil, errs.ErrInvalidNodeString
- }
- nodeID := 0
- host := ""
- port := 8123
- var err error
- if isBroker {
- nodeID, err = strconv.Atoi(res[0])
- if err != nil {
- return nil, err
- }
- host = res[1]
- if len(res) >= 3 {
- port, err = strconv.Atoi(res[2])
- if err != nil {
- return nil, err
- }
- }
- } else {
- host = res[0]
- if len(res) >= 2 {
- port, err = strconv.Atoi(res[1])
- if err != nil {
- return nil, err
- }
- }
- }
- return &Node{
- id: uint32(nodeID),
- host: host,
- port: uint32(port),
- address: host + ":" + strconv.Itoa(port),
- }, nil
-}
-
-// GetID returns the id of a node.
-func (n *Node) GetID() uint32 {
- return n.id
-}
-
-// GetPort returns the port of a node.
-func (n *Node) GetPort() uint32 {
- return n.port
-}
-
-// GetHost returns the hostname of a node.
-func (n *Node) GetHost() string {
- return n.host
-}
-
-// GetAddress returns the address of a node.
-func (n *Node) GetAddress() string {
- return n.address
-}
-
-// String returns the metadata of a node as a string.
-func (n *Node) String() string {
- return strconv.Itoa(int(n.id)) + ":" + n.host + ":" + strconv.Itoa(int(n.port))
-}
-
-// SetHost sets the host.
-func (n *Node) SetHost(host string) {
- n.host = host
-}
-
-// SetAddress sets the address.
-func (n *Node) SetAddress(address string) error {
- port, err := strconv.Atoi(strings.Split(address, ":")[1])
- if err != nil {
- return err
- }
- n.address = address
- n.port = uint32(port)
- return nil
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/partition.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/partition.go
deleted file mode 100644
index a8cccbd..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/partition.go
+++ /dev/null
@@ -1,228 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package metadata
-
-import (
- "math"
- "strconv"
- "strings"
- "time"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/errs"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/flowctrl"
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/util"
-)
-
-// Partition represents the metadata of a partition.
-type Partition struct {
- topic string
- broker *Node
- partitionID int32
- partitionKey string
- offset int64
- lastConsumed bool
- consumeData *ConsumeData
- flowCtrl *flowctrl.Result
- freqCtrl *flowctrl.Item
- strategyData *strategyData
- totalZeroCnt int32
-}
-
-type ConsumeData struct {
- time int64
- errCode int32
- escLimit bool
- msgSize int32
- dltLimit int64
- curDataDlt int64
- requireSlow bool
-}
-
-type strategyData struct {
- nextStageUpdate int64
- nextSliceUpdate int64
- limitSliceMsgSize int64
- curStageMsgSize int64
- curSliceMsgSize int64
-}
-
-func NewConsumeData(time int64, errCode int32, escLimit bool, msgSize int32, dltLimit int64, curDataDlt int64, requireSlow bool) *ConsumeData {
- return &ConsumeData{
- time: time,
- errCode: errCode,
- escLimit: escLimit,
- msgSize: msgSize,
- dltLimit: dltLimit,
- curDataDlt: curDataDlt,
- requireSlow: requireSlow,
- }
-}
-
-// NewPartition parses a partition from the given string.
-// The format of partition string: brokerInfo#topic:partitionId
-func NewPartition(partition string) (*Partition, error) {
- s := strings.Split(partition, "#")
- if len(s) == 1 {
- return nil, errs.ErrInvalidPartitionString
- }
- b, err := NewNode(true, s[0])
- if err != nil {
- return nil, err
- }
- topicPartitionID := strings.Split(s[1], ":")
- if len(topicPartitionID) == 1 {
- return nil, errs.ErrInvalidPartitionString
- }
- topic := topicPartitionID[0]
- partitionID, err := strconv.Atoi(topicPartitionID[1])
- if err != nil {
- return nil, err
- }
- partitionKey := strconv.Itoa(int(b.id)) + ":" + topic + ":" + strconv.Itoa(partitionID)
- item := flowctrl.NewItem()
- item.SetTp(flowctrl.RequestFrequencyControl)
- return &Partition{
- topic: topic,
- broker: b,
- partitionID: int32(partitionID),
- strategyData: &strategyData{},
- partitionKey: partitionKey,
- consumeData: &ConsumeData{
- curDataDlt: util.InvalidValue,
- },
- freqCtrl: item,
- }, nil
-}
-
-// GetLastConsumed returns lastConsumed of a partition.
-func (p *Partition) GetLastConsumed() bool {
- return p.lastConsumed
-}
-
-// GetPartitionID returns the partition id of a partition.
-func (p *Partition) GetPartitionID() int32 {
- return p.partitionID
-}
-
-// GetPartitionKey returns the partition key of a partition.
-func (p *Partition) GetPartitionKey() string {
- return p.partitionKey
-}
-
-// GetTopic returns the topic of the partition subscribed to.
-func (p *Partition) GetTopic() string {
- return p.topic
-}
-
-// GetBroker returns the broker.
-func (p *Partition) GetBroker() *Node {
- return p.broker
-}
-
-// String returns the metadata of a Partition as a string.
-func (p *Partition) String() string {
- return p.broker.String() + "#" + p.topic + ":" + strconv.Itoa(int(p.partitionID))
-}
-
-// SetLastConsumed sets the last consumed.
-func (p *Partition) SetLastConsumed(lastConsumed bool) {
- p.lastConsumed = lastConsumed
-}
-
-// BookConsumeData sets the consumeData.
-func (p *Partition) BookConsumeData(data *ConsumeData) {
- p.consumeData = data
-}
-
-// ProcConsumeResult processes consume result.
-func (p *Partition) ProcConsumeResult(defHandler *flowctrl.RuleHandler, groupHandler *flowctrl.RuleHandler, filterConsume bool, lastConsumed bool) int64 {
- dltTime := time.Now().UnixNano()/int64(time.Millisecond) - p.consumeData.time
- p.updateStrategyData(defHandler, groupHandler)
- p.lastConsumed = lastConsumed
- switch p.consumeData.errCode {
- case errs.RetSuccess, errs.RetErrNotFound:
- if p.consumeData.msgSize == 0 && p.consumeData.errCode != errs.RetSuccess {
- p.totalZeroCnt++
- } else {
- p.totalZeroCnt = 0
- }
- if p.totalZeroCnt > 0 {
- if groupHandler.GetMinZeroCnt() != math.MaxInt64 {
- return groupHandler.GetCurFreqLimitTime(p.totalZeroCnt, p.consumeData.dltLimit) - dltTime
- } else {
- return defHandler.GetCurFreqLimitTime(p.totalZeroCnt, p.consumeData.dltLimit) - dltTime
- }
- }
- if p.consumeData.escLimit {
- return 0
- } else {
- if p.strategyData.curStageMsgSize >= p.flowCtrl.GetDataSizeLimit() ||
- p.strategyData.curSliceMsgSize >= p.strategyData.limitSliceMsgSize {
- if p.flowCtrl.GetFreqMsLimit() > p.consumeData.dltLimit {
- return p.flowCtrl.GetFreqMsLimit() - dltTime
- }
- return p.consumeData.dltLimit - dltTime
- }
- if p.consumeData.errCode == errs.RetSuccess {
- if filterConsume && p.freqCtrl.GetFreqMsLimit() >= 0 {
- if p.consumeData.requireSlow {
- return p.freqCtrl.GetZeroCnt() - dltTime
- } else {
- return p.freqCtrl.GetFreqMsLimit() - dltTime
- }
- } else if !filterConsume && p.freqCtrl.GetDataSizeLimit() >= 0 {
- return p.freqCtrl.GetDataSizeLimit() - dltTime
- }
- }
- return p.consumeData.dltLimit - dltTime
- }
- default:
- return p.consumeData.dltLimit - dltTime
- }
-}
-
-func (p *Partition) updateStrategyData(defHandler *flowctrl.RuleHandler, groupHandler *flowctrl.RuleHandler) {
- p.strategyData.curStageMsgSize += int64(p.consumeData.msgSize)
- p.strategyData.curSliceMsgSize += int64(p.consumeData.msgSize)
- curTime := time.Now().UnixNano() / int64(time.Millisecond)
- if curTime > p.strategyData.nextStageUpdate {
- p.strategyData.curStageMsgSize = 0
- p.strategyData.curSliceMsgSize = 0
- if p.consumeData.curDataDlt < 0 {
- p.flowCtrl = flowctrl.NewResult(math.MaxInt64, 20)
- } else {
- p.flowCtrl = groupHandler.GetCurDataLimit(p.consumeData.curDataDlt)
- if p.flowCtrl == nil {
- p.flowCtrl = defHandler.GetCurDataLimit(p.consumeData.curDataDlt)
- }
- if p.flowCtrl == nil {
- p.flowCtrl = flowctrl.NewResult(math.MaxInt64, 0)
- }
- p.freqCtrl = groupHandler.GetFilterCtrlItem()
- if p.freqCtrl.GetFreqMsLimit() < 0 {
- p.freqCtrl = defHandler.GetFilterCtrlItem()
- }
- }
- p.strategyData.limitSliceMsgSize = p.flowCtrl.GetDataSizeLimit() / 12
- p.strategyData.nextStageUpdate = curTime + 60000
- p.strategyData.nextSliceUpdate = curTime + 5000
- } else if curTime > p.strategyData.nextSliceUpdate {
- p.strategyData.curSliceMsgSize = 0
- p.strategyData.nextSliceUpdate = curTime + 5000
- }
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/subscribe_info.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/subscribe_info.go
deleted file mode 100644
index 06c2a67..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/metadata/subscribe_info.go
+++ /dev/null
@@ -1,90 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package metadata
-
-import (
- "fmt"
- "strings"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/errs"
-)
-
-// SubscribeInfo represents the metadata of the subscribe info.
-type SubscribeInfo struct {
- group string
- consumerID string
- partition *Partition
-}
-
-// GetGroup returns the group name.
-func (s *SubscribeInfo) GetGroup() string {
- return s.group
-}
-
-// GetConsumerID returns the consumer id.
-func (s *SubscribeInfo) GetConsumerID() string {
- return s.consumerID
-}
-
-// GetPartition returns the partition.
-func (s *SubscribeInfo) GetPartition() *Partition {
- return s.partition
-}
-
-// String returns the contents of SubscribeInfo as a string.
-func (s *SubscribeInfo) String() string {
- return fmt.Sprintf("%s@%s#%s", s.consumerID, s.group, s.partition.String())
-}
-
-// NewSubscribeInfo constructs a SubscribeInfo from a given string.
-// If the given is invalid, it will return error.
-// The format of subscribeInfo string: consumerId@group#broker_info#topic:partitionId
-func NewSubscribeInfo(subscribeInfo string) (*SubscribeInfo, error) {
- s := strings.SplitN(subscribeInfo, "#", 2)
- if len(s) == 1 {
- return nil, errs.ErrInvalidSubscribeInfoString
- }
- consumerInfo := strings.Split(s[0], "@")
- if len(consumerInfo) == 1 {
- return nil, errs.ErrInvalidSubscribeInfoString
- }
- partition, err := NewPartition(s[1])
- if err != nil {
- return nil, err
- }
- return &SubscribeInfo{
- group: consumerInfo[1],
- consumerID: consumerInfo[0],
- partition: partition,
- }, nil
-}
-
-// SetPartition sets the partition.
-func (s *SubscribeInfo) SetPartition(partition *Partition) {
- s.partition = partition
-}
-
-// SetGroup sets the group.
-func (s *SubscribeInfo) SetGroup(group string) {
- s.group = group
-}
-
-// SetConsumerID sets the consumerID.
-func (s *SubscribeInfo) SetConsumerID(id string) {
- s.consumerID = id
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/multiplexing/multiplexing.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/multiplexing/multiplexing.go
deleted file mode 100644
index d0bf204..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/multiplexing/multiplexing.go
+++ /dev/null
@@ -1,445 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Package multiplexing defines the multiplex connection pool for sending
-// request and receiving response. After receiving the response, the decoded
-// response will be returned to the client. It is used for the communication
-// with TubeMQ.
-package multiplexing
-
-import (
- "context"
- "crypto/tls"
- "crypto/x509"
- "errors"
- "io/ioutil"
- "net"
- "sync"
- "time"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/codec"
-)
-
-var (
- // ErrConnClosed indicates the connection has been closed
- ErrConnClosed = errors.New("connection has been closed")
- // ErrChanClosed indicates the recv chan has been closed
- ErrChanClosed = errors.New("unexpected recv chan closing")
- // ErrWriteBufferDone indicates write buffer done
- ErrWriteBufferDone = errors.New("write buffer done")
- // ErrAssertConnection indicates connection assertion error
- ErrAssertConnection = errors.New("connection assertion error")
-)
-
-// The state of the connection.
-const (
- Initial int = iota
- Connected
- Closing
- Closed
-)
-
-const queueSize = 10000
-
-// Pool maintains the multiplex connections of different addresses.
-type Pool struct {
- connections *sync.Map
- mu sync.RWMutex
-}
-
-// NewPool will construct a default multiplex connections pool.
-func NewPool() *Pool {
- m := &Pool{
- connections: new(sync.Map),
- }
- return m
-}
-
-// Get will return a multiplex connection
-// 1. If no underlying TCP connection has been created, a TCP connection will be created first.
-// 2. A new multiplex connection with the serialNo will be created and returned.
-func (p *Pool) Get(ctx context.Context, address string, serialNo uint32, opts *DialOptions) (*MultiplexConnection, error) {
- select {
- case <-ctx.Done():
- return nil, ctx.Err()
- default:
- }
-
- if v, ok := p.connections.Load(address); ok {
- if c, ok := v.(*Connection); ok {
- return c.new(ctx, serialNo)
- }
- return nil, ErrAssertConnection
- }
- p.mu.Lock()
- defer p.mu.Unlock()
- // If the concurrent request has created the connection, the connection can be returned directly.
- if v, ok := p.connections.Load(address); ok {
- if c, ok := v.(*Connection); ok {
- mc, err := c.new(ctx, serialNo)
- return mc, err
- }
- return nil, ErrAssertConnection
- }
-
- c := &Connection{
- address: address,
- connections: make(map[uint32]*MultiplexConnection),
- done: make(chan struct{}),
- mDone: make(chan struct{}),
- state: Initial,
- pool: p,
- }
- c.buffer = &writerBuffer{
- buffer: make(chan []byte, queueSize),
- done: c.done,
- }
- p.connections.Store(address, c)
-
- conn, dialOpts, err := dial(ctx, opts)
- c.dialOpts = dialOpts
- if err != nil {
- c.close(err, c.done)
- return nil, err
- }
- c.decoder = codec.New(conn)
- c.conn = conn
- c.state = Connected
- go c.reader()
- go c.writer()
- return c.new(ctx, serialNo)
-}
-
-func dial(ctx context.Context, opts *DialOptions) (net.Conn, *DialOptions, error) {
- var timeout time.Duration
- t, ok := ctx.Deadline()
- if ok {
- timeout = t.Sub(time.Now())
- }
- opts.Timeout = timeout
- select {
- case <-ctx.Done():
- return nil, opts, ctx.Err()
- default:
- }
- conn, err := dialWithTimeout(opts)
- return conn, opts, err
-}
-
-func dialWithTimeout(opts *DialOptions) (net.Conn, error) {
- if len(opts.CACertFile) == 0 {
- return net.DialTimeout(opts.Network, opts.Address, opts.Timeout)
- }
-
- tlsConf := &tls.Config{}
- if opts.CACertFile == "" {
- tlsConf.InsecureSkipVerify = true
- } else {
- if len(opts.TLSServerName) == 0 {
- opts.TLSServerName = opts.Address
- }
- tlsConf.ServerName = opts.TLSServerName
- certPool, err := getCertPool(opts.CACertFile)
- if err != nil {
- return nil, err
- }
-
- tlsConf.RootCAs = certPool
-
- if len(opts.TLSCertFile) != 0 {
- cert, err := tls.LoadX509KeyPair(opts.TLSCertFile, opts.TLSKeyFile)
- if err != nil {
- return nil, err
- }
- tlsConf.Certificates = []tls.Certificate{cert}
- }
- }
- return tls.DialWithDialer(&net.Dialer{Timeout: opts.Timeout}, opts.Network, opts.Address, tlsConf)
-}
-
-func getCertPool(caCertFile string) (*x509.CertPool, error) {
- if caCertFile != "root" {
- ca, err := ioutil.ReadFile(caCertFile)
- if err != nil {
- return nil, err
- }
- certPool := x509.NewCertPool()
- ok := certPool.AppendCertsFromPEM(ca)
- if !ok {
- return nil, err
- }
- return certPool, nil
- }
- return nil, nil
-}
-
-// Close will release all the connections.
-func (p *Pool) Close() {
- p.connections.Range(func(key, value interface{}) bool {
- connection, ok := value.(*Connection)
- if !ok {
- return false
- }
- close(connection.done)
- close(connection.mDone)
- connection.conn.Close()
- return true
- })
-}
-
-type recvReader struct {
- ctx context.Context
- recv chan codec.Response
-}
-
-// MultiplexConnection is used to multiplex a TCP connection.
-// It is distinguished by the serialNo.
-type MultiplexConnection struct {
- serialNo uint32
- conn *Connection
- reader *recvReader
- done chan struct{}
-}
-
-// Write uses the underlying TCP connection to send the bytes.
-func (mc *MultiplexConnection) Write(b []byte) error {
- if err := mc.conn.send(b); err != nil {
- mc.conn.remove(mc.serialNo)
- return err
- }
- return nil
-}
-
-// Read returns the response from the multiplex connection.
-func (mc *MultiplexConnection) Read() (codec.Response, error) {
- select {
- case <-mc.reader.ctx.Done():
- mc.conn.remove(mc.serialNo)
- return nil, mc.reader.ctx.Err()
- case v, ok := <-mc.reader.recv:
- if ok {
- return v, nil
- }
- if mc.conn.err != nil {
- return nil, mc.conn.err
- }
- return nil, ErrChanClosed
- case <-mc.done:
- return nil, mc.conn.err
- }
-}
-
-func (mc *MultiplexConnection) recv(rsp codec.Response) {
- mc.reader.recv <- rsp
- mc.conn.remove(rsp.GetSerialNo())
-}
-
-// DialOptions represents the dail options of the TCP connection.
-// If TLS is not enabled, the configuration of TLS can be ignored.
-type DialOptions struct {
- Network string
- Address string
- Timeout time.Duration
- CACertFile string
- TLSCertFile string
- TLSKeyFile string
- TLSServerName string
-}
-
-// Connection represents the underlying TCP connection of the multiplex connections of an address
-// and maintains the multiplex connections.
-type Connection struct {
- err error
- address string
- mu sync.RWMutex
- connections map[uint32]*MultiplexConnection
- decoder codec.Decoder
- conn net.Conn
- done chan struct{}
- mDone chan struct{}
- buffer *writerBuffer
- dialOpts *DialOptions
- state int
- pool *Pool
-}
-
-func (c *Connection) new(ctx context.Context, serialNo uint32) (*MultiplexConnection, error) {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return nil, c.err
- }
-
- mc := &MultiplexConnection{
- serialNo: serialNo,
- conn: c,
- done: c.mDone,
- reader: &recvReader{
- ctx: ctx,
- recv: make(chan codec.Response, 1),
- },
- }
-
- if lastConn, ok := c.connections[serialNo]; ok {
- close(lastConn.reader.recv)
- }
- c.connections[serialNo] = mc
- return mc, nil
-}
-
-func (c *Connection) close(lastErr error, done chan struct{}) {
- if lastErr == nil {
- return
- }
- c.mu.Lock()
- defer c.mu.Unlock()
-
- if c.state == Closed {
- return
- }
-
- select {
- case <-done:
- return
- default:
- }
-
- c.state = Closing
- c.err = lastErr
- c.connections = make(map[uint32]*MultiplexConnection)
- close(c.done)
- if c.conn != nil {
- c.conn.Close()
- }
- err := c.reconnect()
- if err != nil {
- c.state = Closed
- close(c.mDone)
- c.pool.connections.Delete(c.address)
- }
-}
-
-func (c *Connection) reconnect() error {
- conn, err := dialWithTimeout(c.dialOpts)
- if err != nil {
- return err
- }
- c.done = make(chan struct{})
- c.conn = conn
- c.decoder = codec.New(conn)
- c.buffer.done = c.done
- c.state = Connected
- c.err = nil
- go c.reader()
- go c.writer()
- return nil
-}
-
-// The response handling logic of the TCP connection.
-// 1. Read from the connection and decode it to the Response.
-// 2. Send the response to the corresponding multiplex connection based on the serialNo.
-func (c *Connection) reader() {
- var lastErr error
- for {
- select {
- case <-c.done:
- return
- default:
- }
- rsp, err := c.decoder.Decode()
- if err != nil {
- lastErr = err
- break
- }
- serialNo := rsp.GetSerialNo()
- c.mu.RLock()
- mc, ok := c.connections[serialNo]
- c.mu.RUnlock()
- if !ok {
- continue
- }
- mc.reader.recv <- rsp
- mc.conn.remove(serialNo)
- }
- c.close(lastErr, c.done)
-}
-
-func (c *Connection) writer() {
- var lastErr error
- for {
- select {
- case <-c.done:
- return
- default:
- }
- req, err := c.buffer.get()
- if err != nil {
- lastErr = err
- break
- }
- if err := c.write(req); err != nil {
- lastErr = err
- break
- }
- }
- c.close(lastErr, c.done)
-}
-
-func (c *Connection) write(b []byte) error {
- sent := 0
- for sent < len(b) {
- n, err := c.conn.Write(b[sent:])
- if err != nil {
- return err
- }
- sent += n
- }
- return nil
-}
-
-func (c *Connection) send(b []byte) error {
- if c.state == Closed {
- return ErrConnClosed
- }
-
- select {
- case c.buffer.buffer <- b:
- return nil
- case <-c.mDone:
- return c.err
- }
-}
-
-func (c *Connection) remove(id uint32) {
- c.mu.Lock()
- delete(c.connections, id)
- c.mu.Unlock()
-}
-
-type writerBuffer struct {
- buffer chan []byte
- done <-chan struct{}
-}
-
-func (w *writerBuffer) get() ([]byte, error) {
- select {
- case req := <-w.buffer:
- return req, nil
- case <-w.done:
- return nil, ErrWriteBufferDone
- }
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/multiplexing/multlplexing_test.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/multiplexing/multlplexing_test.go
deleted file mode 100644
index 7657ae3..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/multiplexing/multlplexing_test.go
+++ /dev/null
@@ -1,144 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package multiplexing
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "io"
- "log"
- "net"
- "strconv"
- "sync"
- "sync/atomic"
- "testing"
- "time"
-
- "github.com/stretchr/testify/assert"
-
- "github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/codec"
-)
-
-var (
- address = "127.0.0.1:8888"
- ch = make(chan struct{})
- serialNo uint32 = 1
-)
-
-func init() {
- go simpleForwardTCPServer(ch)
- <-ch
-}
-
-func simpleForwardTCPServer(ch chan struct{}) {
- l, err := net.Listen("tcp", address)
- if err != nil {
- log.Fatal(err)
- }
- defer l.Close()
- address = l.Addr().String()
-
- ch <- struct{}{}
-
- for {
- conn, err := l.Accept()
- if err != nil {
- log.Fatal(err)
- }
-
- go func() {
- io.Copy(conn, conn)
- }()
- }
-}
-
-func Encode(serialNo uint32, body []byte) ([]byte, error) {
- l := len(body)
- buf := bytes.NewBuffer(make([]byte, 0, 16+l))
- if err := binary.Write(buf, binary.BigEndian, codec.RPCProtocolBeginToken); err != nil {
- return nil, err
- }
- if err := binary.Write(buf, binary.BigEndian, serialNo); err != nil {
- return nil, err
- }
- if err := binary.Write(buf, binary.BigEndian, uint32(1)); err != nil {
- return nil, err
- }
- if err := binary.Write(buf, binary.BigEndian, uint32(len(body))); err != nil {
- return nil, err
- }
- buf.Write(body)
- return buf.Bytes(), nil
-}
-
-func TestBasicMultiplexing(t *testing.T) {
- serialNo := atomic.AddUint32(&serialNo, 1)
- ctx, cancel := context.WithTimeout(context.Background(), time.Second)
- defer cancel()
-
- m := NewPool()
- opts := &DialOptions{
- Network: "tcp",
- Address: address,
- }
- mc, err := m.Get(ctx, address, serialNo, opts)
- body := []byte("hello world")
-
- buf, err := Encode(serialNo, body)
- assert.Nil(t, err)
- assert.Nil(t, mc.Write(buf))
-
- rsp, err := mc.Read()
- assert.Nil(t, err)
- assert.Equal(t, serialNo, rsp.GetSerialNo())
- assert.Equal(t, body, rsp.GetBuffer())
- assert.Equal(t, mc.Write(nil), nil)
-}
-
-func TestConcurrentMultiplexing(t *testing.T) {
- count := 1000
- m := NewPool()
- wg := sync.WaitGroup{}
- wg.Add(count)
- for i := 0; i < count; i++ {
- go func(i int) {
- defer wg.Done()
- ctx, cancel := context.WithTimeout(context.Background(), time.Second)
- defer cancel()
- serialNo := atomic.AddUint32(&serialNo, 1)
- opts := &DialOptions{
- Network: "tcp",
- Address: address,
- }
- mc, err := m.Get(ctx, address, serialNo, opts)
- assert.Nil(t, err)
-
- body := []byte("hello world" + strconv.Itoa(i))
- buf, err := Encode(serialNo, body)
- assert.Nil(t, err)
- assert.Nil(t, mc.Write(buf))
-
- rsp, err := mc.Read()
- assert.Nil(t, err)
- assert.Equal(t, serialNo, rsp.GetSerialNo())
- assert.Equal(t, body, rsp.GetBuffer())
- }(i)
- }
- wg.Wait()
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/protocol/BrokerService.pb.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/protocol/BrokerService.pb.go
deleted file mode 100644
index 7bc7513..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/protocol/BrokerService.pb.go
+++ /dev/null
@@ -1,1557 +0,0 @@
-//*
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.26.0
-// protoc v3.17.3
-// source: BrokerService.proto
-
-package protocol
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- reflect "reflect"
- sync "sync"
-)
-
-const (
- // Verify that this generated code is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
- // Verify that runtime/protoimpl is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type TransferedMessage struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- MessageId *int64 `protobuf:"varint,1,req,name=messageId" json:"messageId,omitempty"`
- CheckSum *int32 `protobuf:"varint,2,req,name=checkSum" json:"checkSum,omitempty"`
- PayLoadData []byte `protobuf:"bytes,3,req,name=payLoadData" json:"payLoadData,omitempty"`
- Flag *int32 `protobuf:"varint,4,req,name=flag" json:"flag,omitempty"`
-}
-
-func (x *TransferedMessage) Reset() {
- *x = TransferedMessage{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *TransferedMessage) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*TransferedMessage) ProtoMessage() {}
-
-func (x *TransferedMessage) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[0]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use TransferedMessage.ProtoReflect.Descriptor instead.
-func (*TransferedMessage) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *TransferedMessage) GetMessageId() int64 {
- if x != nil && x.MessageId != nil {
- return *x.MessageId
- }
- return 0
-}
-
-func (x *TransferedMessage) GetCheckSum() int32 {
- if x != nil && x.CheckSum != nil {
- return *x.CheckSum
- }
- return 0
-}
-
-func (x *TransferedMessage) GetPayLoadData() []byte {
- if x != nil {
- return x.PayLoadData
- }
- return nil
-}
-
-func (x *TransferedMessage) GetFlag() int32 {
- if x != nil && x.Flag != nil {
- return *x.Flag
- }
- return 0
-}
-
-type AuthorizedInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- VisitAuthorizedToken *int64 `protobuf:"varint,1,req,name=visitAuthorizedToken" json:"visitAuthorizedToken,omitempty"`
- AuthAuthorizedToken *string `protobuf:"bytes,2,opt,name=authAuthorizedToken" json:"authAuthorizedToken,omitempty"`
-}
-
-func (x *AuthorizedInfo) Reset() {
- *x = AuthorizedInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *AuthorizedInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*AuthorizedInfo) ProtoMessage() {}
-
-func (x *AuthorizedInfo) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[1]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use AuthorizedInfo.ProtoReflect.Descriptor instead.
-func (*AuthorizedInfo) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *AuthorizedInfo) GetVisitAuthorizedToken() int64 {
- if x != nil && x.VisitAuthorizedToken != nil {
- return *x.VisitAuthorizedToken
- }
- return 0
-}
-
-func (x *AuthorizedInfo) GetAuthAuthorizedToken() string {
- if x != nil && x.AuthAuthorizedToken != nil {
- return *x.AuthAuthorizedToken
- }
- return ""
-}
-
-type SendMessageRequestP2B struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- TopicName *string `protobuf:"bytes,2,req,name=topicName" json:"topicName,omitempty"`
- PartitionId *int32 `protobuf:"varint,3,req,name=partitionId" json:"partitionId,omitempty"`
- Data []byte `protobuf:"bytes,4,req,name=data" json:"data,omitempty"`
- Flag *int32 `protobuf:"varint,5,req,name=flag" json:"flag,omitempty"`
- CheckSum *int32 `protobuf:"varint,6,req,name=checkSum" json:"checkSum,omitempty"`
- SentAddr *int32 `protobuf:"varint,7,req,name=sentAddr" json:"sentAddr,omitempty"`
- MsgType *string `protobuf:"bytes,8,opt,name=msgType" json:"msgType,omitempty"`
- MsgTime *string `protobuf:"bytes,9,opt,name=msgTime" json:"msgTime,omitempty"`
- AuthInfo *AuthorizedInfo `protobuf:"bytes,10,opt,name=authInfo" json:"authInfo,omitempty"`
-}
-
-func (x *SendMessageRequestP2B) Reset() {
- *x = SendMessageRequestP2B{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *SendMessageRequestP2B) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*SendMessageRequestP2B) ProtoMessage() {}
-
-func (x *SendMessageRequestP2B) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[2]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use SendMessageRequestP2B.ProtoReflect.Descriptor instead.
-func (*SendMessageRequestP2B) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *SendMessageRequestP2B) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *SendMessageRequestP2B) GetTopicName() string {
- if x != nil && x.TopicName != nil {
- return *x.TopicName
- }
- return ""
-}
-
-func (x *SendMessageRequestP2B) GetPartitionId() int32 {
- if x != nil && x.PartitionId != nil {
- return *x.PartitionId
- }
- return 0
-}
-
-func (x *SendMessageRequestP2B) GetData() []byte {
- if x != nil {
- return x.Data
- }
- return nil
-}
-
-func (x *SendMessageRequestP2B) GetFlag() int32 {
- if x != nil && x.Flag != nil {
- return *x.Flag
- }
- return 0
-}
-
-func (x *SendMessageRequestP2B) GetCheckSum() int32 {
- if x != nil && x.CheckSum != nil {
- return *x.CheckSum
- }
- return 0
-}
-
-func (x *SendMessageRequestP2B) GetSentAddr() int32 {
- if x != nil && x.SentAddr != nil {
- return *x.SentAddr
- }
- return 0
-}
-
-func (x *SendMessageRequestP2B) GetMsgType() string {
- if x != nil && x.MsgType != nil {
- return *x.MsgType
- }
- return ""
-}
-
-func (x *SendMessageRequestP2B) GetMsgTime() string {
- if x != nil && x.MsgTime != nil {
- return *x.MsgTime
- }
- return ""
-}
-
-func (x *SendMessageRequestP2B) GetAuthInfo() *AuthorizedInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-type SendMessageResponseB2P struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
- RequireAuth *bool `protobuf:"varint,4,opt,name=requireAuth" json:"requireAuth,omitempty"`
- MessageId *int64 `protobuf:"varint,5,opt,name=messageId" json:"messageId,omitempty"`
- AppendTime *int64 `protobuf:"varint,6,opt,name=appendTime" json:"appendTime,omitempty"`
- AppendOffset *int64 `protobuf:"varint,7,opt,name=appendOffset" json:"appendOffset,omitempty"`
-}
-
-func (x *SendMessageResponseB2P) Reset() {
- *x = SendMessageResponseB2P{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *SendMessageResponseB2P) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*SendMessageResponseB2P) ProtoMessage() {}
-
-func (x *SendMessageResponseB2P) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[3]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use SendMessageResponseB2P.ProtoReflect.Descriptor instead.
-func (*SendMessageResponseB2P) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *SendMessageResponseB2P) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *SendMessageResponseB2P) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *SendMessageResponseB2P) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *SendMessageResponseB2P) GetRequireAuth() bool {
- if x != nil && x.RequireAuth != nil {
- return *x.RequireAuth
- }
- return false
-}
-
-func (x *SendMessageResponseB2P) GetMessageId() int64 {
- if x != nil && x.MessageId != nil {
- return *x.MessageId
- }
- return 0
-}
-
-func (x *SendMessageResponseB2P) GetAppendTime() int64 {
- if x != nil && x.AppendTime != nil {
- return *x.AppendTime
- }
- return 0
-}
-
-func (x *SendMessageResponseB2P) GetAppendOffset() int64 {
- if x != nil && x.AppendOffset != nil {
- return *x.AppendOffset
- }
- return 0
-}
-
-type RegisterRequestC2B struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- OpType *int32 `protobuf:"varint,1,req,name=opType" json:"opType,omitempty"`
- ClientId *string `protobuf:"bytes,2,req,name=clientId" json:"clientId,omitempty"`
- GroupName *string `protobuf:"bytes,3,req,name=groupName" json:"groupName,omitempty"`
- TopicName *string `protobuf:"bytes,4,req,name=topicName" json:"topicName,omitempty"`
- PartitionId *int32 `protobuf:"varint,5,req,name=partitionId" json:"partitionId,omitempty"`
- ReadStatus *int32 `protobuf:"varint,6,req,name=readStatus" json:"readStatus,omitempty"`
- FilterCondStr []string `protobuf:"bytes,7,rep,name=filterCondStr" json:"filterCondStr,omitempty"`
- CurrOffset *int64 `protobuf:"varint,8,opt,name=currOffset" json:"currOffset,omitempty"`
- SessionKey *string `protobuf:"bytes,9,opt,name=sessionKey" json:"sessionKey,omitempty"`
- SessionTime *int64 `protobuf:"varint,10,opt,name=sessionTime" json:"sessionTime,omitempty"`
- SsdStoreId *int64 `protobuf:"varint,11,opt,name=ssdStoreId" json:"ssdStoreId,omitempty"` // Deprecated
- QryPriorityId *int32 `protobuf:"varint,12,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- AuthInfo *AuthorizedInfo `protobuf:"bytes,13,opt,name=authInfo" json:"authInfo,omitempty"`
-}
-
-func (x *RegisterRequestC2B) Reset() {
- *x = RegisterRequestC2B{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[4]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RegisterRequestC2B) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RegisterRequestC2B) ProtoMessage() {}
-
-func (x *RegisterRequestC2B) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[4]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use RegisterRequestC2B.ProtoReflect.Descriptor instead.
-func (*RegisterRequestC2B) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{4}
-}
-
-func (x *RegisterRequestC2B) GetOpType() int32 {
- if x != nil && x.OpType != nil {
- return *x.OpType
- }
- return 0
-}
-
-func (x *RegisterRequestC2B) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *RegisterRequestC2B) GetGroupName() string {
- if x != nil && x.GroupName != nil {
- return *x.GroupName
- }
- return ""
-}
-
-func (x *RegisterRequestC2B) GetTopicName() string {
- if x != nil && x.TopicName != nil {
- return *x.TopicName
- }
- return ""
-}
-
-func (x *RegisterRequestC2B) GetPartitionId() int32 {
- if x != nil && x.PartitionId != nil {
- return *x.PartitionId
- }
- return 0
-}
-
-func (x *RegisterRequestC2B) GetReadStatus() int32 {
- if x != nil && x.ReadStatus != nil {
- return *x.ReadStatus
- }
- return 0
-}
-
-func (x *RegisterRequestC2B) GetFilterCondStr() []string {
- if x != nil {
- return x.FilterCondStr
- }
- return nil
-}
-
-func (x *RegisterRequestC2B) GetCurrOffset() int64 {
- if x != nil && x.CurrOffset != nil {
- return *x.CurrOffset
- }
- return 0
-}
-
-func (x *RegisterRequestC2B) GetSessionKey() string {
- if x != nil && x.SessionKey != nil {
- return *x.SessionKey
- }
- return ""
-}
-
-func (x *RegisterRequestC2B) GetSessionTime() int64 {
- if x != nil && x.SessionTime != nil {
- return *x.SessionTime
- }
- return 0
-}
-
-func (x *RegisterRequestC2B) GetSsdStoreId() int64 {
- if x != nil && x.SsdStoreId != nil {
- return *x.SsdStoreId
- }
- return 0
-}
-
-func (x *RegisterRequestC2B) GetQryPriorityId() int32 {
- if x != nil && x.QryPriorityId != nil {
- return *x.QryPriorityId
- }
- return 0
-}
-
-func (x *RegisterRequestC2B) GetAuthInfo() *AuthorizedInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-type RegisterResponseB2C struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
- CurrOffset *int64 `protobuf:"varint,4,opt,name=currOffset" json:"currOffset,omitempty"`
- MaxOffset *int64 `protobuf:"varint,5,opt,name=maxOffset" json:"maxOffset,omitempty"`
-}
-
-func (x *RegisterResponseB2C) Reset() {
- *x = RegisterResponseB2C{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[5]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RegisterResponseB2C) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RegisterResponseB2C) ProtoMessage() {}
-
-func (x *RegisterResponseB2C) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[5]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use RegisterResponseB2C.ProtoReflect.Descriptor instead.
-func (*RegisterResponseB2C) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{5}
-}
-
-func (x *RegisterResponseB2C) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *RegisterResponseB2C) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *RegisterResponseB2C) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *RegisterResponseB2C) GetCurrOffset() int64 {
- if x != nil && x.CurrOffset != nil {
- return *x.CurrOffset
- }
- return 0
-}
-
-func (x *RegisterResponseB2C) GetMaxOffset() int64 {
- if x != nil && x.MaxOffset != nil {
- return *x.MaxOffset
- }
- return 0
-}
-
-type HeartBeatRequestC2B struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- GroupName *string `protobuf:"bytes,2,req,name=groupName" json:"groupName,omitempty"`
- ReadStatus *int32 `protobuf:"varint,3,req,name=readStatus" json:"readStatus,omitempty"`
- // brokerId:host:port:topic:partitionId:delayTimeStamp
- PartitionInfo []string `protobuf:"bytes,4,rep,name=partitionInfo" json:"partitionInfo,omitempty"`
- SsdStoreId *int64 `protobuf:"varint,5,opt,name=ssdStoreId" json:"ssdStoreId,omitempty"` // Deprecated
- QryPriorityId *int32 `protobuf:"varint,6,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- AuthInfo *AuthorizedInfo `protobuf:"bytes,7,opt,name=authInfo" json:"authInfo,omitempty"`
-}
-
-func (x *HeartBeatRequestC2B) Reset() {
- *x = HeartBeatRequestC2B{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[6]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *HeartBeatRequestC2B) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*HeartBeatRequestC2B) ProtoMessage() {}
-
-func (x *HeartBeatRequestC2B) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[6]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use HeartBeatRequestC2B.ProtoReflect.Descriptor instead.
-func (*HeartBeatRequestC2B) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{6}
-}
-
-func (x *HeartBeatRequestC2B) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *HeartBeatRequestC2B) GetGroupName() string {
- if x != nil && x.GroupName != nil {
- return *x.GroupName
- }
- return ""
-}
-
-func (x *HeartBeatRequestC2B) GetReadStatus() int32 {
- if x != nil && x.ReadStatus != nil {
- return *x.ReadStatus
- }
- return 0
-}
-
-func (x *HeartBeatRequestC2B) GetPartitionInfo() []string {
- if x != nil {
- return x.PartitionInfo
- }
- return nil
-}
-
-func (x *HeartBeatRequestC2B) GetSsdStoreId() int64 {
- if x != nil && x.SsdStoreId != nil {
- return *x.SsdStoreId
- }
- return 0
-}
-
-func (x *HeartBeatRequestC2B) GetQryPriorityId() int32 {
- if x != nil && x.QryPriorityId != nil {
- return *x.QryPriorityId
- }
- return 0
-}
-
-func (x *HeartBeatRequestC2B) GetAuthInfo() *AuthorizedInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-type HeartBeatResponseB2C struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
- HasPartFailure *bool `protobuf:"varint,4,opt,name=hasPartFailure" json:"hasPartFailure,omitempty"`
- // failCode:brokerId:host:port:topic:partitionId:delayTimeStamp
- FailureInfo []string `protobuf:"bytes,5,rep,name=failureInfo" json:"failureInfo,omitempty"`
- RequireAuth *bool `protobuf:"varint,6,opt,name=requireAuth" json:"requireAuth,omitempty"`
-}
-
-func (x *HeartBeatResponseB2C) Reset() {
- *x = HeartBeatResponseB2C{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[7]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *HeartBeatResponseB2C) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*HeartBeatResponseB2C) ProtoMessage() {}
-
-func (x *HeartBeatResponseB2C) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[7]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use HeartBeatResponseB2C.ProtoReflect.Descriptor instead.
-func (*HeartBeatResponseB2C) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{7}
-}
-
-func (x *HeartBeatResponseB2C) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *HeartBeatResponseB2C) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *HeartBeatResponseB2C) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *HeartBeatResponseB2C) GetHasPartFailure() bool {
- if x != nil && x.HasPartFailure != nil {
- return *x.HasPartFailure
- }
- return false
-}
-
-func (x *HeartBeatResponseB2C) GetFailureInfo() []string {
- if x != nil {
- return x.FailureInfo
- }
- return nil
-}
-
-func (x *HeartBeatResponseB2C) GetRequireAuth() bool {
- if x != nil && x.RequireAuth != nil {
- return *x.RequireAuth
- }
- return false
-}
-
-type GetMessageRequestC2B struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- PartitionId *int32 `protobuf:"varint,2,req,name=partitionId" json:"partitionId,omitempty"`
- GroupName *string `protobuf:"bytes,3,req,name=groupName" json:"groupName,omitempty"`
- TopicName *string `protobuf:"bytes,4,req,name=topicName" json:"topicName,omitempty"`
- LastPackConsumed *bool `protobuf:"varint,5,opt,name=lastPackConsumed" json:"lastPackConsumed,omitempty"`
- ManualCommitOffset *bool `protobuf:"varint,6,opt,name=manualCommitOffset" json:"manualCommitOffset,omitempty"`
- EscFlowCtrl *bool `protobuf:"varint,7,opt,name=escFlowCtrl" json:"escFlowCtrl,omitempty"`
-}
-
-func (x *GetMessageRequestC2B) Reset() {
- *x = GetMessageRequestC2B{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[8]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *GetMessageRequestC2B) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetMessageRequestC2B) ProtoMessage() {}
-
-func (x *GetMessageRequestC2B) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[8]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use GetMessageRequestC2B.ProtoReflect.Descriptor instead.
-func (*GetMessageRequestC2B) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{8}
-}
-
-func (x *GetMessageRequestC2B) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *GetMessageRequestC2B) GetPartitionId() int32 {
- if x != nil && x.PartitionId != nil {
- return *x.PartitionId
- }
- return 0
-}
-
-func (x *GetMessageRequestC2B) GetGroupName() string {
- if x != nil && x.GroupName != nil {
- return *x.GroupName
- }
- return ""
-}
-
-func (x *GetMessageRequestC2B) GetTopicName() string {
- if x != nil && x.TopicName != nil {
- return *x.TopicName
- }
- return ""
-}
-
-func (x *GetMessageRequestC2B) GetLastPackConsumed() bool {
- if x != nil && x.LastPackConsumed != nil {
- return *x.LastPackConsumed
- }
- return false
-}
-
-func (x *GetMessageRequestC2B) GetManualCommitOffset() bool {
- if x != nil && x.ManualCommitOffset != nil {
- return *x.ManualCommitOffset
- }
- return false
-}
-
-func (x *GetMessageRequestC2B) GetEscFlowCtrl() bool {
- if x != nil && x.EscFlowCtrl != nil {
- return *x.EscFlowCtrl
- }
- return false
-}
-
-type GetMessageResponseB2C struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,opt,name=errMsg" json:"errMsg,omitempty"`
- Messages []*TransferedMessage `protobuf:"bytes,4,rep,name=messages" json:"messages,omitempty"`
- CurrOffset *int64 `protobuf:"varint,5,opt,name=currOffset" json:"currOffset,omitempty"`
- MinLimitTime *int32 `protobuf:"varint,6,opt,name=minLimitTime" json:"minLimitTime,omitempty"`
- EscFlowCtrl *bool `protobuf:"varint,7,opt,name=escFlowCtrl" json:"escFlowCtrl,omitempty"`
- CurrDataDlt *int64 `protobuf:"varint,8,opt,name=currDataDlt" json:"currDataDlt,omitempty"`
- RequireSlow *bool `protobuf:"varint,9,opt,name=requireSlow" json:"requireSlow,omitempty"`
- MaxOffset *int64 `protobuf:"varint,10,opt,name=maxOffset" json:"maxOffset,omitempty"`
-}
-
-func (x *GetMessageResponseB2C) Reset() {
- *x = GetMessageResponseB2C{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[9]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *GetMessageResponseB2C) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetMessageResponseB2C) ProtoMessage() {}
-
-func (x *GetMessageResponseB2C) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[9]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use GetMessageResponseB2C.ProtoReflect.Descriptor instead.
-func (*GetMessageResponseB2C) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{9}
-}
-
-func (x *GetMessageResponseB2C) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *GetMessageResponseB2C) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *GetMessageResponseB2C) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *GetMessageResponseB2C) GetMessages() []*TransferedMessage {
- if x != nil {
- return x.Messages
- }
- return nil
-}
-
-func (x *GetMessageResponseB2C) GetCurrOffset() int64 {
- if x != nil && x.CurrOffset != nil {
- return *x.CurrOffset
- }
- return 0
-}
-
-func (x *GetMessageResponseB2C) GetMinLimitTime() int32 {
- if x != nil && x.MinLimitTime != nil {
- return *x.MinLimitTime
- }
- return 0
-}
-
-func (x *GetMessageResponseB2C) GetEscFlowCtrl() bool {
- if x != nil && x.EscFlowCtrl != nil {
- return *x.EscFlowCtrl
- }
- return false
-}
-
-func (x *GetMessageResponseB2C) GetCurrDataDlt() int64 {
- if x != nil && x.CurrDataDlt != nil {
- return *x.CurrDataDlt
- }
- return 0
-}
-
-func (x *GetMessageResponseB2C) GetRequireSlow() bool {
- if x != nil && x.RequireSlow != nil {
- return *x.RequireSlow
- }
- return false
-}
-
-func (x *GetMessageResponseB2C) GetMaxOffset() int64 {
- if x != nil && x.MaxOffset != nil {
- return *x.MaxOffset
- }
- return 0
-}
-
-type CommitOffsetRequestC2B struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- TopicName *string `protobuf:"bytes,2,req,name=topicName" json:"topicName,omitempty"`
- PartitionId *int32 `protobuf:"varint,3,req,name=partitionId" json:"partitionId,omitempty"`
- GroupName *string `protobuf:"bytes,4,req,name=groupName" json:"groupName,omitempty"`
- LastPackConsumed *bool `protobuf:"varint,5,opt,name=lastPackConsumed" json:"lastPackConsumed,omitempty"`
-}
-
-func (x *CommitOffsetRequestC2B) Reset() {
- *x = CommitOffsetRequestC2B{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[10]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CommitOffsetRequestC2B) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CommitOffsetRequestC2B) ProtoMessage() {}
-
-func (x *CommitOffsetRequestC2B) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[10]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CommitOffsetRequestC2B.ProtoReflect.Descriptor instead.
-func (*CommitOffsetRequestC2B) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{10}
-}
-
-func (x *CommitOffsetRequestC2B) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *CommitOffsetRequestC2B) GetTopicName() string {
- if x != nil && x.TopicName != nil {
- return *x.TopicName
- }
- return ""
-}
-
-func (x *CommitOffsetRequestC2B) GetPartitionId() int32 {
- if x != nil && x.PartitionId != nil {
- return *x.PartitionId
- }
- return 0
-}
-
-func (x *CommitOffsetRequestC2B) GetGroupName() string {
- if x != nil && x.GroupName != nil {
- return *x.GroupName
- }
- return ""
-}
-
-func (x *CommitOffsetRequestC2B) GetLastPackConsumed() bool {
- if x != nil && x.LastPackConsumed != nil {
- return *x.LastPackConsumed
- }
- return false
-}
-
-type CommitOffsetResponseB2C struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
- CurrOffset *int64 `protobuf:"varint,4,opt,name=currOffset" json:"currOffset,omitempty"`
- MaxOffset *int64 `protobuf:"varint,5,opt,name=maxOffset" json:"maxOffset,omitempty"`
-}
-
-func (x *CommitOffsetResponseB2C) Reset() {
- *x = CommitOffsetResponseB2C{}
- if protoimpl.UnsafeEnabled {
- mi := &file_BrokerService_proto_msgTypes[11]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CommitOffsetResponseB2C) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CommitOffsetResponseB2C) ProtoMessage() {}
-
-func (x *CommitOffsetResponseB2C) ProtoReflect() protoreflect.Message {
- mi := &file_BrokerService_proto_msgTypes[11]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CommitOffsetResponseB2C.ProtoReflect.Descriptor instead.
-func (*CommitOffsetResponseB2C) Descriptor() ([]byte, []int) {
- return file_BrokerService_proto_rawDescGZIP(), []int{11}
-}
-
-func (x *CommitOffsetResponseB2C) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *CommitOffsetResponseB2C) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *CommitOffsetResponseB2C) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *CommitOffsetResponseB2C) GetCurrOffset() int64 {
- if x != nil && x.CurrOffset != nil {
- return *x.CurrOffset
- }
- return 0
-}
-
-func (x *CommitOffsetResponseB2C) GetMaxOffset() int64 {
- if x != nil && x.MaxOffset != nil {
- return *x.MaxOffset
- }
- return 0
-}
-
-var File_BrokerService_proto protoreflect.FileDescriptor
-
-var file_BrokerService_proto_rawDesc = []byte{
- 0x0a, 0x13, 0x42, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
- 0x65, 0x72, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6d,
- 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x02, 0x28, 0x03, 0x52, 0x09,
- 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x65,
- 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x02, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x65,
- 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x4c, 0x6f, 0x61, 0x64,
- 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x4c,
- 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18,
- 0x04, 0x20, 0x02, 0x28, 0x05, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x22, 0x76, 0x0a, 0x0e, 0x41,
- 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x32, 0x0a,
- 0x14, 0x76, 0x69, 0x73, 0x69, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64,
- 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x02, 0x28, 0x03, 0x52, 0x14, 0x76, 0x69, 0x73,
- 0x69, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65,
- 0x6e, 0x12, 0x30, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
- 0x7a, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13,
- 0x61, 0x75, 0x74, 0x68, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x54, 0x6f,
- 0x6b, 0x65, 0x6e, 0x22, 0xb4, 0x02, 0x0a, 0x15, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x32, 0x42, 0x12, 0x1a, 0x0a,
- 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52,
- 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x70,
- 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f,
- 0x70, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69,
- 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x02, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61,
- 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74,
- 0x61, 0x18, 0x04, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a,
- 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x05, 0x20, 0x02, 0x28, 0x05, 0x52, 0x04, 0x66, 0x6c, 0x61,
- 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x18, 0x06, 0x20,
- 0x02, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x12, 0x1a, 0x0a,
- 0x08, 0x73, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x18, 0x07, 0x20, 0x02, 0x28, 0x05, 0x52,
- 0x08, 0x73, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67,
- 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54,
- 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2b, 0x0a,
- 0x08, 0x61, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x0f, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f,
- 0x52, 0x08, 0x61, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xe8, 0x01, 0x0a, 0x16, 0x53,
- 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x42, 0x32, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
- 0x18, 0x01, 0x20, 0x02, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12,
- 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x05,
- 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72,
- 0x4d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x02, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73,
- 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x41, 0x75, 0x74, 0x68,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x41,
- 0x75, 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64,
- 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49,
- 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18,
- 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d,
- 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65,
- 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f,
- 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0xc1, 0x03, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
- 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x32, 0x42, 0x12, 0x16, 0x0a, 0x06,
- 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x02, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x70,
- 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64,
- 0x18, 0x02, 0x20, 0x02, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64,
- 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
- 0x02, 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c,
- 0x0a, 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x02, 0x28,
- 0x09, 0x52, 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b,
- 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x05, 0x20, 0x02, 0x28,
- 0x05, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1e,
- 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x02,
- 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24,
- 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18,
- 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e,
- 0x64, 0x53, 0x74, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x75, 0x72, 0x72, 0x4f, 0x66, 0x66, 0x73,
- 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x75, 0x72, 0x72, 0x4f, 0x66,
- 0x66, 0x73, 0x65, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4b,
- 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f,
- 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54,
- 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69,
- 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x73, 0x64, 0x53, 0x74, 0x6f,
- 0x72, 0x65, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x73, 0x73, 0x64, 0x53,
- 0x74, 0x6f, 0x72, 0x65, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x71, 0x72, 0x79, 0x50, 0x72, 0x69,
- 0x6f, 0x72, 0x69, 0x74, 0x79, 0x49, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x71,
- 0x72, 0x79, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x08,
- 0x61, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f,
- 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52,
- 0x08, 0x61, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x9f, 0x01, 0x0a, 0x13, 0x52, 0x65,
- 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x32,
- 0x43, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x02,
- 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65,
- 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72,
- 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18,
- 0x03, 0x20, 0x02, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1e, 0x0a,
- 0x0a, 0x63, 0x75, 0x72, 0x72, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28,
- 0x03, 0x52, 0x0a, 0x63, 0x75, 0x72, 0x72, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1c, 0x0a,
- 0x09, 0x6d, 0x61, 0x78, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
- 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x88, 0x02, 0x0a, 0x13,
- 0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x43, 0x32, 0x42, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18,
- 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12,
- 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x02,
- 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a,
- 0x0a, 0x72, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x02, 0x28,
- 0x05, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a,
- 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x04,
- 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49,
- 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x73, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49,
- 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x73, 0x73, 0x64, 0x53, 0x74, 0x6f, 0x72,
- 0x65, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x71, 0x72, 0x79, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69,
- 0x74, 0x79, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x71, 0x72, 0x79, 0x50,
- 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x08, 0x61, 0x75, 0x74,
- 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x41, 0x75,
- 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x61, 0x75,
- 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xce, 0x01, 0x0a, 0x14, 0x48, 0x65, 0x61, 0x72, 0x74,
- 0x42, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x32, 0x43, 0x12,
- 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x02, 0x28, 0x08,
- 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72,
- 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43,
- 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x03, 0x20,
- 0x02, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x26, 0x0a, 0x0e, 0x68,
- 0x61, 0x73, 0x50, 0x61, 0x72, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x08, 0x52, 0x0e, 0x68, 0x61, 0x73, 0x50, 0x61, 0x72, 0x74, 0x46, 0x61, 0x69, 0x6c,
- 0x75, 0x72, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x49, 0x6e,
- 0x66, 0x6f, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72,
- 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65,
- 0x41, 0x75, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75,
- 0x69, 0x72, 0x65, 0x41, 0x75, 0x74, 0x68, 0x22, 0x8e, 0x02, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4d,
- 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x32, 0x42,
- 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x02,
- 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b,
- 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x02, 0x28,
- 0x05, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1c,
- 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x02, 0x28,
- 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09,
- 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x02, 0x28, 0x09, 0x52,
- 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x6c, 0x61,
- 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x18, 0x05,
- 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x43, 0x6f,
- 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c,
- 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01,
- 0x28, 0x08, 0x52, 0x12, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
- 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x73, 0x63, 0x46, 0x6c, 0x6f,
- 0x77, 0x43, 0x74, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x73, 0x63,
- 0x46, 0x6c, 0x6f, 0x77, 0x43, 0x74, 0x72, 0x6c, 0x22, 0xdb, 0x02, 0x0a, 0x15, 0x47, 0x65, 0x74,
- 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42,
- 0x32, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20,
- 0x02, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07,
- 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x05, 0x52, 0x07, 0x65,
- 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67,
- 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x2e,
- 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
- 0x32, 0x12, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x65, 0x64, 0x4d, 0x65, 0x73,
- 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1e,
- 0x0a, 0x0a, 0x63, 0x75, 0x72, 0x72, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01,
- 0x28, 0x03, 0x52, 0x0a, 0x63, 0x75, 0x72, 0x72, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x22,
- 0x0a, 0x0c, 0x6d, 0x69, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x54, 0x69,
- 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x73, 0x63, 0x46, 0x6c, 0x6f, 0x77, 0x43, 0x74, 0x72,
- 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x73, 0x63, 0x46, 0x6c, 0x6f, 0x77,
- 0x43, 0x74, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x75, 0x72, 0x72, 0x44, 0x61, 0x74, 0x61,
- 0x44, 0x6c, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x75, 0x72, 0x72, 0x44,
- 0x61, 0x74, 0x61, 0x44, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72,
- 0x65, 0x53, 0x6c, 0x6f, 0x77, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x72, 0x65, 0x71,
- 0x75, 0x69, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x77, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x4f,
- 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78,
- 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0xbe, 0x01, 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
- 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x32,
- 0x42, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20,
- 0x02, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a,
- 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x09,
- 0x52, 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70,
- 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x02, 0x28, 0x05,
- 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1c, 0x0a,
- 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x02, 0x28, 0x09,
- 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x6c,
- 0x61, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x18,
- 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x43,
- 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x22, 0xa3, 0x01, 0x0a, 0x17, 0x43, 0x6f, 0x6d, 0x6d,
- 0x69, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x42, 0x32, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01,
- 0x20, 0x02, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a,
- 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x05, 0x52, 0x07,
- 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73,
- 0x67, 0x18, 0x03, 0x20, 0x02, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12,
- 0x1e, 0x0a, 0x0a, 0x63, 0x75, 0x72, 0x72, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x75, 0x72, 0x72, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12,
- 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01,
- 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x42, 0x57, 0x0a,
- 0x34, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x69, 0x6e, 0x6c, 0x6f,
- 0x6e, 0x67, 0x2e, 0x74, 0x75, 0x62, 0x65, 0x6d, 0x71, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x67, 0x65, 0x6e, 0x65,
- 0x72, 0x61, 0x74, 0x65, 0x64, 0x42, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x6f,
- 0x6b, 0x65, 0x72, 0x48, 0x01, 0x5a, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f,
- 0x88, 0x01, 0x01, 0xa0, 0x01, 0x01,
-}
-
-var (
- file_BrokerService_proto_rawDescOnce sync.Once
- file_BrokerService_proto_rawDescData = file_BrokerService_proto_rawDesc
-)
-
-func file_BrokerService_proto_rawDescGZIP() []byte {
- file_BrokerService_proto_rawDescOnce.Do(func() {
- file_BrokerService_proto_rawDescData = protoimpl.X.CompressGZIP(file_BrokerService_proto_rawDescData)
- })
- return file_BrokerService_proto_rawDescData
-}
-
-var file_BrokerService_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
-var file_BrokerService_proto_goTypes = []interface{}{
- (*TransferedMessage)(nil), // 0: TransferedMessage
- (*AuthorizedInfo)(nil), // 1: AuthorizedInfo
- (*SendMessageRequestP2B)(nil), // 2: SendMessageRequestP2B
- (*SendMessageResponseB2P)(nil), // 3: SendMessageResponseB2P
- (*RegisterRequestC2B)(nil), // 4: RegisterRequestC2B
- (*RegisterResponseB2C)(nil), // 5: RegisterResponseB2C
- (*HeartBeatRequestC2B)(nil), // 6: HeartBeatRequestC2B
- (*HeartBeatResponseB2C)(nil), // 7: HeartBeatResponseB2C
- (*GetMessageRequestC2B)(nil), // 8: GetMessageRequestC2B
- (*GetMessageResponseB2C)(nil), // 9: GetMessageResponseB2C
- (*CommitOffsetRequestC2B)(nil), // 10: CommitOffsetRequestC2B
- (*CommitOffsetResponseB2C)(nil), // 11: CommitOffsetResponseB2C
-}
-var file_BrokerService_proto_depIdxs = []int32{
- 1, // 0: SendMessageRequestP2B.authInfo:type_name -> AuthorizedInfo
- 1, // 1: RegisterRequestC2B.authInfo:type_name -> AuthorizedInfo
- 1, // 2: HeartBeatRequestC2B.authInfo:type_name -> AuthorizedInfo
- 0, // 3: GetMessageResponseB2C.messages:type_name -> TransferedMessage
- 4, // [4:4] is the sub-list for method output_type
- 4, // [4:4] is the sub-list for method input_type
- 4, // [4:4] is the sub-list for extension type_name
- 4, // [4:4] is the sub-list for extension extendee
- 0, // [0:4] is the sub-list for field type_name
-}
-
-func init() { file_BrokerService_proto_init() }
-func file_BrokerService_proto_init() {
- if File_BrokerService_proto != nil {
- return
- }
- if !protoimpl.UnsafeEnabled {
- file_BrokerService_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*TransferedMessage); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*AuthorizedInfo); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*SendMessageRequestP2B); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*SendMessageResponseB2P); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RegisterRequestC2B); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RegisterResponseB2C); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*HeartBeatRequestC2B); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*HeartBeatResponseB2C); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*GetMessageRequestC2B); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*GetMessageResponseB2C); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*CommitOffsetRequestC2B); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_BrokerService_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*CommitOffsetResponseB2C); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_BrokerService_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 12,
- NumExtensions: 0,
- NumServices: 0,
- },
- GoTypes: file_BrokerService_proto_goTypes,
- DependencyIndexes: file_BrokerService_proto_depIdxs,
- MessageInfos: file_BrokerService_proto_msgTypes,
- }.Build()
- File_BrokerService_proto = out.File
- file_BrokerService_proto_rawDesc = nil
- file_BrokerService_proto_goTypes = nil
- file_BrokerService_proto_depIdxs = nil
-}
diff --git a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/protocol/MasterService.pb.go b/inlong-tubemq/tubemq-client-twins/tubemq-client-go/protocol/MasterService.pb.go
deleted file mode 100644
index 6eccef1..0000000
--- a/inlong-tubemq/tubemq-client-twins/tubemq-client-go/protocol/MasterService.pb.go
+++ /dev/null
@@ -1,5147 +0,0 @@
-//*
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.26.0
-// protoc v3.17.3
-// source: MasterService.proto
-
-package protocol
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- reflect "reflect"
- sync "sync"
-)
-
-const (
- // Verify that this generated code is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
- // Verify that runtime/protoimpl is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type EventProto struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- RebalanceId *int64 `protobuf:"varint,1,opt,name=rebalanceId" json:"rebalanceId,omitempty"`
- OpType *int32 `protobuf:"varint,2,opt,name=opType" json:"opType,omitempty"`
- Status *int32 `protobuf:"varint,3,opt,name=status" json:"status,omitempty"`
- // consumerId@group-brokerId:host:port-topic:partitionId
- SubscribeInfo []string `protobuf:"bytes,4,rep,name=subscribeInfo" json:"subscribeInfo,omitempty"`
-}
-
-func (x *EventProto) Reset() {
- *x = EventProto{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *EventProto) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*EventProto) ProtoMessage() {}
-
-func (x *EventProto) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[0]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use EventProto.ProtoReflect.Descriptor instead.
-func (*EventProto) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *EventProto) GetRebalanceId() int64 {
- if x != nil && x.RebalanceId != nil {
- return *x.RebalanceId
- }
- return 0
-}
-
-func (x *EventProto) GetOpType() int32 {
- if x != nil && x.OpType != nil {
- return *x.OpType
- }
- return 0
-}
-
-func (x *EventProto) GetStatus() int32 {
- if x != nil && x.Status != nil {
- return *x.Status
- }
- return 0
-}
-
-func (x *EventProto) GetSubscribeInfo() []string {
- if x != nil {
- return x.SubscribeInfo
- }
- return nil
-}
-
-type EnableBrokerFunInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- EnableConsumeAuthenticate *bool `protobuf:"varint,1,req,name=enableConsumeAuthenticate" json:"enableConsumeAuthenticate,omitempty"`
- EnableConsumeAuthorize *bool `protobuf:"varint,2,req,name=enableConsumeAuthorize" json:"enableConsumeAuthorize,omitempty"`
- EnableProduceAuthenticate *bool `protobuf:"varint,3,req,name=enableProduceAuthenticate" json:"enableProduceAuthenticate,omitempty"`
- EnableProduceAuthorize *bool `protobuf:"varint,4,req,name=enableProduceAuthorize" json:"enableProduceAuthorize,omitempty"`
- EnableVisitTokenCheck *bool `protobuf:"varint,5,opt,name=enableVisitTokenCheck" json:"enableVisitTokenCheck,omitempty"`
-}
-
-func (x *EnableBrokerFunInfo) Reset() {
- *x = EnableBrokerFunInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *EnableBrokerFunInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*EnableBrokerFunInfo) ProtoMessage() {}
-
-func (x *EnableBrokerFunInfo) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[1]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use EnableBrokerFunInfo.ProtoReflect.Descriptor instead.
-func (*EnableBrokerFunInfo) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *EnableBrokerFunInfo) GetEnableConsumeAuthenticate() bool {
- if x != nil && x.EnableConsumeAuthenticate != nil {
- return *x.EnableConsumeAuthenticate
- }
- return false
-}
-
-func (x *EnableBrokerFunInfo) GetEnableConsumeAuthorize() bool {
- if x != nil && x.EnableConsumeAuthorize != nil {
- return *x.EnableConsumeAuthorize
- }
- return false
-}
-
-func (x *EnableBrokerFunInfo) GetEnableProduceAuthenticate() bool {
- if x != nil && x.EnableProduceAuthenticate != nil {
- return *x.EnableProduceAuthenticate
- }
- return false
-}
-
-func (x *EnableBrokerFunInfo) GetEnableProduceAuthorize() bool {
- if x != nil && x.EnableProduceAuthorize != nil {
- return *x.EnableProduceAuthorize
- }
- return false
-}
-
-func (x *EnableBrokerFunInfo) GetEnableVisitTokenCheck() bool {
- if x != nil && x.EnableVisitTokenCheck != nil {
- return *x.EnableVisitTokenCheck
- }
- return false
-}
-
-type AuthenticateInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- UserName *string `protobuf:"bytes,1,req,name=userName" json:"userName,omitempty"`
- Timestamp *int64 `protobuf:"varint,2,req,name=timestamp" json:"timestamp,omitempty"`
- Nonce *int32 `protobuf:"varint,3,req,name=nonce" json:"nonce,omitempty"`
- OthParams *string `protobuf:"bytes,4,req,name=othParams" json:"othParams,omitempty"`
- Signature *string `protobuf:"bytes,5,req,name=signature" json:"signature,omitempty"`
-}
-
-func (x *AuthenticateInfo) Reset() {
- *x = AuthenticateInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *AuthenticateInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*AuthenticateInfo) ProtoMessage() {}
-
-func (x *AuthenticateInfo) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[2]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use AuthenticateInfo.ProtoReflect.Descriptor instead.
-func (*AuthenticateInfo) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *AuthenticateInfo) GetUserName() string {
- if x != nil && x.UserName != nil {
- return *x.UserName
- }
- return ""
-}
-
-func (x *AuthenticateInfo) GetTimestamp() int64 {
- if x != nil && x.Timestamp != nil {
- return *x.Timestamp
- }
- return 0
-}
-
-func (x *AuthenticateInfo) GetNonce() int32 {
- if x != nil && x.Nonce != nil {
- return *x.Nonce
- }
- return 0
-}
-
-func (x *AuthenticateInfo) GetOthParams() string {
- if x != nil && x.OthParams != nil {
- return *x.OthParams
- }
- return ""
-}
-
-func (x *AuthenticateInfo) GetSignature() string {
- if x != nil && x.Signature != nil {
- return *x.Signature
- }
- return ""
-}
-
-type MasterCertificateInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- AuthInfo *AuthenticateInfo `protobuf:"bytes,1,opt,name=authInfo" json:"authInfo,omitempty"`
- AuthorizedToken *string `protobuf:"bytes,2,opt,name=authorizedToken" json:"authorizedToken,omitempty"`
-}
-
-func (x *MasterCertificateInfo) Reset() {
- *x = MasterCertificateInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *MasterCertificateInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*MasterCertificateInfo) ProtoMessage() {}
-
-func (x *MasterCertificateInfo) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[3]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use MasterCertificateInfo.ProtoReflect.Descriptor instead.
-func (*MasterCertificateInfo) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *MasterCertificateInfo) GetAuthInfo() *AuthenticateInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-func (x *MasterCertificateInfo) GetAuthorizedToken() string {
- if x != nil && x.AuthorizedToken != nil {
- return *x.AuthorizedToken
- }
- return ""
-}
-
-type MasterAuthorizedInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- VisitAuthorizedToken *int64 `protobuf:"varint,1,req,name=visitAuthorizedToken" json:"visitAuthorizedToken,omitempty"`
- AuthAuthorizedToken *string `protobuf:"bytes,2,opt,name=authAuthorizedToken" json:"authAuthorizedToken,omitempty"`
-}
-
-func (x *MasterAuthorizedInfo) Reset() {
- *x = MasterAuthorizedInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[4]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *MasterAuthorizedInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*MasterAuthorizedInfo) ProtoMessage() {}
-
-func (x *MasterAuthorizedInfo) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[4]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use MasterAuthorizedInfo.ProtoReflect.Descriptor instead.
-func (*MasterAuthorizedInfo) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{4}
-}
-
-func (x *MasterAuthorizedInfo) GetVisitAuthorizedToken() int64 {
- if x != nil && x.VisitAuthorizedToken != nil {
- return *x.VisitAuthorizedToken
- }
- return 0
-}
-
-func (x *MasterAuthorizedInfo) GetAuthAuthorizedToken() string {
- if x != nil && x.AuthAuthorizedToken != nil {
- return *x.AuthAuthorizedToken
- }
- return ""
-}
-
-type MasterBrokerAuthorizedInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- VisitAuthorizedToken *string `protobuf:"bytes,1,req,name=visitAuthorizedToken" json:"visitAuthorizedToken,omitempty"`
- AuthAuthorizedToken *string `protobuf:"bytes,2,opt,name=authAuthorizedToken" json:"authAuthorizedToken,omitempty"`
-}
-
-func (x *MasterBrokerAuthorizedInfo) Reset() {
- *x = MasterBrokerAuthorizedInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[5]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *MasterBrokerAuthorizedInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*MasterBrokerAuthorizedInfo) ProtoMessage() {}
-
-func (x *MasterBrokerAuthorizedInfo) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[5]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use MasterBrokerAuthorizedInfo.ProtoReflect.Descriptor instead.
-func (*MasterBrokerAuthorizedInfo) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{5}
-}
-
-func (x *MasterBrokerAuthorizedInfo) GetVisitAuthorizedToken() string {
- if x != nil && x.VisitAuthorizedToken != nil {
- return *x.VisitAuthorizedToken
- }
- return ""
-}
-
-func (x *MasterBrokerAuthorizedInfo) GetAuthAuthorizedToken() string {
- if x != nil && x.AuthAuthorizedToken != nil {
- return *x.AuthAuthorizedToken
- }
- return ""
-}
-
-type ApprovedClientConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ConfigId *int64 `protobuf:"varint,1,req,name=configId" json:"configId,omitempty"`
- MaxMsgSize *int32 `protobuf:"varint,2,opt,name=maxMsgSize" json:"maxMsgSize,omitempty"`
-}
-
-func (x *ApprovedClientConfig) Reset() {
- *x = ApprovedClientConfig{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[6]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *ApprovedClientConfig) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ApprovedClientConfig) ProtoMessage() {}
-
-func (x *ApprovedClientConfig) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[6]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ApprovedClientConfig.ProtoReflect.Descriptor instead.
-func (*ApprovedClientConfig) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{6}
-}
-
-func (x *ApprovedClientConfig) GetConfigId() int64 {
- if x != nil && x.ConfigId != nil {
- return *x.ConfigId
- }
- return 0
-}
-
-func (x *ApprovedClientConfig) GetMaxMsgSize() int32 {
- if x != nil && x.MaxMsgSize != nil {
- return *x.MaxMsgSize
- }
- return 0
-}
-
-type ClusterConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ConfigId *int64 `protobuf:"varint,1,req,name=configId" json:"configId,omitempty"`
- MaxMsgSize *int32 `protobuf:"varint,2,opt,name=maxMsgSize" json:"maxMsgSize,omitempty"`
-}
-
-func (x *ClusterConfig) Reset() {
- *x = ClusterConfig{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[7]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *ClusterConfig) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ClusterConfig) ProtoMessage() {}
-
-func (x *ClusterConfig) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[7]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ClusterConfig.ProtoReflect.Descriptor instead.
-func (*ClusterConfig) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{7}
-}
-
-func (x *ClusterConfig) GetConfigId() int64 {
- if x != nil && x.ConfigId != nil {
- return *x.ConfigId
- }
- return 0
-}
-
-func (x *ClusterConfig) GetMaxMsgSize() int32 {
- if x != nil && x.MaxMsgSize != nil {
- return *x.MaxMsgSize
- }
- return 0
-}
-
-type RegisterRequestP2M struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- TopicList []string `protobuf:"bytes,2,rep,name=topicList" json:"topicList,omitempty"`
- BrokerCheckSum *int64 `protobuf:"varint,3,req,name=brokerCheckSum" json:"brokerCheckSum,omitempty"`
- HostName *string `protobuf:"bytes,4,req,name=hostName" json:"hostName,omitempty"`
- AuthInfo *MasterCertificateInfo `protobuf:"bytes,5,opt,name=authInfo" json:"authInfo,omitempty"`
- JdkVersion *string `protobuf:"bytes,6,opt,name=jdkVersion" json:"jdkVersion,omitempty"`
- AppdConfig *ApprovedClientConfig `protobuf:"bytes,7,opt,name=appdConfig" json:"appdConfig,omitempty"`
-}
-
-func (x *RegisterRequestP2M) Reset() {
- *x = RegisterRequestP2M{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[8]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RegisterRequestP2M) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RegisterRequestP2M) ProtoMessage() {}
-
-func (x *RegisterRequestP2M) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[8]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use RegisterRequestP2M.ProtoReflect.Descriptor instead.
-func (*RegisterRequestP2M) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{8}
-}
-
-func (x *RegisterRequestP2M) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *RegisterRequestP2M) GetTopicList() []string {
- if x != nil {
- return x.TopicList
- }
- return nil
-}
-
-func (x *RegisterRequestP2M) GetBrokerCheckSum() int64 {
- if x != nil && x.BrokerCheckSum != nil {
- return *x.BrokerCheckSum
- }
- return 0
-}
-
-func (x *RegisterRequestP2M) GetHostName() string {
- if x != nil && x.HostName != nil {
- return *x.HostName
- }
- return ""
-}
-
-func (x *RegisterRequestP2M) GetAuthInfo() *MasterCertificateInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-func (x *RegisterRequestP2M) GetJdkVersion() string {
- if x != nil && x.JdkVersion != nil {
- return *x.JdkVersion
- }
- return ""
-}
-
-func (x *RegisterRequestP2M) GetAppdConfig() *ApprovedClientConfig {
- if x != nil {
- return x.AppdConfig
- }
- return nil
-}
-
-type RegisterResponseM2P struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
- BrokerCheckSum *int64 `protobuf:"varint,4,req,name=brokerCheckSum" json:"brokerCheckSum,omitempty"`
- BrokerInfos []string `protobuf:"bytes,5,rep,name=brokerInfos" json:"brokerInfos,omitempty"`
- AuthorizedInfo *MasterAuthorizedInfo `protobuf:"bytes,6,opt,name=authorizedInfo" json:"authorizedInfo,omitempty"`
- AppdConfig *ApprovedClientConfig `protobuf:"bytes,7,opt,name=appdConfig" json:"appdConfig,omitempty"`
-}
-
-func (x *RegisterResponseM2P) Reset() {
- *x = RegisterResponseM2P{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[9]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RegisterResponseM2P) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RegisterResponseM2P) ProtoMessage() {}
-
-func (x *RegisterResponseM2P) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[9]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use RegisterResponseM2P.ProtoReflect.Descriptor instead.
-func (*RegisterResponseM2P) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{9}
-}
-
-func (x *RegisterResponseM2P) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *RegisterResponseM2P) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *RegisterResponseM2P) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *RegisterResponseM2P) GetBrokerCheckSum() int64 {
- if x != nil && x.BrokerCheckSum != nil {
- return *x.BrokerCheckSum
- }
- return 0
-}
-
-func (x *RegisterResponseM2P) GetBrokerInfos() []string {
- if x != nil {
- return x.BrokerInfos
- }
- return nil
-}
-
-func (x *RegisterResponseM2P) GetAuthorizedInfo() *MasterAuthorizedInfo {
- if x != nil {
- return x.AuthorizedInfo
- }
- return nil
-}
-
-func (x *RegisterResponseM2P) GetAppdConfig() *ApprovedClientConfig {
- if x != nil {
- return x.AppdConfig
- }
- return nil
-}
-
-type HeartRequestP2M struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- BrokerCheckSum *int64 `protobuf:"varint,2,req,name=brokerCheckSum" json:"brokerCheckSum,omitempty"`
- HostName *string `protobuf:"bytes,3,req,name=hostName" json:"hostName,omitempty"`
- TopicList []string `protobuf:"bytes,4,rep,name=topicList" json:"topicList,omitempty"`
- AuthInfo *MasterCertificateInfo `protobuf:"bytes,5,opt,name=authInfo" json:"authInfo,omitempty"`
- AppdConfig *ApprovedClientConfig `protobuf:"bytes,6,opt,name=appdConfig" json:"appdConfig,omitempty"`
-}
-
-func (x *HeartRequestP2M) Reset() {
- *x = HeartRequestP2M{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[10]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *HeartRequestP2M) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*HeartRequestP2M) ProtoMessage() {}
-
-func (x *HeartRequestP2M) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[10]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use HeartRequestP2M.ProtoReflect.Descriptor instead.
-func (*HeartRequestP2M) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{10}
-}
-
-func (x *HeartRequestP2M) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *HeartRequestP2M) GetBrokerCheckSum() int64 {
- if x != nil && x.BrokerCheckSum != nil {
- return *x.BrokerCheckSum
- }
- return 0
-}
-
-func (x *HeartRequestP2M) GetHostName() string {
- if x != nil && x.HostName != nil {
- return *x.HostName
- }
- return ""
-}
-
-func (x *HeartRequestP2M) GetTopicList() []string {
- if x != nil {
- return x.TopicList
- }
- return nil
-}
-
-func (x *HeartRequestP2M) GetAuthInfo() *MasterCertificateInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-func (x *HeartRequestP2M) GetAppdConfig() *ApprovedClientConfig {
- if x != nil {
- return x.AppdConfig
- }
- return nil
-}
-
-type HeartResponseM2P struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
- BrokerCheckSum *int64 `protobuf:"varint,4,req,name=brokerCheckSum" json:"brokerCheckSum,omitempty"`
- // brokerId:host:port-topic:partitionNum
- TopicInfos []string `protobuf:"bytes,5,rep,name=topicInfos" json:"topicInfos,omitempty"`
- BrokerInfos []string `protobuf:"bytes,6,rep,name=brokerInfos" json:"brokerInfos,omitempty"`
- RequireAuth *bool `protobuf:"varint,7,opt,name=requireAuth" json:"requireAuth,omitempty"`
- AuthorizedInfo *MasterAuthorizedInfo `protobuf:"bytes,8,opt,name=authorizedInfo" json:"authorizedInfo,omitempty"`
- AppdConfig *ApprovedClientConfig `protobuf:"bytes,9,opt,name=appdConfig" json:"appdConfig,omitempty"`
-}
-
-func (x *HeartResponseM2P) Reset() {
- *x = HeartResponseM2P{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[11]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *HeartResponseM2P) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*HeartResponseM2P) ProtoMessage() {}
-
-func (x *HeartResponseM2P) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[11]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use HeartResponseM2P.ProtoReflect.Descriptor instead.
-func (*HeartResponseM2P) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{11}
-}
-
-func (x *HeartResponseM2P) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *HeartResponseM2P) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *HeartResponseM2P) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *HeartResponseM2P) GetBrokerCheckSum() int64 {
- if x != nil && x.BrokerCheckSum != nil {
- return *x.BrokerCheckSum
- }
- return 0
-}
-
-func (x *HeartResponseM2P) GetTopicInfos() []string {
- if x != nil {
- return x.TopicInfos
- }
- return nil
-}
-
-func (x *HeartResponseM2P) GetBrokerInfos() []string {
- if x != nil {
- return x.BrokerInfos
- }
- return nil
-}
-
-func (x *HeartResponseM2P) GetRequireAuth() bool {
- if x != nil && x.RequireAuth != nil {
- return *x.RequireAuth
- }
- return false
-}
-
-func (x *HeartResponseM2P) GetAuthorizedInfo() *MasterAuthorizedInfo {
- if x != nil {
- return x.AuthorizedInfo
- }
- return nil
-}
-
-func (x *HeartResponseM2P) GetAppdConfig() *ApprovedClientConfig {
- if x != nil {
- return x.AppdConfig
- }
- return nil
-}
-
-type CloseRequestP2M struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- AuthInfo *MasterCertificateInfo `protobuf:"bytes,2,opt,name=authInfo" json:"authInfo,omitempty"`
-}
-
-func (x *CloseRequestP2M) Reset() {
- *x = CloseRequestP2M{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[12]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CloseRequestP2M) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CloseRequestP2M) ProtoMessage() {}
-
-func (x *CloseRequestP2M) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[12]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CloseRequestP2M.ProtoReflect.Descriptor instead.
-func (*CloseRequestP2M) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{12}
-}
-
-func (x *CloseRequestP2M) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *CloseRequestP2M) GetAuthInfo() *MasterCertificateInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-type CloseResponseM2P struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
-}
-
-func (x *CloseResponseM2P) Reset() {
- *x = CloseResponseM2P{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[13]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CloseResponseM2P) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CloseResponseM2P) ProtoMessage() {}
-
-func (x *CloseResponseM2P) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[13]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CloseResponseM2P.ProtoReflect.Descriptor instead.
-func (*CloseResponseM2P) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{13}
-}
-
-func (x *CloseResponseM2P) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *CloseResponseM2P) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *CloseResponseM2P) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-type RegisterRequestC2M struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- GroupName *string `protobuf:"bytes,2,req,name=groupName" json:"groupName,omitempty"`
- HostName *string `protobuf:"bytes,3,req,name=hostName" json:"hostName,omitempty"`
- TopicList []string `protobuf:"bytes,4,rep,name=topicList" json:"topicList,omitempty"`
- // consumerId@group-brokerId:host:port-topic:partitionId
- SubscribeInfo []string `protobuf:"bytes,5,rep,name=subscribeInfo" json:"subscribeInfo,omitempty"`
- TopicCondition []string `protobuf:"bytes,6,rep,name=topicCondition" json:"topicCondition,omitempty"`
- RequireBound *bool `protobuf:"varint,7,opt,name=requireBound" json:"requireBound,omitempty"`
- SessionTime *int64 `protobuf:"varint,8,opt,name=sessionTime" json:"sessionTime,omitempty"`
- SessionKey *string `protobuf:"bytes,9,opt,name=sessionKey" json:"sessionKey,omitempty"`
- TotalCount *int32 `protobuf:"varint,10,opt,name=totalCount" json:"totalCount,omitempty"`
- RequiredPartition *string `protobuf:"bytes,11,opt,name=requiredPartition" json:"requiredPartition,omitempty"`
- NotAllocated *bool `protobuf:"varint,12,opt,name=notAllocated" json:"notAllocated,omitempty"`
- SelectBig *bool `protobuf:"varint,13,opt,name=selectBig" json:"selectBig,omitempty"`
- GroupFlowCheckId *int64 `protobuf:"varint,14,opt,name=groupFlowCheckId" json:"groupFlowCheckId,omitempty"`
- DefFlowCheckId *int64 `protobuf:"varint,15,opt,name=defFlowCheckId" json:"defFlowCheckId,omitempty"`
- SsdStoreId *int64 `protobuf:"varint,16,opt,name=ssdStoreId" json:"ssdStoreId,omitempty"` // Deprecated
- QryPriorityId *int32 `protobuf:"varint,17,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- AuthInfo *MasterCertificateInfo `protobuf:"bytes,18,opt,name=authInfo" json:"authInfo,omitempty"`
- JdkVersion *string `protobuf:"bytes,19,opt,name=jdkVersion" json:"jdkVersion,omitempty"`
-}
-
-func (x *RegisterRequestC2M) Reset() {
- *x = RegisterRequestC2M{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[14]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RegisterRequestC2M) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RegisterRequestC2M) ProtoMessage() {}
-
-func (x *RegisterRequestC2M) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[14]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use RegisterRequestC2M.ProtoReflect.Descriptor instead.
-func (*RegisterRequestC2M) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{14}
-}
-
-func (x *RegisterRequestC2M) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *RegisterRequestC2M) GetGroupName() string {
- if x != nil && x.GroupName != nil {
- return *x.GroupName
- }
- return ""
-}
-
-func (x *RegisterRequestC2M) GetHostName() string {
- if x != nil && x.HostName != nil {
- return *x.HostName
- }
- return ""
-}
-
-func (x *RegisterRequestC2M) GetTopicList() []string {
- if x != nil {
- return x.TopicList
- }
- return nil
-}
-
-func (x *RegisterRequestC2M) GetSubscribeInfo() []string {
- if x != nil {
- return x.SubscribeInfo
- }
- return nil
-}
-
-func (x *RegisterRequestC2M) GetTopicCondition() []string {
- if x != nil {
- return x.TopicCondition
- }
- return nil
-}
-
-func (x *RegisterRequestC2M) GetRequireBound() bool {
- if x != nil && x.RequireBound != nil {
- return *x.RequireBound
- }
- return false
-}
-
-func (x *RegisterRequestC2M) GetSessionTime() int64 {
- if x != nil && x.SessionTime != nil {
- return *x.SessionTime
- }
- return 0
-}
-
-func (x *RegisterRequestC2M) GetSessionKey() string {
- if x != nil && x.SessionKey != nil {
- return *x.SessionKey
- }
- return ""
-}
-
-func (x *RegisterRequestC2M) GetTotalCount() int32 {
- if x != nil && x.TotalCount != nil {
- return *x.TotalCount
- }
- return 0
-}
-
-func (x *RegisterRequestC2M) GetRequiredPartition() string {
- if x != nil && x.RequiredPartition != nil {
- return *x.RequiredPartition
- }
- return ""
-}
-
-func (x *RegisterRequestC2M) GetNotAllocated() bool {
- if x != nil && x.NotAllocated != nil {
- return *x.NotAllocated
- }
- return false
-}
-
-func (x *RegisterRequestC2M) GetSelectBig() bool {
- if x != nil && x.SelectBig != nil {
- return *x.SelectBig
- }
- return false
-}
-
-func (x *RegisterRequestC2M) GetGroupFlowCheckId() int64 {
- if x != nil && x.GroupFlowCheckId != nil {
- return *x.GroupFlowCheckId
- }
- return 0
-}
-
-func (x *RegisterRequestC2M) GetDefFlowCheckId() int64 {
- if x != nil && x.DefFlowCheckId != nil {
- return *x.DefFlowCheckId
- }
- return 0
-}
-
-func (x *RegisterRequestC2M) GetSsdStoreId() int64 {
- if x != nil && x.SsdStoreId != nil {
- return *x.SsdStoreId
- }
- return 0
-}
-
-func (x *RegisterRequestC2M) GetQryPriorityId() int32 {
- if x != nil && x.QryPriorityId != nil {
- return *x.QryPriorityId
- }
- return 0
-}
-
-func (x *RegisterRequestC2M) GetAuthInfo() *MasterCertificateInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-func (x *RegisterRequestC2M) GetJdkVersion() string {
- if x != nil && x.JdkVersion != nil {
- return *x.JdkVersion
- }
- return ""
-}
-
-type RegisterResponseM2C struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
- // brokerId:host:port-topic:partitionNum
- TopicInfo []string `protobuf:"bytes,4,rep,name=topicInfo" json:"topicInfo,omitempty"`
- NotAllocated *bool `protobuf:"varint,5,opt,name=notAllocated" json:"notAllocated,omitempty"`
- DefFlowCheckId *int64 `protobuf:"varint,6,opt,name=defFlowCheckId" json:"defFlowCheckId,omitempty"`
- DefFlowControlInfo *string `protobuf:"bytes,7,opt,name=defFlowControlInfo" json:"defFlowControlInfo,omitempty"`
- GroupFlowCheckId *int64 `protobuf:"varint,8,opt,name=groupFlowCheckId" json:"groupFlowCheckId,omitempty"`
- GroupFlowControlInfo *string `protobuf:"bytes,9,opt,name=groupFlowControlInfo" json:"groupFlowControlInfo,omitempty"`
- SsdStoreId *int64 `protobuf:"varint,10,opt,name=ssdStoreId" json:"ssdStoreId,omitempty"` // Deprecated
- QryPriorityId *int32 `protobuf:"varint,11,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- AuthorizedInfo *MasterAuthorizedInfo `protobuf:"bytes,12,opt,name=authorizedInfo" json:"authorizedInfo,omitempty"`
-}
-
-func (x *RegisterResponseM2C) Reset() {
- *x = RegisterResponseM2C{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[15]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RegisterResponseM2C) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RegisterResponseM2C) ProtoMessage() {}
-
-func (x *RegisterResponseM2C) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[15]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use RegisterResponseM2C.ProtoReflect.Descriptor instead.
-func (*RegisterResponseM2C) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{15}
-}
-
-func (x *RegisterResponseM2C) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *RegisterResponseM2C) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *RegisterResponseM2C) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *RegisterResponseM2C) GetTopicInfo() []string {
- if x != nil {
- return x.TopicInfo
- }
- return nil
-}
-
-func (x *RegisterResponseM2C) GetNotAllocated() bool {
- if x != nil && x.NotAllocated != nil {
- return *x.NotAllocated
- }
- return false
-}
-
-func (x *RegisterResponseM2C) GetDefFlowCheckId() int64 {
- if x != nil && x.DefFlowCheckId != nil {
- return *x.DefFlowCheckId
- }
- return 0
-}
-
-func (x *RegisterResponseM2C) GetDefFlowControlInfo() string {
- if x != nil && x.DefFlowControlInfo != nil {
- return *x.DefFlowControlInfo
- }
- return ""
-}
-
-func (x *RegisterResponseM2C) GetGroupFlowCheckId() int64 {
- if x != nil && x.GroupFlowCheckId != nil {
- return *x.GroupFlowCheckId
- }
- return 0
-}
-
-func (x *RegisterResponseM2C) GetGroupFlowControlInfo() string {
- if x != nil && x.GroupFlowControlInfo != nil {
- return *x.GroupFlowControlInfo
- }
- return ""
-}
-
-func (x *RegisterResponseM2C) GetSsdStoreId() int64 {
- if x != nil && x.SsdStoreId != nil {
- return *x.SsdStoreId
- }
- return 0
-}
-
-func (x *RegisterResponseM2C) GetQryPriorityId() int32 {
- if x != nil && x.QryPriorityId != nil {
- return *x.QryPriorityId
- }
- return 0
-}
-
-func (x *RegisterResponseM2C) GetAuthorizedInfo() *MasterAuthorizedInfo {
- if x != nil {
- return x.AuthorizedInfo
- }
- return nil
-}
-
-type HeartRequestC2M struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- GroupName *string `protobuf:"bytes,2,req,name=groupName" json:"groupName,omitempty"`
- SubscribeInfo []string `protobuf:"bytes,3,rep,name=subscribeInfo" json:"subscribeInfo,omitempty"`
- ReportSubscribeInfo *bool `protobuf:"varint,4,req,name=reportSubscribeInfo" json:"reportSubscribeInfo,omitempty"`
- Event *EventProto `protobuf:"bytes,5,opt,name=event" json:"event,omitempty"`
- DefFlowCheckId *int64 `protobuf:"varint,6,opt,name=defFlowCheckId" json:"defFlowCheckId,omitempty"`
- GroupFlowCheckId *int64 `protobuf:"varint,7,opt,name=groupFlowCheckId" json:"groupFlowCheckId,omitempty"`
- SsdStoreId *int64 `protobuf:"varint,8,opt,name=ssdStoreId" json:"ssdStoreId,omitempty"` // Deprecated
- QryPriorityId *int32 `protobuf:"varint,9,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- AuthInfo *MasterCertificateInfo `protobuf:"bytes,10,opt,name=authInfo" json:"authInfo,omitempty"`
-}
-
-func (x *HeartRequestC2M) Reset() {
- *x = HeartRequestC2M{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[16]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *HeartRequestC2M) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*HeartRequestC2M) ProtoMessage() {}
-
-func (x *HeartRequestC2M) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[16]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use HeartRequestC2M.ProtoReflect.Descriptor instead.
-func (*HeartRequestC2M) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{16}
-}
-
-func (x *HeartRequestC2M) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *HeartRequestC2M) GetGroupName() string {
- if x != nil && x.GroupName != nil {
- return *x.GroupName
- }
- return ""
-}
-
-func (x *HeartRequestC2M) GetSubscribeInfo() []string {
- if x != nil {
- return x.SubscribeInfo
- }
- return nil
-}
-
-func (x *HeartRequestC2M) GetReportSubscribeInfo() bool {
- if x != nil && x.ReportSubscribeInfo != nil {
- return *x.ReportSubscribeInfo
- }
- return false
-}
-
-func (x *HeartRequestC2M) GetEvent() *EventProto {
- if x != nil {
- return x.Event
- }
- return nil
-}
-
-func (x *HeartRequestC2M) GetDefFlowCheckId() int64 {
- if x != nil && x.DefFlowCheckId != nil {
- return *x.DefFlowCheckId
- }
- return 0
-}
-
-func (x *HeartRequestC2M) GetGroupFlowCheckId() int64 {
- if x != nil && x.GroupFlowCheckId != nil {
- return *x.GroupFlowCheckId
- }
- return 0
-}
-
-func (x *HeartRequestC2M) GetSsdStoreId() int64 {
- if x != nil && x.SsdStoreId != nil {
- return *x.SsdStoreId
- }
- return 0
-}
-
-func (x *HeartRequestC2M) GetQryPriorityId() int32 {
- if x != nil && x.QryPriorityId != nil {
- return *x.QryPriorityId
- }
- return 0
-}
-
-func (x *HeartRequestC2M) GetAuthInfo() *MasterCertificateInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-type HeartResponseM2C struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
- Event *EventProto `protobuf:"bytes,4,opt,name=event" json:"event,omitempty"`
- NotAllocated *bool `protobuf:"varint,5,opt,name=notAllocated" json:"notAllocated,omitempty"`
- DefFlowCheckId *int64 `protobuf:"varint,6,opt,name=defFlowCheckId" json:"defFlowCheckId,omitempty"`
- DefFlowControlInfo *string `protobuf:"bytes,7,opt,name=defFlowControlInfo" json:"defFlowControlInfo,omitempty"`
- GroupFlowCheckId *int64 `protobuf:"varint,8,opt,name=groupFlowCheckId" json:"groupFlowCheckId,omitempty"`
- GroupFlowControlInfo *string `protobuf:"bytes,9,opt,name=groupFlowControlInfo" json:"groupFlowControlInfo,omitempty"`
- SsdStoreId *int64 `protobuf:"varint,10,opt,name=ssdStoreId" json:"ssdStoreId,omitempty"` // Deprecated
- QryPriorityId *int32 `protobuf:"varint,11,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- RequireAuth *bool `protobuf:"varint,12,opt,name=requireAuth" json:"requireAuth,omitempty"`
- AuthorizedInfo *MasterAuthorizedInfo `protobuf:"bytes,13,opt,name=authorizedInfo" json:"authorizedInfo,omitempty"`
-}
-
-func (x *HeartResponseM2C) Reset() {
- *x = HeartResponseM2C{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[17]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *HeartResponseM2C) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*HeartResponseM2C) ProtoMessage() {}
-
-func (x *HeartResponseM2C) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[17]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use HeartResponseM2C.ProtoReflect.Descriptor instead.
-func (*HeartResponseM2C) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{17}
-}
-
-func (x *HeartResponseM2C) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *HeartResponseM2C) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *HeartResponseM2C) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *HeartResponseM2C) GetEvent() *EventProto {
- if x != nil {
- return x.Event
- }
- return nil
-}
-
-func (x *HeartResponseM2C) GetNotAllocated() bool {
- if x != nil && x.NotAllocated != nil {
- return *x.NotAllocated
- }
- return false
-}
-
-func (x *HeartResponseM2C) GetDefFlowCheckId() int64 {
- if x != nil && x.DefFlowCheckId != nil {
- return *x.DefFlowCheckId
- }
- return 0
-}
-
-func (x *HeartResponseM2C) GetDefFlowControlInfo() string {
- if x != nil && x.DefFlowControlInfo != nil {
- return *x.DefFlowControlInfo
- }
- return ""
-}
-
-func (x *HeartResponseM2C) GetGroupFlowCheckId() int64 {
- if x != nil && x.GroupFlowCheckId != nil {
- return *x.GroupFlowCheckId
- }
- return 0
-}
-
-func (x *HeartResponseM2C) GetGroupFlowControlInfo() string {
- if x != nil && x.GroupFlowControlInfo != nil {
- return *x.GroupFlowControlInfo
- }
- return ""
-}
-
-func (x *HeartResponseM2C) GetSsdStoreId() int64 {
- if x != nil && x.SsdStoreId != nil {
- return *x.SsdStoreId
- }
- return 0
-}
-
-func (x *HeartResponseM2C) GetQryPriorityId() int32 {
- if x != nil && x.QryPriorityId != nil {
- return *x.QryPriorityId
- }
- return 0
-}
-
-func (x *HeartResponseM2C) GetRequireAuth() bool {
- if x != nil && x.RequireAuth != nil {
- return *x.RequireAuth
- }
- return false
-}
-
-func (x *HeartResponseM2C) GetAuthorizedInfo() *MasterAuthorizedInfo {
- if x != nil {
- return x.AuthorizedInfo
- }
- return nil
-}
-
-type CloseRequestC2M struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- GroupName *string `protobuf:"bytes,2,req,name=groupName" json:"groupName,omitempty"`
- AuthInfo *MasterCertificateInfo `protobuf:"bytes,3,opt,name=authInfo" json:"authInfo,omitempty"`
-}
-
-func (x *CloseRequestC2M) Reset() {
- *x = CloseRequestC2M{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[18]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CloseRequestC2M) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CloseRequestC2M) ProtoMessage() {}
-
-func (x *CloseRequestC2M) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[18]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CloseRequestC2M.ProtoReflect.Descriptor instead.
-func (*CloseRequestC2M) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{18}
-}
-
-func (x *CloseRequestC2M) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *CloseRequestC2M) GetGroupName() string {
- if x != nil && x.GroupName != nil {
- return *x.GroupName
- }
- return ""
-}
-
-func (x *CloseRequestC2M) GetAuthInfo() *MasterCertificateInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-type CloseResponseM2C struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
-}
-
-func (x *CloseResponseM2C) Reset() {
- *x = CloseResponseM2C{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[19]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CloseResponseM2C) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CloseResponseM2C) ProtoMessage() {}
-
-func (x *CloseResponseM2C) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[19]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CloseResponseM2C.ProtoReflect.Descriptor instead.
-func (*CloseResponseM2C) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{19}
-}
-
-func (x *CloseResponseM2C) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *CloseResponseM2C) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *CloseResponseM2C) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-type RegisterRequestB2M struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ClientId *string `protobuf:"bytes,1,req,name=clientId" json:"clientId,omitempty"`
- BrokerOnline *bool `protobuf:"varint,2,req,name=brokerOnline" json:"brokerOnline,omitempty"`
- EnableTls *bool `protobuf:"varint,3,req,name=enableTls" json:"enableTls,omitempty"`
- ReadStatusRpt *int32 `protobuf:"varint,4,req,name=readStatusRpt" json:"readStatusRpt,omitempty"`
- WriteStatusRpt *int32 `protobuf:"varint,5,req,name=writeStatusRpt" json:"writeStatusRpt,omitempty"`
- CurBrokerConfId *int64 `protobuf:"varint,6,req,name=curBrokerConfId" json:"curBrokerConfId,omitempty"`
- ConfCheckSumId *int32 `protobuf:"varint,7,req,name=confCheckSumId" json:"confCheckSumId,omitempty"`
- // defaultPartNum:acceptPublish:acceptSubscribe:unflushThreshold:unflushInterval:deleteWhen:deletePolicy
- BrokerDefaultConfInfo *string `protobuf:"bytes,8,req,name=brokerDefaultConfInfo" json:"brokerDefaultConfInfo,omitempty"`
- // topic:partNum:acceptPublish:acceptSubscribe:unflushThreshold:unflushInterval:deleteWhen:deletePolicy:filterStatusId:statusId:attributes
- BrokerTopicSetConfInfo []string `protobuf:"bytes,9,rep,name=brokerTopicSetConfInfo" json:"brokerTopicSetConfInfo,omitempty"`
- SsdStoreId *int64 `protobuf:"varint,10,opt,name=ssdStoreId" json:"ssdStoreId,omitempty"` // Deprecated
- FlowCheckId *int64 `protobuf:"varint,11,opt,name=flowCheckId" json:"flowCheckId,omitempty"`
- QryPriorityId *int32 `protobuf:"varint,12,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- TlsPort *int32 `protobuf:"varint,13,opt,name=tlsPort" json:"tlsPort,omitempty"`
- AuthInfo *MasterCertificateInfo `protobuf:"bytes,14,opt,name=authInfo" json:"authInfo,omitempty"`
- ClsConfig *ClusterConfig `protobuf:"bytes,15,opt,name=clsConfig" json:"clsConfig,omitempty"`
-}
-
-func (x *RegisterRequestB2M) Reset() {
- *x = RegisterRequestB2M{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[20]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RegisterRequestB2M) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RegisterRequestB2M) ProtoMessage() {}
-
-func (x *RegisterRequestB2M) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[20]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use RegisterRequestB2M.ProtoReflect.Descriptor instead.
-func (*RegisterRequestB2M) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{20}
-}
-
-func (x *RegisterRequestB2M) GetClientId() string {
- if x != nil && x.ClientId != nil {
- return *x.ClientId
- }
- return ""
-}
-
-func (x *RegisterRequestB2M) GetBrokerOnline() bool {
- if x != nil && x.BrokerOnline != nil {
- return *x.BrokerOnline
- }
- return false
-}
-
-func (x *RegisterRequestB2M) GetEnableTls() bool {
- if x != nil && x.EnableTls != nil {
- return *x.EnableTls
- }
- return false
-}
-
-func (x *RegisterRequestB2M) GetReadStatusRpt() int32 {
- if x != nil && x.ReadStatusRpt != nil {
- return *x.ReadStatusRpt
- }
- return 0
-}
-
-func (x *RegisterRequestB2M) GetWriteStatusRpt() int32 {
- if x != nil && x.WriteStatusRpt != nil {
- return *x.WriteStatusRpt
- }
- return 0
-}
-
-func (x *RegisterRequestB2M) GetCurBrokerConfId() int64 {
- if x != nil && x.CurBrokerConfId != nil {
- return *x.CurBrokerConfId
- }
- return 0
-}
-
-func (x *RegisterRequestB2M) GetConfCheckSumId() int32 {
- if x != nil && x.ConfCheckSumId != nil {
- return *x.ConfCheckSumId
- }
- return 0
-}
-
-func (x *RegisterRequestB2M) GetBrokerDefaultConfInfo() string {
- if x != nil && x.BrokerDefaultConfInfo != nil {
- return *x.BrokerDefaultConfInfo
- }
- return ""
-}
-
-func (x *RegisterRequestB2M) GetBrokerTopicSetConfInfo() []string {
- if x != nil {
- return x.BrokerTopicSetConfInfo
- }
- return nil
-}
-
-func (x *RegisterRequestB2M) GetSsdStoreId() int64 {
- if x != nil && x.SsdStoreId != nil {
- return *x.SsdStoreId
- }
- return 0
-}
-
-func (x *RegisterRequestB2M) GetFlowCheckId() int64 {
- if x != nil && x.FlowCheckId != nil {
- return *x.FlowCheckId
- }
- return 0
-}
-
-func (x *RegisterRequestB2M) GetQryPriorityId() int32 {
- if x != nil && x.QryPriorityId != nil {
- return *x.QryPriorityId
- }
- return 0
-}
-
-func (x *RegisterRequestB2M) GetTlsPort() int32 {
- if x != nil && x.TlsPort != nil {
- return *x.TlsPort
- }
- return 0
-}
-
-func (x *RegisterRequestB2M) GetAuthInfo() *MasterCertificateInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-func (x *RegisterRequestB2M) GetClsConfig() *ClusterConfig {
- if x != nil {
- return x.ClsConfig
- }
- return nil
-}
-
-type RegisterResponseM2B struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
- StopRead *bool `protobuf:"varint,4,req,name=stopRead" json:"stopRead,omitempty"`
- StopWrite *bool `protobuf:"varint,5,req,name=stopWrite" json:"stopWrite,omitempty"`
- TakeConfInfo *bool `protobuf:"varint,6,req,name=takeConfInfo" json:"takeConfInfo,omitempty"`
- EnableBrokerInfo *EnableBrokerFunInfo `protobuf:"bytes,7,opt,name=enableBrokerInfo" json:"enableBrokerInfo,omitempty"`
- CurBrokerConfId *int64 `protobuf:"varint,8,opt,name=curBrokerConfId" json:"curBrokerConfId,omitempty"`
- ConfCheckSumId *int32 `protobuf:"varint,9,opt,name=confCheckSumId" json:"confCheckSumId,omitempty"`
- // defaultPartNum:acceptPublish:acceptSubscribe:unflushThreshold:unflushInterval:deleteWhen:deletePolicy
- BrokerDefaultConfInfo *string `protobuf:"bytes,10,opt,name=brokerDefaultConfInfo" json:"brokerDefaultConfInfo,omitempty"`
- // topic:partNum:acceptPublish:acceptSubscribe:unflushThreshold:unflushInterval:deleteWhen:deletePolicy:filterStatusId:statusId:attributes
- BrokerTopicSetConfInfo []string `protobuf:"bytes,11,rep,name=brokerTopicSetConfInfo" json:"brokerTopicSetConfInfo,omitempty"`
- SsdStoreId *int64 `protobuf:"varint,12,opt,name=ssdStoreId" json:"ssdStoreId,omitempty"` // Deprecated
- FlowCheckId *int64 `protobuf:"varint,13,opt,name=flowCheckId" json:"flowCheckId,omitempty"`
- FlowControlInfo *string `protobuf:"bytes,14,opt,name=flowControlInfo" json:"flowControlInfo,omitempty"`
- QryPriorityId *int32 `protobuf:"varint,15,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- AuthorizedInfo *MasterAuthorizedInfo `protobuf:"bytes,16,opt,name=authorizedInfo" json:"authorizedInfo,omitempty"` // Deprecated
- BrokerAuthorizedInfo *MasterBrokerAuthorizedInfo `protobuf:"bytes,17,opt,name=brokerAuthorizedInfo" json:"brokerAuthorizedInfo,omitempty"`
- ClsConfig *ClusterConfig `protobuf:"bytes,18,opt,name=clsConfig" json:"clsConfig,omitempty"`
-}
-
-func (x *RegisterResponseM2B) Reset() {
- *x = RegisterResponseM2B{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[21]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RegisterResponseM2B) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RegisterResponseM2B) ProtoMessage() {}
-
-func (x *RegisterResponseM2B) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[21]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use RegisterResponseM2B.ProtoReflect.Descriptor instead.
-func (*RegisterResponseM2B) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{21}
-}
-
-func (x *RegisterResponseM2B) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *RegisterResponseM2B) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *RegisterResponseM2B) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *RegisterResponseM2B) GetStopRead() bool {
- if x != nil && x.StopRead != nil {
- return *x.StopRead
- }
- return false
-}
-
-func (x *RegisterResponseM2B) GetStopWrite() bool {
- if x != nil && x.StopWrite != nil {
- return *x.StopWrite
- }
- return false
-}
-
-func (x *RegisterResponseM2B) GetTakeConfInfo() bool {
- if x != nil && x.TakeConfInfo != nil {
- return *x.TakeConfInfo
- }
- return false
-}
-
-func (x *RegisterResponseM2B) GetEnableBrokerInfo() *EnableBrokerFunInfo {
- if x != nil {
- return x.EnableBrokerInfo
- }
- return nil
-}
-
-func (x *RegisterResponseM2B) GetCurBrokerConfId() int64 {
- if x != nil && x.CurBrokerConfId != nil {
- return *x.CurBrokerConfId
- }
- return 0
-}
-
-func (x *RegisterResponseM2B) GetConfCheckSumId() int32 {
- if x != nil && x.ConfCheckSumId != nil {
- return *x.ConfCheckSumId
- }
- return 0
-}
-
-func (x *RegisterResponseM2B) GetBrokerDefaultConfInfo() string {
- if x != nil && x.BrokerDefaultConfInfo != nil {
- return *x.BrokerDefaultConfInfo
- }
- return ""
-}
-
-func (x *RegisterResponseM2B) GetBrokerTopicSetConfInfo() []string {
- if x != nil {
- return x.BrokerTopicSetConfInfo
- }
- return nil
-}
-
-func (x *RegisterResponseM2B) GetSsdStoreId() int64 {
- if x != nil && x.SsdStoreId != nil {
- return *x.SsdStoreId
- }
- return 0
-}
-
-func (x *RegisterResponseM2B) GetFlowCheckId() int64 {
- if x != nil && x.FlowCheckId != nil {
- return *x.FlowCheckId
- }
- return 0
-}
-
-func (x *RegisterResponseM2B) GetFlowControlInfo() string {
- if x != nil && x.FlowControlInfo != nil {
- return *x.FlowControlInfo
- }
- return ""
-}
-
-func (x *RegisterResponseM2B) GetQryPriorityId() int32 {
- if x != nil && x.QryPriorityId != nil {
- return *x.QryPriorityId
- }
- return 0
-}
-
-func (x *RegisterResponseM2B) GetAuthorizedInfo() *MasterAuthorizedInfo {
- if x != nil {
- return x.AuthorizedInfo
- }
- return nil
-}
-
-func (x *RegisterResponseM2B) GetBrokerAuthorizedInfo() *MasterBrokerAuthorizedInfo {
- if x != nil {
- return x.BrokerAuthorizedInfo
- }
- return nil
-}
-
-func (x *RegisterResponseM2B) GetClsConfig() *ClusterConfig {
- if x != nil {
- return x.ClsConfig
- }
- return nil
-}
-
-type HeartRequestB2M struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- BrokerId *string `protobuf:"bytes,1,req,name=brokerId" json:"brokerId,omitempty"`
- BrokerOnline *bool `protobuf:"varint,2,req,name=brokerOnline" json:"brokerOnline,omitempty"`
- ReadStatusRpt *int32 `protobuf:"varint,3,req,name=readStatusRpt" json:"readStatusRpt,omitempty"`
- WriteStatusRpt *int32 `protobuf:"varint,4,req,name=writeStatusRpt" json:"writeStatusRpt,omitempty"`
- CurBrokerConfId *int64 `protobuf:"varint,5,req,name=curBrokerConfId" json:"curBrokerConfId,omitempty"`
- ConfCheckSumId *int32 `protobuf:"varint,6,req,name=confCheckSumId" json:"confCheckSumId,omitempty"`
- TakeConfInfo *bool `protobuf:"varint,7,req,name=takeConfInfo" json:"takeConfInfo,omitempty"`
- TakeRemovedTopicInfo *bool `protobuf:"varint,8,req,name=takeRemovedTopicInfo" json:"takeRemovedTopicInfo,omitempty"`
- // defaultPartNum:acceptPublish:acceptSubscribe:unflushThreshold:unflushInterval:deleteWhen:deletePolicy
- BrokerDefaultConfInfo *string `protobuf:"bytes,9,opt,name=brokerDefaultConfInfo" json:"brokerDefaultConfInfo,omitempty"`
- // topic:partNum:acceptPublish:acceptSubscribe:unflushThreshold:unflushInterval:deleteWhen:deletePolicy:filterStatusId:statusId:attributes
- BrokerTopicSetConfInfo []string `protobuf:"bytes,10,rep,name=brokerTopicSetConfInfo" json:"brokerTopicSetConfInfo,omitempty"`
- RemovedTopicsInfo []string `protobuf:"bytes,11,rep,name=removedTopicsInfo" json:"removedTopicsInfo,omitempty"`
- SsdStoreId *int64 `protobuf:"varint,12,opt,name=ssdStoreId" json:"ssdStoreId,omitempty"` // Deprecated
- FlowCheckId *int64 `protobuf:"varint,13,opt,name=flowCheckId" json:"flowCheckId,omitempty"`
- QryPriorityId *int32 `protobuf:"varint,14,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- AuthInfo *MasterCertificateInfo `protobuf:"bytes,15,opt,name=authInfo" json:"authInfo,omitempty"`
- ClsConfig *ClusterConfig `protobuf:"bytes,16,opt,name=clsConfig" json:"clsConfig,omitempty"`
-}
-
-func (x *HeartRequestB2M) Reset() {
- *x = HeartRequestB2M{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[22]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *HeartRequestB2M) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*HeartRequestB2M) ProtoMessage() {}
-
-func (x *HeartRequestB2M) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[22]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use HeartRequestB2M.ProtoReflect.Descriptor instead.
-func (*HeartRequestB2M) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{22}
-}
-
-func (x *HeartRequestB2M) GetBrokerId() string {
- if x != nil && x.BrokerId != nil {
- return *x.BrokerId
- }
- return ""
-}
-
-func (x *HeartRequestB2M) GetBrokerOnline() bool {
- if x != nil && x.BrokerOnline != nil {
- return *x.BrokerOnline
- }
- return false
-}
-
-func (x *HeartRequestB2M) GetReadStatusRpt() int32 {
- if x != nil && x.ReadStatusRpt != nil {
- return *x.ReadStatusRpt
- }
- return 0
-}
-
-func (x *HeartRequestB2M) GetWriteStatusRpt() int32 {
- if x != nil && x.WriteStatusRpt != nil {
- return *x.WriteStatusRpt
- }
- return 0
-}
-
-func (x *HeartRequestB2M) GetCurBrokerConfId() int64 {
- if x != nil && x.CurBrokerConfId != nil {
- return *x.CurBrokerConfId
- }
- return 0
-}
-
-func (x *HeartRequestB2M) GetConfCheckSumId() int32 {
- if x != nil && x.ConfCheckSumId != nil {
- return *x.ConfCheckSumId
- }
- return 0
-}
-
-func (x *HeartRequestB2M) GetTakeConfInfo() bool {
- if x != nil && x.TakeConfInfo != nil {
- return *x.TakeConfInfo
- }
- return false
-}
-
-func (x *HeartRequestB2M) GetTakeRemovedTopicInfo() bool {
- if x != nil && x.TakeRemovedTopicInfo != nil {
- return *x.TakeRemovedTopicInfo
- }
- return false
-}
-
-func (x *HeartRequestB2M) GetBrokerDefaultConfInfo() string {
- if x != nil && x.BrokerDefaultConfInfo != nil {
- return *x.BrokerDefaultConfInfo
- }
- return ""
-}
-
-func (x *HeartRequestB2M) GetBrokerTopicSetConfInfo() []string {
- if x != nil {
- return x.BrokerTopicSetConfInfo
- }
- return nil
-}
-
-func (x *HeartRequestB2M) GetRemovedTopicsInfo() []string {
- if x != nil {
- return x.RemovedTopicsInfo
- }
- return nil
-}
-
-func (x *HeartRequestB2M) GetSsdStoreId() int64 {
- if x != nil && x.SsdStoreId != nil {
- return *x.SsdStoreId
- }
- return 0
-}
-
-func (x *HeartRequestB2M) GetFlowCheckId() int64 {
- if x != nil && x.FlowCheckId != nil {
- return *x.FlowCheckId
- }
- return 0
-}
-
-func (x *HeartRequestB2M) GetQryPriorityId() int32 {
- if x != nil && x.QryPriorityId != nil {
- return *x.QryPriorityId
- }
- return 0
-}
-
-func (x *HeartRequestB2M) GetAuthInfo() *MasterCertificateInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-func (x *HeartRequestB2M) GetClsConfig() *ClusterConfig {
- if x != nil {
- return x.ClsConfig
- }
- return nil
-}
-
-type HeartResponseM2B struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
- StopRead *bool `protobuf:"varint,4,req,name=stopRead" json:"stopRead,omitempty"`
- StopWrite *bool `protobuf:"varint,5,req,name=stopWrite" json:"stopWrite,omitempty"`
- CurBrokerConfId *int64 `protobuf:"varint,6,req,name=curBrokerConfId" json:"curBrokerConfId,omitempty"`
- ConfCheckSumId *int32 `protobuf:"varint,7,req,name=confCheckSumId" json:"confCheckSumId,omitempty"`
- NeedReportData *bool `protobuf:"varint,8,req,name=needReportData" json:"needReportData,omitempty"`
- TakeConfInfo *bool `protobuf:"varint,9,req,name=takeConfInfo" json:"takeConfInfo,omitempty"`
- TakeRemoveTopicInfo *bool `protobuf:"varint,10,req,name=takeRemoveTopicInfo" json:"takeRemoveTopicInfo,omitempty"`
- // defaultPartNum:acceptPublish:acceptSubscribe:unflushThreshold:unflushInterval:deleteWhen:deletePolicy
- BrokerDefaultConfInfo *string `protobuf:"bytes,11,opt,name=brokerDefaultConfInfo" json:"brokerDefaultConfInfo,omitempty"`
- // topic:partNum:acceptPublish:acceptSubscribe:unflushThreshold:unflushInterval:deleteWhen:deletePolicy:filterStatusId:statusId:attributes
- BrokerTopicSetConfInfo []string `protobuf:"bytes,12,rep,name=brokerTopicSetConfInfo" json:"brokerTopicSetConfInfo,omitempty"`
- // topic:partNum:acceptPublish:acceptSubscribe:unflushThreshold:unflushInterval:deleteWhen:deletePolicy:filterStatusId:statusId:attributes
- RemoveTopicConfInfo []string `protobuf:"bytes,13,rep,name=removeTopicConfInfo" json:"removeTopicConfInfo,omitempty"`
- SsdStoreId *int64 `protobuf:"varint,14,opt,name=ssdStoreId" json:"ssdStoreId,omitempty"` // Deprecated
- FlowCheckId *int64 `protobuf:"varint,15,opt,name=flowCheckId" json:"flowCheckId,omitempty"`
- FlowControlInfo *string `protobuf:"bytes,16,opt,name=flowControlInfo" json:"flowControlInfo,omitempty"`
- QryPriorityId *int32 `protobuf:"varint,17,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- AuthorizedInfo *MasterAuthorizedInfo `protobuf:"bytes,18,opt,name=authorizedInfo" json:"authorizedInfo,omitempty"` // Deprecated
- BrokerAuthorizedInfo *MasterBrokerAuthorizedInfo `protobuf:"bytes,19,opt,name=brokerAuthorizedInfo" json:"brokerAuthorizedInfo,omitempty"`
- ClsConfig *ClusterConfig `protobuf:"bytes,20,opt,name=clsConfig" json:"clsConfig,omitempty"`
-}
-
-func (x *HeartResponseM2B) Reset() {
- *x = HeartResponseM2B{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[23]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *HeartResponseM2B) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*HeartResponseM2B) ProtoMessage() {}
-
-func (x *HeartResponseM2B) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[23]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use HeartResponseM2B.ProtoReflect.Descriptor instead.
-func (*HeartResponseM2B) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{23}
-}
-
-func (x *HeartResponseM2B) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *HeartResponseM2B) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *HeartResponseM2B) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-func (x *HeartResponseM2B) GetStopRead() bool {
- if x != nil && x.StopRead != nil {
- return *x.StopRead
- }
- return false
-}
-
-func (x *HeartResponseM2B) GetStopWrite() bool {
- if x != nil && x.StopWrite != nil {
- return *x.StopWrite
- }
- return false
-}
-
-func (x *HeartResponseM2B) GetCurBrokerConfId() int64 {
- if x != nil && x.CurBrokerConfId != nil {
- return *x.CurBrokerConfId
- }
- return 0
-}
-
-func (x *HeartResponseM2B) GetConfCheckSumId() int32 {
- if x != nil && x.ConfCheckSumId != nil {
- return *x.ConfCheckSumId
- }
- return 0
-}
-
-func (x *HeartResponseM2B) GetNeedReportData() bool {
- if x != nil && x.NeedReportData != nil {
- return *x.NeedReportData
- }
- return false
-}
-
-func (x *HeartResponseM2B) GetTakeConfInfo() bool {
- if x != nil && x.TakeConfInfo != nil {
- return *x.TakeConfInfo
- }
- return false
-}
-
-func (x *HeartResponseM2B) GetTakeRemoveTopicInfo() bool {
- if x != nil && x.TakeRemoveTopicInfo != nil {
- return *x.TakeRemoveTopicInfo
- }
- return false
-}
-
-func (x *HeartResponseM2B) GetBrokerDefaultConfInfo() string {
- if x != nil && x.BrokerDefaultConfInfo != nil {
- return *x.BrokerDefaultConfInfo
- }
- return ""
-}
-
-func (x *HeartResponseM2B) GetBrokerTopicSetConfInfo() []string {
- if x != nil {
- return x.BrokerTopicSetConfInfo
- }
- return nil
-}
-
-func (x *HeartResponseM2B) GetRemoveTopicConfInfo() []string {
- if x != nil {
- return x.RemoveTopicConfInfo
- }
- return nil
-}
-
-func (x *HeartResponseM2B) GetSsdStoreId() int64 {
- if x != nil && x.SsdStoreId != nil {
- return *x.SsdStoreId
- }
- return 0
-}
-
-func (x *HeartResponseM2B) GetFlowCheckId() int64 {
- if x != nil && x.FlowCheckId != nil {
- return *x.FlowCheckId
- }
- return 0
-}
-
-func (x *HeartResponseM2B) GetFlowControlInfo() string {
- if x != nil && x.FlowControlInfo != nil {
- return *x.FlowControlInfo
- }
- return ""
-}
-
-func (x *HeartResponseM2B) GetQryPriorityId() int32 {
- if x != nil && x.QryPriorityId != nil {
- return *x.QryPriorityId
- }
- return 0
-}
-
-func (x *HeartResponseM2B) GetAuthorizedInfo() *MasterAuthorizedInfo {
- if x != nil {
- return x.AuthorizedInfo
- }
- return nil
-}
-
-func (x *HeartResponseM2B) GetBrokerAuthorizedInfo() *MasterBrokerAuthorizedInfo {
- if x != nil {
- return x.BrokerAuthorizedInfo
- }
- return nil
-}
-
-func (x *HeartResponseM2B) GetClsConfig() *ClusterConfig {
- if x != nil {
- return x.ClsConfig
- }
- return nil
-}
-
-type CloseRequestB2M struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- BrokerId *string `protobuf:"bytes,1,req,name=brokerId" json:"brokerId,omitempty"`
- AuthInfo *MasterCertificateInfo `protobuf:"bytes,2,opt,name=authInfo" json:"authInfo,omitempty"`
-}
-
-func (x *CloseRequestB2M) Reset() {
- *x = CloseRequestB2M{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[24]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CloseRequestB2M) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CloseRequestB2M) ProtoMessage() {}
-
-func (x *CloseRequestB2M) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[24]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CloseRequestB2M.ProtoReflect.Descriptor instead.
-func (*CloseRequestB2M) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{24}
-}
-
-func (x *CloseRequestB2M) GetBrokerId() string {
- if x != nil && x.BrokerId != nil {
- return *x.BrokerId
- }
- return ""
-}
-
-func (x *CloseRequestB2M) GetAuthInfo() *MasterCertificateInfo {
- if x != nil {
- return x.AuthInfo
- }
- return nil
-}
-
-type CloseResponseM2B struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
- ErrCode *int32 `protobuf:"varint,2,req,name=errCode" json:"errCode,omitempty"`
- ErrMsg *string `protobuf:"bytes,3,req,name=errMsg" json:"errMsg,omitempty"`
-}
-
-func (x *CloseResponseM2B) Reset() {
- *x = CloseResponseM2B{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[25]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CloseResponseM2B) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CloseResponseM2B) ProtoMessage() {}
-
-func (x *CloseResponseM2B) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[25]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CloseResponseM2B.ProtoReflect.Descriptor instead.
-func (*CloseResponseM2B) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{25}
-}
-
-func (x *CloseResponseM2B) GetSuccess() bool {
- if x != nil && x.Success != nil {
- return *x.Success
- }
- return false
-}
-
-func (x *CloseResponseM2B) GetErrCode() int32 {
- if x != nil && x.ErrCode != nil {
- return *x.ErrCode
- }
- return 0
-}
-
-func (x *CloseResponseM2B) GetErrMsg() string {
- if x != nil && x.ErrMsg != nil {
- return *x.ErrMsg
- }
- return ""
-}
-
-type DataStorePath struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- RecordId *int32 `protobuf:"varint,1,req,name=recordId" json:"recordId,omitempty"`
- IsActive *bool `protobuf:"varint,2,req,name=isActive" json:"isActive,omitempty"`
- IsDefPath *bool `protobuf:"varint,3,req,name=isDefPath" json:"isDefPath,omitempty"`
- DataPath *string `protobuf:"bytes,4,opt,name=dataPath" json:"dataPath,omitempty"`
-}
-
-func (x *DataStorePath) Reset() {
- *x = DataStorePath{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[26]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DataStorePath) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DataStorePath) ProtoMessage() {}
-
-func (x *DataStorePath) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[26]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use DataStorePath.ProtoReflect.Descriptor instead.
-func (*DataStorePath) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{26}
-}
-
-func (x *DataStorePath) GetRecordId() int32 {
- if x != nil && x.RecordId != nil {
- return *x.RecordId
- }
- return 0
-}
-
-func (x *DataStorePath) GetIsActive() bool {
- if x != nil && x.IsActive != nil {
- return *x.IsActive
- }
- return false
-}
-
-func (x *DataStorePath) GetIsDefPath() bool {
- if x != nil && x.IsDefPath != nil {
- return *x.IsDefPath
- }
- return false
-}
-
-func (x *DataStorePath) GetDataPath() string {
- if x != nil && x.DataPath != nil {
- return *x.DataPath
- }
- return ""
-}
-
-type TopicRmvInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- TopicName *string `protobuf:"bytes,1,req,name=topicName" json:"topicName,omitempty"`
- StatusId *int32 `protobuf:"varint,2,req,name=statusId" json:"statusId,omitempty"`
-}
-
-func (x *TopicRmvInfo) Reset() {
- *x = TopicRmvInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[27]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *TopicRmvInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*TopicRmvInfo) ProtoMessage() {}
-
-func (x *TopicRmvInfo) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[27]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use TopicRmvInfo.ProtoReflect.Descriptor instead.
-func (*TopicRmvInfo) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{27}
-}
-
-func (x *TopicRmvInfo) GetTopicName() string {
- if x != nil && x.TopicName != nil {
- return *x.TopicName
- }
- return ""
-}
-
-func (x *TopicRmvInfo) GetStatusId() int32 {
- if x != nil && x.StatusId != nil {
- return *x.StatusId
- }
- return 0
-}
-
-type DefaultConfigInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- NumTopicStores *int32 `protobuf:"varint,1,req,name=numTopicStores" json:"numTopicStores,omitempty"`
- NumPartitions *int32 `protobuf:"varint,2,req,name=numPartitions" json:"numPartitions,omitempty"`
- UnflushMsgCnt *int32 `protobuf:"varint,3,req,name=unflushMsgCnt" json:"unflushMsgCnt,omitempty"`
- UnflushInterval *int32 `protobuf:"varint,4,req,name=unflushInterval" json:"unflushInterval,omitempty"`
- UnflushDataSize *int32 `protobuf:"varint,5,req,name=unflushDataSize" json:"unflushDataSize,omitempty"`
- MemCacheBlockSize *int32 `protobuf:"varint,6,req,name=memCacheBlockSize" json:"memCacheBlockSize,omitempty"`
- NumMemCacheBlock *int32 `protobuf:"varint,7,req,name=numMemCacheBlock" json:"numMemCacheBlock,omitempty"`
- BathDiskWriteUnit *int32 `protobuf:"varint,8,req,name=bathDiskWriteUnit" json:"bathDiskWriteUnit,omitempty"`
- BathDiskReadUnit *int32 `protobuf:"varint,9,req,name=bathDiskReadUnit" json:"bathDiskReadUnit,omitempty"`
- AcceptPublish *bool `protobuf:"varint,10,req,name=acceptPublish" json:"acceptPublish,omitempty"`
- AcceptSubscribe *bool `protobuf:"varint,11,req,name=acceptSubscribe" json:"acceptSubscribe,omitempty"`
- DeletePolicy *string `protobuf:"bytes,12,req,name=deletePolicy" json:"deletePolicy,omitempty"`
-}
-
-func (x *DefaultConfigInfo) Reset() {
- *x = DefaultConfigInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[28]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DefaultConfigInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DefaultConfigInfo) ProtoMessage() {}
-
-func (x *DefaultConfigInfo) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[28]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use DefaultConfigInfo.ProtoReflect.Descriptor instead.
-func (*DefaultConfigInfo) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{28}
-}
-
-func (x *DefaultConfigInfo) GetNumTopicStores() int32 {
- if x != nil && x.NumTopicStores != nil {
- return *x.NumTopicStores
- }
- return 0
-}
-
-func (x *DefaultConfigInfo) GetNumPartitions() int32 {
- if x != nil && x.NumPartitions != nil {
- return *x.NumPartitions
- }
- return 0
-}
-
-func (x *DefaultConfigInfo) GetUnflushMsgCnt() int32 {
- if x != nil && x.UnflushMsgCnt != nil {
- return *x.UnflushMsgCnt
- }
- return 0
-}
-
-func (x *DefaultConfigInfo) GetUnflushInterval() int32 {
- if x != nil && x.UnflushInterval != nil {
- return *x.UnflushInterval
- }
- return 0
-}
-
-func (x *DefaultConfigInfo) GetUnflushDataSize() int32 {
- if x != nil && x.UnflushDataSize != nil {
- return *x.UnflushDataSize
- }
- return 0
-}
-
-func (x *DefaultConfigInfo) GetMemCacheBlockSize() int32 {
- if x != nil && x.MemCacheBlockSize != nil {
- return *x.MemCacheBlockSize
- }
- return 0
-}
-
-func (x *DefaultConfigInfo) GetNumMemCacheBlock() int32 {
- if x != nil && x.NumMemCacheBlock != nil {
- return *x.NumMemCacheBlock
- }
- return 0
-}
-
-func (x *DefaultConfigInfo) GetBathDiskWriteUnit() int32 {
- if x != nil && x.BathDiskWriteUnit != nil {
- return *x.BathDiskWriteUnit
- }
- return 0
-}
-
-func (x *DefaultConfigInfo) GetBathDiskReadUnit() int32 {
- if x != nil && x.BathDiskReadUnit != nil {
- return *x.BathDiskReadUnit
- }
- return 0
-}
-
-func (x *DefaultConfigInfo) GetAcceptPublish() bool {
- if x != nil && x.AcceptPublish != nil {
- return *x.AcceptPublish
- }
- return false
-}
-
-func (x *DefaultConfigInfo) GetAcceptSubscribe() bool {
- if x != nil && x.AcceptSubscribe != nil {
- return *x.AcceptSubscribe
- }
- return false
-}
-
-func (x *DefaultConfigInfo) GetDeletePolicy() string {
- if x != nil && x.DeletePolicy != nil {
- return *x.DeletePolicy
- }
- return ""
-}
-
-type TopicConfigInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- TopicName *string `protobuf:"bytes,1,req,name=topicName" json:"topicName,omitempty"`
- StatusId *int32 `protobuf:"varint,2,opt,name=statusId" json:"statusId,omitempty"`
- NumTopicStores *int32 `protobuf:"varint,3,opt,name=numTopicStores" json:"numTopicStores,omitempty"`
- NumPartitions *int32 `protobuf:"varint,4,opt,name=numPartitions" json:"numPartitions,omitempty"`
- UnflushMsgCnt *int32 `protobuf:"varint,5,opt,name=unflushMsgCnt" json:"unflushMsgCnt,omitempty"`
- UnflushInterval *int32 `protobuf:"varint,6,opt,name=unflushInterval" json:"unflushInterval,omitempty"`
- UnflushDataSize *int32 `protobuf:"varint,7,opt,name=unflushDataSize" json:"unflushDataSize,omitempty"`
- MemCacheBlockSize *int32 `protobuf:"varint,8,opt,name=memCacheBlockSize" json:"memCacheBlockSize,omitempty"`
- NumMemCacheBlock *int32 `protobuf:"varint,9,opt,name=numMemCacheBlock" json:"numMemCacheBlock,omitempty"`
- AcceptPublish *bool `protobuf:"varint,10,opt,name=acceptPublish" json:"acceptPublish,omitempty"`
- AcceptSubscribe *bool `protobuf:"varint,11,opt,name=acceptSubscribe" json:"acceptSubscribe,omitempty"`
- DeletePolicy *string `protobuf:"bytes,12,opt,name=deletePolicy" json:"deletePolicy,omitempty"`
- DataPath []*DataStorePath `protobuf:"bytes,13,rep,name=dataPath" json:"dataPath,omitempty"`
-}
-
-func (x *TopicConfigInfo) Reset() {
- *x = TopicConfigInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[29]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *TopicConfigInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*TopicConfigInfo) ProtoMessage() {}
-
-func (x *TopicConfigInfo) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[29]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use TopicConfigInfo.ProtoReflect.Descriptor instead.
-func (*TopicConfigInfo) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{29}
-}
-
-func (x *TopicConfigInfo) GetTopicName() string {
- if x != nil && x.TopicName != nil {
- return *x.TopicName
- }
- return ""
-}
-
-func (x *TopicConfigInfo) GetStatusId() int32 {
- if x != nil && x.StatusId != nil {
- return *x.StatusId
- }
- return 0
-}
-
-func (x *TopicConfigInfo) GetNumTopicStores() int32 {
- if x != nil && x.NumTopicStores != nil {
- return *x.NumTopicStores
- }
- return 0
-}
-
-func (x *TopicConfigInfo) GetNumPartitions() int32 {
- if x != nil && x.NumPartitions != nil {
- return *x.NumPartitions
- }
- return 0
-}
-
-func (x *TopicConfigInfo) GetUnflushMsgCnt() int32 {
- if x != nil && x.UnflushMsgCnt != nil {
- return *x.UnflushMsgCnt
- }
- return 0
-}
-
-func (x *TopicConfigInfo) GetUnflushInterval() int32 {
- if x != nil && x.UnflushInterval != nil {
- return *x.UnflushInterval
- }
- return 0
-}
-
-func (x *TopicConfigInfo) GetUnflushDataSize() int32 {
- if x != nil && x.UnflushDataSize != nil {
- return *x.UnflushDataSize
- }
- return 0
-}
-
-func (x *TopicConfigInfo) GetMemCacheBlockSize() int32 {
- if x != nil && x.MemCacheBlockSize != nil {
- return *x.MemCacheBlockSize
- }
- return 0
-}
-
-func (x *TopicConfigInfo) GetNumMemCacheBlock() int32 {
- if x != nil && x.NumMemCacheBlock != nil {
- return *x.NumMemCacheBlock
- }
- return 0
-}
-
-func (x *TopicConfigInfo) GetAcceptPublish() bool {
- if x != nil && x.AcceptPublish != nil {
- return *x.AcceptPublish
- }
- return false
-}
-
-func (x *TopicConfigInfo) GetAcceptSubscribe() bool {
- if x != nil && x.AcceptSubscribe != nil {
- return *x.AcceptSubscribe
- }
- return false
-}
-
-func (x *TopicConfigInfo) GetDeletePolicy() string {
- if x != nil && x.DeletePolicy != nil {
- return *x.DeletePolicy
- }
- return ""
-}
-
-func (x *TopicConfigInfo) GetDataPath() []*DataStorePath {
- if x != nil {
- return x.DataPath
- }
- return nil
-}
-
-type BrokerConfigInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- BrokerConfId *int64 `protobuf:"varint,1,req,name=brokerConfId" json:"brokerConfId,omitempty"`
- ConfCheckSumId *int32 `protobuf:"varint,2,req,name=confCheckSumId" json:"confCheckSumId,omitempty"`
- DefConfigInfo *DefaultConfigInfo `protobuf:"bytes,3,opt,name=defConfigInfo" json:"defConfigInfo,omitempty"`
- TopicConfigInfos []*TopicConfigInfo `protobuf:"bytes,4,rep,name=topicConfigInfos" json:"topicConfigInfos,omitempty"`
- EnableTls *bool `protobuf:"varint,5,opt,name=enableTls" json:"enableTls,omitempty"`
- TlsPort *int32 `protobuf:"varint,6,opt,name=tlsPort" json:"tlsPort,omitempty"`
- WebPort *int32 `protobuf:"varint,7,opt,name=webPort" json:"webPort,omitempty"`
-}
-
-func (x *BrokerConfigInfo) Reset() {
- *x = BrokerConfigInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[30]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *BrokerConfigInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*BrokerConfigInfo) ProtoMessage() {}
-
-func (x *BrokerConfigInfo) ProtoReflect() protoreflect.Message {
- mi := &file_MasterService_proto_msgTypes[30]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use BrokerConfigInfo.ProtoReflect.Descriptor instead.
-func (*BrokerConfigInfo) Descriptor() ([]byte, []int) {
- return file_MasterService_proto_rawDescGZIP(), []int{30}
-}
-
-func (x *BrokerConfigInfo) GetBrokerConfId() int64 {
- if x != nil && x.BrokerConfId != nil {
- return *x.BrokerConfId
- }
- return 0
-}
-
-func (x *BrokerConfigInfo) GetConfCheckSumId() int32 {
- if x != nil && x.ConfCheckSumId != nil {
- return *x.ConfCheckSumId
- }
- return 0
-}
-
-func (x *BrokerConfigInfo) GetDefConfigInfo() *DefaultConfigInfo {
- if x != nil {
- return x.DefConfigInfo
- }
- return nil
-}
-
-func (x *BrokerConfigInfo) GetTopicConfigInfos() []*TopicConfigInfo {
- if x != nil {
- return x.TopicConfigInfos
- }
- return nil
-}
-
-func (x *BrokerConfigInfo) GetEnableTls() bool {
- if x != nil && x.EnableTls != nil {
- return *x.EnableTls
- }
- return false
-}
-
-func (x *BrokerConfigInfo) GetTlsPort() int32 {
- if x != nil && x.TlsPort != nil {
- return *x.TlsPort
- }
- return 0
-}
-
-func (x *BrokerConfigInfo) GetWebPort() int32 {
- if x != nil && x.WebPort != nil {
- return *x.WebPort
- }
- return 0
-}
-
-type BrokerPolicyInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- PolicyId *int64 `protobuf:"varint,1,opt,name=policyId" json:"policyId,omitempty"`
- QryPriorityId *int32 `protobuf:"varint,2,opt,name=qryPriorityId" json:"qryPriorityId,omitempty"`
- PolicyInfo *string `protobuf:"bytes,3,opt,name=policyInfo" json:"policyInfo,omitempty"`
-}
-
-func (x *BrokerPolicyInfo) Reset() {
- *x = BrokerPolicyInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_MasterService_proto_msgTypes[31]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
... 5091 lines suppressed ...