diff --git a/admin/Admin.go b/admin/Admin.go index 760ba47..39e2d69 100644 --- a/admin/Admin.go +++ b/admin/Admin.go @@ -22,6 +22,7 @@ type Admin interface { ListTopics() ([]*topic.TopicInfo, error) ListTopicsByOrgId(orgId string) ([]*topic.Topic, error) ListTopicsInfo() ([]*topic.Topic, error) + LookupTopics(request *message.LookupTopicsRequest) (*message.LookupTopicsResponse, error) GetTopicOffset(request *message.GetTopicOffsetRequest) ([]*message.OffsetInfo, error) GetPartitionOffset(request *message.GetPartitionOffsetRequest) (*message.OffsetInfo, error) GetScheduleInfo(request *message.GetScheduleInfoRequest) (map[*topic.TopicAndPartition]string, error) diff --git a/admin/TalosAdmin.go b/admin/TalosAdmin.go index 29f884a..378b2d1 100644 --- a/admin/TalosAdmin.go +++ b/admin/TalosAdmin.go @@ -28,6 +28,10 @@ type TalosAdmin struct { credential *auth.Credential } +func (a *TalosAdmin) ListTopicsByOrgId(orgId string) ([]*topic.Topic, error) { + panic("implement me") +} + func NewTalosAdmin(clientFactory *client.TalosClientFactory) *TalosAdmin { return &TalosAdmin{ topicClient: clientFactory.NewTopicClientDefault(), @@ -87,9 +91,9 @@ func (a *TalosAdmin) ListTopicsInfo() ([]*topic.Topic, error) { return listTopicsInfoResponse.GetTopicList(), err } -func (a *TalosAdmin) ListTopicsByOrgId(orgId string) ([]*topic.Topic, error) { - listTopicsResponse, err := a.metricClient.ListTopicsByOrgId(orgId) - return listTopicsResponse.GetTopicList(), err +func (a *TalosAdmin) LookupTopics(request *message.LookupTopicsRequest) ( + *message.LookupTopicsResponse, error) { + return a.messageClient.LookupTopics(request) } func (a *TalosAdmin) GetTopicOffset(request *message.GetTopicOffsetRequest) ( @@ -104,6 +108,12 @@ func (a *TalosAdmin) GetPartitionOffset(request *message.GetPartitionOffsetReque return getPartitionOffsetResponse.GetOffsetInfo(), err } +func (a *TalosAdmin) DescribeTopicGroup(request *topic.DescribeTopicGroupRequest) ( + *topic.TopicGroup, error) { + getPartitionOffsetResponse, err := a.topicClient.DescribeTopicGroup(request) + return getPartitionOffsetResponse.GetTopicGroup(), err +} + func (a *TalosAdmin) GetScheduleInfo(request *message.GetScheduleInfoRequest) ( map[*topic.TopicAndPartition]string, error) { getScheduleInfoResponse, err := a.messageClient.GetScheduleInfo(request) diff --git a/client/TalosClientFactory.go b/client/TalosClientFactory.go index 3364b78..6b3f1e5 100644 --- a/client/TalosClientFactory.go +++ b/client/TalosClientFactory.go @@ -155,6 +155,67 @@ type TopicClientProxy struct { clockOffset int64 } +func (p *TopicClientProxy) CreateTopicGroup(request *topic.CreateTopicGroupRequest) ( + r *topic.CreateTopicGroupResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=createTopicGroup") + defer transport.Close() + client := topic.NewTopicServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.CreateTopicGroup(request) + +} + +func (p *TopicClientProxy) DescribeTopicGroup(request *topic.DescribeTopicGroupRequest) ( + r *topic.DescribeTopicGroupResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=describeTopicGroup") + defer transport.Close() + client := topic.NewTopicServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.DescribeTopicGroup(request) +} + +func (p *TopicClientProxy) DeleteTopicGroup( + request *topic.DeleteTopicGroupRequest) (err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=deleteTopicGroup") + defer transport.Close() + client := topic.NewTopicServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.DeleteTopicGroup(request) +} + +func (p *TopicClientProxy) ListTopicGroup(request *topic.ListTopicGroupRequest) ( + r *topic.ListTopicGroupResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=listTopicGroup") + defer transport.Close() + client := topic.NewTopicServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.ListTopicGroup(request) +} + +func (p *TopicClientProxy) CreateReplicationTopic(request *topic.CreateReplicationTopicRequest) ( + r *topic.CreateTopicResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=createReplicationTopic") + defer transport.Close() + client := topic.NewTopicServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.CreateReplicationTopic(request) +} + +func (p *TopicClientProxy) GetTopicAttribute(request *topic.GetTopicAttributeRequest) ( + r *topic.GetTopicAttributeResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=getTopicAttribute") + defer transport.Close() + client := topic.NewTopicServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.GetTopicAttribute(request) +} + func (p *TopicClientProxy) GetServiceVersion() (r *common.Version, err error) { transport := p.factory.GetTransportWithClockOffset(nil, p.clockOffset, "type=getServerVersion") @@ -338,6 +399,56 @@ type MessageClientProxy struct { clockOffset int64 } +func (p *MessageClientProxy) Prepare(request *message.PrepareRequest) ( + r *message.PrepareResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=prepare") + defer transport.Close() + client := message.NewMessageServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.Prepare(request) +} + +func (p *MessageClientProxy) Commit(request *message.CommitRequest) ( + r *message.CommitResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=commit") + defer transport.Close() + client := message.NewMessageServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.Commit(request) +} + +func (p *MessageClientProxy) Rollback(request *message.RollbackRequest) ( + r *message.RollbackResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=rollback") + defer transport.Close() + client := message.NewMessageServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.Rollback(request) +} + +func (p *MessageClientProxy) GetUnkownStateTransaction(request *message.GetUnkownStateTransactionRequest) ( + r *message.GetUnkownStateTransactionResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=getUnkownStateTransaction") + defer transport.Close() + client := message.NewMessageServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.GetUnkownStateTransaction(request) +} + +func (p *MessageClientProxy) LookupTopics(request *message.LookupTopicsRequest) ( + r *message.LookupTopicsResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=lookupTopics") + defer transport.Close() + client := message.NewMessageServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.LookupTopics(request) +} + func (p *MessageClientProxy) GetServiceVersion() (r *common.Version, err error) { transport := p.factory.GetTransportWithClockOffset(nil, p.clockOffset, "type=getServerVersion") @@ -424,6 +535,41 @@ type ConsumerClientProxy struct { clockOffset int64 } +func (p *ConsumerClientProxy) LockWorkerForMultiTopics(request *consumer.MultiTopicsLockWorkerRequest) (r *consumer.MultiTopicsLockWorkerResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=lockWorkerForMultiTopics") + defer transport.Close() + client := consumer.NewConsumerServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.LockWorkerForMultiTopics(request) +} + +func (p *ConsumerClientProxy) CheckRegister(request *consumer.CheckRegisterRequest) (r *consumer.CheckRegisterResponse, err error) { + panic("implement me") +} + +func (p *ConsumerClientProxy) RenewForMultiTopics(request *consumer.MultiTopicsRenewRequest) (r *consumer.MultiTopicsRenewResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=renewForMultiTopics") + defer transport.Close() + client := consumer.NewConsumerServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.RenewForMultiTopics(request) +} + +func (p *ConsumerClientProxy) QueryWorkerForMultiTopics(request *consumer.MultiTopicsQueryWorkerRequest) (r *consumer.MultiTopicsQueryWorkerResponse, err error) { + transport := p.factory.GetTransportWithClockOffset(nil, + p.clockOffset, "type=queryWorkerForMultiTopics") + defer transport.Close() + client := consumer.NewConsumerServiceClientFactory(transport, + thrift.NewTCompactProtocolFactory()) + return client.QueryWorkerForMultiTopics(request) +} + +func (p *ConsumerClientProxy) DeleteConsumerGroup(request *consumer.DeleteConsumerGroupRequest) (err error) { + panic("implement me") +} + func (p *ConsumerClientProxy) GetServiceVersion() (r *common.Version, err error) { transport := p.factory.GetTransportWithClockOffset(nil, p.clockOffset, "type=getServerVersion") @@ -680,16 +826,6 @@ func (p *MetricClientProxy) ValidClientVersion(clientVersion *common.Version) (e return client.ValidClientVersion(clientVersion) } -func (p *MetricClientProxy) ListTopicsByOrgId(orgId string) ( - r *topic.ListTopicsInfoResponse, err error) { - transport := p.factory.GetTransportWithClockOffset(nil, - p.clockOffset, "type=listTopicsByOrgId") - defer transport.Close() - client := metric.NewMetricServiceClientFactory(transport, - thrift.NewTCompactProtocolFactory()) - return client.ListTopicsByOrgId(orgId) -} - func (p *MetricClientProxy) ListTopics() (r *topic.ListTopicsInfoResponse, err error) { transport := p.factory.GetTransportWithClockOffset(nil, p.clockOffset, "type=listTopics") diff --git a/consumer/PartitionFetcher.go b/consumer/PartitionFetcher.go index 6bcd417..4594c35 100644 --- a/consumer/PartitionFetcher.go +++ b/consumer/PartitionFetcher.go @@ -191,8 +191,8 @@ func (f *PartitionFetcher) GetCurState() TaskState { func (f *PartitionFetcher) updateState(targetState TaskState) bool { f.fetcherLock.Lock() defer f.fetcherLock.Unlock() - f.log.Infof("PartitionFetcher for Partition: %d update status from: %s to %s", - f.partitionId, f.curState.String(), targetState.String()) + f.log.Infof("PartitionFetcher for Topic: %s Partition: %d update status from: %s to %s", + f.topicAndPartition.TopicName, f.partitionId, f.curState.String(), targetState.String()) switch targetState { case INIT: @@ -230,8 +230,8 @@ func (f *PartitionFetcher) Lock() { if f.updateState(LOCKED) { f.wg.Add(1) go f.fetcherStateMachine() - f.log.Infof("Worker: %s invoke partition: %d to 'LOCKED', try to serve it.", - f.workerId, f.partitionId) + f.log.Infof("Worker: %s invoke topic: %s partition: %d to 'LOCKED', try to serve it.", + f.workerId, f.topicAndPartition.TopicName, f.partitionId) } } @@ -307,12 +307,12 @@ func (f *PartitionFetcher) stealPartition() bool { f.log.Errorf("lock partition failed: %s", err.Error()) return false } - f.log.Infof("Worker: %s success to lock partitions: %d", - f.workerId, f.partitionId) + f.log.Infof("Worker: %s success to lock topic: %s partitions: %d", + f.workerId, f.topicAndPartition.TopicName, f.partitionId) return true } - f.log.Errorf("Worker: %s failed to lock partitions: %d", - f.workerId, f.partitionId) + f.log.Errorf("Worker: %s failed to lock topic: %s partition: %d", + f.workerId, f.topicAndPartition.TopicName, f.partitionId) return false } diff --git a/consumer/TalosConsumer.go b/consumer/TalosConsumer.go index f1368bf..5261af2 100644 --- a/consumer/TalosConsumer.go +++ b/consumer/TalosConsumer.go @@ -44,7 +44,15 @@ func (p WorkerPairs) Len() int { // descending sort func (p WorkerPairs) Less(i, j int) bool { - return p[i].hasPartitionNum > p[j].hasPartitionNum + if p[i].hasPartitionNum > p[j].hasPartitionNum { + return true + } + + if p[i].hasPartitionNum < p[j].hasPartitionNum { + return false + } + + return p[i].workerId > p[j].workerId } func (p WorkerPairs) Swap(i, j int) { @@ -403,6 +411,16 @@ func (c *TalosConsumer) makeBalance() { hasList := c.getHasList() has := len(hasList) + // release all reduced partition and wait next cycle to balance + if len(hasList) > 0 && int(hasList[len(hasList) - 1]) >= c.partitionNumber { + for _, partitionId := range hasList { + if int(partitionId) >= c.partitionNumber { + toReleaseList = append(toReleaseList, partitionId) + } + } + break + } + // workerNum > partitionNum, idle workers have no match target, do nothing if i >= len(targetList) { break diff --git a/consumer/TalosConsumerConfig.go b/consumer/TalosConsumerConfig.go index f179133..d620d82 100644 --- a/consumer/TalosConsumerConfig.go +++ b/consumer/TalosConsumerConfig.go @@ -15,6 +15,7 @@ import ( type TalosConsumerConfig struct { partitionCheckInterval int64 + topicPatternCheckInterval int64 workerInfoCheckInterval int64 renewCheckInterval int64 renewMaxRetry int64 @@ -53,6 +54,9 @@ func initConsumerConfig(props *utils.Properties) *TalosConsumerConfig { partitionCheckInterval, _ := strconv.ParseInt(props.GetProperty( GALAXY_TALOS_CONSUMER_CHECK_PARTITION_INTERVAL, strconv.Itoa(GALAXY_TALOS_CONSUMER_CHECK_PARTITION_INTERVAL_DEFAULT)), 10, 64) + topicPatternCheckInterval, _ := strconv.ParseInt(props.GetProperty( + GALAXY_TALOS_CONSUMER_CHECK_TOPIC_PATTERN_INTERVAL, + strconv.Itoa(GALAXY_TALOS_CONSUMER_CHECK_TOPIC_PATTERN_INTERVAL_DEFAULT)), 10, 64) workerInfoCheckInterval, _ := strconv.ParseInt(props.GetProperty( GALAXY_TALOS_CONSUMER_CHECK_WORKER_INFO_INTERVAL, strconv.Itoa(GALAXY_TALOS_CONSUMER_CHECK_WORKER_INFO_INTERVAL_DEFAULT)), 10, 64) @@ -98,6 +102,7 @@ func initConsumerConfig(props *utils.Properties) *TalosConsumerConfig { return &TalosConsumerConfig{ partitionCheckInterval: partitionCheckInterval, + topicPatternCheckInterval: topicPatternCheckInterval, workerInfoCheckInterval: workerInfoCheckInterval, renewCheckInterval: renewCheckInterval, renewMaxRetry: renewMaxRetry, @@ -125,6 +130,14 @@ func (c *TalosConsumerConfig) CheckParameter() error { return err } + err = utils.CheckParameterRange(GALAXY_TALOS_CONSUMER_CHECK_TOPIC_PATTERN_INTERVAL, + c.topicPatternCheckInterval, + GALAXY_TALOS_CONSUMER_CHECK_TOPIC_PATTERN_INTERVAL_MINIMUM, + GALAXY_TALOS_CONSUMER_CHECK_TOPIC_PATTERN_INTERVAL_MAXIMUM) + if err != nil { + return err + } + err = utils.CheckParameterRange(GALAXY_TALOS_CONSUMER_CHECK_WORKER_INFO_INTERVAL, c.workerInfoCheckInterval, GALAXY_TALOS_CONSUMER_CHECK_WORKER_INFO_INTERVAL_MINIMUM, @@ -191,6 +204,9 @@ func (c *TalosConsumerConfig) CheckParameter() error { return nil } +func (c *TalosConsumerConfig) GetTopicPatternCheckInterval() int64 { + return c.topicPatternCheckInterval +} func (c *TalosConsumerConfig) GetPartitionCheckInterval() int64 { return c.partitionCheckInterval } diff --git a/consumer/TalosConsumerConfigKey.go b/consumer/TalosConsumerConfigKey.go index 4c05cfe..c5177f8 100644 --- a/consumer/TalosConsumerConfigKey.go +++ b/consumer/TalosConsumerConfigKey.go @@ -15,6 +15,14 @@ const ( GALAXY_TALOS_CONSUMER_CHECK_PARTITION_INTERVAL_MINIMUM = 1000 * 60 GALAXY_TALOS_CONSUMER_CHECK_PARTITION_INTERVAL_MAXIMUM = 1000 * 60 * 3 + /** + * The consumer check all authorized topics that match given pattern + */ + GALAXY_TALOS_CONSUMER_CHECK_TOPIC_PATTERN_INTERVAL = "galaxy.talos.consumer.check.topic.pattern.interval" + GALAXY_TALOS_CONSUMER_CHECK_TOPIC_PATTERN_INTERVAL_DEFAULT = 5 * 60 * 1000 + GALAXY_TALOS_CONSUMER_CHECK_TOPIC_PATTERN_INTERVAL_MINIMUM = 3 * 60 * 1000 + GALAXY_TALOS_CONSUMER_CHECK_TOPIC_PATTERN_INTERVAL_MAXIMUM = 10 * 60 * 1000 + /** * The consumer check alive worker info and their serving partitions interval */ diff --git a/consumer/TalosMessageReader.go b/consumer/TalosMessageReader.go index d5760b5..4e0c787 100644 --- a/consumer/TalosMessageReader.go +++ b/consumer/TalosMessageReader.go @@ -76,8 +76,8 @@ func (r *TalosMessageReader) InitStartOffset() error { r.lastCommitOffset = atomic.LoadInt64(r.startOffset) - 1 r.finishedOffset = r.lastCommitOffset } - r.log.Infof("Init startOffset: %d lastCommitOffset: %d for partition: %d ", - atomic.LoadInt64(r.startOffset), r.lastCommitOffset, + r.log.Infof("Init startOffset: %d lastCommitOffset: %d for topic: %s partition: %d ", + atomic.LoadInt64(r.startOffset), r.lastCommitOffset, r.topicAndPartition.GetTopicName(), r.topicAndPartition.GetPartitionId()) return nil } diff --git a/consumer/TalosTopicsConsumer.go b/consumer/TalosTopicsConsumer.go new file mode 100644 index 0000000..41df997 --- /dev/null +++ b/consumer/TalosTopicsConsumer.go @@ -0,0 +1,880 @@ +/** + * Copyright 2021, Xiaomi. + * All rights reserved. + * Author: fangchengjin@xiaomi.com + */ + +package consumer + +import ( + "fmt" + "math/rand" + "reflect" + "sort" + "sync" + "time" + + "github.com/XiaoMi/talos-sdk-golang/admin" + "github.com/XiaoMi/talos-sdk-golang/client" + "github.com/XiaoMi/talos-sdk-golang/thrift/auth" + "github.com/XiaoMi/talos-sdk-golang/thrift/consumer" + "github.com/XiaoMi/talos-sdk-golang/thrift/message" + "github.com/XiaoMi/talos-sdk-golang/thrift/topic" + "github.com/XiaoMi/talos-sdk-golang/utils" + "github.com/sirupsen/logrus" +) + +type TopicPartitions []*topic.TopicAndPartition + +func (p TopicPartitions) Len() int { + return len(p) +} + +func (p TopicPartitions) Less(i, j int) bool { + // partitionId ascending + if p[i].GetPartitionId() < p[j].GetPartitionId() { + return true + } + if p[i].GetPartitionId() > p[j].GetPartitionId() { + return false + } + // topicName ascending + return p[i].GetTopicName() < p[j].GetTopicName() +} + +func (p TopicPartitions) Swap(i, j int) { + p[i], p[j] = p[j], p[i] +} + +type TalosTopicsConsumer struct { + workerId string + consumerGroup string + topicGroup string + messageProcessorFactory MessageProcessorFactory + MessageReaderFactory *TalosMessageReaderFactory + partitionFetcherMap map[*topic.TopicAndPartition]*PartitionFetcher + talosConsumerConfig *TalosConsumerConfig + talosClientFactory client.TalosClientFactoryInterface + scheduleInfoCache *client.ScheduleInfoCache + talosAdmin admin.Admin + consumerClient consumer.ConsumerService + topicAbnormalCallback client.TopicAbnormalCallback + readWriteLock sync.RWMutex + falconWriter *utils.FalconWriter + // init by getting from rpc call as follows + topicPattern string + totalPartitionNumber int32 + topicPartitionMap map[string]int32 + topicList []*topic.TopicTalosResourceName + workerInfoMap map[string][]*topic.TopicAndPartition + partitionCheckpoint map[*topic.TopicAndPartition]Long + checkPartTaskChan chan utils.StopSign + checkWorkerTaskChan chan utils.StopSign + renewTaskChan chan utils.StopSign + monitorTaskChan chan utils.StopSign + WaitGroup *sync.WaitGroup + log *logrus.Logger +} + +func NewTalosMultiTopicsConsumerByProperties(properties *utils.Properties, + messageProcessorFactory MessageProcessorFactory, + abnormalCallback client.TopicAbnormalCallback) (*TalosTopicsConsumer, error) { + + topicPattern := properties.Get("galaxy.talos.topic.pattern") + consumerGroupName := properties.Get("galaxy.talos.group.name") + clientIdPrefix := properties.Get("galaxy.talos.client.prefix") + secretKeyId := properties.Get("galaxy.talos.access.key") + secretKey := properties.Get("galaxy.talos.access.secret") + userType := auth.UserType_DEV_XIAOMI + // credential + credential := &auth.Credential{ + TypeA1: &userType, + SecretKeyId: &secretKeyId, + SecretKey: &secretKey, + } + consumerConfig := NewTalosConsumerConfigByProperties(properties) + + return NewDefaultTalosMultiTopicsConsumer(consumerGroupName, consumerConfig, credential, + topicPattern, NewTalosMessageReaderFactory(), messageProcessorFactory, + clientIdPrefix, abnormalCallback, make(map[*topic.TopicAndPartition]Long, 0), utils.InitLogger()) +} + +func NewTalosMultiTopicsConsumerByFilename(propertyFilename string, + messageProcessorFactory MessageProcessorFactory, + abnormalCallback client.TopicAbnormalCallback) (*TalosTopicsConsumer, error) { + + props := utils.LoadProperties(propertyFilename) + topicName := props.Get("galaxy.talos.topic.name") + consumerGroupName := props.Get("galaxy.talos.group.name") + clientIdPrefix := props.Get("galaxy.talos.client.prefix") + secretKeyId := props.Get("galaxy.talos.access.key") + secretKey := props.Get("galaxy.talos.access.secret") + userType := auth.UserType_DEV_XIAOMI + // credential + credential := &auth.Credential{ + TypeA1: &userType, + SecretKeyId: &secretKeyId, + SecretKey: &secretKey, + } + consumerConfig := NewTalosConsumerConfigByProperties(props) + + return NewDefaultTalosMultiTopicsConsumer(consumerGroupName, consumerConfig, credential, + topicName, NewTalosMessageReaderFactory(), messageProcessorFactory, + clientIdPrefix, abnormalCallback, make(map[*topic.TopicAndPartition]Long, 0), utils.InitLogger()) +} + +func NewTalosMultiTopicsConsumerWithLogger(propertyFilename string, + messageProcessorFactory MessageProcessorFactory, + abnormalCallback client.TopicAbnormalCallback, logger *logrus.Logger) (*TalosTopicsConsumer, error) { + + props := utils.LoadProperties(propertyFilename) + topicGroup := props.Get("galaxy.talos.topic.group") + consumerGroupName := props.Get("galaxy.talos.group.name") + clientIdPrefix := props.Get("galaxy.talos.client.prefix") + secretKeyId := props.Get("galaxy.talos.access.key") + secretKey := props.Get("galaxy.talos.access.secret") + userType := auth.UserType_DEV_XIAOMI + // credential + credential := &auth.Credential{ + TypeA1: &userType, + SecretKeyId: &secretKeyId, + SecretKey: &secretKey, + } + consumerConfig := NewTalosConsumerConfigByProperties(props) + + return NewDefaultTalosMultiTopicsConsumer(consumerGroupName, consumerConfig, credential, + topicGroup, NewTalosMessageReaderFactory(), messageProcessorFactory, + clientIdPrefix, abnormalCallback, make(map[*topic.TopicAndPartition]Long, 0), logger) +} + +func NewTalosMultiTopicsConsumer(consumerGroupName string, consumerConfig *TalosConsumerConfig, + credential *auth.Credential, topicName string, + messageProcessorFactory MessageProcessorFactory, clientIdPrefix string, + abnormalCallback client.TopicAbnormalCallback, logger *logrus.Logger) (*TalosTopicsConsumer, error) { + return NewDefaultTalosMultiTopicsConsumer(consumerGroupName, consumerConfig, credential, + topicName, NewTalosMessageReaderFactory(), messageProcessorFactory, + clientIdPrefix, abnormalCallback, make(map[*topic.TopicAndPartition]Long, 0), logger) +} + +func NewDefaultTalosMultiTopicsConsumer(consumerGroupName string, consumerConfig *TalosConsumerConfig, + credential *auth.Credential, topicGroupName string, + messageReaderFactory *TalosMessageReaderFactory, + messageProcessorFactory MessageProcessorFactory, clientIdPrefix string, + abnormalCallback client.TopicAbnormalCallback, + partitionCheckpoint map[*topic.TopicAndPartition]Long, logger *logrus.Logger) (*TalosTopicsConsumer, error) { + + workerId, err := utils.CheckAndGenerateClientId(clientIdPrefix) + if err != nil { + return nil, err + } + + err = utils.CheckNameValidity(consumerGroupName) + if err != nil { + return nil, err + } + + talosClientFactory := client.NewTalosClientFactory(consumerConfig.TalosClientConfig, credential) + consumerClient := talosClientFactory.NewConsumerClientDefault() + + talosAdmin := admin.NewTalosAdmin(talosClientFactory) + + falconWriter := utils.NewFalconWriter(consumerConfig.TalosClientConfig.FalconUrl(), logger) + + c := &TalosTopicsConsumer{ + workerId: workerId, + consumerGroup: consumerGroupName, + messageProcessorFactory: messageProcessorFactory, + MessageReaderFactory: messageReaderFactory, + partitionFetcherMap: make(map[*topic.TopicAndPartition]*PartitionFetcher), + talosConsumerConfig: consumerConfig, + talosClientFactory: talosClientFactory, + talosAdmin: talosAdmin, + topicGroup: topicGroupName, + topicPattern: "", + topicPartitionMap: make(map[string]int32), + topicList: make([]*topic.TopicTalosResourceName, 0), + consumerClient: consumerClient, + topicAbnormalCallback: abnormalCallback, + partitionCheckpoint: partitionCheckpoint, + scheduleInfoCache: new(client.ScheduleInfoCache), + falconWriter: falconWriter, + checkPartTaskChan: make(chan utils.StopSign), + checkWorkerTaskChan: make(chan utils.StopSign), + renewTaskChan: make(chan utils.StopSign), + monitorTaskChan: make(chan utils.StopSign), + WaitGroup: new(sync.WaitGroup), + log: logger, + } + + response, err := talosAdmin.DescribeTopicGroup(&topic.DescribeTopicGroupRequest{TopicGroupName: topicGroupName}) + if err != nil { + return nil, err + } + + if response.IsSetTopicPattern() { + c.topicPattern = response.GetTopicPattern() + err = c.getTopicAndScheduleInfo() + if err != nil { + return nil, err + } + + c.WaitGroup.Add(1) + go c.initCheckTopicsTask() + } else if response.IsSetTopicSet() { + err = c.getTopicAndScheduleInfoByList(response.TopicSet) + if err != nil { + return nil, err + } + } + + c.log.Infof("The worker: %s is initializing...", workerId) + + // register self workerId + err = c.registerSelf() + if err != nil { + return nil, err + } + + // get worker info + err = c.getWorkerInfo() + if err != nil { + return nil, err + } + + // do balance and init simple consumer + c.makeBalance() + + // start CheckPartitionTask/CheckWorkerInfoTask/RenewTask/MonitorTask + c.WaitGroup.Add(3) + + go c.initCheckWorkerInfoTask() + go c.initRenewTask() + go c.initConsumerMonitorTask() + + return c, nil +} + +func (c *TalosTopicsConsumer) getTopicAndScheduleInfo() error { + response, err := c.talosAdmin.LookupTopics(&message.LookupTopicsRequest{TopicPattern: c.topicPattern}) + if err != nil { + return err + } + + if len(response.Topics) == 0 { + return fmt.Errorf("no authorized topics match topic pattern: %s", c.topicPattern) + } + + c.setTopics(response.Topics) + c.log.Infof("The worker: %s check and get topic info done", c.workerId) + return nil +} + +func (c *TalosTopicsConsumer) getTopicAndScheduleInfoByList(topicList []string) error { + for _, topicName := range topicList { + err := utils.CheckNameValidity(topicName) + if err != nil { + return err + } + + response, err := c.talosAdmin.GetDescribeInfo(&topic.GetDescribeInfoRequest{TopicName: topicName}) + if err != nil { + return err + } + + c.topicPartitionMap[response.TopicTalosResourceName.TopicTalosResourceName] = response.PartitionNumber + } + + c.setTopics(c.topicPartitionMap) + c.log.Infof("The worker: %s check and get topic info done", c.workerId) + return nil +} + +func (c *TalosTopicsConsumer) registerSelf() error { + lockWorkerRequest := &consumer.MultiTopicsLockWorkerRequest{ + ConsumerGroup: c.consumerGroup, + Topics: c.topicList, + WorkerId: c.workerId, + } + lockWorkerResponse := consumer.NewMultiTopicsLockWorkerResponse() + + var err error + tryCount := c.talosConsumerConfig.GetSelfRegisterMaxRetry() + 1 + for tryCount > 0 { + tryCount-- + lockWorkerResponse, err = c.consumerClient.LockWorkerForMultiTopics(lockWorkerRequest) + if err != nil { + continue + } + if lockWorkerResponse.GetRegisterSuccess() { + c.log.Infof("The worker: %s register self success", c.workerId) + return nil + } + c.log.Debugf("The worker: %s register self failed, make %d retry", + c.workerId, tryCount+1) + } + return fmt.Errorf("The worker: %s register self failed: %s ", + c.workerId, err.Error()) +} + +func (c *TalosTopicsConsumer) getWorkerInfo() error { + queryWorkerRequest := &consumer.MultiTopicsQueryWorkerRequest{ + ConsumerGroup: c.consumerGroup, + TopicTalosResourceNames: c.topicList, + } + queryWorkerResponse, err := c.consumerClient.QueryWorkerForMultiTopics(queryWorkerRequest) + if err != nil { + return err + } + + // if queryWorkerInfoMap size equals 0, + // it represents hbase failed error, do not update local map + // because registration, the queryWorkerInfoMap size >= 1 at least + // if queryWorkerInfoMap not contains self, it indicates renew failed, + // do not update local map to prevent a bad re-balance + if _, ok := queryWorkerResponse.GetWorkerMap()[c.workerId]; !ok || + len(queryWorkerResponse.GetWorkerMap()) == 0 { + return fmt.Errorf("query workerInfo failed, don't update local map") + } + c.readWriteLock.Lock() + c.workerInfoMap = queryWorkerResponse.GetWorkerMap() + c.readWriteLock.Unlock() + return nil +} + +func (c *TalosTopicsConsumer) calculateTargetList(copyPartitionNum, workerNumber int, + targetList *[]int) error { + if workerNumber == 1 { + // one worker serving all partitions + *targetList = append(*targetList, copyPartitionNum) + } else if copyPartitionNum < workerNumber { + // per worker per partition, the extra worker must be idle + for i := 0; i < copyPartitionNum; i++ { + *targetList = append(*targetList, 1) + } + } else { + // calculate the target sequence + sum := 0 + min := copyPartitionNum / workerNumber + remainder := copyPartitionNum % workerNumber + // add max by remainder + for i := 0; i < remainder; i++ { + *targetList = append(*targetList, min+1) + sum += min + 1 + } + + // add min by (workerNumber - remainder) + for i := 0; i < workerNumber-remainder; i++ { + *targetList = append(*targetList, min) + sum += min + } + if sum != copyPartitionNum { + return fmt.Errorf("illegal partition number: %d", sum) + } + } + + // sort target by descending + sort.Sort(sort.Reverse(sort.IntSlice(*targetList))) + c.log.Infof("Worker: %s calculate target partitions done: %v", + c.workerId, *targetList) + return nil +} + +func (c *TalosTopicsConsumer) calculateWorkerPairs(copyWorkerMap map[string][]*topic.TopicAndPartition, + sortedWorkerPairs *WorkerPairs) { + for workerId, partitionIdList := range copyWorkerMap { + *sortedWorkerPairs = append(*sortedWorkerPairs, + NewWorkerPair(workerId, len(partitionIdList))) + } + sort.Sort(sortedWorkerPairs) // descending + c.log.Infof("worker: %s calculate sorted worker pairs: %v", + c.workerId, sortedWorkerPairs) +} + +func (c *TalosTopicsConsumer) makeBalance() { + /** + * When start make balance, we deep copy 'totalPartitionNumber' and 'workerInfoMap' + * to prevent both value appear inconsistent during the process makeBalance + */ + copyPartitionNum := c.totalPartitionNumber + copyWorkerInfoMap := c.deepCopyWorkerInfoMap() + + /** + * if workerInfoMap not contains workerId, there must be error in renew task. + * the renew task will cancel the consuming task and stop to read data, + * so just return and do not care balance. + */ + if _, ok := copyWorkerInfoMap[c.workerId]; !ok { + c.log.Errorf("WorkerInfoMap not contains worker: %s. There may be some error"+ + " for renew task.", c.workerId) + return + } + + // calculate target and sorted worker pairs + targetList := make([]int, 0) + sortedWorkerPairs := make(WorkerPairs, 0) + c.calculateTargetList(int(copyPartitionNum), len(copyWorkerInfoMap), &targetList) + c.calculateWorkerPairs(copyWorkerInfoMap, &sortedWorkerPairs) + //judge stealing or release partition + toStealList := make([]*topic.TopicAndPartition, 0) + toReleaseList := make([]*topic.TopicAndPartition, 0) + + for i := 0; i < sortedWorkerPairs.Len(); i++ { + if sortedWorkerPairs[i].workerId == c.workerId { + hasList := c.getHasList() + has := len(hasList) + + // when a topic decreases partition, release all reduced partitions + for _, tp := range hasList { + topicName := tp.GetTopicTalosResourceName().GetTopicTalosResourceName() + if partitionNum, ok := c.topicPartitionMap[topicName]; !ok || + tp.GetPartitionId() >= partitionNum { + toReleaseList = append(toReleaseList, tp) + } + } + // wait next cycle to balance + if len(toReleaseList) > 0 { + break + } + + // workerNum > partitionNum, idle workers have no match target, do nothing + if i >= len(targetList) { + break + } + target := targetList[i] + + c.log.Infof("Worker: %s has: %d partition, target: %d", c.workerId, has, target) + + // a balanced state, do nothing + if has == target { + break + } else if has > target { + sort.Sort(hasList) + //release partitions + toReleaseNum := has - target + for toReleaseNum > 0 && len(hasList) > 0 { + toReleaseList = append(toReleaseList, hasList[0]) + hasList = hasList[1:] + toReleaseNum-- + } + } else { + // stealing partitions + idlePartitions := c.getIdlePartitions() + if len(idlePartitions) > 0 { + toStealNum := target - has + rand.Seed(time.Now().UnixNano()) + for toStealNum > 0 && len(idlePartitions) > 0 { + randomIndex := rand.Intn(len(idlePartitions)) + toStealList = append(toStealList, idlePartitions[randomIndex]) + idlePartitions = append(idlePartitions[:randomIndex], idlePartitions[randomIndex+1:]...) + toStealNum-- + } + } + } // else + break + } + } + + // steal or release partition lock or reached a balance state + if len(toStealList) > 0 && len(toReleaseList) > 0 { + c.log.Errorf("make balance error: both toStealList and toReleaseList exist") + return + } + if len(toStealList) > 0 { + c.stealPartitionLock(toStealList) + } else if len(toReleaseList) > 0 { + c.releasePartitionLock(toReleaseList) + } else { + // do nothing when reach balance state + c.log.Infof("The worker: %s have reached a balanced state.", c.workerId) + } +} + +func (c *TalosTopicsConsumer) stealPartitionLock(toStealList TopicPartitions) { + c.log.Infof("Worker: %s try to steal %d partition: %v", c.workerId, len(toStealList), toStealList) + // try to lock and invoke serving partition PartitionFetcher to 'LOCKED' state + url := c.talosConsumerConfig.ServiceEndpoint() + utils.TALOS_MESSAGE_SERVICE_PATH + c.readWriteLock.Lock() + for _, partition := range toStealList { + if _, ok := c.partitionFetcherMap[partition]; !ok { + // Note 'partitionCheckPoint.get(partitionId)' may be null, it's ok + messageReader := c.MessageReaderFactory.CreateMessageReader(c.talosConsumerConfig, c.log) + partitionFetcher := NewPartitionFetcher(c.consumerGroup, partition.TopicName, + partition.TopicTalosResourceName, partition.PartitionId, c.talosConsumerConfig, + c.workerId, c.consumerClient, c.scheduleInfoCache, + c.talosClientFactory.NewMessageClient(url), + c.messageProcessorFactory.CreateProcessor(), + messageReader, c.partitionCheckpoint[partition], c.log) + c.partitionFetcherMap[partition] = partitionFetcher + } + c.partitionFetcherMap[partition].Lock() + } + c.readWriteLock.Unlock() +} + +func (c *TalosTopicsConsumer) releasePartitionLock(toReleaseList TopicPartitions) { + c.log.Infof("Worker: %s try to release %d parition: %v", + c.workerId, len(toReleaseList), toReleaseList) + // stop read, commit offset, unlock the partition async + for _, partitionId := range toReleaseList { + if _, ok := c.partitionFetcherMap[partitionId]; !ok { + c.log.Errorf("partitionFetcher map not contains partition: %d", partitionId) + return + } + c.partitionFetcherMap[partitionId].Unlock() + } +} + +func (c *TalosTopicsConsumer) getIdlePartitions() TopicPartitions { + if c.totalPartitionNumber < 0 { + c.log.Errorf("consumer has error partition num: %d", c.totalPartitionNumber) + return nil + } + idlePartitions := make(TopicPartitions, 0) + + c.readWriteLock.Lock() + defer c.readWriteLock.Unlock() + + for t, partitionNum := range c.topicPartitionMap { + for i := 0; i < int(partitionNum); i++ { + topicName, _ := utils.GetTopicNameByResourceName(t) + idelPartition := &topic.TopicAndPartition{ + TopicName: topicName, + TopicTalosResourceName: &topic.TopicTalosResourceName{TopicTalosResourceName: t}, + PartitionId: int32(i), + } + idlePartitions = append(idlePartitions, idelPartition) + } + } + + for _, partitionIdList := range c.workerInfoMap { + for _, servePartitionId := range partitionIdList { + for j, idlePartitionId := range idlePartitions { + if reflect.DeepEqual(servePartitionId, idlePartitionId) { + idlePartitions = append(idlePartitions[:j], idlePartitions[j+1:]...) + break + } + } + } + } + sort.Sort(idlePartitions) + return idlePartitions +} + +func (c *TalosTopicsConsumer) getHasList() TopicPartitions { + hasList := make(TopicPartitions, 0) + c.readWriteLock.Lock() + defer c.readWriteLock.Unlock() + for partitionId, partitionFetcher := range c.partitionFetcherMap { + if partitionFetcher.IsServing() { + hasList = append(hasList, partitionId) + } + } + return hasList +} + +func (c *TalosTopicsConsumer) cancelAllConsumingTask() { + c.releasePartitionLock(c.getHasList()) +} + +func (c *TalosTopicsConsumer) shutDownAllFetcher() { + for _, partitionFetcher := range c.partitionFetcherMap { + partitionFetcher.Shutdown() + } +} + +func (c *TalosTopicsConsumer) ShutDown() { + c.log.Infof("Worker: %s is shutting down...", c.workerId) + c.checkWorkerTaskChan <- utils.Shutdown + c.checkPartTaskChan <- utils.Shutdown + c.shutDownAllFetcher() + c.renewTaskChan <- utils.Shutdown + c.monitorTaskChan <- utils.Shutdown + close(c.checkWorkerTaskChan) + close(c.checkPartTaskChan) + close(c.renewTaskChan) + close(c.monitorTaskChan) + c.WaitGroup.Wait() + c.log.Infof("Worker: %s is shutdown.", c.workerId) +} + +func (c *TalosTopicsConsumer) deepCopyWorkerInfoMap() map[string][]*topic.TopicAndPartition { + copyMap := make(map[string][]*topic.TopicAndPartition, len(c.workerInfoMap)) + c.readWriteLock.Lock() + defer c.readWriteLock.Unlock() + for workerId, partitionIdList := range c.workerInfoMap { + copyMap[workerId] = partitionIdList + } + return copyMap +} + +func (c *TalosTopicsConsumer) setTopics(topics map[string]int32) { + c.readWriteLock.Lock() + defer c.readWriteLock.Unlock() + + c.topicPartitionMap = topics + c.totalPartitionNumber = 0 + c.topicList = make([]*topic.TopicTalosResourceName, 0, len(topics)) + for t, p := range topics { + c.topicList = append(c.topicList, &topic.TopicTalosResourceName{TopicTalosResourceName: t}) + c.totalPartitionNumber += p + } + + for _, topic := range c.topicList { + c.scheduleInfoCache = client.GetScheduleInfoCache(topic, c.talosConsumerConfig.TalosClientConfig, + c.talosClientFactory.NewMessageClientDefault(), c.talosClientFactory, c.log) + } +} + +func (c *TalosTopicsConsumer) getRenewPartitionList() map[string][]int32 { + toRenewList := make(map[string][]int32, 0) + c.readWriteLock.RLock() + for _, topic := range c.topicList { + toRenewList[topic.TopicTalosResourceName] = make([]int32, 0) + } + for partition, partitionFetcher := range c.partitionFetcherMap { + if partitionFetcher.IsHoldingLock() { + topicResourceName := partition.TopicTalosResourceName.TopicTalosResourceName + if _, ok := toRenewList[topicResourceName]; !ok { + toRenewList[topicResourceName] = make([]int32, 0) + } + toRenewList[topicResourceName] = append( + toRenewList[topicResourceName], partition.PartitionId) + } + } + c.readWriteLock.RUnlock() + return toRenewList +} + +func (c *TalosTopicsConsumer) initCheckTopicsTask() { + defer c.WaitGroup.Done() + // check check all authorized topics that match given pattern every 10 minutes delay by default + duration := time.Duration(c.talosConsumerConfig. + GetTopicPatternCheckInterval()) * time.Millisecond + ticker := time.NewTicker(duration) + defer ticker.Stop() + for { + select { + case <-ticker.C: + c.CheckTopicPatternTask() + case <-c.checkPartTaskChan: + return + } + } +} + +func (c *TalosTopicsConsumer) initCheckWorkerInfoTask() { + defer c.WaitGroup.Done() + // check worker info every 10 seconds delay by default + duration := time.Duration(c.talosConsumerConfig. + GetWorkerInfoCheckInterval()) * time.Millisecond + ticker := time.NewTicker(duration) + defer ticker.Stop() + for { + select { + case <-ticker.C: + c.CheckWorkerInfoTask() + case <-c.checkWorkerTaskChan: + return + } + } +} + +func (c *TalosTopicsConsumer) initRenewTask() { + defer c.WaitGroup.Done() + // renewTask every 7 seconds delay by default + duration := time.Duration(c.talosConsumerConfig.GetRenewCheckInterval()) * time.Millisecond + ticker := time.NewTicker(duration) + defer ticker.Stop() + for { + select { + case <-ticker.C: + c.ReNewTask() + case <-c.renewTaskChan: + return + } + } +} + +func (c *TalosTopicsConsumer) initConsumerMonitorTask() { + defer c.WaitGroup.Done() + if !c.talosConsumerConfig.TalosClientConfig.ClientMonitorSwitch() { + return + } + // push to falcon every 60 seconds delay by default + duration := time.Duration(c.talosConsumerConfig.TalosClientConfig. + ReportMetricInterval()) * time.Second + ticker := time.NewTicker(duration) + defer ticker.Stop() + for { + select { + case <-ticker.C: + c.ConsumerMonitorTask() + case <-c.monitorTaskChan: + return + } + } +} + +/** + * Check Topics Task + * + * if topics number or partition number of any single topic change, invoke ReBalanceTask + */ +func (c *TalosTopicsConsumer) CheckTopicPatternTask() { + topicAndPartition := new(topic.TopicAndPartition) + if len(c.topicList) == 0 { + topicAndPartition = nil + } else { + topicName, _ := utils.GetTopicNameByResourceName(c.topicList[0].TopicTalosResourceName) + topicAndPartition = &topic.TopicAndPartition{ + TopicName: topicName, + TopicTalosResourceName: c.topicList[0], + PartitionId: 0, + } + } + response, err := c.scheduleInfoCache.GetOrCreateMessageClient(topicAndPartition).LookupTopics( + &message.LookupTopicsRequest{TopicPattern: c.topicPattern}) + if err != nil { + c.log.Errorf("Exception in CheckTopicsTask: %s", err.Error()) + return + } + + newTopicPartitionMap := response.GetTopics() + if len(newTopicPartitionMap) == 0 { + c.log.Errorf("CheckTopics error: No authorized topics match topic pattern: %s, "+ + "cancel all consume tasks.", c.topicPattern) + c.setTopics(newTopicPartitionMap) + c.cancelAllConsumingTask() + return + } + + if c.isTopicsOrPartitionsChanged(newTopicPartitionMap) { + c.log.Infof("matched topic or partition number changed, execute a re-balance task.") + // update topic list and partition number + c.setTopics(newTopicPartitionMap) + // call the re-balance task + c.WaitGroup.Add(1) + go c.CheckWorkerInfoTask() + } +} + +/** + * Check Worker Info Task + * + * check alive worker number and get the worker serving map + * 1) get the latest worker info and synchronized update the local workInfoMap + * 2) invoke the ReBalanceTask every time + * + * Note: + * a) current alive workers refer to scan 'consumerGroup+Topic+Worker' + * b) all serving partitions got by the a)'s alive workers + * + * G+T+W G+T+P + * yes no -- normal, exist idle workers + * no yes -- abnormal, but ttl will fix it + */ +func (c *TalosTopicsConsumer) CheckWorkerInfoTask() { + if err := c.getWorkerInfo(); err != nil { + c.log.Errorf("Get worker info error: %s", err.Error()) + } + // invoke the re-balance task every time + c.WaitGroup.Add(1) + go c.ReBalanceTask() +} + +/** + * Re-Balance Task + * + * This task just re-calculate the 'has'/'max'/'min' and try to steal/release + * 'CheckPartitionTask' takes charge of updating totalPartitionNumber + * 'CheckWorkerInfoTask' takes charge of updating workerInfoMap + */ +func (c *TalosTopicsConsumer) ReBalanceTask() { + defer c.WaitGroup.Done() + c.makeBalance() +} + +/** + * ReNew Task (contains two sections per renew) + * + * Note: we make renew process outside rather than inner PartitionFetcher class + * because: + * 1) make the partitionFetcher heartbeat and worker heartbeat together + * 2) renew all the serving partitions lock within one rpc process, + * which prevent massive rpc request to server + * + * when get what to renew, we take 'partitionFetcherMap' as guideline + */ +func (c *TalosTopicsConsumer) ReNewTask() { + toRenewPartitionList := c.getRenewPartitionList() + consumeUnit := &consumer.MultiTopicsConsumeUnit{ + ConsumerGroup: c.consumerGroup, + TopicPartitions: toRenewPartitionList, + WorkerId: c.workerId, + } + renewRequest := &consumer.MultiTopicsRenewRequest{ConsumeUnit: consumeUnit} + var renewResponse *consumer.MultiTopicsRenewResponse + var err error + + // plus 1 to include the first renew operation + maxRetry := c.talosConsumerConfig.GetRenewMaxRetry() + 1 + for maxRetry > 0 { + maxRetry-- + renewResponse, err = c.consumerClient.RenewForMultiTopics(renewRequest) + if err != nil { + c.log.Errorf("Worker: %s renew error: %s", c.workerId, err.Error()) + continue + } + + // 1) make heartbeat success and renew partitions success + if renewResponse.GetHeartbeatSuccess() && + len(renewResponse.GetFailedPartitionList()) == 0 { + c.log.Debugf("Worker: %s success heartbeat and renew partitions: %v", + c.workerId, toRenewPartitionList) + return + } + } //end for + + // 2) make heart beat failed, cancel all partitions + // no need to renew anything, so block the renew thread and cancel all task + if renewResponse != nil && !renewResponse.GetHeartbeatSuccess() { + c.log.Errorf("Worker: %s failed to make heartbeat, cancel all consumer task", + c.workerId) + c.cancelAllConsumingTask() + } + + // 3) make heartbeat success but renew some partitions failed + // stop read, commit offset, unlock for renew failed partitions + // the release process is graceful, so may be a long time, + // do not block the renew thread and switch thread to re-balance thread + if renewResponse != nil && len(renewResponse.GetFailedPartitionList()) > 0 { + failedRenewList := renewResponse.GetFailedPartitionList() + c.log.Errorf("Worker: %s failed to renew partitions: %v", + c.workerId, failedRenewList) + c.releasePartitionLock(failedRenewList) + } +} + +func (c *TalosTopicsConsumer) ConsumerMonitorTask() { + metrics := make([]*utils.FalconMetric, 0) + for _, p := range c.partitionFetcherMap { + metrics = append(metrics, p.messageReader.NewFalconMetrics()...) + } + c.falconWriter.PushToFalcon(metrics) +} + +func (c *TalosTopicsConsumer) isTopicsOrPartitionsChanged(newTopicPartitionMap map[string]int32) bool { + for topic, partitionNum := range c.topicPartitionMap { + if newPartitionNum, ok := newTopicPartitionMap[topic]; ok { + // partition number is not same + if partitionNum != newPartitionNum { + return true + } + } else { + // some topics are deleted + return true + } + } + // check if add topics + return len(c.topicPartitionMap) < len(newTopicPartitionMap) +} diff --git a/example/admin/TalosAdminDemo.go b/example/admin/TalosAdminDemo.go index 8a8bddc..246b543 100644 --- a/example/admin/TalosAdminDemo.go +++ b/example/admin/TalosAdminDemo.go @@ -130,19 +130,6 @@ func (demo TalosAdminDemo) listTopics() ([]*topic.TopicInfo, error) { return topicInfoList, err } -func (demo TalosAdminDemo) listTopicsByOrgId(orgId string) ([]*topic.Topic, error) { - topicInfoList, err := demo.talosAdmin.ListTopicsByOrgId(orgId) - if err != nil { - log.Errorf("Topic failed to listTopics: %s") - return nil, err - } - log.Infof("Topic success to listTopics: %s", topicInfoList) - for _, topic := range topicInfoList { - log.Infof("Topic info: %s", topic) - } - return topicInfoList, err -} - func (demo TalosAdminDemo) listTopicsInfo() ([]*topic.Topic, error) { topicInfoList, err := demo.talosAdmin.ListTopicsInfo() if err != nil { diff --git a/example/talos_topics_consumer/TalosTopicsConsumerDemo.go b/example/talos_topics_consumer/TalosTopicsConsumerDemo.go new file mode 100644 index 0000000..14ecb60 --- /dev/null +++ b/example/talos_topics_consumer/TalosTopicsConsumerDemo.go @@ -0,0 +1,85 @@ +/** + * Copyright 2021, Xiaomi. + * All rights reserved. + * Author: fangchengjin@xiaomi.com + */ + +package main + +import ( + "flag" + "sync/atomic" + "time" + + "github.com/XiaoMi/talos-sdk-golang/client" + "github.com/XiaoMi/talos-sdk-golang/consumer" + "github.com/XiaoMi/talos-sdk-golang/thrift/message" + "github.com/XiaoMi/talos-sdk-golang/utils" + "github.com/sirupsen/logrus" +) + +/** + * Returns a talos message processor to processing data for a (assigned) partition. + */ +type MyMessageProcessorFactory struct { + log *logrus.Logger +} + +func NewMyMessageProcessorFactory(logger *logrus.Logger) *MyMessageProcessorFactory { + return &MyMessageProcessorFactory{log: logger} +} + +// using for thread-safe when processing different partition data +func (f *MyMessageProcessorFactory) CreateProcessor() consumer.MessageProcessor { + processor := &MyMessageProcessor{log: f.log} + return processor +} + +var successGetNumber = new(int64) + +type MyMessageProcessor struct { + log *logrus.Logger +} + +func (p *MyMessageProcessor) Process(messages []*message.MessageAndOffset, + messageCheckpointer consumer.MessageCheckpointer) { + for _, msg := range messages { + p.log.Infof("Message content: %s", string(msg.GetMessage().GetMessage())) + } + atomic.AddInt64(successGetNumber, int64(len(messages))) + p.log.Infof("Consuming total data so far: %d", atomic.LoadInt64(successGetNumber)) + + /** if user has set 'galaxy.talos.consumer.checkpoint.auto.commit' to false, + * then you can call the 'checkpoint' to commit the list of messages. + */ + //messageCheckpointer.CheckpointByFinishedOffset() +} + +func main() { + log := utils.InitLogger() + // init client config by put $your_propertyFile in your classpath + // with the content of: + /* + galaxy.talos.service.endpoint=$talosServiceURI + */ + var propertyFilename string + flag.StringVar(&propertyFilename, "conf", "talosConsumer.txt", "conf: talosConsumer.txt'") + flag.Parse() + + // init talosConsumer + talosConsumer, err := consumer.NewTalosMultiTopicsConsumerWithLogger(propertyFilename, NewMyMessageProcessorFactory(log), + client.NewSimpleTopicAbnormalCallback(), log) + if err != nil { + log.Errorf("init talosMultiTopicsConsumer failed: %s", err.Error()) + return + } + + go func() { + time.Sleep(5 * time.Second) + // talosConsumer.ShutDown() + }() + + // block main function + talosConsumer.WaitGroup.Wait() + +} diff --git a/thrift/common/ttypes.go b/thrift/common/ttypes.go index 8485add..5459a10 100644 --- a/thrift/common/ttypes.go +++ b/thrift/common/ttypes.go @@ -65,47 +65,59 @@ func HttpStatusCodePtr(v HttpStatusCode) *HttpStatusCode { return &v } type ErrorCode int64 const ( - ErrorCode_NO_ERROR ErrorCode = 0 - ErrorCode_UNKNOWN ErrorCode = 1 - ErrorCode_UNEXPECTED_ERROR ErrorCode = 2 - ErrorCode_UNEXPECTED_MESSAGE_OFFSET ErrorCode = 3 - ErrorCode_TOPIC_EXIST ErrorCode = 4 - ErrorCode_TOPIC_NOT_EXIST ErrorCode = 5 - ErrorCode_QUOTA_NOT_EXIST ErrorCode = 6 - ErrorCode_LOCK_EXIST ErrorCode = 7 - ErrorCode_LOCK_NOT_EXIST ErrorCode = 8 - ErrorCode_LOCK_VALUE_NOT_EXPECTED ErrorCode = 9 - ErrorCode_MESSAGE_MISSING ErrorCode = 10 - ErrorCode_MESSAGE_INCOMPLETE ErrorCode = 11 - ErrorCode_MESSAGE_INDEX_UNDESIRED_ERROR ErrorCode = 12 - ErrorCode_MESSAGE_INDEX_NOT_EXIST ErrorCode = 13 - ErrorCode_MESSAGE_OFFSET_OUT_OF_RANGE ErrorCode = 14 - ErrorCode_INVALID_NAME_ERROR ErrorCode = 15 - ErrorCode_INVALID_TOPIC_PARAMS ErrorCode = 16 - ErrorCode_OPERATION_FAILED ErrorCode = 17 - ErrorCode_HDFS_OPERATION_FAILED ErrorCode = 18 - ErrorCode_HBASE_OPERATION_FAILED ErrorCode = 19 - ErrorCode_ZOOKEEPER_OPERATION_FAILED ErrorCode = 20 - ErrorCode_PARTITION_NOT_SERVING ErrorCode = 21 - ErrorCode_PARTITION_NOT_EXIST ErrorCode = 22 - ErrorCode_ZK_NODE_EXIST ErrorCode = 23 - ErrorCode_ZK_NODE_NOT_EXIST ErrorCode = 24 - ErrorCode_REST_SERVER_INIT_ERROR ErrorCode = 25 - ErrorCode_INTERNAL_SERVER_ERROR ErrorCode = 26 - ErrorCode_EXCESSIVE_PENDING_MESSAGE ErrorCode = 27 - ErrorCode_PERMISSION_DENIED_ERROR ErrorCode = 28 - ErrorCode_HDFS_FILE_NOT_EXIST ErrorCode = 29 - ErrorCode_INVALID_AUTH_INFO ErrorCode = 30 - ErrorCode_SUB_RESOURCE_NAME_EXIST ErrorCode = 31 - ErrorCode_SUB_RESOURCE_NAME_NOT_EXIST ErrorCode = 32 - ErrorCode_REQUEST_PROCESS_TIMEOUT ErrorCode = 33 - ErrorCode_QUOTA_EXCEEDED ErrorCode = 34 - ErrorCode_THROTTLE_REJECT_ERROR ErrorCode = 35 - ErrorCode_QUOTA_AUTO_APPROVE_FAILED ErrorCode = 36 - ErrorCode_HBASE_OPERATION_BLOCKED ErrorCode = 37 - ErrorCode_CLOCK_TOO_SKEWED ErrorCode = 38 - ErrorCode_REQUEST_TOO_LARGE ErrorCode = 39 - ErrorCode_BAD_REQUEST ErrorCode = 40 + ErrorCode_NO_ERROR ErrorCode = 0 + ErrorCode_UNKNOWN ErrorCode = 1 + ErrorCode_UNEXPECTED_ERROR ErrorCode = 2 + ErrorCode_UNEXPECTED_MESSAGE_OFFSET ErrorCode = 3 + ErrorCode_TOPIC_EXIST ErrorCode = 4 + ErrorCode_TOPIC_NOT_EXIST ErrorCode = 5 + ErrorCode_QUOTA_NOT_EXIST ErrorCode = 6 + ErrorCode_LOCK_EXIST ErrorCode = 7 + ErrorCode_LOCK_NOT_EXIST ErrorCode = 8 + ErrorCode_LOCK_VALUE_NOT_EXPECTED ErrorCode = 9 + ErrorCode_MESSAGE_MISSING ErrorCode = 10 + ErrorCode_MESSAGE_INCOMPLETE ErrorCode = 11 + ErrorCode_MESSAGE_INDEX_UNDESIRED_ERROR ErrorCode = 12 + ErrorCode_MESSAGE_INDEX_NOT_EXIST ErrorCode = 13 + ErrorCode_MESSAGE_OFFSET_OUT_OF_RANGE ErrorCode = 14 + ErrorCode_INVALID_NAME_ERROR ErrorCode = 15 + ErrorCode_INVALID_TOPIC_PARAMS ErrorCode = 16 + ErrorCode_OPERATION_FAILED ErrorCode = 17 + ErrorCode_HDFS_OPERATION_FAILED ErrorCode = 18 + ErrorCode_HBASE_OPERATION_FAILED ErrorCode = 19 + ErrorCode_ZOOKEEPER_OPERATION_FAILED ErrorCode = 20 + ErrorCode_PARTITION_NOT_SERVING ErrorCode = 21 + ErrorCode_PARTITION_NOT_EXIST ErrorCode = 22 + ErrorCode_ZK_NODE_EXIST ErrorCode = 23 + ErrorCode_ZK_NODE_NOT_EXIST ErrorCode = 24 + ErrorCode_REST_SERVER_INIT_ERROR ErrorCode = 25 + ErrorCode_INTERNAL_SERVER_ERROR ErrorCode = 26 + ErrorCode_EXCESSIVE_PENDING_MESSAGE ErrorCode = 27 + ErrorCode_PERMISSION_DENIED_ERROR ErrorCode = 28 + ErrorCode_HDFS_FILE_NOT_EXIST ErrorCode = 29 + ErrorCode_INVALID_AUTH_INFO ErrorCode = 30 + ErrorCode_SUB_RESOURCE_NAME_EXIST ErrorCode = 31 + ErrorCode_SUB_RESOURCE_NAME_NOT_EXIST ErrorCode = 32 + ErrorCode_REQUEST_PROCESS_TIMEOUT ErrorCode = 33 + ErrorCode_QUOTA_EXCEEDED ErrorCode = 34 + ErrorCode_THROTTLE_REJECT_ERROR ErrorCode = 35 + ErrorCode_QUOTA_AUTO_APPROVE_FAILED ErrorCode = 36 + ErrorCode_HBASE_OPERATION_BLOCKED ErrorCode = 37 + ErrorCode_CLOCK_TOO_SKEWED ErrorCode = 38 + ErrorCode_REQUEST_TOO_LARGE ErrorCode = 39 + ErrorCode_BAD_REQUEST ErrorCode = 40 + ErrorCode_CONSUMER_NOT_EXIST ErrorCode = 41 + ErrorCode_TRANSACTION_FINISHED ErrorCode = 42 + ErrorCode_TRANSACTION_NOT_EXIST ErrorCode = 43 + ErrorCode_GET_DATA_PREVIEW_ERROR ErrorCode = 44 + ErrorCode_TALOS_SCHEMA_ERROR ErrorCode = 45 + ErrorCode_SOURCE_ClUSTER_LIST_HAS_CIRCLE ErrorCode = 46 + ErrorCode_PUT_MESSAGE_FAILED_TO_MIRROR_PARTITION ErrorCode = 47 + ErrorCode_NOT_TRANSACTION_TOPIC_ERROR ErrorCode = 48 + ErrorCode_TRANSACTION_ACK_DUPLICATED ErrorCode = 49 + ErrorCode_CHANGE_PARTITION_TOO_FAST ErrorCode = 50 + ErrorCode_TOO_MANY_CONSUMER ErrorCode = 51 + ErrorCode_CONSUMER_GROUP_STILL_WORKING ErrorCode = 52 ) func (p ErrorCode) String() string { @@ -192,6 +204,30 @@ func (p ErrorCode) String() string { return "ErrorCode_REQUEST_TOO_LARGE" case ErrorCode_BAD_REQUEST: return "ErrorCode_BAD_REQUEST" + case ErrorCode_CONSUMER_NOT_EXIST: + return "ErrorCode_CONSUMER_NOT_EXIST" + case ErrorCode_TRANSACTION_FINISHED: + return "ErrorCode_TRANSACTION_FINISHED" + case ErrorCode_TRANSACTION_NOT_EXIST: + return "ErrorCode_TRANSACTION_NOT_EXIST" + case ErrorCode_GET_DATA_PREVIEW_ERROR: + return "ErrorCode_GET_DATA_PREVIEW_ERROR" + case ErrorCode_TALOS_SCHEMA_ERROR: + return "ErrorCode_TALOS_SCHEMA_ERROR" + case ErrorCode_SOURCE_ClUSTER_LIST_HAS_CIRCLE: + return "ErrorCode_SOURCE_ClUSTER_LIST_HAS_CIRCLE" + case ErrorCode_PUT_MESSAGE_FAILED_TO_MIRROR_PARTITION: + return "ErrorCode_PUT_MESSAGE_FAILED_TO_MIRROR_PARTITION" + case ErrorCode_NOT_TRANSACTION_TOPIC_ERROR: + return "ErrorCode_NOT_TRANSACTION_TOPIC_ERROR" + case ErrorCode_TRANSACTION_ACK_DUPLICATED: + return "ErrorCode_TRANSACTION_ACK_DUPLICATED" + case ErrorCode_CHANGE_PARTITION_TOO_FAST: + return "ErrorCode_CHANGE_PARTITION_TOO_FAST" + case ErrorCode_TOO_MANY_CONSUMER: + return "ErrorCode_TOO_MANY_CONSUMER" + case ErrorCode_CONSUMER_GROUP_STILL_WORKING: + return "ErrorCode_CONSUMER_GROUP_STILL_WORKING" } return "" } @@ -280,6 +316,30 @@ func ErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCode_REQUEST_TOO_LARGE, nil case "ErrorCode_BAD_REQUEST": return ErrorCode_BAD_REQUEST, nil + case "ErrorCode_CONSUMER_NOT_EXIST": + return ErrorCode_CONSUMER_NOT_EXIST, nil + case "ErrorCode_TRANSACTION_FINISHED": + return ErrorCode_TRANSACTION_FINISHED, nil + case "ErrorCode_TRANSACTION_NOT_EXIST": + return ErrorCode_TRANSACTION_NOT_EXIST, nil + case "ErrorCode_GET_DATA_PREVIEW_ERROR": + return ErrorCode_GET_DATA_PREVIEW_ERROR, nil + case "ErrorCode_TALOS_SCHEMA_ERROR": + return ErrorCode_TALOS_SCHEMA_ERROR, nil + case "ErrorCode_SOURCE_ClUSTER_LIST_HAS_CIRCLE": + return ErrorCode_SOURCE_ClUSTER_LIST_HAS_CIRCLE, nil + case "ErrorCode_PUT_MESSAGE_FAILED_TO_MIRROR_PARTITION": + return ErrorCode_PUT_MESSAGE_FAILED_TO_MIRROR_PARTITION, nil + case "ErrorCode_NOT_TRANSACTION_TOPIC_ERROR": + return ErrorCode_NOT_TRANSACTION_TOPIC_ERROR, nil + case "ErrorCode_TRANSACTION_ACK_DUPLICATED": + return ErrorCode_TRANSACTION_ACK_DUPLICATED, nil + case "ErrorCode_CHANGE_PARTITION_TOO_FAST": + return ErrorCode_CHANGE_PARTITION_TOO_FAST, nil + case "ErrorCode_TOO_MANY_CONSUMER": + return ErrorCode_TOO_MANY_CONSUMER, nil + case "ErrorCode_CONSUMER_GROUP_STILL_WORKING": + return ErrorCode_CONSUMER_GROUP_STILL_WORKING, nil } return ErrorCode(0), fmt.Errorf("not a valid ErrorCode string") } diff --git a/thrift/consumer/consumer_service-remote/consumer_service-remote.go b/thrift/consumer/consumer_service-remote/consumer_service-remote.go index 066c9e0..d6d71c5 100755 --- a/thrift/consumer/consumer_service-remote/consumer_service-remote.go +++ b/thrift/consumer/consumer_service-remote/consumer_service-remote.go @@ -23,13 +23,18 @@ func Usage() { fmt.Fprintln(os.Stderr, "\nFunctions:") fmt.Fprintln(os.Stderr, " LockPartitionResponse lockPartition(LockPartitionRequest request)") fmt.Fprintln(os.Stderr, " LockWorkerResponse lockWorker(LockWorkerRequest request)") + fmt.Fprintln(os.Stderr, " MultiTopicsLockWorkerResponse lockWorkerForMultiTopics(MultiTopicsLockWorkerRequest request)") + fmt.Fprintln(os.Stderr, " CheckRegisterResponse checkRegister(CheckRegisterRequest request)") fmt.Fprintln(os.Stderr, " void unlockPartition(UnlockPartitionRequest request)") fmt.Fprintln(os.Stderr, " RenewResponse renew(RenewRequest request)") + fmt.Fprintln(os.Stderr, " MultiTopicsRenewResponse renewForMultiTopics(MultiTopicsRenewRequest request)") fmt.Fprintln(os.Stderr, " UpdateOffsetResponse updateOffset(UpdateOffsetRequest request)") fmt.Fprintln(os.Stderr, " QueryOffsetResponse queryOffset(QueryOffsetRequest request)") fmt.Fprintln(os.Stderr, " QueryWorkerResponse queryWorker(QueryWorkerRequest request)") + fmt.Fprintln(os.Stderr, " MultiTopicsQueryWorkerResponse queryWorkerForMultiTopics(MultiTopicsQueryWorkerRequest request)") fmt.Fprintln(os.Stderr, " QueryOrgOffsetResponse queryOrgOffset(QueryOrgOffsetRequest request)") fmt.Fprintln(os.Stderr, " GetWorkerIdResponse getWorkerId(GetWorkerIdRequest request)") + fmt.Fprintln(os.Stderr, " void deleteConsumerGroup(DeleteConsumerGroupRequest request)") fmt.Fprintln(os.Stderr, " Version getServiceVersion()") fmt.Fprintln(os.Stderr, " void validClientVersion(Version clientVersion)") fmt.Fprintln(os.Stderr) @@ -131,19 +136,19 @@ func main() { fmt.Fprintln(os.Stderr, "LockPartition requires 1 args") flag.Usage() } - arg28 := flag.Arg(1) - mbTrans29 := thrift.NewTMemoryBufferLen(len(arg28)) - defer mbTrans29.Close() - _, err30 := mbTrans29.WriteString(arg28) - if err30 != nil { + arg47 := flag.Arg(1) + mbTrans48 := thrift.NewTMemoryBufferLen(len(arg47)) + defer mbTrans48.Close() + _, err49 := mbTrans48.WriteString(arg47) + if err49 != nil { Usage() return } - factory31 := thrift.NewTSimpleJSONProtocolFactory() - jsProt32 := factory31.GetProtocol(mbTrans29) + factory50 := thrift.NewTSimpleJSONProtocolFactory() + jsProt51 := factory50.GetProtocol(mbTrans48) argvalue0 := consumer.NewLockPartitionRequest() - err33 := argvalue0.Read(jsProt32) - if err33 != nil { + err52 := argvalue0.Read(jsProt51) + if err52 != nil { Usage() return } @@ -156,19 +161,19 @@ func main() { fmt.Fprintln(os.Stderr, "LockWorker requires 1 args") flag.Usage() } - arg34 := flag.Arg(1) - mbTrans35 := thrift.NewTMemoryBufferLen(len(arg34)) - defer mbTrans35.Close() - _, err36 := mbTrans35.WriteString(arg34) - if err36 != nil { + arg53 := flag.Arg(1) + mbTrans54 := thrift.NewTMemoryBufferLen(len(arg53)) + defer mbTrans54.Close() + _, err55 := mbTrans54.WriteString(arg53) + if err55 != nil { Usage() return } - factory37 := thrift.NewTSimpleJSONProtocolFactory() - jsProt38 := factory37.GetProtocol(mbTrans35) + factory56 := thrift.NewTSimpleJSONProtocolFactory() + jsProt57 := factory56.GetProtocol(mbTrans54) argvalue0 := consumer.NewLockWorkerRequest() - err39 := argvalue0.Read(jsProt38) - if err39 != nil { + err58 := argvalue0.Read(jsProt57) + if err58 != nil { Usage() return } @@ -176,24 +181,74 @@ func main() { fmt.Print(client.LockWorker(value0)) fmt.Print("\n") break + case "lockWorkerForMultiTopics": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "LockWorkerForMultiTopics requires 1 args") + flag.Usage() + } + arg59 := flag.Arg(1) + mbTrans60 := thrift.NewTMemoryBufferLen(len(arg59)) + defer mbTrans60.Close() + _, err61 := mbTrans60.WriteString(arg59) + if err61 != nil { + Usage() + return + } + factory62 := thrift.NewTSimpleJSONProtocolFactory() + jsProt63 := factory62.GetProtocol(mbTrans60) + argvalue0 := consumer.NewMultiTopicsLockWorkerRequest() + err64 := argvalue0.Read(jsProt63) + if err64 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LockWorkerForMultiTopics(value0)) + fmt.Print("\n") + break + case "checkRegister": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "CheckRegister requires 1 args") + flag.Usage() + } + arg65 := flag.Arg(1) + mbTrans66 := thrift.NewTMemoryBufferLen(len(arg65)) + defer mbTrans66.Close() + _, err67 := mbTrans66.WriteString(arg65) + if err67 != nil { + Usage() + return + } + factory68 := thrift.NewTSimpleJSONProtocolFactory() + jsProt69 := factory68.GetProtocol(mbTrans66) + argvalue0 := consumer.NewCheckRegisterRequest() + err70 := argvalue0.Read(jsProt69) + if err70 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CheckRegister(value0)) + fmt.Print("\n") + break case "unlockPartition": if flag.NArg()-1 != 1 { fmt.Fprintln(os.Stderr, "UnlockPartition requires 1 args") flag.Usage() } - arg40 := flag.Arg(1) - mbTrans41 := thrift.NewTMemoryBufferLen(len(arg40)) - defer mbTrans41.Close() - _, err42 := mbTrans41.WriteString(arg40) - if err42 != nil { + arg71 := flag.Arg(1) + mbTrans72 := thrift.NewTMemoryBufferLen(len(arg71)) + defer mbTrans72.Close() + _, err73 := mbTrans72.WriteString(arg71) + if err73 != nil { Usage() return } - factory43 := thrift.NewTSimpleJSONProtocolFactory() - jsProt44 := factory43.GetProtocol(mbTrans41) + factory74 := thrift.NewTSimpleJSONProtocolFactory() + jsProt75 := factory74.GetProtocol(mbTrans72) argvalue0 := consumer.NewUnlockPartitionRequest() - err45 := argvalue0.Read(jsProt44) - if err45 != nil { + err76 := argvalue0.Read(jsProt75) + if err76 != nil { Usage() return } @@ -206,19 +261,19 @@ func main() { fmt.Fprintln(os.Stderr, "Renew requires 1 args") flag.Usage() } - arg46 := flag.Arg(1) - mbTrans47 := thrift.NewTMemoryBufferLen(len(arg46)) - defer mbTrans47.Close() - _, err48 := mbTrans47.WriteString(arg46) - if err48 != nil { + arg77 := flag.Arg(1) + mbTrans78 := thrift.NewTMemoryBufferLen(len(arg77)) + defer mbTrans78.Close() + _, err79 := mbTrans78.WriteString(arg77) + if err79 != nil { Usage() return } - factory49 := thrift.NewTSimpleJSONProtocolFactory() - jsProt50 := factory49.GetProtocol(mbTrans47) + factory80 := thrift.NewTSimpleJSONProtocolFactory() + jsProt81 := factory80.GetProtocol(mbTrans78) argvalue0 := consumer.NewRenewRequest() - err51 := argvalue0.Read(jsProt50) - if err51 != nil { + err82 := argvalue0.Read(jsProt81) + if err82 != nil { Usage() return } @@ -226,24 +281,49 @@ func main() { fmt.Print(client.Renew(value0)) fmt.Print("\n") break + case "renewForMultiTopics": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "RenewForMultiTopics requires 1 args") + flag.Usage() + } + arg83 := flag.Arg(1) + mbTrans84 := thrift.NewTMemoryBufferLen(len(arg83)) + defer mbTrans84.Close() + _, err85 := mbTrans84.WriteString(arg83) + if err85 != nil { + Usage() + return + } + factory86 := thrift.NewTSimpleJSONProtocolFactory() + jsProt87 := factory86.GetProtocol(mbTrans84) + argvalue0 := consumer.NewMultiTopicsRenewRequest() + err88 := argvalue0.Read(jsProt87) + if err88 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RenewForMultiTopics(value0)) + fmt.Print("\n") + break case "updateOffset": if flag.NArg()-1 != 1 { fmt.Fprintln(os.Stderr, "UpdateOffset requires 1 args") flag.Usage() } - arg52 := flag.Arg(1) - mbTrans53 := thrift.NewTMemoryBufferLen(len(arg52)) - defer mbTrans53.Close() - _, err54 := mbTrans53.WriteString(arg52) - if err54 != nil { + arg89 := flag.Arg(1) + mbTrans90 := thrift.NewTMemoryBufferLen(len(arg89)) + defer mbTrans90.Close() + _, err91 := mbTrans90.WriteString(arg89) + if err91 != nil { Usage() return } - factory55 := thrift.NewTSimpleJSONProtocolFactory() - jsProt56 := factory55.GetProtocol(mbTrans53) + factory92 := thrift.NewTSimpleJSONProtocolFactory() + jsProt93 := factory92.GetProtocol(mbTrans90) argvalue0 := consumer.NewUpdateOffsetRequest() - err57 := argvalue0.Read(jsProt56) - if err57 != nil { + err94 := argvalue0.Read(jsProt93) + if err94 != nil { Usage() return } @@ -256,19 +336,19 @@ func main() { fmt.Fprintln(os.Stderr, "QueryOffset requires 1 args") flag.Usage() } - arg58 := flag.Arg(1) - mbTrans59 := thrift.NewTMemoryBufferLen(len(arg58)) - defer mbTrans59.Close() - _, err60 := mbTrans59.WriteString(arg58) - if err60 != nil { + arg95 := flag.Arg(1) + mbTrans96 := thrift.NewTMemoryBufferLen(len(arg95)) + defer mbTrans96.Close() + _, err97 := mbTrans96.WriteString(arg95) + if err97 != nil { Usage() return } - factory61 := thrift.NewTSimpleJSONProtocolFactory() - jsProt62 := factory61.GetProtocol(mbTrans59) + factory98 := thrift.NewTSimpleJSONProtocolFactory() + jsProt99 := factory98.GetProtocol(mbTrans96) argvalue0 := consumer.NewQueryOffsetRequest() - err63 := argvalue0.Read(jsProt62) - if err63 != nil { + err100 := argvalue0.Read(jsProt99) + if err100 != nil { Usage() return } @@ -281,19 +361,19 @@ func main() { fmt.Fprintln(os.Stderr, "QueryWorker requires 1 args") flag.Usage() } - arg64 := flag.Arg(1) - mbTrans65 := thrift.NewTMemoryBufferLen(len(arg64)) - defer mbTrans65.Close() - _, err66 := mbTrans65.WriteString(arg64) - if err66 != nil { + arg101 := flag.Arg(1) + mbTrans102 := thrift.NewTMemoryBufferLen(len(arg101)) + defer mbTrans102.Close() + _, err103 := mbTrans102.WriteString(arg101) + if err103 != nil { Usage() return } - factory67 := thrift.NewTSimpleJSONProtocolFactory() - jsProt68 := factory67.GetProtocol(mbTrans65) + factory104 := thrift.NewTSimpleJSONProtocolFactory() + jsProt105 := factory104.GetProtocol(mbTrans102) argvalue0 := consumer.NewQueryWorkerRequest() - err69 := argvalue0.Read(jsProt68) - if err69 != nil { + err106 := argvalue0.Read(jsProt105) + if err106 != nil { Usage() return } @@ -301,24 +381,49 @@ func main() { fmt.Print(client.QueryWorker(value0)) fmt.Print("\n") break + case "queryWorkerForMultiTopics": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "QueryWorkerForMultiTopics requires 1 args") + flag.Usage() + } + arg107 := flag.Arg(1) + mbTrans108 := thrift.NewTMemoryBufferLen(len(arg107)) + defer mbTrans108.Close() + _, err109 := mbTrans108.WriteString(arg107) + if err109 != nil { + Usage() + return + } + factory110 := thrift.NewTSimpleJSONProtocolFactory() + jsProt111 := factory110.GetProtocol(mbTrans108) + argvalue0 := consumer.NewMultiTopicsQueryWorkerRequest() + err112 := argvalue0.Read(jsProt111) + if err112 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.QueryWorkerForMultiTopics(value0)) + fmt.Print("\n") + break case "queryOrgOffset": if flag.NArg()-1 != 1 { fmt.Fprintln(os.Stderr, "QueryOrgOffset requires 1 args") flag.Usage() } - arg70 := flag.Arg(1) - mbTrans71 := thrift.NewTMemoryBufferLen(len(arg70)) - defer mbTrans71.Close() - _, err72 := mbTrans71.WriteString(arg70) - if err72 != nil { + arg113 := flag.Arg(1) + mbTrans114 := thrift.NewTMemoryBufferLen(len(arg113)) + defer mbTrans114.Close() + _, err115 := mbTrans114.WriteString(arg113) + if err115 != nil { Usage() return } - factory73 := thrift.NewTSimpleJSONProtocolFactory() - jsProt74 := factory73.GetProtocol(mbTrans71) + factory116 := thrift.NewTSimpleJSONProtocolFactory() + jsProt117 := factory116.GetProtocol(mbTrans114) argvalue0 := consumer.NewQueryOrgOffsetRequest() - err75 := argvalue0.Read(jsProt74) - if err75 != nil { + err118 := argvalue0.Read(jsProt117) + if err118 != nil { Usage() return } @@ -331,19 +436,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetWorkerId requires 1 args") flag.Usage() } - arg76 := flag.Arg(1) - mbTrans77 := thrift.NewTMemoryBufferLen(len(arg76)) - defer mbTrans77.Close() - _, err78 := mbTrans77.WriteString(arg76) - if err78 != nil { + arg119 := flag.Arg(1) + mbTrans120 := thrift.NewTMemoryBufferLen(len(arg119)) + defer mbTrans120.Close() + _, err121 := mbTrans120.WriteString(arg119) + if err121 != nil { Usage() return } - factory79 := thrift.NewTSimpleJSONProtocolFactory() - jsProt80 := factory79.GetProtocol(mbTrans77) + factory122 := thrift.NewTSimpleJSONProtocolFactory() + jsProt123 := factory122.GetProtocol(mbTrans120) argvalue0 := consumer.NewGetWorkerIdRequest() - err81 := argvalue0.Read(jsProt80) - if err81 != nil { + err124 := argvalue0.Read(jsProt123) + if err124 != nil { Usage() return } @@ -351,6 +456,31 @@ func main() { fmt.Print(client.GetWorkerId(value0)) fmt.Print("\n") break + case "deleteConsumerGroup": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteConsumerGroup requires 1 args") + flag.Usage() + } + arg125 := flag.Arg(1) + mbTrans126 := thrift.NewTMemoryBufferLen(len(arg125)) + defer mbTrans126.Close() + _, err127 := mbTrans126.WriteString(arg125) + if err127 != nil { + Usage() + return + } + factory128 := thrift.NewTSimpleJSONProtocolFactory() + jsProt129 := factory128.GetProtocol(mbTrans126) + argvalue0 := consumer.NewDeleteConsumerGroupRequest() + err130 := argvalue0.Read(jsProt129) + if err130 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteConsumerGroup(value0)) + fmt.Print("\n") + break case "getServiceVersion": if flag.NArg()-1 != 0 { fmt.Fprintln(os.Stderr, "GetServiceVersion requires 0 args") @@ -364,19 +494,19 @@ func main() { fmt.Fprintln(os.Stderr, "ValidClientVersion requires 1 args") flag.Usage() } - arg82 := flag.Arg(1) - mbTrans83 := thrift.NewTMemoryBufferLen(len(arg82)) - defer mbTrans83.Close() - _, err84 := mbTrans83.WriteString(arg82) - if err84 != nil { + arg131 := flag.Arg(1) + mbTrans132 := thrift.NewTMemoryBufferLen(len(arg131)) + defer mbTrans132.Close() + _, err133 := mbTrans132.WriteString(arg131) + if err133 != nil { Usage() return } - factory85 := thrift.NewTSimpleJSONProtocolFactory() - jsProt86 := factory85.GetProtocol(mbTrans83) + factory134 := thrift.NewTSimpleJSONProtocolFactory() + jsProt135 := factory134.GetProtocol(mbTrans132) argvalue0 := consumer.NewVersion() - err87 := argvalue0.Read(jsProt86) - if err87 != nil { + err136 := argvalue0.Read(jsProt135) + if err136 != nil { Usage() return } diff --git a/thrift/consumer/consumerservice.go b/thrift/consumer/consumerservice.go index d01d89d..be2c008 100644 --- a/thrift/consumer/consumerservice.go +++ b/thrift/consumer/consumerservice.go @@ -35,6 +35,18 @@ type ConsumerService interface { // Parameters: // - Request LockWorker(request *LockWorkerRequest) (r *LockWorkerResponse, err error) + // lock a worker heartbeat for multi topics + // + // + // Parameters: + // - Request + LockWorkerForMultiTopics(request *MultiTopicsLockWorkerRequest) (r *MultiTopicsLockWorkerResponse, err error) + // check if worker can register + // + // + // Parameters: + // - Request + CheckRegister(request *CheckRegisterRequest) (r *CheckRegisterResponse, err error) // unlock a consume unit for specified worker // // @@ -47,6 +59,12 @@ type ConsumerService interface { // Parameters: // - Request Renew(request *RenewRequest) (r *RenewResponse, err error) + // renew worker heartbeat and serving partitions for multi topics + // + // + // Parameters: + // - Request + RenewForMultiTopics(request *MultiTopicsRenewRequest) (r *MultiTopicsRenewResponse, err error) // update offset for a consuming consumeUnit task // // @@ -65,6 +83,12 @@ type ConsumerService interface { // Parameters: // - Request QueryWorker(request *QueryWorkerRequest) (r *QueryWorkerResponse, err error) + // query worker for a consuming topic by specified consumer group for multi topics + // + // + // Parameters: + // - Request + QueryWorkerForMultiTopics(request *MultiTopicsQueryWorkerRequest) (r *MultiTopicsQueryWorkerResponse, err error) // query consumer group and partition offset // // @@ -77,6 +101,12 @@ type ConsumerService interface { // Parameters: // - Request GetWorkerId(request *GetWorkerIdRequest) (r *GetWorkerIdResponse, err error) + // Delete consumerGroup for specific topic + // + // + // Parameters: + // - Request + DeleteConsumerGroup(request *DeleteConsumerGroupRequest) (err error) } type ConsumerServiceClient struct { @@ -136,16 +166,16 @@ func (p *ConsumerServiceClient) recvLockPartition() (value *LockPartitionRespons return } if mTypeId == thrift.EXCEPTION { - error9 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error10 error - error10, err = error9.Read(iprot) + error18 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error19 error + error19, err = error18.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error10 + err = error19 return } if p.SeqId != seqId { @@ -212,16 +242,16 @@ func (p *ConsumerServiceClient) recvLockWorker() (value *LockWorkerResponse, err return } if mTypeId == thrift.EXCEPTION { - error11 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error12 error - error12, err = error11.Read(iprot) + error20 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error21 error + error21, err = error20.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error12 + err = error21 return } if p.SeqId != seqId { @@ -243,6 +273,158 @@ func (p *ConsumerServiceClient) recvLockWorker() (value *LockWorkerResponse, err return } +// lock a worker heartbeat for multi topics +// +// +// Parameters: +// - Request +func (p *ConsumerServiceClient) LockWorkerForMultiTopics(request *MultiTopicsLockWorkerRequest) (r *MultiTopicsLockWorkerResponse, err error) { + if err = p.sendLockWorkerForMultiTopics(request); err != nil { + return + } + return p.recvLockWorkerForMultiTopics() +} + +func (p *ConsumerServiceClient) sendLockWorkerForMultiTopics(request *MultiTopicsLockWorkerRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("lockWorkerForMultiTopics", thrift.CALL, p.SeqId); err != nil { + return + } + args := LockWorkerForMultiTopicsArgs{ + Request: request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *ConsumerServiceClient) recvLockWorkerForMultiTopics() (value *MultiTopicsLockWorkerResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if mTypeId == thrift.EXCEPTION { + error22 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error23 error + error23, err = error22.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error23 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "lockWorkerForMultiTopics failed: out of sequence response") + return + } + result := LockWorkerForMultiTopicsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + value = result.GetSuccess() + return +} + +// check if worker can register +// +// +// Parameters: +// - Request +func (p *ConsumerServiceClient) CheckRegister(request *CheckRegisterRequest) (r *CheckRegisterResponse, err error) { + if err = p.sendCheckRegister(request); err != nil { + return + } + return p.recvCheckRegister() +} + +func (p *ConsumerServiceClient) sendCheckRegister(request *CheckRegisterRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("checkRegister", thrift.CALL, p.SeqId); err != nil { + return + } + args := CheckRegisterArgs{ + Request: request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *ConsumerServiceClient) recvCheckRegister() (value *CheckRegisterResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if mTypeId == thrift.EXCEPTION { + error24 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error25 error + error25, err = error24.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error25 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "checkRegister failed: out of sequence response") + return + } + result := CheckRegisterResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + value = result.GetSuccess() + return +} + // unlock a consume unit for specified worker // // @@ -288,16 +470,16 @@ func (p *ConsumerServiceClient) recvUnlockPartition() (err error) { return } if mTypeId == thrift.EXCEPTION { - error13 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error14 error - error14, err = error13.Read(iprot) + error26 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error27 error + error27, err = error26.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error14 + err = error27 return } if p.SeqId != seqId { @@ -363,16 +545,16 @@ func (p *ConsumerServiceClient) recvRenew() (value *RenewResponse, err error) { return } if mTypeId == thrift.EXCEPTION { - error15 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error16 error - error16, err = error15.Read(iprot) + error28 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error29 error + error29, err = error28.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error16 + err = error29 return } if p.SeqId != seqId { @@ -394,6 +576,82 @@ func (p *ConsumerServiceClient) recvRenew() (value *RenewResponse, err error) { return } +// renew worker heartbeat and serving partitions for multi topics +// +// +// Parameters: +// - Request +func (p *ConsumerServiceClient) RenewForMultiTopics(request *MultiTopicsRenewRequest) (r *MultiTopicsRenewResponse, err error) { + if err = p.sendRenewForMultiTopics(request); err != nil { + return + } + return p.recvRenewForMultiTopics() +} + +func (p *ConsumerServiceClient) sendRenewForMultiTopics(request *MultiTopicsRenewRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("renewForMultiTopics", thrift.CALL, p.SeqId); err != nil { + return + } + args := RenewForMultiTopicsArgs{ + Request: request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *ConsumerServiceClient) recvRenewForMultiTopics() (value *MultiTopicsRenewResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if mTypeId == thrift.EXCEPTION { + error30 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error31 error + error31, err = error30.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error31 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "renewForMultiTopics failed: out of sequence response") + return + } + result := RenewForMultiTopicsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + value = result.GetSuccess() + return +} + // update offset for a consuming consumeUnit task // // @@ -439,16 +697,16 @@ func (p *ConsumerServiceClient) recvUpdateOffset() (value *UpdateOffsetResponse, return } if mTypeId == thrift.EXCEPTION { - error17 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error18 error - error18, err = error17.Read(iprot) + error32 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error33 error + error33, err = error32.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error18 + err = error33 return } if p.SeqId != seqId { @@ -515,16 +773,16 @@ func (p *ConsumerServiceClient) recvQueryOffset() (value *QueryOffsetResponse, e return } if mTypeId == thrift.EXCEPTION { - error19 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error20 error - error20, err = error19.Read(iprot) + error34 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error35 error + error35, err = error34.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error20 + err = error35 return } if p.SeqId != seqId { @@ -591,16 +849,16 @@ func (p *ConsumerServiceClient) recvQueryWorker() (value *QueryWorkerResponse, e return } if mTypeId == thrift.EXCEPTION { - error21 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error22 error - error22, err = error21.Read(iprot) + error36 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error37 error + error37, err = error36.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error22 + err = error37 return } if p.SeqId != seqId { @@ -622,29 +880,29 @@ func (p *ConsumerServiceClient) recvQueryWorker() (value *QueryWorkerResponse, e return } -// query consumer group and partition offset +// query worker for a consuming topic by specified consumer group for multi topics // // // Parameters: // - Request -func (p *ConsumerServiceClient) QueryOrgOffset(request *QueryOrgOffsetRequest) (r *QueryOrgOffsetResponse, err error) { - if err = p.sendQueryOrgOffset(request); err != nil { +func (p *ConsumerServiceClient) QueryWorkerForMultiTopics(request *MultiTopicsQueryWorkerRequest) (r *MultiTopicsQueryWorkerResponse, err error) { + if err = p.sendQueryWorkerForMultiTopics(request); err != nil { return } - return p.recvQueryOrgOffset() + return p.recvQueryWorkerForMultiTopics() } -func (p *ConsumerServiceClient) sendQueryOrgOffset(request *QueryOrgOffsetRequest) (err error) { +func (p *ConsumerServiceClient) sendQueryWorkerForMultiTopics(request *MultiTopicsQueryWorkerRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("queryOrgOffset", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("queryWorkerForMultiTopics", thrift.CALL, p.SeqId); err != nil { return } - args := QueryOrgOffsetArgs{ + args := QueryWorkerForMultiTopicsArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -656,7 +914,7 @@ func (p *ConsumerServiceClient) sendQueryOrgOffset(request *QueryOrgOffsetReques return oprot.Flush() } -func (p *ConsumerServiceClient) recvQueryOrgOffset() (value *QueryOrgOffsetResponse, err error) { +func (p *ConsumerServiceClient) recvQueryWorkerForMultiTopics() (value *MultiTopicsQueryWorkerResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -667,23 +925,23 @@ func (p *ConsumerServiceClient) recvQueryOrgOffset() (value *QueryOrgOffsetRespo return } if mTypeId == thrift.EXCEPTION { - error23 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error24 error - error24, err = error23.Read(iprot) + error38 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error39 error + error39, err = error38.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error24 + err = error39 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "queryOrgOffset failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "queryWorkerForMultiTopics failed: out of sequence response") return } - result := QueryOrgOffsetResult{} + result := QueryWorkerForMultiTopicsResult{} if err = result.Read(iprot); err != nil { return } @@ -698,29 +956,29 @@ func (p *ConsumerServiceClient) recvQueryOrgOffset() (value *QueryOrgOffsetRespo return } -// Get workerId +// query consumer group and partition offset // // // Parameters: // - Request -func (p *ConsumerServiceClient) GetWorkerId(request *GetWorkerIdRequest) (r *GetWorkerIdResponse, err error) { - if err = p.sendGetWorkerId(request); err != nil { +func (p *ConsumerServiceClient) QueryOrgOffset(request *QueryOrgOffsetRequest) (r *QueryOrgOffsetResponse, err error) { + if err = p.sendQueryOrgOffset(request); err != nil { return } - return p.recvGetWorkerId() + return p.recvQueryOrgOffset() } -func (p *ConsumerServiceClient) sendGetWorkerId(request *GetWorkerIdRequest) (err error) { +func (p *ConsumerServiceClient) sendQueryOrgOffset(request *QueryOrgOffsetRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("getWorkerId", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("queryOrgOffset", thrift.CALL, p.SeqId); err != nil { return } - args := GetWorkerIdArgs{ + args := QueryOrgOffsetArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -732,7 +990,7 @@ func (p *ConsumerServiceClient) sendGetWorkerId(request *GetWorkerIdRequest) (er return oprot.Flush() } -func (p *ConsumerServiceClient) recvGetWorkerId() (value *GetWorkerIdResponse, err error) { +func (p *ConsumerServiceClient) recvQueryOrgOffset() (value *QueryOrgOffsetResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -743,23 +1001,23 @@ func (p *ConsumerServiceClient) recvGetWorkerId() (value *GetWorkerIdResponse, e return } if mTypeId == thrift.EXCEPTION { - error25 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error26 error - error26, err = error25.Read(iprot) + error40 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error41 error + error41, err = error40.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error26 + err = error41 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getWorkerId failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "queryOrgOffset failed: out of sequence response") return } - result := GetWorkerIdResult{} + result := QueryOrgOffsetResult{} if err = result.Read(iprot); err != nil { return } @@ -774,29 +1032,185 @@ func (p *ConsumerServiceClient) recvGetWorkerId() (value *GetWorkerIdResponse, e return } -type ConsumerServiceProcessor struct { - *common.TalosBaseServiceProcessor -} - -func NewConsumerServiceProcessor(handler ConsumerService) *ConsumerServiceProcessor { - self27 := &ConsumerServiceProcessor{common.NewTalosBaseServiceProcessor(handler)} - self27.AddToProcessorMap("lockPartition", &consumerServiceProcessorLockPartition{handler: handler}) - self27.AddToProcessorMap("lockWorker", &consumerServiceProcessorLockWorker{handler: handler}) - self27.AddToProcessorMap("unlockPartition", &consumerServiceProcessorUnlockPartition{handler: handler}) - self27.AddToProcessorMap("renew", &consumerServiceProcessorRenew{handler: handler}) - self27.AddToProcessorMap("updateOffset", &consumerServiceProcessorUpdateOffset{handler: handler}) - self27.AddToProcessorMap("queryOffset", &consumerServiceProcessorQueryOffset{handler: handler}) - self27.AddToProcessorMap("queryWorker", &consumerServiceProcessorQueryWorker{handler: handler}) - self27.AddToProcessorMap("queryOrgOffset", &consumerServiceProcessorQueryOrgOffset{handler: handler}) - self27.AddToProcessorMap("getWorkerId", &consumerServiceProcessorGetWorkerId{handler: handler}) - return self27 -} - -type consumerServiceProcessorLockPartition struct { - handler ConsumerService +// Get workerId +// +// +// Parameters: +// - Request +func (p *ConsumerServiceClient) GetWorkerId(request *GetWorkerIdRequest) (r *GetWorkerIdResponse, err error) { + if err = p.sendGetWorkerId(request); err != nil { + return + } + return p.recvGetWorkerId() } -func (p *consumerServiceProcessorLockPartition) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { +func (p *ConsumerServiceClient) sendGetWorkerId(request *GetWorkerIdRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getWorkerId", thrift.CALL, p.SeqId); err != nil { + return + } + args := GetWorkerIdArgs{ + Request: request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *ConsumerServiceClient) recvGetWorkerId() (value *GetWorkerIdResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if mTypeId == thrift.EXCEPTION { + error42 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error43 error + error43, err = error42.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error43 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getWorkerId failed: out of sequence response") + return + } + result := GetWorkerIdResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + value = result.GetSuccess() + return +} + +// Delete consumerGroup for specific topic +// +// +// Parameters: +// - Request +func (p *ConsumerServiceClient) DeleteConsumerGroup(request *DeleteConsumerGroupRequest) (err error) { + if err = p.sendDeleteConsumerGroup(request); err != nil { + return + } + return p.recvDeleteConsumerGroup() +} + +func (p *ConsumerServiceClient) sendDeleteConsumerGroup(request *DeleteConsumerGroupRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("deleteConsumerGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := DeleteConsumerGroupArgs{ + Request: request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *ConsumerServiceClient) recvDeleteConsumerGroup() (err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if mTypeId == thrift.EXCEPTION { + error44 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error45 error + error45, err = error44.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error45 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "deleteConsumerGroup failed: out of sequence response") + return + } + result := DeleteConsumerGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + return +} + +type ConsumerServiceProcessor struct { + *common.TalosBaseServiceProcessor +} + +func NewConsumerServiceProcessor(handler ConsumerService) *ConsumerServiceProcessor { + self46 := &ConsumerServiceProcessor{common.NewTalosBaseServiceProcessor(handler)} + self46.AddToProcessorMap("lockPartition", &consumerServiceProcessorLockPartition{handler: handler}) + self46.AddToProcessorMap("lockWorker", &consumerServiceProcessorLockWorker{handler: handler}) + self46.AddToProcessorMap("lockWorkerForMultiTopics", &consumerServiceProcessorLockWorkerForMultiTopics{handler: handler}) + self46.AddToProcessorMap("checkRegister", &consumerServiceProcessorCheckRegister{handler: handler}) + self46.AddToProcessorMap("unlockPartition", &consumerServiceProcessorUnlockPartition{handler: handler}) + self46.AddToProcessorMap("renew", &consumerServiceProcessorRenew{handler: handler}) + self46.AddToProcessorMap("renewForMultiTopics", &consumerServiceProcessorRenewForMultiTopics{handler: handler}) + self46.AddToProcessorMap("updateOffset", &consumerServiceProcessorUpdateOffset{handler: handler}) + self46.AddToProcessorMap("queryOffset", &consumerServiceProcessorQueryOffset{handler: handler}) + self46.AddToProcessorMap("queryWorker", &consumerServiceProcessorQueryWorker{handler: handler}) + self46.AddToProcessorMap("queryWorkerForMultiTopics", &consumerServiceProcessorQueryWorkerForMultiTopics{handler: handler}) + self46.AddToProcessorMap("queryOrgOffset", &consumerServiceProcessorQueryOrgOffset{handler: handler}) + self46.AddToProcessorMap("getWorkerId", &consumerServiceProcessorGetWorkerId{handler: handler}) + self46.AddToProcessorMap("deleteConsumerGroup", &consumerServiceProcessorDeleteConsumerGroup{handler: handler}) + return self46 +} + +type consumerServiceProcessorLockPartition struct { + handler ConsumerService +} + +func (p *consumerServiceProcessorLockPartition) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { args := LockPartitionArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() @@ -898,16 +1312,16 @@ func (p *consumerServiceProcessorLockWorker) Process(seqId int32, iprot, oprot t return true, err } -type consumerServiceProcessorUnlockPartition struct { +type consumerServiceProcessorLockWorkerForMultiTopics struct { handler ConsumerService } -func (p *consumerServiceProcessorUnlockPartition) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UnlockPartitionArgs{} +func (p *consumerServiceProcessorLockWorkerForMultiTopics) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LockWorkerForMultiTopicsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("unlockPartition", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("lockWorkerForMultiTopics", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -915,22 +1329,25 @@ func (p *consumerServiceProcessorUnlockPartition) Process(seqId int32, iprot, op } iprot.ReadMessageEnd() - result := UnlockPartitionResult{} + result := LockWorkerForMultiTopicsResult{} + var retval *MultiTopicsLockWorkerResponse var err2 error - if err2 = p.handler.UnlockPartition(args.Request); err2 != nil { + if retval, err2 = p.handler.LockWorkerForMultiTopics(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing unlockPartition: "+err2.Error()) - oprot.WriteMessageBegin("unlockPartition", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lockWorkerForMultiTopics: "+err2.Error()) + oprot.WriteMessageBegin("lockWorkerForMultiTopics", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() return true, err2 } + } else { + result.Success = retval } - if err2 = oprot.WriteMessageBegin("unlockPartition", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("lockWorkerForMultiTopics", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -948,16 +1365,16 @@ func (p *consumerServiceProcessorUnlockPartition) Process(seqId int32, iprot, op return true, err } -type consumerServiceProcessorRenew struct { +type consumerServiceProcessorCheckRegister struct { handler ConsumerService } -func (p *consumerServiceProcessorRenew) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := RenewArgs{} +func (p *consumerServiceProcessorCheckRegister) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CheckRegisterArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("renew", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("checkRegister", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -965,16 +1382,16 @@ func (p *consumerServiceProcessorRenew) Process(seqId int32, iprot, oprot thrift } iprot.ReadMessageEnd() - result := RenewResult{} - var retval *RenewResponse + result := CheckRegisterResult{} + var retval *CheckRegisterResponse var err2 error - if retval, err2 = p.handler.Renew(args.Request); err2 != nil { + if retval, err2 = p.handler.CheckRegister(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing renew: "+err2.Error()) - oprot.WriteMessageBegin("renew", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing checkRegister: "+err2.Error()) + oprot.WriteMessageBegin("checkRegister", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -983,7 +1400,7 @@ func (p *consumerServiceProcessorRenew) Process(seqId int32, iprot, oprot thrift } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("renew", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("checkRegister", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -1001,16 +1418,16 @@ func (p *consumerServiceProcessorRenew) Process(seqId int32, iprot, oprot thrift return true, err } -type consumerServiceProcessorUpdateOffset struct { +type consumerServiceProcessorUnlockPartition struct { handler ConsumerService } -func (p *consumerServiceProcessorUpdateOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UpdateOffsetArgs{} +func (p *consumerServiceProcessorUnlockPartition) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UnlockPartitionArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("updateOffset", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("unlockPartition", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1018,25 +1435,22 @@ func (p *consumerServiceProcessorUpdateOffset) Process(seqId int32, iprot, oprot } iprot.ReadMessageEnd() - result := UpdateOffsetResult{} - var retval *UpdateOffsetResponse + result := UnlockPartitionResult{} var err2 error - if retval, err2 = p.handler.UpdateOffset(args.Request); err2 != nil { + if err2 = p.handler.UnlockPartition(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateOffset: "+err2.Error()) - oprot.WriteMessageBegin("updateOffset", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing unlockPartition: "+err2.Error()) + oprot.WriteMessageBegin("unlockPartition", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() return true, err2 } - } else { - result.Success = retval } - if err2 = oprot.WriteMessageBegin("updateOffset", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("unlockPartition", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -1054,16 +1468,16 @@ func (p *consumerServiceProcessorUpdateOffset) Process(seqId int32, iprot, oprot return true, err } -type consumerServiceProcessorQueryOffset struct { +type consumerServiceProcessorRenew struct { handler ConsumerService } -func (p *consumerServiceProcessorQueryOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := QueryOffsetArgs{} +func (p *consumerServiceProcessorRenew) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RenewArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("queryOffset", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("renew", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1071,16 +1485,16 @@ func (p *consumerServiceProcessorQueryOffset) Process(seqId int32, iprot, oprot } iprot.ReadMessageEnd() - result := QueryOffsetResult{} - var retval *QueryOffsetResponse + result := RenewResult{} + var retval *RenewResponse var err2 error - if retval, err2 = p.handler.QueryOffset(args.Request); err2 != nil { + if retval, err2 = p.handler.Renew(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryOffset: "+err2.Error()) - oprot.WriteMessageBegin("queryOffset", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing renew: "+err2.Error()) + oprot.WriteMessageBegin("renew", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1089,7 +1503,7 @@ func (p *consumerServiceProcessorQueryOffset) Process(seqId int32, iprot, oprot } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("queryOffset", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("renew", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -1107,16 +1521,16 @@ func (p *consumerServiceProcessorQueryOffset) Process(seqId int32, iprot, oprot return true, err } -type consumerServiceProcessorQueryWorker struct { +type consumerServiceProcessorRenewForMultiTopics struct { handler ConsumerService } -func (p *consumerServiceProcessorQueryWorker) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := QueryWorkerArgs{} +func (p *consumerServiceProcessorRenewForMultiTopics) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RenewForMultiTopicsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("queryWorker", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("renewForMultiTopics", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1124,16 +1538,16 @@ func (p *consumerServiceProcessorQueryWorker) Process(seqId int32, iprot, oprot } iprot.ReadMessageEnd() - result := QueryWorkerResult{} - var retval *QueryWorkerResponse + result := RenewForMultiTopicsResult{} + var retval *MultiTopicsRenewResponse var err2 error - if retval, err2 = p.handler.QueryWorker(args.Request); err2 != nil { + if retval, err2 = p.handler.RenewForMultiTopics(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryWorker: "+err2.Error()) - oprot.WriteMessageBegin("queryWorker", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing renewForMultiTopics: "+err2.Error()) + oprot.WriteMessageBegin("renewForMultiTopics", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1142,7 +1556,7 @@ func (p *consumerServiceProcessorQueryWorker) Process(seqId int32, iprot, oprot } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("queryWorker", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("renewForMultiTopics", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -1160,16 +1574,16 @@ func (p *consumerServiceProcessorQueryWorker) Process(seqId int32, iprot, oprot return true, err } -type consumerServiceProcessorQueryOrgOffset struct { +type consumerServiceProcessorUpdateOffset struct { handler ConsumerService } -func (p *consumerServiceProcessorQueryOrgOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := QueryOrgOffsetArgs{} +func (p *consumerServiceProcessorUpdateOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UpdateOffsetArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("queryOrgOffset", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("updateOffset", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1177,16 +1591,16 @@ func (p *consumerServiceProcessorQueryOrgOffset) Process(seqId int32, iprot, opr } iprot.ReadMessageEnd() - result := QueryOrgOffsetResult{} - var retval *QueryOrgOffsetResponse + result := UpdateOffsetResult{} + var retval *UpdateOffsetResponse var err2 error - if retval, err2 = p.handler.QueryOrgOffset(args.Request); err2 != nil { + if retval, err2 = p.handler.UpdateOffset(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryOrgOffset: "+err2.Error()) - oprot.WriteMessageBegin("queryOrgOffset", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateOffset: "+err2.Error()) + oprot.WriteMessageBegin("updateOffset", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1195,7 +1609,7 @@ func (p *consumerServiceProcessorQueryOrgOffset) Process(seqId int32, iprot, opr } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("queryOrgOffset", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("updateOffset", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -1213,16 +1627,16 @@ func (p *consumerServiceProcessorQueryOrgOffset) Process(seqId int32, iprot, opr return true, err } -type consumerServiceProcessorGetWorkerId struct { +type consumerServiceProcessorQueryOffset struct { handler ConsumerService } -func (p *consumerServiceProcessorGetWorkerId) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := GetWorkerIdArgs{} +func (p *consumerServiceProcessorQueryOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := QueryOffsetArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getWorkerId", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("queryOffset", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1230,16 +1644,16 @@ func (p *consumerServiceProcessorGetWorkerId) Process(seqId int32, iprot, oprot } iprot.ReadMessageEnd() - result := GetWorkerIdResult{} - var retval *GetWorkerIdResponse + result := QueryOffsetResult{} + var retval *QueryOffsetResponse var err2 error - if retval, err2 = p.handler.GetWorkerId(args.Request); err2 != nil { + if retval, err2 = p.handler.QueryOffset(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getWorkerId: "+err2.Error()) - oprot.WriteMessageBegin("getWorkerId", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryOffset: "+err2.Error()) + oprot.WriteMessageBegin("queryOffset", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1248,7 +1662,7 @@ func (p *consumerServiceProcessorGetWorkerId) Process(seqId int32, iprot, oprot } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("getWorkerId", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("queryOffset", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -1266,17 +1680,279 @@ func (p *consumerServiceProcessorGetWorkerId) Process(seqId int32, iprot, oprot return true, err } -// HELPER FUNCTIONS AND STRUCTURES - -type LockPartitionArgs struct { - Request *LockPartitionRequest `thrift:"request,1" json:"request"` -} - -func NewLockPartitionArgs() *LockPartitionArgs { - return &LockPartitionArgs{} +type consumerServiceProcessorQueryWorker struct { + handler ConsumerService } -var LockPartitionArgs_Request_DEFAULT *LockPartitionRequest +func (p *consumerServiceProcessorQueryWorker) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := QueryWorkerArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("queryWorker", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := QueryWorkerResult{} + var retval *QueryWorkerResponse + var err2 error + if retval, err2 = p.handler.QueryWorker(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryWorker: "+err2.Error()) + oprot.WriteMessageBegin("queryWorker", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("queryWorker", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type consumerServiceProcessorQueryWorkerForMultiTopics struct { + handler ConsumerService +} + +func (p *consumerServiceProcessorQueryWorkerForMultiTopics) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := QueryWorkerForMultiTopicsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("queryWorkerForMultiTopics", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := QueryWorkerForMultiTopicsResult{} + var retval *MultiTopicsQueryWorkerResponse + var err2 error + if retval, err2 = p.handler.QueryWorkerForMultiTopics(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryWorkerForMultiTopics: "+err2.Error()) + oprot.WriteMessageBegin("queryWorkerForMultiTopics", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("queryWorkerForMultiTopics", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type consumerServiceProcessorQueryOrgOffset struct { + handler ConsumerService +} + +func (p *consumerServiceProcessorQueryOrgOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := QueryOrgOffsetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("queryOrgOffset", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := QueryOrgOffsetResult{} + var retval *QueryOrgOffsetResponse + var err2 error + if retval, err2 = p.handler.QueryOrgOffset(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryOrgOffset: "+err2.Error()) + oprot.WriteMessageBegin("queryOrgOffset", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("queryOrgOffset", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type consumerServiceProcessorGetWorkerId struct { + handler ConsumerService +} + +func (p *consumerServiceProcessorGetWorkerId) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetWorkerIdArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getWorkerId", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := GetWorkerIdResult{} + var retval *GetWorkerIdResponse + var err2 error + if retval, err2 = p.handler.GetWorkerId(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getWorkerId: "+err2.Error()) + oprot.WriteMessageBegin("getWorkerId", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getWorkerId", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type consumerServiceProcessorDeleteConsumerGroup struct { + handler ConsumerService +} + +func (p *consumerServiceProcessorDeleteConsumerGroup) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := DeleteConsumerGroupArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("deleteConsumerGroup", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := DeleteConsumerGroupResult{} + var err2 error + if err2 = p.handler.DeleteConsumerGroup(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteConsumerGroup: "+err2.Error()) + oprot.WriteMessageBegin("deleteConsumerGroup", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } + if err2 = oprot.WriteMessageBegin("deleteConsumerGroup", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +// HELPER FUNCTIONS AND STRUCTURES + +type LockPartitionArgs struct { + Request *LockPartitionRequest `thrift:"request,1" json:"request"` +} + +func NewLockPartitionArgs() *LockPartitionArgs { + return &LockPartitionArgs{} +} + +var LockPartitionArgs_Request_DEFAULT *LockPartitionRequest func (p *LockPartitionArgs) GetRequest() *LockPartitionRequest { if !p.IsSetRequest() { @@ -1707,7 +2383,915 @@ func (p *LockWorkerResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *LockWorkerResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *LockWorkerResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *LockWorkerResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *LockWorkerResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LockWorkerResult(%+v)", *p) +} + +type LockWorkerForMultiTopicsArgs struct { + Request *MultiTopicsLockWorkerRequest `thrift:"request,1" json:"request"` +} + +func NewLockWorkerForMultiTopicsArgs() *LockWorkerForMultiTopicsArgs { + return &LockWorkerForMultiTopicsArgs{} +} + +var LockWorkerForMultiTopicsArgs_Request_DEFAULT *MultiTopicsLockWorkerRequest + +func (p *LockWorkerForMultiTopicsArgs) GetRequest() *MultiTopicsLockWorkerRequest { + if !p.IsSetRequest() { + return LockWorkerForMultiTopicsArgs_Request_DEFAULT + } + return p.Request +} +func (p *LockWorkerForMultiTopicsArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *LockWorkerForMultiTopicsArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *LockWorkerForMultiTopicsArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &MultiTopicsLockWorkerRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *LockWorkerForMultiTopicsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("lockWorkerForMultiTopics_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *LockWorkerForMultiTopicsArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *LockWorkerForMultiTopicsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LockWorkerForMultiTopicsArgs(%+v)", *p) +} + +type LockWorkerForMultiTopicsResult struct { + Success *MultiTopicsLockWorkerResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewLockWorkerForMultiTopicsResult() *LockWorkerForMultiTopicsResult { + return &LockWorkerForMultiTopicsResult{} +} + +var LockWorkerForMultiTopicsResult_Success_DEFAULT *MultiTopicsLockWorkerResponse + +func (p *LockWorkerForMultiTopicsResult) GetSuccess() *MultiTopicsLockWorkerResponse { + if !p.IsSetSuccess() { + return LockWorkerForMultiTopicsResult_Success_DEFAULT + } + return p.Success +} + +var LockWorkerForMultiTopicsResult_E_DEFAULT *common.GalaxyTalosException + +func (p *LockWorkerForMultiTopicsResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return LockWorkerForMultiTopicsResult_E_DEFAULT + } + return p.E +} +func (p *LockWorkerForMultiTopicsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LockWorkerForMultiTopicsResult) IsSetE() bool { + return p.E != nil +} + +func (p *LockWorkerForMultiTopicsResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *LockWorkerForMultiTopicsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &MultiTopicsLockWorkerResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *LockWorkerForMultiTopicsResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *LockWorkerForMultiTopicsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("lockWorkerForMultiTopics_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *LockWorkerForMultiTopicsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *LockWorkerForMultiTopicsResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *LockWorkerForMultiTopicsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LockWorkerForMultiTopicsResult(%+v)", *p) +} + +type CheckRegisterArgs struct { + Request *CheckRegisterRequest `thrift:"request,1" json:"request"` +} + +func NewCheckRegisterArgs() *CheckRegisterArgs { + return &CheckRegisterArgs{} +} + +var CheckRegisterArgs_Request_DEFAULT *CheckRegisterRequest + +func (p *CheckRegisterArgs) GetRequest() *CheckRegisterRequest { + if !p.IsSetRequest() { + return CheckRegisterArgs_Request_DEFAULT + } + return p.Request +} +func (p *CheckRegisterArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *CheckRegisterArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CheckRegisterArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &CheckRegisterRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *CheckRegisterArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("checkRegister_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CheckRegisterArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *CheckRegisterArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CheckRegisterArgs(%+v)", *p) +} + +type CheckRegisterResult struct { + Success *CheckRegisterResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewCheckRegisterResult() *CheckRegisterResult { + return &CheckRegisterResult{} +} + +var CheckRegisterResult_Success_DEFAULT *CheckRegisterResponse + +func (p *CheckRegisterResult) GetSuccess() *CheckRegisterResponse { + if !p.IsSetSuccess() { + return CheckRegisterResult_Success_DEFAULT + } + return p.Success +} + +var CheckRegisterResult_E_DEFAULT *common.GalaxyTalosException + +func (p *CheckRegisterResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return CheckRegisterResult_E_DEFAULT + } + return p.E +} +func (p *CheckRegisterResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CheckRegisterResult) IsSetE() bool { + return p.E != nil +} + +func (p *CheckRegisterResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CheckRegisterResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &CheckRegisterResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *CheckRegisterResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *CheckRegisterResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("checkRegister_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CheckRegisterResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *CheckRegisterResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *CheckRegisterResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CheckRegisterResult(%+v)", *p) +} + +type UnlockPartitionArgs struct { + Request *UnlockPartitionRequest `thrift:"request,1" json:"request"` +} + +func NewUnlockPartitionArgs() *UnlockPartitionArgs { + return &UnlockPartitionArgs{} +} + +var UnlockPartitionArgs_Request_DEFAULT *UnlockPartitionRequest + +func (p *UnlockPartitionArgs) GetRequest() *UnlockPartitionRequest { + if !p.IsSetRequest() { + return UnlockPartitionArgs_Request_DEFAULT + } + return p.Request +} +func (p *UnlockPartitionArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *UnlockPartitionArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *UnlockPartitionArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &UnlockPartitionRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *UnlockPartitionArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("unlockPartition_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *UnlockPartitionArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *UnlockPartitionArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UnlockPartitionArgs(%+v)", *p) +} + +type UnlockPartitionResult struct { + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewUnlockPartitionResult() *UnlockPartitionResult { + return &UnlockPartitionResult{} +} + +var UnlockPartitionResult_E_DEFAULT *common.GalaxyTalosException + +func (p *UnlockPartitionResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return UnlockPartitionResult_E_DEFAULT + } + return p.E +} +func (p *UnlockPartitionResult) IsSetE() bool { + return p.E != nil +} + +func (p *UnlockPartitionResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *UnlockPartitionResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *UnlockPartitionResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("unlockPartition_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *UnlockPartitionResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *UnlockPartitionResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UnlockPartitionResult(%+v)", *p) +} + +type RenewArgs struct { + Request *RenewRequest `thrift:"request,1" json:"request"` +} + +func NewRenewArgs() *RenewArgs { + return &RenewArgs{} +} + +var RenewArgs_Request_DEFAULT *RenewRequest + +func (p *RenewArgs) GetRequest() *RenewRequest { + if !p.IsSetRequest() { + return RenewArgs_Request_DEFAULT + } + return p.Request +} +func (p *RenewArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *RenewArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *RenewArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &RenewRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *RenewArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("renew_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *RenewArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *RenewArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RenewArgs(%+v)", *p) +} + +type RenewResult struct { + Success *RenewResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewRenewResult() *RenewResult { + return &RenewResult{} +} + +var RenewResult_Success_DEFAULT *RenewResponse + +func (p *RenewResult) GetSuccess() *RenewResponse { + if !p.IsSetSuccess() { + return RenewResult_Success_DEFAULT + } + return p.Success +} + +var RenewResult_E_DEFAULT *common.GalaxyTalosException + +func (p *RenewResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return RenewResult_E_DEFAULT + } + return p.E +} +func (p *RenewResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RenewResult) IsSetE() bool { + return p.E != nil +} + +func (p *RenewResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *RenewResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &RenewResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *RenewResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *RenewResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("renew_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *RenewResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -1722,7 +3306,7 @@ func (p *LockWorkerResult) writeField0(oprot thrift.TProtocol) (err error) { return err } -func (p *LockWorkerResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *RenewResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -1737,34 +3321,34 @@ func (p *LockWorkerResult) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *LockWorkerResult) String() string { +func (p *RenewResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LockWorkerResult(%+v)", *p) + return fmt.Sprintf("RenewResult(%+v)", *p) } -type UnlockPartitionArgs struct { - Request *UnlockPartitionRequest `thrift:"request,1" json:"request"` +type RenewForMultiTopicsArgs struct { + Request *MultiTopicsRenewRequest `thrift:"request,1" json:"request"` } -func NewUnlockPartitionArgs() *UnlockPartitionArgs { - return &UnlockPartitionArgs{} +func NewRenewForMultiTopicsArgs() *RenewForMultiTopicsArgs { + return &RenewForMultiTopicsArgs{} } -var UnlockPartitionArgs_Request_DEFAULT *UnlockPartitionRequest +var RenewForMultiTopicsArgs_Request_DEFAULT *MultiTopicsRenewRequest -func (p *UnlockPartitionArgs) GetRequest() *UnlockPartitionRequest { +func (p *RenewForMultiTopicsArgs) GetRequest() *MultiTopicsRenewRequest { if !p.IsSetRequest() { - return UnlockPartitionArgs_Request_DEFAULT + return RenewForMultiTopicsArgs_Request_DEFAULT } return p.Request } -func (p *UnlockPartitionArgs) IsSetRequest() bool { +func (p *RenewForMultiTopicsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UnlockPartitionArgs) Read(iprot thrift.TProtocol) error { +func (p *RenewForMultiTopicsArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1796,16 +3380,16 @@ func (p *UnlockPartitionArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *UnlockPartitionArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &UnlockPartitionRequest{} +func (p *RenewForMultiTopicsArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &MultiTopicsRenewRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *UnlockPartitionArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("unlockPartition_args"); err != nil { +func (p *RenewForMultiTopicsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("renewForMultiTopics_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1820,7 +3404,7 @@ func (p *UnlockPartitionArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *UnlockPartitionArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *RenewForMultiTopicsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -1833,34 +3417,48 @@ func (p *UnlockPartitionArgs) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *UnlockPartitionArgs) String() string { +func (p *RenewForMultiTopicsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UnlockPartitionArgs(%+v)", *p) + return fmt.Sprintf("RenewForMultiTopicsArgs(%+v)", *p) } -type UnlockPartitionResult struct { - E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +type RenewForMultiTopicsResult struct { + Success *MultiTopicsRenewResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewUnlockPartitionResult() *UnlockPartitionResult { - return &UnlockPartitionResult{} +func NewRenewForMultiTopicsResult() *RenewForMultiTopicsResult { + return &RenewForMultiTopicsResult{} } -var UnlockPartitionResult_E_DEFAULT *common.GalaxyTalosException +var RenewForMultiTopicsResult_Success_DEFAULT *MultiTopicsRenewResponse -func (p *UnlockPartitionResult) GetE() *common.GalaxyTalosException { +func (p *RenewForMultiTopicsResult) GetSuccess() *MultiTopicsRenewResponse { + if !p.IsSetSuccess() { + return RenewForMultiTopicsResult_Success_DEFAULT + } + return p.Success +} + +var RenewForMultiTopicsResult_E_DEFAULT *common.GalaxyTalosException + +func (p *RenewForMultiTopicsResult) GetE() *common.GalaxyTalosException { if !p.IsSetE() { - return UnlockPartitionResult_E_DEFAULT + return RenewForMultiTopicsResult_E_DEFAULT } return p.E } -func (p *UnlockPartitionResult) IsSetE() bool { +func (p *RenewForMultiTopicsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RenewForMultiTopicsResult) IsSetE() bool { return p.E != nil } -func (p *UnlockPartitionResult) Read(iprot thrift.TProtocol) error { +func (p *RenewForMultiTopicsResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1873,6 +3471,10 @@ func (p *UnlockPartitionResult) Read(iprot thrift.TProtocol) error { break } switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } case 1: if err := p.ReadField1(iprot); err != nil { return err @@ -1892,7 +3494,15 @@ func (p *UnlockPartitionResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *UnlockPartitionResult) ReadField1(iprot thrift.TProtocol) error { +func (p *RenewForMultiTopicsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &MultiTopicsRenewResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *RenewForMultiTopicsResult) ReadField1(iprot thrift.TProtocol) error { p.E = &common.GalaxyTalosException{} if err := p.E.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.E, err) @@ -1900,10 +3510,13 @@ func (p *UnlockPartitionResult) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UnlockPartitionResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("unlockPartition_result"); err != nil { +func (p *RenewForMultiTopicsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("renewForMultiTopics_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } + if err := p.writeField0(oprot); err != nil { + return err + } if err := p.writeField1(oprot); err != nil { return err } @@ -1916,7 +3529,22 @@ func (p *UnlockPartitionResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *UnlockPartitionResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *RenewForMultiTopicsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *RenewForMultiTopicsResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -1931,34 +3559,34 @@ func (p *UnlockPartitionResult) writeField1(oprot thrift.TProtocol) (err error) return err } -func (p *UnlockPartitionResult) String() string { +func (p *RenewForMultiTopicsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UnlockPartitionResult(%+v)", *p) + return fmt.Sprintf("RenewForMultiTopicsResult(%+v)", *p) } -type RenewArgs struct { - Request *RenewRequest `thrift:"request,1" json:"request"` +type UpdateOffsetArgs struct { + Request *UpdateOffsetRequest `thrift:"request,1" json:"request"` } -func NewRenewArgs() *RenewArgs { - return &RenewArgs{} +func NewUpdateOffsetArgs() *UpdateOffsetArgs { + return &UpdateOffsetArgs{} } -var RenewArgs_Request_DEFAULT *RenewRequest +var UpdateOffsetArgs_Request_DEFAULT *UpdateOffsetRequest -func (p *RenewArgs) GetRequest() *RenewRequest { +func (p *UpdateOffsetArgs) GetRequest() *UpdateOffsetRequest { if !p.IsSetRequest() { - return RenewArgs_Request_DEFAULT + return UpdateOffsetArgs_Request_DEFAULT } return p.Request } -func (p *RenewArgs) IsSetRequest() bool { +func (p *UpdateOffsetArgs) IsSetRequest() bool { return p.Request != nil } -func (p *RenewArgs) Read(iprot thrift.TProtocol) error { +func (p *UpdateOffsetArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1990,16 +3618,16 @@ func (p *RenewArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *RenewArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &RenewRequest{} +func (p *UpdateOffsetArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &UpdateOffsetRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *RenewArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("renew_args"); err != nil { +func (p *UpdateOffsetArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("updateOffset_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -2014,7 +3642,7 @@ func (p *RenewArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *RenewArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *UpdateOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -2027,48 +3655,48 @@ func (p *RenewArgs) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *RenewArgs) String() string { +func (p *UpdateOffsetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("RenewArgs(%+v)", *p) + return fmt.Sprintf("UpdateOffsetArgs(%+v)", *p) } -type RenewResult struct { - Success *RenewResponse `thrift:"success,0" json:"success"` +type UpdateOffsetResult struct { + Success *UpdateOffsetResponse `thrift:"success,0" json:"success"` E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewRenewResult() *RenewResult { - return &RenewResult{} +func NewUpdateOffsetResult() *UpdateOffsetResult { + return &UpdateOffsetResult{} } -var RenewResult_Success_DEFAULT *RenewResponse +var UpdateOffsetResult_Success_DEFAULT *UpdateOffsetResponse -func (p *RenewResult) GetSuccess() *RenewResponse { +func (p *UpdateOffsetResult) GetSuccess() *UpdateOffsetResponse { if !p.IsSetSuccess() { - return RenewResult_Success_DEFAULT + return UpdateOffsetResult_Success_DEFAULT } return p.Success } -var RenewResult_E_DEFAULT *common.GalaxyTalosException +var UpdateOffsetResult_E_DEFAULT *common.GalaxyTalosException -func (p *RenewResult) GetE() *common.GalaxyTalosException { +func (p *UpdateOffsetResult) GetE() *common.GalaxyTalosException { if !p.IsSetE() { - return RenewResult_E_DEFAULT + return UpdateOffsetResult_E_DEFAULT } return p.E } -func (p *RenewResult) IsSetSuccess() bool { +func (p *UpdateOffsetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *RenewResult) IsSetE() bool { +func (p *UpdateOffsetResult) IsSetE() bool { return p.E != nil } -func (p *RenewResult) Read(iprot thrift.TProtocol) error { +func (p *UpdateOffsetResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2104,15 +3732,15 @@ func (p *RenewResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *RenewResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &RenewResponse{} +func (p *UpdateOffsetResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &UpdateOffsetResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *RenewResult) ReadField1(iprot thrift.TProtocol) error { +func (p *UpdateOffsetResult) ReadField1(iprot thrift.TProtocol) error { p.E = &common.GalaxyTalosException{} if err := p.E.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.E, err) @@ -2120,8 +3748,8 @@ func (p *RenewResult) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *RenewResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("renew_result"); err != nil { +func (p *UpdateOffsetResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("updateOffset_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { @@ -2139,7 +3767,7 @@ func (p *RenewResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *RenewResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *UpdateOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -2154,7 +3782,7 @@ func (p *RenewResult) writeField0(oprot thrift.TProtocol) (err error) { return err } -func (p *RenewResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *UpdateOffsetResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -2169,34 +3797,34 @@ func (p *RenewResult) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *RenewResult) String() string { +func (p *UpdateOffsetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("RenewResult(%+v)", *p) + return fmt.Sprintf("UpdateOffsetResult(%+v)", *p) } -type UpdateOffsetArgs struct { - Request *UpdateOffsetRequest `thrift:"request,1" json:"request"` +type QueryOffsetArgs struct { + Request *QueryOffsetRequest `thrift:"request,1" json:"request"` } -func NewUpdateOffsetArgs() *UpdateOffsetArgs { - return &UpdateOffsetArgs{} +func NewQueryOffsetArgs() *QueryOffsetArgs { + return &QueryOffsetArgs{} } -var UpdateOffsetArgs_Request_DEFAULT *UpdateOffsetRequest +var QueryOffsetArgs_Request_DEFAULT *QueryOffsetRequest -func (p *UpdateOffsetArgs) GetRequest() *UpdateOffsetRequest { +func (p *QueryOffsetArgs) GetRequest() *QueryOffsetRequest { if !p.IsSetRequest() { - return UpdateOffsetArgs_Request_DEFAULT + return QueryOffsetArgs_Request_DEFAULT } return p.Request } -func (p *UpdateOffsetArgs) IsSetRequest() bool { +func (p *QueryOffsetArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UpdateOffsetArgs) Read(iprot thrift.TProtocol) error { +func (p *QueryOffsetArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2228,16 +3856,16 @@ func (p *UpdateOffsetArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *UpdateOffsetArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &UpdateOffsetRequest{} +func (p *QueryOffsetArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &QueryOffsetRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *UpdateOffsetArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("updateOffset_args"); err != nil { +func (p *QueryOffsetArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("queryOffset_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -2252,7 +3880,7 @@ func (p *UpdateOffsetArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *UpdateOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *QueryOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -2265,48 +3893,48 @@ func (p *UpdateOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *UpdateOffsetArgs) String() string { +func (p *QueryOffsetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UpdateOffsetArgs(%+v)", *p) + return fmt.Sprintf("QueryOffsetArgs(%+v)", *p) } -type UpdateOffsetResult struct { - Success *UpdateOffsetResponse `thrift:"success,0" json:"success"` +type QueryOffsetResult struct { + Success *QueryOffsetResponse `thrift:"success,0" json:"success"` E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewUpdateOffsetResult() *UpdateOffsetResult { - return &UpdateOffsetResult{} +func NewQueryOffsetResult() *QueryOffsetResult { + return &QueryOffsetResult{} } -var UpdateOffsetResult_Success_DEFAULT *UpdateOffsetResponse +var QueryOffsetResult_Success_DEFAULT *QueryOffsetResponse -func (p *UpdateOffsetResult) GetSuccess() *UpdateOffsetResponse { +func (p *QueryOffsetResult) GetSuccess() *QueryOffsetResponse { if !p.IsSetSuccess() { - return UpdateOffsetResult_Success_DEFAULT + return QueryOffsetResult_Success_DEFAULT } return p.Success } -var UpdateOffsetResult_E_DEFAULT *common.GalaxyTalosException +var QueryOffsetResult_E_DEFAULT *common.GalaxyTalosException -func (p *UpdateOffsetResult) GetE() *common.GalaxyTalosException { +func (p *QueryOffsetResult) GetE() *common.GalaxyTalosException { if !p.IsSetE() { - return UpdateOffsetResult_E_DEFAULT + return QueryOffsetResult_E_DEFAULT } return p.E } -func (p *UpdateOffsetResult) IsSetSuccess() bool { +func (p *QueryOffsetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UpdateOffsetResult) IsSetE() bool { +func (p *QueryOffsetResult) IsSetE() bool { return p.E != nil } -func (p *UpdateOffsetResult) Read(iprot thrift.TProtocol) error { +func (p *QueryOffsetResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2342,15 +3970,15 @@ func (p *UpdateOffsetResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *UpdateOffsetResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &UpdateOffsetResponse{} +func (p *QueryOffsetResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &QueryOffsetResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *UpdateOffsetResult) ReadField1(iprot thrift.TProtocol) error { +func (p *QueryOffsetResult) ReadField1(iprot thrift.TProtocol) error { p.E = &common.GalaxyTalosException{} if err := p.E.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.E, err) @@ -2358,8 +3986,8 @@ func (p *UpdateOffsetResult) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UpdateOffsetResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("updateOffset_result"); err != nil { +func (p *QueryOffsetResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("queryOffset_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { @@ -2377,7 +4005,7 @@ func (p *UpdateOffsetResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *UpdateOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *QueryOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -2392,7 +4020,7 @@ func (p *UpdateOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { return err } -func (p *UpdateOffsetResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *QueryOffsetResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -2407,34 +4035,34 @@ func (p *UpdateOffsetResult) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *UpdateOffsetResult) String() string { +func (p *QueryOffsetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UpdateOffsetResult(%+v)", *p) + return fmt.Sprintf("QueryOffsetResult(%+v)", *p) } -type QueryOffsetArgs struct { - Request *QueryOffsetRequest `thrift:"request,1" json:"request"` +type QueryWorkerArgs struct { + Request *QueryWorkerRequest `thrift:"request,1" json:"request"` } -func NewQueryOffsetArgs() *QueryOffsetArgs { - return &QueryOffsetArgs{} +func NewQueryWorkerArgs() *QueryWorkerArgs { + return &QueryWorkerArgs{} } -var QueryOffsetArgs_Request_DEFAULT *QueryOffsetRequest +var QueryWorkerArgs_Request_DEFAULT *QueryWorkerRequest -func (p *QueryOffsetArgs) GetRequest() *QueryOffsetRequest { +func (p *QueryWorkerArgs) GetRequest() *QueryWorkerRequest { if !p.IsSetRequest() { - return QueryOffsetArgs_Request_DEFAULT + return QueryWorkerArgs_Request_DEFAULT } return p.Request } -func (p *QueryOffsetArgs) IsSetRequest() bool { +func (p *QueryWorkerArgs) IsSetRequest() bool { return p.Request != nil } -func (p *QueryOffsetArgs) Read(iprot thrift.TProtocol) error { +func (p *QueryWorkerArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2466,16 +4094,16 @@ func (p *QueryOffsetArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *QueryOffsetArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &QueryOffsetRequest{} +func (p *QueryWorkerArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &QueryWorkerRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } - -func (p *QueryOffsetArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("queryOffset_args"); err != nil { + +func (p *QueryWorkerArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("queryWorker_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -2490,7 +4118,7 @@ func (p *QueryOffsetArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *QueryOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *QueryWorkerArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -2503,48 +4131,48 @@ func (p *QueryOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *QueryOffsetArgs) String() string { +func (p *QueryWorkerArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("QueryOffsetArgs(%+v)", *p) + return fmt.Sprintf("QueryWorkerArgs(%+v)", *p) } -type QueryOffsetResult struct { - Success *QueryOffsetResponse `thrift:"success,0" json:"success"` +type QueryWorkerResult struct { + Success *QueryWorkerResponse `thrift:"success,0" json:"success"` E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewQueryOffsetResult() *QueryOffsetResult { - return &QueryOffsetResult{} +func NewQueryWorkerResult() *QueryWorkerResult { + return &QueryWorkerResult{} } -var QueryOffsetResult_Success_DEFAULT *QueryOffsetResponse +var QueryWorkerResult_Success_DEFAULT *QueryWorkerResponse -func (p *QueryOffsetResult) GetSuccess() *QueryOffsetResponse { +func (p *QueryWorkerResult) GetSuccess() *QueryWorkerResponse { if !p.IsSetSuccess() { - return QueryOffsetResult_Success_DEFAULT + return QueryWorkerResult_Success_DEFAULT } return p.Success } -var QueryOffsetResult_E_DEFAULT *common.GalaxyTalosException +var QueryWorkerResult_E_DEFAULT *common.GalaxyTalosException -func (p *QueryOffsetResult) GetE() *common.GalaxyTalosException { +func (p *QueryWorkerResult) GetE() *common.GalaxyTalosException { if !p.IsSetE() { - return QueryOffsetResult_E_DEFAULT + return QueryWorkerResult_E_DEFAULT } return p.E } -func (p *QueryOffsetResult) IsSetSuccess() bool { +func (p *QueryWorkerResult) IsSetSuccess() bool { return p.Success != nil } -func (p *QueryOffsetResult) IsSetE() bool { +func (p *QueryWorkerResult) IsSetE() bool { return p.E != nil } -func (p *QueryOffsetResult) Read(iprot thrift.TProtocol) error { +func (p *QueryWorkerResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2580,15 +4208,15 @@ func (p *QueryOffsetResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *QueryOffsetResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &QueryOffsetResponse{} +func (p *QueryWorkerResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &QueryWorkerResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *QueryOffsetResult) ReadField1(iprot thrift.TProtocol) error { +func (p *QueryWorkerResult) ReadField1(iprot thrift.TProtocol) error { p.E = &common.GalaxyTalosException{} if err := p.E.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.E, err) @@ -2596,8 +4224,8 @@ func (p *QueryOffsetResult) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *QueryOffsetResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("queryOffset_result"); err != nil { +func (p *QueryWorkerResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("queryWorker_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { @@ -2615,7 +4243,7 @@ func (p *QueryOffsetResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *QueryOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *QueryWorkerResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -2630,7 +4258,7 @@ func (p *QueryOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { return err } -func (p *QueryOffsetResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *QueryWorkerResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -2645,34 +4273,34 @@ func (p *QueryOffsetResult) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *QueryOffsetResult) String() string { +func (p *QueryWorkerResult) String() string { if p == nil { return "" } - return fmt.Sprintf("QueryOffsetResult(%+v)", *p) + return fmt.Sprintf("QueryWorkerResult(%+v)", *p) } -type QueryWorkerArgs struct { - Request *QueryWorkerRequest `thrift:"request,1" json:"request"` +type QueryWorkerForMultiTopicsArgs struct { + Request *MultiTopicsQueryWorkerRequest `thrift:"request,1" json:"request"` } -func NewQueryWorkerArgs() *QueryWorkerArgs { - return &QueryWorkerArgs{} +func NewQueryWorkerForMultiTopicsArgs() *QueryWorkerForMultiTopicsArgs { + return &QueryWorkerForMultiTopicsArgs{} } -var QueryWorkerArgs_Request_DEFAULT *QueryWorkerRequest +var QueryWorkerForMultiTopicsArgs_Request_DEFAULT *MultiTopicsQueryWorkerRequest -func (p *QueryWorkerArgs) GetRequest() *QueryWorkerRequest { +func (p *QueryWorkerForMultiTopicsArgs) GetRequest() *MultiTopicsQueryWorkerRequest { if !p.IsSetRequest() { - return QueryWorkerArgs_Request_DEFAULT + return QueryWorkerForMultiTopicsArgs_Request_DEFAULT } return p.Request } -func (p *QueryWorkerArgs) IsSetRequest() bool { +func (p *QueryWorkerForMultiTopicsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *QueryWorkerArgs) Read(iprot thrift.TProtocol) error { +func (p *QueryWorkerForMultiTopicsArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2704,16 +4332,16 @@ func (p *QueryWorkerArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &QueryWorkerRequest{} +func (p *QueryWorkerForMultiTopicsArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &MultiTopicsQueryWorkerRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *QueryWorkerArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("queryWorker_args"); err != nil { +func (p *QueryWorkerForMultiTopicsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("queryWorkerForMultiTopics_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -2728,7 +4356,7 @@ func (p *QueryWorkerArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *QueryWorkerForMultiTopicsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -2741,48 +4369,48 @@ func (p *QueryWorkerArgs) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *QueryWorkerArgs) String() string { +func (p *QueryWorkerForMultiTopicsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("QueryWorkerArgs(%+v)", *p) + return fmt.Sprintf("QueryWorkerForMultiTopicsArgs(%+v)", *p) } -type QueryWorkerResult struct { - Success *QueryWorkerResponse `thrift:"success,0" json:"success"` - E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +type QueryWorkerForMultiTopicsResult struct { + Success *MultiTopicsQueryWorkerResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewQueryWorkerResult() *QueryWorkerResult { - return &QueryWorkerResult{} +func NewQueryWorkerForMultiTopicsResult() *QueryWorkerForMultiTopicsResult { + return &QueryWorkerForMultiTopicsResult{} } -var QueryWorkerResult_Success_DEFAULT *QueryWorkerResponse +var QueryWorkerForMultiTopicsResult_Success_DEFAULT *MultiTopicsQueryWorkerResponse -func (p *QueryWorkerResult) GetSuccess() *QueryWorkerResponse { +func (p *QueryWorkerForMultiTopicsResult) GetSuccess() *MultiTopicsQueryWorkerResponse { if !p.IsSetSuccess() { - return QueryWorkerResult_Success_DEFAULT + return QueryWorkerForMultiTopicsResult_Success_DEFAULT } return p.Success } -var QueryWorkerResult_E_DEFAULT *common.GalaxyTalosException +var QueryWorkerForMultiTopicsResult_E_DEFAULT *common.GalaxyTalosException -func (p *QueryWorkerResult) GetE() *common.GalaxyTalosException { +func (p *QueryWorkerForMultiTopicsResult) GetE() *common.GalaxyTalosException { if !p.IsSetE() { - return QueryWorkerResult_E_DEFAULT + return QueryWorkerForMultiTopicsResult_E_DEFAULT } return p.E } -func (p *QueryWorkerResult) IsSetSuccess() bool { +func (p *QueryWorkerForMultiTopicsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *QueryWorkerResult) IsSetE() bool { +func (p *QueryWorkerForMultiTopicsResult) IsSetE() bool { return p.E != nil } -func (p *QueryWorkerResult) Read(iprot thrift.TProtocol) error { +func (p *QueryWorkerForMultiTopicsResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2818,15 +4446,15 @@ func (p *QueryWorkerResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &QueryWorkerResponse{} +func (p *QueryWorkerForMultiTopicsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &MultiTopicsQueryWorkerResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *QueryWorkerResult) ReadField1(iprot thrift.TProtocol) error { +func (p *QueryWorkerForMultiTopicsResult) ReadField1(iprot thrift.TProtocol) error { p.E = &common.GalaxyTalosException{} if err := p.E.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.E, err) @@ -2834,8 +4462,8 @@ func (p *QueryWorkerResult) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("queryWorker_result"); err != nil { +func (p *QueryWorkerForMultiTopicsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("queryWorkerForMultiTopics_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { @@ -2853,7 +4481,7 @@ func (p *QueryWorkerResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *QueryWorkerForMultiTopicsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -2868,7 +4496,7 @@ func (p *QueryWorkerResult) writeField0(oprot thrift.TProtocol) (err error) { return err } -func (p *QueryWorkerResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *QueryWorkerForMultiTopicsResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -2883,11 +4511,11 @@ func (p *QueryWorkerResult) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *QueryWorkerResult) String() string { +func (p *QueryWorkerForMultiTopicsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("QueryWorkerResult(%+v)", *p) + return fmt.Sprintf("QueryWorkerForMultiTopicsResult(%+v)", *p) } type QueryOrgOffsetArgs struct { @@ -3365,3 +4993,197 @@ func (p *GetWorkerIdResult) String() string { } return fmt.Sprintf("GetWorkerIdResult(%+v)", *p) } + +type DeleteConsumerGroupArgs struct { + Request *DeleteConsumerGroupRequest `thrift:"request,1" json:"request"` +} + +func NewDeleteConsumerGroupArgs() *DeleteConsumerGroupArgs { + return &DeleteConsumerGroupArgs{} +} + +var DeleteConsumerGroupArgs_Request_DEFAULT *DeleteConsumerGroupRequest + +func (p *DeleteConsumerGroupArgs) GetRequest() *DeleteConsumerGroupRequest { + if !p.IsSetRequest() { + return DeleteConsumerGroupArgs_Request_DEFAULT + } + return p.Request +} +func (p *DeleteConsumerGroupArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *DeleteConsumerGroupArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *DeleteConsumerGroupArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &DeleteConsumerGroupRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *DeleteConsumerGroupArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("deleteConsumerGroup_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *DeleteConsumerGroupArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *DeleteConsumerGroupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteConsumerGroupArgs(%+v)", *p) +} + +type DeleteConsumerGroupResult struct { + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewDeleteConsumerGroupResult() *DeleteConsumerGroupResult { + return &DeleteConsumerGroupResult{} +} + +var DeleteConsumerGroupResult_E_DEFAULT *common.GalaxyTalosException + +func (p *DeleteConsumerGroupResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return DeleteConsumerGroupResult_E_DEFAULT + } + return p.E +} +func (p *DeleteConsumerGroupResult) IsSetE() bool { + return p.E != nil +} + +func (p *DeleteConsumerGroupResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *DeleteConsumerGroupResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *DeleteConsumerGroupResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("deleteConsumerGroup_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *DeleteConsumerGroupResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *DeleteConsumerGroupResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteConsumerGroupResult(%+v)", *p) +} diff --git a/thrift/consumer/ttypes.go b/thrift/consumer/ttypes.go index e4e265a..a156d26 100644 --- a/thrift/consumer/ttypes.go +++ b/thrift/consumer/ttypes.go @@ -240,6 +240,212 @@ func (p *ConsumeUnit) String() string { return fmt.Sprintf("ConsumeUnit(%+v)", *p) } +type MultiTopicsConsumeUnit struct { + ConsumerGroup string `thrift:"consumerGroup,1,required" json:"consumerGroup"` + TopicPartitions map[string][]int32 `thrift:"topicPartitions,2,required" json:"topicPartitions"` + WorkerId string `thrift:"workerId,3,required" json:"workerId"` +} + +func NewMultiTopicsConsumeUnit() *MultiTopicsConsumeUnit { + return &MultiTopicsConsumeUnit{} +} + +func (p *MultiTopicsConsumeUnit) GetConsumerGroup() string { + return p.ConsumerGroup +} + +func (p *MultiTopicsConsumeUnit) GetTopicPartitions() map[string][]int32 { + return p.TopicPartitions +} + +func (p *MultiTopicsConsumeUnit) GetWorkerId() string { + return p.WorkerId +} +func (p *MultiTopicsConsumeUnit) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *MultiTopicsConsumeUnit) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.ConsumerGroup = v + } + return nil +} + +func (p *MultiTopicsConsumeUnit) ReadField2(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return fmt.Errorf("error reading map begin: %s", err) + } + tMap := make(map[string][]int32, size) + p.TopicPartitions = tMap + for i := 0; i < size; i++ { + var _key1 string + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + _key1 = v + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return fmt.Errorf("error reading list begin: %s", err) + } + tSlice := make([]int32, 0, size) + _val2 := tSlice + for i := 0; i < size; i++ { + var _elem3 int32 + if v, err := iprot.ReadI32(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + _elem3 = v + } + _val2 = append(_val2, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return fmt.Errorf("error reading list end: %s", err) + } + p.TopicPartitions[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return fmt.Errorf("error reading map end: %s", err) + } + return nil +} + +func (p *MultiTopicsConsumeUnit) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.WorkerId = v + } + return nil +} + +func (p *MultiTopicsConsumeUnit) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("MultiTopicsConsumeUnit"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *MultiTopicsConsumeUnit) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("consumerGroup", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:consumerGroup: %s", p, err) + } + if err := oprot.WriteString(string(p.ConsumerGroup)); err != nil { + return fmt.Errorf("%T.consumerGroup (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:consumerGroup: %s", p, err) + } + return err +} + +func (p *MultiTopicsConsumeUnit) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicPartitions", thrift.MAP, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:topicPartitions: %s", p, err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.TopicPartitions)); err != nil { + return fmt.Errorf("error writing map begin: %s", err) + } + for k, v := range p.TopicPartitions { + if err := oprot.WriteString(string(k)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) + } + if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + return fmt.Errorf("error writing list begin: %s", err) + } + for _, v := range v { + if err := oprot.WriteI32(int32(v)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return fmt.Errorf("error writing list end: %s", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return fmt.Errorf("error writing map end: %s", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:topicPartitions: %s", p, err) + } + return err +} + +func (p *MultiTopicsConsumeUnit) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("workerId", thrift.STRING, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:workerId: %s", p, err) + } + if err := oprot.WriteString(string(p.WorkerId)); err != nil { + return fmt.Errorf("%T.workerId (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:workerId: %s", p, err) + } + return err +} + +func (p *MultiTopicsConsumeUnit) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiTopicsConsumeUnit(%+v)", *p) +} + type CheckPoint struct { ConsumerGroup string `thrift:"consumerGroup,1,required" json:"consumerGroup"` TopicAndPartition *topic.TopicAndPartition `thrift:"topicAndPartition,2,required" json:"topicAndPartition"` @@ -639,13 +845,13 @@ func (p *LockPartitionResponse) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]int32, 0, size) p.SuccessPartitions = tSlice for i := 0; i < size; i++ { - var _elem1 int32 + var _elem4 int32 if v, err := iprot.ReadI32(); err != nil { return fmt.Errorf("error reading field 0: %s", err) } else { - _elem1 = v + _elem4 = v } - p.SuccessPartitions = append(p.SuccessPartitions, _elem1) + p.SuccessPartitions = append(p.SuccessPartitions, _elem4) } if err := iprot.ReadListEnd(); err != nil { return fmt.Errorf("error reading list end: %s", err) @@ -661,13 +867,13 @@ func (p *LockPartitionResponse) ReadField2(iprot thrift.TProtocol) error { tSlice := make([]int32, 0, size) p.FailedPartitions = tSlice for i := 0; i < size; i++ { - var _elem2 int32 + var _elem5 int32 if v, err := iprot.ReadI32(); err != nil { return fmt.Errorf("error reading field 0: %s", err) } else { - _elem2 = v + _elem5 = v } - p.FailedPartitions = append(p.FailedPartitions, _elem2) + p.FailedPartitions = append(p.FailedPartitions, _elem5) } if err := iprot.ReadListEnd(); err != nil { return fmt.Errorf("error reading list end: %s", err) @@ -743,27 +949,27 @@ func (p *LockPartitionResponse) String() string { return fmt.Sprintf("LockPartitionResponse(%+v)", *p) } -type LockWorkerRequest struct { +type CheckRegisterRequest struct { ConsumeUnit *ConsumeUnit `thrift:"consumeUnit,1,required" json:"consumeUnit"` } -func NewLockWorkerRequest() *LockWorkerRequest { - return &LockWorkerRequest{} +func NewCheckRegisterRequest() *CheckRegisterRequest { + return &CheckRegisterRequest{} } -var LockWorkerRequest_ConsumeUnit_DEFAULT *ConsumeUnit +var CheckRegisterRequest_ConsumeUnit_DEFAULT *ConsumeUnit -func (p *LockWorkerRequest) GetConsumeUnit() *ConsumeUnit { +func (p *CheckRegisterRequest) GetConsumeUnit() *ConsumeUnit { if !p.IsSetConsumeUnit() { - return LockWorkerRequest_ConsumeUnit_DEFAULT + return CheckRegisterRequest_ConsumeUnit_DEFAULT } return p.ConsumeUnit } -func (p *LockWorkerRequest) IsSetConsumeUnit() bool { +func (p *CheckRegisterRequest) IsSetConsumeUnit() bool { return p.ConsumeUnit != nil } -func (p *LockWorkerRequest) Read(iprot thrift.TProtocol) error { +func (p *CheckRegisterRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -795,7 +1001,7 @@ func (p *LockWorkerRequest) Read(iprot thrift.TProtocol) error { return nil } -func (p *LockWorkerRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *CheckRegisterRequest) ReadField1(iprot thrift.TProtocol) error { p.ConsumeUnit = &ConsumeUnit{} if err := p.ConsumeUnit.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.ConsumeUnit, err) @@ -803,8 +1009,8 @@ func (p *LockWorkerRequest) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *LockWorkerRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("LockWorkerRequest"); err != nil { +func (p *CheckRegisterRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CheckRegisterRequest"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -819,7 +1025,7 @@ func (p *LockWorkerRequest) Write(oprot thrift.TProtocol) error { return nil } -func (p *LockWorkerRequest) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CheckRegisterRequest) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("consumeUnit", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:consumeUnit: %s", p, err) } @@ -832,25 +1038,25 @@ func (p *LockWorkerRequest) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *LockWorkerRequest) String() string { +func (p *CheckRegisterRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("LockWorkerRequest(%+v)", *p) + return fmt.Sprintf("CheckRegisterRequest(%+v)", *p) } -type LockWorkerResponse struct { - RegisterSuccess bool `thrift:"registerSuccess,1,required" json:"registerSuccess"` +type CheckRegisterResponse struct { + CanRegister bool `thrift:"canRegister,1,required" json:"canRegister"` } -func NewLockWorkerResponse() *LockWorkerResponse { - return &LockWorkerResponse{} +func NewCheckRegisterResponse() *CheckRegisterResponse { + return &CheckRegisterResponse{} } -func (p *LockWorkerResponse) GetRegisterSuccess() bool { - return p.RegisterSuccess +func (p *CheckRegisterResponse) GetCanRegister() bool { + return p.CanRegister } -func (p *LockWorkerResponse) Read(iprot thrift.TProtocol) error { +func (p *CheckRegisterResponse) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -882,17 +1088,17 @@ func (p *LockWorkerResponse) Read(iprot thrift.TProtocol) error { return nil } -func (p *LockWorkerResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *CheckRegisterResponse) ReadField1(iprot thrift.TProtocol) error { if v, err := iprot.ReadBool(); err != nil { return fmt.Errorf("error reading field 1: %s", err) } else { - p.RegisterSuccess = v + p.CanRegister = v } return nil } -func (p *LockWorkerResponse) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("LockWorkerResponse"); err != nil { +func (p *CheckRegisterResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CheckRegisterResponse"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -907,47 +1113,47 @@ func (p *LockWorkerResponse) Write(oprot thrift.TProtocol) error { return nil } -func (p *LockWorkerResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("registerSuccess", thrift.BOOL, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:registerSuccess: %s", p, err) +func (p *CheckRegisterResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("canRegister", thrift.BOOL, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:canRegister: %s", p, err) } - if err := oprot.WriteBool(bool(p.RegisterSuccess)); err != nil { - return fmt.Errorf("%T.registerSuccess (1) field write error: %s", p, err) + if err := oprot.WriteBool(bool(p.CanRegister)); err != nil { + return fmt.Errorf("%T.canRegister (1) field write error: %s", p, err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:registerSuccess: %s", p, err) + return fmt.Errorf("%T write field end error 1:canRegister: %s", p, err) } return err } -func (p *LockWorkerResponse) String() string { +func (p *CheckRegisterResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("LockWorkerResponse(%+v)", *p) + return fmt.Sprintf("CheckRegisterResponse(%+v)", *p) } -type UnlockPartitionRequest struct { +type LockWorkerRequest struct { ConsumeUnit *ConsumeUnit `thrift:"consumeUnit,1,required" json:"consumeUnit"` } -func NewUnlockPartitionRequest() *UnlockPartitionRequest { - return &UnlockPartitionRequest{} +func NewLockWorkerRequest() *LockWorkerRequest { + return &LockWorkerRequest{} } -var UnlockPartitionRequest_ConsumeUnit_DEFAULT *ConsumeUnit +var LockWorkerRequest_ConsumeUnit_DEFAULT *ConsumeUnit -func (p *UnlockPartitionRequest) GetConsumeUnit() *ConsumeUnit { +func (p *LockWorkerRequest) GetConsumeUnit() *ConsumeUnit { if !p.IsSetConsumeUnit() { - return UnlockPartitionRequest_ConsumeUnit_DEFAULT + return LockWorkerRequest_ConsumeUnit_DEFAULT } return p.ConsumeUnit } -func (p *UnlockPartitionRequest) IsSetConsumeUnit() bool { +func (p *LockWorkerRequest) IsSetConsumeUnit() bool { return p.ConsumeUnit != nil } -func (p *UnlockPartitionRequest) Read(iprot thrift.TProtocol) error { +func (p *LockWorkerRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -979,7 +1185,7 @@ func (p *UnlockPartitionRequest) Read(iprot thrift.TProtocol) error { return nil } -func (p *UnlockPartitionRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *LockWorkerRequest) ReadField1(iprot thrift.TProtocol) error { p.ConsumeUnit = &ConsumeUnit{} if err := p.ConsumeUnit.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.ConsumeUnit, err) @@ -987,8 +1193,8 @@ func (p *UnlockPartitionRequest) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UnlockPartitionRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("UnlockPartitionRequest"); err != nil { +func (p *LockWorkerRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("LockWorkerRequest"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1003,7 +1209,7 @@ func (p *UnlockPartitionRequest) Write(oprot thrift.TProtocol) error { return nil } -func (p *UnlockPartitionRequest) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LockWorkerRequest) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("consumeUnit", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:consumeUnit: %s", p, err) } @@ -1016,34 +1222,25 @@ func (p *UnlockPartitionRequest) writeField1(oprot thrift.TProtocol) (err error) return err } -func (p *UnlockPartitionRequest) String() string { +func (p *LockWorkerRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("UnlockPartitionRequest(%+v)", *p) + return fmt.Sprintf("LockWorkerRequest(%+v)", *p) } -type RenewRequest struct { - ConsumeUnit *ConsumeUnit `thrift:"consumeUnit,1,required" json:"consumeUnit"` +type LockWorkerResponse struct { + RegisterSuccess bool `thrift:"registerSuccess,1,required" json:"registerSuccess"` } -func NewRenewRequest() *RenewRequest { - return &RenewRequest{} +func NewLockWorkerResponse() *LockWorkerResponse { + return &LockWorkerResponse{} } -var RenewRequest_ConsumeUnit_DEFAULT *ConsumeUnit - -func (p *RenewRequest) GetConsumeUnit() *ConsumeUnit { - if !p.IsSetConsumeUnit() { - return RenewRequest_ConsumeUnit_DEFAULT - } - return p.ConsumeUnit -} -func (p *RenewRequest) IsSetConsumeUnit() bool { - return p.ConsumeUnit != nil +func (p *LockWorkerResponse) GetRegisterSuccess() bool { + return p.RegisterSuccess } - -func (p *RenewRequest) Read(iprot thrift.TProtocol) error { +func (p *LockWorkerResponse) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1075,16 +1272,711 @@ func (p *RenewRequest) Read(iprot thrift.TProtocol) error { return nil } -func (p *RenewRequest) ReadField1(iprot thrift.TProtocol) error { - p.ConsumeUnit = &ConsumeUnit{} - if err := p.ConsumeUnit.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.ConsumeUnit, err) +func (p *LockWorkerResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.RegisterSuccess = v + } + return nil +} + +func (p *LockWorkerResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("LockWorkerResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *LockWorkerResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("registerSuccess", thrift.BOOL, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:registerSuccess: %s", p, err) + } + if err := oprot.WriteBool(bool(p.RegisterSuccess)); err != nil { + return fmt.Errorf("%T.registerSuccess (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:registerSuccess: %s", p, err) + } + return err +} + +func (p *LockWorkerResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LockWorkerResponse(%+v)", *p) +} + +type MultiTopicsLockWorkerRequest struct { + ConsumerGroup string `thrift:"consumerGroup,1,required" json:"consumerGroup"` + Topics []*topic.TopicTalosResourceName `thrift:"topics,2,required" json:"topics"` + WorkerId string `thrift:"workerId,3,required" json:"workerId"` +} + +func NewMultiTopicsLockWorkerRequest() *MultiTopicsLockWorkerRequest { + return &MultiTopicsLockWorkerRequest{} +} + +func (p *MultiTopicsLockWorkerRequest) GetConsumerGroup() string { + return p.ConsumerGroup +} + +func (p *MultiTopicsLockWorkerRequest) GetTopics() []*topic.TopicTalosResourceName { + return p.Topics +} + +func (p *MultiTopicsLockWorkerRequest) GetWorkerId() string { + return p.WorkerId +} +func (p *MultiTopicsLockWorkerRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *MultiTopicsLockWorkerRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.ConsumerGroup = v + } + return nil +} + +func (p *MultiTopicsLockWorkerRequest) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return fmt.Errorf("error reading list begin: %s", err) + } + tSlice := make([]*topic.TopicTalosResourceName, 0, size) + p.Topics = tSlice + for i := 0; i < size; i++ { + _elem6 := &topic.TopicTalosResourceName{} + if err := _elem6.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _elem6, err) + } + p.Topics = append(p.Topics, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return fmt.Errorf("error reading list end: %s", err) + } + return nil +} + +func (p *MultiTopicsLockWorkerRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.WorkerId = v + } + return nil +} + +func (p *MultiTopicsLockWorkerRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("MultiTopicsLockWorkerRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *MultiTopicsLockWorkerRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("consumerGroup", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:consumerGroup: %s", p, err) + } + if err := oprot.WriteString(string(p.ConsumerGroup)); err != nil { + return fmt.Errorf("%T.consumerGroup (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:consumerGroup: %s", p, err) + } + return err +} + +func (p *MultiTopicsLockWorkerRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topics", thrift.LIST, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:topics: %s", p, err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Topics)); err != nil { + return fmt.Errorf("error writing list begin: %s", err) + } + for _, v := range p.Topics { + if err := v.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", v, err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return fmt.Errorf("error writing list end: %s", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:topics: %s", p, err) + } + return err +} + +func (p *MultiTopicsLockWorkerRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("workerId", thrift.STRING, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:workerId: %s", p, err) + } + if err := oprot.WriteString(string(p.WorkerId)); err != nil { + return fmt.Errorf("%T.workerId (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:workerId: %s", p, err) + } + return err +} + +func (p *MultiTopicsLockWorkerRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiTopicsLockWorkerRequest(%+v)", *p) +} + +type MultiTopicsLockWorkerResponse struct { + RegisterSuccess bool `thrift:"registerSuccess,1,required" json:"registerSuccess"` +} + +func NewMultiTopicsLockWorkerResponse() *MultiTopicsLockWorkerResponse { + return &MultiTopicsLockWorkerResponse{} +} + +func (p *MultiTopicsLockWorkerResponse) GetRegisterSuccess() bool { + return p.RegisterSuccess +} +func (p *MultiTopicsLockWorkerResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *MultiTopicsLockWorkerResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.RegisterSuccess = v + } + return nil +} + +func (p *MultiTopicsLockWorkerResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("MultiTopicsLockWorkerResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *MultiTopicsLockWorkerResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("registerSuccess", thrift.BOOL, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:registerSuccess: %s", p, err) + } + if err := oprot.WriteBool(bool(p.RegisterSuccess)); err != nil { + return fmt.Errorf("%T.registerSuccess (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:registerSuccess: %s", p, err) + } + return err +} + +func (p *MultiTopicsLockWorkerResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiTopicsLockWorkerResponse(%+v)", *p) +} + +type UnlockPartitionRequest struct { + ConsumeUnit *ConsumeUnit `thrift:"consumeUnit,1,required" json:"consumeUnit"` +} + +func NewUnlockPartitionRequest() *UnlockPartitionRequest { + return &UnlockPartitionRequest{} +} + +var UnlockPartitionRequest_ConsumeUnit_DEFAULT *ConsumeUnit + +func (p *UnlockPartitionRequest) GetConsumeUnit() *ConsumeUnit { + if !p.IsSetConsumeUnit() { + return UnlockPartitionRequest_ConsumeUnit_DEFAULT + } + return p.ConsumeUnit +} +func (p *UnlockPartitionRequest) IsSetConsumeUnit() bool { + return p.ConsumeUnit != nil +} + +func (p *UnlockPartitionRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *UnlockPartitionRequest) ReadField1(iprot thrift.TProtocol) error { + p.ConsumeUnit = &ConsumeUnit{} + if err := p.ConsumeUnit.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.ConsumeUnit, err) + } + return nil +} + +func (p *UnlockPartitionRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("UnlockPartitionRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *UnlockPartitionRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("consumeUnit", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:consumeUnit: %s", p, err) + } + if err := p.ConsumeUnit.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.ConsumeUnit, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:consumeUnit: %s", p, err) + } + return err +} + +func (p *UnlockPartitionRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UnlockPartitionRequest(%+v)", *p) +} + +type RenewRequest struct { + ConsumeUnit *ConsumeUnit `thrift:"consumeUnit,1,required" json:"consumeUnit"` +} + +func NewRenewRequest() *RenewRequest { + return &RenewRequest{} +} + +var RenewRequest_ConsumeUnit_DEFAULT *ConsumeUnit + +func (p *RenewRequest) GetConsumeUnit() *ConsumeUnit { + if !p.IsSetConsumeUnit() { + return RenewRequest_ConsumeUnit_DEFAULT + } + return p.ConsumeUnit +} +func (p *RenewRequest) IsSetConsumeUnit() bool { + return p.ConsumeUnit != nil +} + +func (p *RenewRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *RenewRequest) ReadField1(iprot thrift.TProtocol) error { + p.ConsumeUnit = &ConsumeUnit{} + if err := p.ConsumeUnit.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.ConsumeUnit, err) + } + return nil +} + +func (p *RenewRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("RenewRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *RenewRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("consumeUnit", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:consumeUnit: %s", p, err) + } + if err := p.ConsumeUnit.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.ConsumeUnit, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:consumeUnit: %s", p, err) + } + return err +} + +func (p *RenewRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RenewRequest(%+v)", *p) +} + +type RenewResponse struct { + HeartbeatSuccess bool `thrift:"heartbeatSuccess,1,required" json:"heartbeatSuccess"` + FailedPartitionList []int32 `thrift:"failedPartitionList,2,required" json:"failedPartitionList"` +} + +func NewRenewResponse() *RenewResponse { + return &RenewResponse{} +} + +func (p *RenewResponse) GetHeartbeatSuccess() bool { + return p.HeartbeatSuccess +} + +func (p *RenewResponse) GetFailedPartitionList() []int32 { + return p.FailedPartitionList +} +func (p *RenewResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *RenewResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.HeartbeatSuccess = v + } + return nil +} + +func (p *RenewResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return fmt.Errorf("error reading list begin: %s", err) + } + tSlice := make([]int32, 0, size) + p.FailedPartitionList = tSlice + for i := 0; i < size; i++ { + var _elem7 int32 + if v, err := iprot.ReadI32(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + _elem7 = v + } + p.FailedPartitionList = append(p.FailedPartitionList, _elem7) + } + if err := iprot.ReadListEnd(); err != nil { + return fmt.Errorf("error reading list end: %s", err) + } + return nil +} + +func (p *RenewResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("RenewResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *RenewResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("heartbeatSuccess", thrift.BOOL, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:heartbeatSuccess: %s", p, err) + } + if err := oprot.WriteBool(bool(p.HeartbeatSuccess)); err != nil { + return fmt.Errorf("%T.heartbeatSuccess (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:heartbeatSuccess: %s", p, err) + } + return err +} + +func (p *RenewResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("failedPartitionList", thrift.LIST, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:failedPartitionList: %s", p, err) + } + if err := oprot.WriteListBegin(thrift.I32, len(p.FailedPartitionList)); err != nil { + return fmt.Errorf("error writing list begin: %s", err) + } + for _, v := range p.FailedPartitionList { + if err := oprot.WriteI32(int32(v)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return fmt.Errorf("error writing list end: %s", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:failedPartitionList: %s", p, err) + } + return err +} + +func (p *RenewResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RenewResponse(%+v)", *p) +} + +type MultiTopicsRenewRequest struct { + ConsumeUnit *MultiTopicsConsumeUnit `thrift:"consumeUnit,1,required" json:"consumeUnit"` +} + +func NewMultiTopicsRenewRequest() *MultiTopicsRenewRequest { + return &MultiTopicsRenewRequest{} +} + +var MultiTopicsRenewRequest_ConsumeUnit_DEFAULT *MultiTopicsConsumeUnit + +func (p *MultiTopicsRenewRequest) GetConsumeUnit() *MultiTopicsConsumeUnit { + if !p.IsSetConsumeUnit() { + return MultiTopicsRenewRequest_ConsumeUnit_DEFAULT + } + return p.ConsumeUnit +} +func (p *MultiTopicsRenewRequest) IsSetConsumeUnit() bool { + return p.ConsumeUnit != nil +} + +func (p *MultiTopicsRenewRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) } return nil } -func (p *RenewRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("RenewRequest"); err != nil { +func (p *MultiTopicsRenewRequest) ReadField1(iprot thrift.TProtocol) error { + p.ConsumeUnit = &MultiTopicsConsumeUnit{} + if err := p.ConsumeUnit.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.ConsumeUnit, err) + } + return nil +} + +func (p *MultiTopicsRenewRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("MultiTopicsRenewRequest"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1099,7 +1991,7 @@ func (p *RenewRequest) Write(oprot thrift.TProtocol) error { return nil } -func (p *RenewRequest) writeField1(oprot thrift.TProtocol) (err error) { +func (p *MultiTopicsRenewRequest) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("consumeUnit", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:consumeUnit: %s", p, err) } @@ -1112,30 +2004,30 @@ func (p *RenewRequest) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *RenewRequest) String() string { +func (p *MultiTopicsRenewRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("RenewRequest(%+v)", *p) + return fmt.Sprintf("MultiTopicsRenewRequest(%+v)", *p) } -type RenewResponse struct { - HeartbeatSuccess bool `thrift:"heartbeatSuccess,1,required" json:"heartbeatSuccess"` - FailedPartitionList []int32 `thrift:"failedPartitionList,2,required" json:"failedPartitionList"` +type MultiTopicsRenewResponse struct { + HeartbeatSuccess bool `thrift:"heartbeatSuccess,1,required" json:"heartbeatSuccess"` + FailedPartitionList []*topic.TopicAndPartition `thrift:"failedPartitionList,2,required" json:"failedPartitionList"` } -func NewRenewResponse() *RenewResponse { - return &RenewResponse{} +func NewMultiTopicsRenewResponse() *MultiTopicsRenewResponse { + return &MultiTopicsRenewResponse{} } -func (p *RenewResponse) GetHeartbeatSuccess() bool { +func (p *MultiTopicsRenewResponse) GetHeartbeatSuccess() bool { return p.HeartbeatSuccess } -func (p *RenewResponse) GetFailedPartitionList() []int32 { +func (p *MultiTopicsRenewResponse) GetFailedPartitionList() []*topic.TopicAndPartition { return p.FailedPartitionList } -func (p *RenewResponse) Read(iprot thrift.TProtocol) error { +func (p *MultiTopicsRenewResponse) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1171,7 +2063,7 @@ func (p *RenewResponse) Read(iprot thrift.TProtocol) error { return nil } -func (p *RenewResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *MultiTopicsRenewResponse) ReadField1(iprot thrift.TProtocol) error { if v, err := iprot.ReadBool(); err != nil { return fmt.Errorf("error reading field 1: %s", err) } else { @@ -1180,21 +2072,19 @@ func (p *RenewResponse) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *RenewResponse) ReadField2(iprot thrift.TProtocol) error { +func (p *MultiTopicsRenewResponse) ReadField2(iprot thrift.TProtocol) error { _, size, err := iprot.ReadListBegin() if err != nil { return fmt.Errorf("error reading list begin: %s", err) } - tSlice := make([]int32, 0, size) + tSlice := make([]*topic.TopicAndPartition, 0, size) p.FailedPartitionList = tSlice for i := 0; i < size; i++ { - var _elem3 int32 - if v, err := iprot.ReadI32(); err != nil { - return fmt.Errorf("error reading field 0: %s", err) - } else { - _elem3 = v + _elem8 := &topic.TopicAndPartition{} + if err := _elem8.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _elem8, err) } - p.FailedPartitionList = append(p.FailedPartitionList, _elem3) + p.FailedPartitionList = append(p.FailedPartitionList, _elem8) } if err := iprot.ReadListEnd(); err != nil { return fmt.Errorf("error reading list end: %s", err) @@ -1202,8 +2092,8 @@ func (p *RenewResponse) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *RenewResponse) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("RenewResponse"); err != nil { +func (p *MultiTopicsRenewResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("MultiTopicsRenewResponse"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1221,7 +2111,7 @@ func (p *RenewResponse) Write(oprot thrift.TProtocol) error { return nil } -func (p *RenewResponse) writeField1(oprot thrift.TProtocol) (err error) { +func (p *MultiTopicsRenewResponse) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("heartbeatSuccess", thrift.BOOL, 1); err != nil { return fmt.Errorf("%T write field begin error 1:heartbeatSuccess: %s", p, err) } @@ -1234,16 +2124,16 @@ func (p *RenewResponse) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *RenewResponse) writeField2(oprot thrift.TProtocol) (err error) { +func (p *MultiTopicsRenewResponse) writeField2(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("failedPartitionList", thrift.LIST, 2); err != nil { return fmt.Errorf("%T write field begin error 2:failedPartitionList: %s", p, err) } - if err := oprot.WriteListBegin(thrift.I32, len(p.FailedPartitionList)); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.FailedPartitionList)); err != nil { return fmt.Errorf("error writing list begin: %s", err) } for _, v := range p.FailedPartitionList { - if err := oprot.WriteI32(int32(v)); err != nil { - return fmt.Errorf("%T. (0) field write error: %s", p, err) + if err := v.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", v, err) } } if err := oprot.WriteListEnd(); err != nil { @@ -1255,11 +2145,11 @@ func (p *RenewResponse) writeField2(oprot thrift.TProtocol) (err error) { return err } -func (p *RenewResponse) String() string { +func (p *MultiTopicsRenewResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("RenewResponse(%+v)", *p) + return fmt.Sprintf("MultiTopicsRenewResponse(%+v)", *p) } type UpdateOffsetRequest struct { @@ -1619,17 +2509,266 @@ func (p *QueryOffsetResponse) Read(iprot thrift.TProtocol) error { return nil } -func (p *QueryOffsetResponse) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return fmt.Errorf("error reading field 1: %s", err) - } else { - p.MsgOffset = v +func (p *QueryOffsetResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.MsgOffset = v + } + return nil +} + +func (p *QueryOffsetResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("QueryOffsetResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *QueryOffsetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("msgOffset", thrift.I64, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:msgOffset: %s", p, err) + } + if err := oprot.WriteI64(int64(p.MsgOffset)); err != nil { + return fmt.Errorf("%T.msgOffset (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:msgOffset: %s", p, err) + } + return err +} + +func (p *QueryOffsetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryOffsetResponse(%+v)", *p) +} + +type QueryWorkerRequest struct { + ConsumerGroup string `thrift:"consumerGroup,1,required" json:"consumerGroup"` + TopicTalosResourceName *topic.TopicTalosResourceName `thrift:"topicTalosResourceName,2,required" json:"topicTalosResourceName"` +} + +func NewQueryWorkerRequest() *QueryWorkerRequest { + return &QueryWorkerRequest{} +} + +func (p *QueryWorkerRequest) GetConsumerGroup() string { + return p.ConsumerGroup +} + +var QueryWorkerRequest_TopicTalosResourceName_DEFAULT *topic.TopicTalosResourceName + +func (p *QueryWorkerRequest) GetTopicTalosResourceName() *topic.TopicTalosResourceName { + if !p.IsSetTopicTalosResourceName() { + return QueryWorkerRequest_TopicTalosResourceName_DEFAULT + } + return p.TopicTalosResourceName +} +func (p *QueryWorkerRequest) IsSetTopicTalosResourceName() bool { + return p.TopicTalosResourceName != nil +} + +func (p *QueryWorkerRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *QueryWorkerRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.ConsumerGroup = v + } + return nil +} + +func (p *QueryWorkerRequest) ReadField2(iprot thrift.TProtocol) error { + p.TopicTalosResourceName = &topic.TopicTalosResourceName{} + if err := p.TopicTalosResourceName.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicTalosResourceName, err) + } + return nil +} + +func (p *QueryWorkerRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("QueryWorkerRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *QueryWorkerRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("consumerGroup", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:consumerGroup: %s", p, err) + } + if err := oprot.WriteString(string(p.ConsumerGroup)); err != nil { + return fmt.Errorf("%T.consumerGroup (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:consumerGroup: %s", p, err) + } + return err +} + +func (p *QueryWorkerRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicTalosResourceName", thrift.STRUCT, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:topicTalosResourceName: %s", p, err) + } + if err := p.TopicTalosResourceName.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicTalosResourceName, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:topicTalosResourceName: %s", p, err) + } + return err +} + +func (p *QueryWorkerRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryWorkerRequest(%+v)", *p) +} + +type QueryWorkerResponse struct { + WorkerMap map[string][]int32 `thrift:"workerMap,1,required" json:"workerMap"` +} + +func NewQueryWorkerResponse() *QueryWorkerResponse { + return &QueryWorkerResponse{} +} + +func (p *QueryWorkerResponse) GetWorkerMap() map[string][]int32 { + return p.WorkerMap +} +func (p *QueryWorkerResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *QueryWorkerResponse) ReadField1(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return fmt.Errorf("error reading map begin: %s", err) + } + tMap := make(map[string][]int32, size) + p.WorkerMap = tMap + for i := 0; i < size; i++ { + var _key9 string + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + _key9 = v + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return fmt.Errorf("error reading list begin: %s", err) + } + tSlice := make([]int32, 0, size) + _val10 := tSlice + for i := 0; i < size; i++ { + var _elem11 int32 + if v, err := iprot.ReadI32(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + _elem11 = v + } + _val10 = append(_val10, _elem11) + } + if err := iprot.ReadListEnd(); err != nil { + return fmt.Errorf("error reading list end: %s", err) + } + p.WorkerMap[_key9] = _val10 + } + if err := iprot.ReadMapEnd(); err != nil { + return fmt.Errorf("error reading map end: %s", err) } return nil } -func (p *QueryOffsetResponse) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("QueryOffsetResponse"); err != nil { +func (p *QueryWorkerResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("QueryWorkerResponse"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1644,52 +2783,62 @@ func (p *QueryOffsetResponse) Write(oprot thrift.TProtocol) error { return nil } -func (p *QueryOffsetResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("msgOffset", thrift.I64, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:msgOffset: %s", p, err) +func (p *QueryWorkerResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("workerMap", thrift.MAP, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:workerMap: %s", p, err) } - if err := oprot.WriteI64(int64(p.MsgOffset)); err != nil { - return fmt.Errorf("%T.msgOffset (1) field write error: %s", p, err) + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.WorkerMap)); err != nil { + return fmt.Errorf("error writing map begin: %s", err) + } + for k, v := range p.WorkerMap { + if err := oprot.WriteString(string(k)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) + } + if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + return fmt.Errorf("error writing list begin: %s", err) + } + for _, v := range v { + if err := oprot.WriteI32(int32(v)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return fmt.Errorf("error writing list end: %s", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return fmt.Errorf("error writing map end: %s", err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:msgOffset: %s", p, err) + return fmt.Errorf("%T write field end error 1:workerMap: %s", p, err) } return err } -func (p *QueryOffsetResponse) String() string { +func (p *QueryWorkerResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("QueryOffsetResponse(%+v)", *p) + return fmt.Sprintf("QueryWorkerResponse(%+v)", *p) } -type QueryWorkerRequest struct { - ConsumerGroup string `thrift:"consumerGroup,1,required" json:"consumerGroup"` - TopicTalosResourceName *topic.TopicTalosResourceName `thrift:"topicTalosResourceName,2,required" json:"topicTalosResourceName"` +type MultiTopicsQueryWorkerRequest struct { + ConsumerGroup string `thrift:"consumerGroup,1,required" json:"consumerGroup"` + TopicTalosResourceNames []*topic.TopicTalosResourceName `thrift:"topicTalosResourceNames,2,required" json:"topicTalosResourceNames"` } -func NewQueryWorkerRequest() *QueryWorkerRequest { - return &QueryWorkerRequest{} +func NewMultiTopicsQueryWorkerRequest() *MultiTopicsQueryWorkerRequest { + return &MultiTopicsQueryWorkerRequest{} } -func (p *QueryWorkerRequest) GetConsumerGroup() string { +func (p *MultiTopicsQueryWorkerRequest) GetConsumerGroup() string { return p.ConsumerGroup } -var QueryWorkerRequest_TopicTalosResourceName_DEFAULT *topic.TopicTalosResourceName - -func (p *QueryWorkerRequest) GetTopicTalosResourceName() *topic.TopicTalosResourceName { - if !p.IsSetTopicTalosResourceName() { - return QueryWorkerRequest_TopicTalosResourceName_DEFAULT - } - return p.TopicTalosResourceName -} -func (p *QueryWorkerRequest) IsSetTopicTalosResourceName() bool { - return p.TopicTalosResourceName != nil +func (p *MultiTopicsQueryWorkerRequest) GetTopicTalosResourceNames() []*topic.TopicTalosResourceName { + return p.TopicTalosResourceNames } - -func (p *QueryWorkerRequest) Read(iprot thrift.TProtocol) error { +func (p *MultiTopicsQueryWorkerRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1725,7 +2874,7 @@ func (p *QueryWorkerRequest) Read(iprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *MultiTopicsQueryWorkerRequest) ReadField1(iprot thrift.TProtocol) error { if v, err := iprot.ReadString(); err != nil { return fmt.Errorf("error reading field 1: %s", err) } else { @@ -1734,16 +2883,28 @@ func (p *QueryWorkerRequest) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerRequest) ReadField2(iprot thrift.TProtocol) error { - p.TopicTalosResourceName = &topic.TopicTalosResourceName{} - if err := p.TopicTalosResourceName.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.TopicTalosResourceName, err) +func (p *MultiTopicsQueryWorkerRequest) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return fmt.Errorf("error reading list begin: %s", err) + } + tSlice := make([]*topic.TopicTalosResourceName, 0, size) + p.TopicTalosResourceNames = tSlice + for i := 0; i < size; i++ { + _elem12 := &topic.TopicTalosResourceName{} + if err := _elem12.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _elem12, err) + } + p.TopicTalosResourceNames = append(p.TopicTalosResourceNames, _elem12) + } + if err := iprot.ReadListEnd(); err != nil { + return fmt.Errorf("error reading list end: %s", err) } return nil } -func (p *QueryWorkerRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("QueryWorkerRequest"); err != nil { +func (p *MultiTopicsQueryWorkerRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("MultiTopicsQueryWorkerRequest"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1761,7 +2922,7 @@ func (p *QueryWorkerRequest) Write(oprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerRequest) writeField1(oprot thrift.TProtocol) (err error) { +func (p *MultiTopicsQueryWorkerRequest) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("consumerGroup", thrift.STRING, 1); err != nil { return fmt.Errorf("%T write field begin error 1:consumerGroup: %s", p, err) } @@ -1774,38 +2935,46 @@ func (p *QueryWorkerRequest) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *QueryWorkerRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("topicTalosResourceName", thrift.STRUCT, 2); err != nil { - return fmt.Errorf("%T write field begin error 2:topicTalosResourceName: %s", p, err) +func (p *MultiTopicsQueryWorkerRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicTalosResourceNames", thrift.LIST, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:topicTalosResourceNames: %s", p, err) } - if err := p.TopicTalosResourceName.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", p.TopicTalosResourceName, err) + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TopicTalosResourceNames)); err != nil { + return fmt.Errorf("error writing list begin: %s", err) + } + for _, v := range p.TopicTalosResourceNames { + if err := v.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", v, err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return fmt.Errorf("error writing list end: %s", err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 2:topicTalosResourceName: %s", p, err) + return fmt.Errorf("%T write field end error 2:topicTalosResourceNames: %s", p, err) } return err } -func (p *QueryWorkerRequest) String() string { +func (p *MultiTopicsQueryWorkerRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("QueryWorkerRequest(%+v)", *p) + return fmt.Sprintf("MultiTopicsQueryWorkerRequest(%+v)", *p) } -type QueryWorkerResponse struct { - WorkerMap map[string][]int32 `thrift:"workerMap,1,required" json:"workerMap"` +type MultiTopicsQueryWorkerResponse struct { + WorkerMap map[string][]*topic.TopicAndPartition `thrift:"workerMap,1,required" json:"workerMap"` } -func NewQueryWorkerResponse() *QueryWorkerResponse { - return &QueryWorkerResponse{} +func NewMultiTopicsQueryWorkerResponse() *MultiTopicsQueryWorkerResponse { + return &MultiTopicsQueryWorkerResponse{} } -func (p *QueryWorkerResponse) GetWorkerMap() map[string][]int32 { +func (p *MultiTopicsQueryWorkerResponse) GetWorkerMap() map[string][]*topic.TopicAndPartition { return p.WorkerMap } -func (p *QueryWorkerResponse) Read(iprot thrift.TProtocol) error { +func (p *MultiTopicsQueryWorkerResponse) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1837,39 +3006,37 @@ func (p *QueryWorkerResponse) Read(iprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *MultiTopicsQueryWorkerResponse) ReadField1(iprot thrift.TProtocol) error { _, _, size, err := iprot.ReadMapBegin() if err != nil { return fmt.Errorf("error reading map begin: %s", err) } - tMap := make(map[string][]int32, size) + tMap := make(map[string][]*topic.TopicAndPartition, size) p.WorkerMap = tMap for i := 0; i < size; i++ { - var _key4 string + var _key13 string if v, err := iprot.ReadString(); err != nil { return fmt.Errorf("error reading field 0: %s", err) } else { - _key4 = v + _key13 = v } _, size, err := iprot.ReadListBegin() if err != nil { return fmt.Errorf("error reading list begin: %s", err) } - tSlice := make([]int32, 0, size) - _val5 := tSlice + tSlice := make([]*topic.TopicAndPartition, 0, size) + _val14 := tSlice for i := 0; i < size; i++ { - var _elem6 int32 - if v, err := iprot.ReadI32(); err != nil { - return fmt.Errorf("error reading field 0: %s", err) - } else { - _elem6 = v + _elem15 := &topic.TopicAndPartition{} + if err := _elem15.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _elem15, err) } - _val5 = append(_val5, _elem6) + _val14 = append(_val14, _elem15) } if err := iprot.ReadListEnd(); err != nil { return fmt.Errorf("error reading list end: %s", err) } - p.WorkerMap[_key4] = _val5 + p.WorkerMap[_key13] = _val14 } if err := iprot.ReadMapEnd(); err != nil { return fmt.Errorf("error reading map end: %s", err) @@ -1877,8 +3044,8 @@ func (p *QueryWorkerResponse) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerResponse) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("QueryWorkerResponse"); err != nil { +func (p *MultiTopicsQueryWorkerResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("MultiTopicsQueryWorkerResponse"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1893,7 +3060,7 @@ func (p *QueryWorkerResponse) Write(oprot thrift.TProtocol) error { return nil } -func (p *QueryWorkerResponse) writeField1(oprot thrift.TProtocol) (err error) { +func (p *MultiTopicsQueryWorkerResponse) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("workerMap", thrift.MAP, 1); err != nil { return fmt.Errorf("%T write field begin error 1:workerMap: %s", p, err) } @@ -1904,12 +3071,12 @@ func (p *QueryWorkerResponse) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteString(string(k)); err != nil { return fmt.Errorf("%T. (0) field write error: %s", p, err) } - if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { return fmt.Errorf("error writing list begin: %s", err) } for _, v := range v { - if err := oprot.WriteI32(int32(v)); err != nil { - return fmt.Errorf("%T. (0) field write error: %s", p, err) + if err := v.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", v, err) } } if err := oprot.WriteListEnd(); err != nil { @@ -1925,11 +3092,11 @@ func (p *QueryWorkerResponse) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *QueryWorkerResponse) String() string { +func (p *MultiTopicsQueryWorkerResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("QueryWorkerResponse(%+v)", *p) + return fmt.Sprintf("MultiTopicsQueryWorkerResponse(%+v)", *p) } type ConsumerGroupAndPartition struct { @@ -2269,17 +3436,17 @@ func (p *QueryOrgOffsetResponse) ReadField1(iprot thrift.TProtocol) error { tMap := make(map[*ConsumerGroupAndPartition]int64, size) p.ConsumerGroupOffsetMap = tMap for i := 0; i < size; i++ { - _key7 := &ConsumerGroupAndPartition{} - if err := _key7.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", _key7, err) + _key16 := &ConsumerGroupAndPartition{} + if err := _key16.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _key16, err) } - var _val8 int64 + var _val17 int64 if v, err := iprot.ReadI64(); err != nil { return fmt.Errorf("error reading field 0: %s", err) } else { - _val8 = v + _val17 = v } - p.ConsumerGroupOffsetMap[_key7] = _val8 + p.ConsumerGroupOffsetMap[_key16] = _val17 } if err := iprot.ReadMapEnd(); err != nil { return fmt.Errorf("error reading map end: %s", err) @@ -2551,3 +3718,133 @@ func (p *GetWorkerIdResponse) String() string { } return fmt.Sprintf("GetWorkerIdResponse(%+v)", *p) } + +type DeleteConsumerGroupRequest struct { + ConsumerGroup string `thrift:"consumerGroup,1,required" json:"consumerGroup"` + TopicTalosResourceName *topic.TopicTalosResourceName `thrift:"topicTalosResourceName,2,required" json:"topicTalosResourceName"` +} + +func NewDeleteConsumerGroupRequest() *DeleteConsumerGroupRequest { + return &DeleteConsumerGroupRequest{} +} + +func (p *DeleteConsumerGroupRequest) GetConsumerGroup() string { + return p.ConsumerGroup +} + +var DeleteConsumerGroupRequest_TopicTalosResourceName_DEFAULT *topic.TopicTalosResourceName + +func (p *DeleteConsumerGroupRequest) GetTopicTalosResourceName() *topic.TopicTalosResourceName { + if !p.IsSetTopicTalosResourceName() { + return DeleteConsumerGroupRequest_TopicTalosResourceName_DEFAULT + } + return p.TopicTalosResourceName +} +func (p *DeleteConsumerGroupRequest) IsSetTopicTalosResourceName() bool { + return p.TopicTalosResourceName != nil +} + +func (p *DeleteConsumerGroupRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *DeleteConsumerGroupRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.ConsumerGroup = v + } + return nil +} + +func (p *DeleteConsumerGroupRequest) ReadField2(iprot thrift.TProtocol) error { + p.TopicTalosResourceName = &topic.TopicTalosResourceName{} + if err := p.TopicTalosResourceName.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicTalosResourceName, err) + } + return nil +} + +func (p *DeleteConsumerGroupRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("DeleteConsumerGroupRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *DeleteConsumerGroupRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("consumerGroup", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:consumerGroup: %s", p, err) + } + if err := oprot.WriteString(string(p.ConsumerGroup)); err != nil { + return fmt.Errorf("%T.consumerGroup (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:consumerGroup: %s", p, err) + } + return err +} + +func (p *DeleteConsumerGroupRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicTalosResourceName", thrift.STRUCT, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:topicTalosResourceName: %s", p, err) + } + if err := p.TopicTalosResourceName.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicTalosResourceName, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:topicTalosResourceName: %s", p, err) + } + return err +} + +func (p *DeleteConsumerGroupRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteConsumerGroupRequest(%+v)", *p) +} diff --git a/thrift/message/message_service-remote/message_service-remote.go b/thrift/message/message_service-remote/message_service-remote.go index f0a1181..1bf448b 100755 --- a/thrift/message/message_service-remote/message_service-remote.go +++ b/thrift/message/message_service-remote/message_service-remote.go @@ -27,6 +27,11 @@ func Usage() { fmt.Fprintln(os.Stderr, " GetPartitionOffsetResponse getPartitionOffset(GetPartitionOffsetRequest request)") fmt.Fprintln(os.Stderr, " GetPartitionsOffsetResponse getPartitionsOffset(GetPartitionsOffsetRequest request)") fmt.Fprintln(os.Stderr, " GetScheduleInfoResponse getScheduleInfo(GetScheduleInfoRequest request)") + fmt.Fprintln(os.Stderr, " PrepareResponse prepare(PrepareRequest request)") + fmt.Fprintln(os.Stderr, " CommitResponse commit(CommitRequest request)") + fmt.Fprintln(os.Stderr, " RollbackResponse rollback(RollbackRequest request)") + fmt.Fprintln(os.Stderr, " GetUnkownStateTransactionResponse getUnkownStateTransaction(GetUnkownStateTransactionRequest request)") + fmt.Fprintln(os.Stderr, " LookupTopicsResponse lookupTopics(LookupTopicsRequest request)") fmt.Fprintln(os.Stderr, " Version getServiceVersion()") fmt.Fprintln(os.Stderr, " void validClientVersion(Version clientVersion)") fmt.Fprintln(os.Stderr) @@ -128,19 +133,19 @@ func main() { fmt.Fprintln(os.Stderr, "PutMessage requires 1 args") flag.Usage() } - arg21 := flag.Arg(1) - mbTrans22 := thrift.NewTMemoryBufferLen(len(arg21)) - defer mbTrans22.Close() - _, err23 := mbTrans22.WriteString(arg21) - if err23 != nil { + arg35 := flag.Arg(1) + mbTrans36 := thrift.NewTMemoryBufferLen(len(arg35)) + defer mbTrans36.Close() + _, err37 := mbTrans36.WriteString(arg35) + if err37 != nil { Usage() return } - factory24 := thrift.NewTSimpleJSONProtocolFactory() - jsProt25 := factory24.GetProtocol(mbTrans22) + factory38 := thrift.NewTSimpleJSONProtocolFactory() + jsProt39 := factory38.GetProtocol(mbTrans36) argvalue0 := message.NewPutMessageRequest() - err26 := argvalue0.Read(jsProt25) - if err26 != nil { + err40 := argvalue0.Read(jsProt39) + if err40 != nil { Usage() return } @@ -153,19 +158,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetMessage requires 1 args") flag.Usage() } - arg27 := flag.Arg(1) - mbTrans28 := thrift.NewTMemoryBufferLen(len(arg27)) - defer mbTrans28.Close() - _, err29 := mbTrans28.WriteString(arg27) - if err29 != nil { + arg41 := flag.Arg(1) + mbTrans42 := thrift.NewTMemoryBufferLen(len(arg41)) + defer mbTrans42.Close() + _, err43 := mbTrans42.WriteString(arg41) + if err43 != nil { Usage() return } - factory30 := thrift.NewTSimpleJSONProtocolFactory() - jsProt31 := factory30.GetProtocol(mbTrans28) + factory44 := thrift.NewTSimpleJSONProtocolFactory() + jsProt45 := factory44.GetProtocol(mbTrans42) argvalue0 := message.NewGetMessageRequest() - err32 := argvalue0.Read(jsProt31) - if err32 != nil { + err46 := argvalue0.Read(jsProt45) + if err46 != nil { Usage() return } @@ -178,19 +183,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetTopicOffset requires 1 args") flag.Usage() } - arg33 := flag.Arg(1) - mbTrans34 := thrift.NewTMemoryBufferLen(len(arg33)) - defer mbTrans34.Close() - _, err35 := mbTrans34.WriteString(arg33) - if err35 != nil { + arg47 := flag.Arg(1) + mbTrans48 := thrift.NewTMemoryBufferLen(len(arg47)) + defer mbTrans48.Close() + _, err49 := mbTrans48.WriteString(arg47) + if err49 != nil { Usage() return } - factory36 := thrift.NewTSimpleJSONProtocolFactory() - jsProt37 := factory36.GetProtocol(mbTrans34) + factory50 := thrift.NewTSimpleJSONProtocolFactory() + jsProt51 := factory50.GetProtocol(mbTrans48) argvalue0 := message.NewGetTopicOffsetRequest() - err38 := argvalue0.Read(jsProt37) - if err38 != nil { + err52 := argvalue0.Read(jsProt51) + if err52 != nil { Usage() return } @@ -203,19 +208,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetPartitionOffset requires 1 args") flag.Usage() } - arg39 := flag.Arg(1) - mbTrans40 := thrift.NewTMemoryBufferLen(len(arg39)) - defer mbTrans40.Close() - _, err41 := mbTrans40.WriteString(arg39) - if err41 != nil { + arg53 := flag.Arg(1) + mbTrans54 := thrift.NewTMemoryBufferLen(len(arg53)) + defer mbTrans54.Close() + _, err55 := mbTrans54.WriteString(arg53) + if err55 != nil { Usage() return } - factory42 := thrift.NewTSimpleJSONProtocolFactory() - jsProt43 := factory42.GetProtocol(mbTrans40) + factory56 := thrift.NewTSimpleJSONProtocolFactory() + jsProt57 := factory56.GetProtocol(mbTrans54) argvalue0 := message.NewGetPartitionOffsetRequest() - err44 := argvalue0.Read(jsProt43) - if err44 != nil { + err58 := argvalue0.Read(jsProt57) + if err58 != nil { Usage() return } @@ -228,19 +233,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetPartitionsOffset requires 1 args") flag.Usage() } - arg45 := flag.Arg(1) - mbTrans46 := thrift.NewTMemoryBufferLen(len(arg45)) - defer mbTrans46.Close() - _, err47 := mbTrans46.WriteString(arg45) - if err47 != nil { + arg59 := flag.Arg(1) + mbTrans60 := thrift.NewTMemoryBufferLen(len(arg59)) + defer mbTrans60.Close() + _, err61 := mbTrans60.WriteString(arg59) + if err61 != nil { Usage() return } - factory48 := thrift.NewTSimpleJSONProtocolFactory() - jsProt49 := factory48.GetProtocol(mbTrans46) + factory62 := thrift.NewTSimpleJSONProtocolFactory() + jsProt63 := factory62.GetProtocol(mbTrans60) argvalue0 := message.NewGetPartitionsOffsetRequest() - err50 := argvalue0.Read(jsProt49) - if err50 != nil { + err64 := argvalue0.Read(jsProt63) + if err64 != nil { Usage() return } @@ -253,19 +258,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetScheduleInfo requires 1 args") flag.Usage() } - arg51 := flag.Arg(1) - mbTrans52 := thrift.NewTMemoryBufferLen(len(arg51)) - defer mbTrans52.Close() - _, err53 := mbTrans52.WriteString(arg51) - if err53 != nil { + arg65 := flag.Arg(1) + mbTrans66 := thrift.NewTMemoryBufferLen(len(arg65)) + defer mbTrans66.Close() + _, err67 := mbTrans66.WriteString(arg65) + if err67 != nil { Usage() return } - factory54 := thrift.NewTSimpleJSONProtocolFactory() - jsProt55 := factory54.GetProtocol(mbTrans52) + factory68 := thrift.NewTSimpleJSONProtocolFactory() + jsProt69 := factory68.GetProtocol(mbTrans66) argvalue0 := message.NewGetScheduleInfoRequest() - err56 := argvalue0.Read(jsProt55) - if err56 != nil { + err70 := argvalue0.Read(jsProt69) + if err70 != nil { Usage() return } @@ -273,6 +278,131 @@ func main() { fmt.Print(client.GetScheduleInfo(value0)) fmt.Print("\n") break + case "prepare": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "Prepare requires 1 args") + flag.Usage() + } + arg71 := flag.Arg(1) + mbTrans72 := thrift.NewTMemoryBufferLen(len(arg71)) + defer mbTrans72.Close() + _, err73 := mbTrans72.WriteString(arg71) + if err73 != nil { + Usage() + return + } + factory74 := thrift.NewTSimpleJSONProtocolFactory() + jsProt75 := factory74.GetProtocol(mbTrans72) + argvalue0 := message.NewPrepareRequest() + err76 := argvalue0.Read(jsProt75) + if err76 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Prepare(value0)) + fmt.Print("\n") + break + case "commit": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "Commit requires 1 args") + flag.Usage() + } + arg77 := flag.Arg(1) + mbTrans78 := thrift.NewTMemoryBufferLen(len(arg77)) + defer mbTrans78.Close() + _, err79 := mbTrans78.WriteString(arg77) + if err79 != nil { + Usage() + return + } + factory80 := thrift.NewTSimpleJSONProtocolFactory() + jsProt81 := factory80.GetProtocol(mbTrans78) + argvalue0 := message.NewCommitRequest() + err82 := argvalue0.Read(jsProt81) + if err82 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Commit(value0)) + fmt.Print("\n") + break + case "rollback": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "Rollback requires 1 args") + flag.Usage() + } + arg83 := flag.Arg(1) + mbTrans84 := thrift.NewTMemoryBufferLen(len(arg83)) + defer mbTrans84.Close() + _, err85 := mbTrans84.WriteString(arg83) + if err85 != nil { + Usage() + return + } + factory86 := thrift.NewTSimpleJSONProtocolFactory() + jsProt87 := factory86.GetProtocol(mbTrans84) + argvalue0 := message.NewRollbackRequest() + err88 := argvalue0.Read(jsProt87) + if err88 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Rollback(value0)) + fmt.Print("\n") + break + case "getUnkownStateTransaction": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "GetUnkownStateTransaction requires 1 args") + flag.Usage() + } + arg89 := flag.Arg(1) + mbTrans90 := thrift.NewTMemoryBufferLen(len(arg89)) + defer mbTrans90.Close() + _, err91 := mbTrans90.WriteString(arg89) + if err91 != nil { + Usage() + return + } + factory92 := thrift.NewTSimpleJSONProtocolFactory() + jsProt93 := factory92.GetProtocol(mbTrans90) + argvalue0 := message.NewGetUnkownStateTransactionRequest() + err94 := argvalue0.Read(jsProt93) + if err94 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUnkownStateTransaction(value0)) + fmt.Print("\n") + break + case "lookupTopics": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "LookupTopics requires 1 args") + flag.Usage() + } + arg95 := flag.Arg(1) + mbTrans96 := thrift.NewTMemoryBufferLen(len(arg95)) + defer mbTrans96.Close() + _, err97 := mbTrans96.WriteString(arg95) + if err97 != nil { + Usage() + return + } + factory98 := thrift.NewTSimpleJSONProtocolFactory() + jsProt99 := factory98.GetProtocol(mbTrans96) + argvalue0 := message.NewLookupTopicsRequest() + err100 := argvalue0.Read(jsProt99) + if err100 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupTopics(value0)) + fmt.Print("\n") + break case "getServiceVersion": if flag.NArg()-1 != 0 { fmt.Fprintln(os.Stderr, "GetServiceVersion requires 0 args") @@ -286,19 +416,19 @@ func main() { fmt.Fprintln(os.Stderr, "ValidClientVersion requires 1 args") flag.Usage() } - arg57 := flag.Arg(1) - mbTrans58 := thrift.NewTMemoryBufferLen(len(arg57)) - defer mbTrans58.Close() - _, err59 := mbTrans58.WriteString(arg57) - if err59 != nil { + arg101 := flag.Arg(1) + mbTrans102 := thrift.NewTMemoryBufferLen(len(arg101)) + defer mbTrans102.Close() + _, err103 := mbTrans102.WriteString(arg101) + if err103 != nil { Usage() return } - factory60 := thrift.NewTSimpleJSONProtocolFactory() - jsProt61 := factory60.GetProtocol(mbTrans58) + factory104 := thrift.NewTSimpleJSONProtocolFactory() + jsProt105 := factory104.GetProtocol(mbTrans102) argvalue0 := message.NewVersion() - err62 := argvalue0.Read(jsProt61) - if err62 != nil { + err106 := argvalue0.Read(jsProt105) + if err106 != nil { Usage() return } diff --git a/thrift/message/messageservice.go b/thrift/message/messageservice.go index 04ce354..8d16957 100644 --- a/thrift/message/messageservice.go +++ b/thrift/message/messageservice.go @@ -60,6 +60,36 @@ type MessageService interface { // Parameters: // - Request GetScheduleInfo(request *GetScheduleInfoRequest) (r *GetScheduleInfoResponse, err error) + // Prepare transaction message; + // + // + // Parameters: + // - Request + Prepare(request *PrepareRequest) (r *PrepareResponse, err error) + // Commit transaction message; + // + // + // Parameters: + // - Request + Commit(request *CommitRequest) (r *CommitResponse, err error) + // Rollback transaction message; + // + // + // Parameters: + // - Request + Rollback(request *RollbackRequest) (r *RollbackResponse, err error) + // get list of unkown status transaction for callback + // + // + // Parameters: + // - Request + GetUnkownStateTransaction(request *GetUnkownStateTransactionRequest) (r *GetUnkownStateTransactionResponse, err error) + // look up all topics and partition number that match topic pattern + // + // + // Parameters: + // - Request + LookupTopics(request *LookupTopicsRequest) (r *LookupTopicsResponse, err error) } type MessageServiceClient struct { @@ -119,16 +149,16 @@ func (p *MessageServiceClient) recvPutMessage() (value *PutMessageResponse, err return } if mTypeId == thrift.EXCEPTION { - error8 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error9 error - error9, err = error8.Read(iprot) + error12 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error13 error + error13, err = error12.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error9 + err = error13 return } if p.SeqId != seqId { @@ -195,16 +225,16 @@ func (p *MessageServiceClient) recvGetMessage() (value *GetMessageResponse, err return } if mTypeId == thrift.EXCEPTION { - error10 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error11 error - error11, err = error10.Read(iprot) + error14 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error15 error + error15, err = error14.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error11 + err = error15 return } if p.SeqId != seqId { @@ -272,16 +302,16 @@ func (p *MessageServiceClient) recvGetTopicOffset() (value *GetTopicOffsetRespon return } if mTypeId == thrift.EXCEPTION { - error12 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error13 error - error13, err = error12.Read(iprot) + error16 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error17 error + error17, err = error16.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error13 + err = error17 return } if p.SeqId != seqId { @@ -348,16 +378,16 @@ func (p *MessageServiceClient) recvGetPartitionOffset() (value *GetPartitionOffs return } if mTypeId == thrift.EXCEPTION { - error14 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error15 error - error15, err = error14.Read(iprot) + error18 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error19 error + error19, err = error18.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error15 + err = error19 return } if p.SeqId != seqId { @@ -420,16 +450,16 @@ func (p *MessageServiceClient) recvGetPartitionsOffset() (value *GetPartitionsOf return } if mTypeId == thrift.EXCEPTION { - error16 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error17 error - error17, err = error16.Read(iprot) + error20 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error21 error + error21, err = error20.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error17 + err = error21 return } if p.SeqId != seqId { @@ -492,16 +522,16 @@ func (p *MessageServiceClient) recvGetScheduleInfo() (value *GetScheduleInfoResp return } if mTypeId == thrift.EXCEPTION { - error18 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error19 error - error19, err = error18.Read(iprot) + error22 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error23 error + error23, err = error22.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error19 + err = error23 return } if p.SeqId != seqId { @@ -523,190 +553,416 @@ func (p *MessageServiceClient) recvGetScheduleInfo() (value *GetScheduleInfoResp return } -type MessageServiceProcessor struct { - *common.TalosBaseServiceProcessor -} - -func NewMessageServiceProcessor(handler MessageService) *MessageServiceProcessor { - self20 := &MessageServiceProcessor{common.NewTalosBaseServiceProcessor(handler)} - self20.AddToProcessorMap("putMessage", &messageServiceProcessorPutMessage{handler: handler}) - self20.AddToProcessorMap("getMessage", &messageServiceProcessorGetMessage{handler: handler}) - self20.AddToProcessorMap("getTopicOffset", &messageServiceProcessorGetTopicOffset{handler: handler}) - self20.AddToProcessorMap("getPartitionOffset", &messageServiceProcessorGetPartitionOffset{handler: handler}) - self20.AddToProcessorMap("getPartitionsOffset", &messageServiceProcessorGetPartitionsOffset{handler: handler}) - self20.AddToProcessorMap("getScheduleInfo", &messageServiceProcessorGetScheduleInfo{handler: handler}) - return self20 -} - -type messageServiceProcessorPutMessage struct { - handler MessageService -} - -func (p *messageServiceProcessorPutMessage) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PutMessageArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("putMessage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +// Prepare transaction message; +// +// +// Parameters: +// - Request +func (p *MessageServiceClient) Prepare(request *PrepareRequest) (r *PrepareResponse, err error) { + if err = p.sendPrepare(request); err != nil { + return } + return p.recvPrepare() +} - iprot.ReadMessageEnd() - result := PutMessageResult{} - var retval *PutMessageResponse - var err2 error - if retval, err2 = p.handler.PutMessage(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing putMessage: "+err2.Error()) - oprot.WriteMessageBegin("putMessage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("putMessage", thrift.REPLY, seqId); err2 != nil { - err = err2 +func (p *MessageServiceClient) sendPrepare(request *PrepareRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + p.SeqId++ + if err = oprot.WriteMessageBegin("prepare", thrift.CALL, p.SeqId); err != nil { + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + args := PrepareArgs{ + Request: request, } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err = args.Write(oprot); err != nil { + return } - if err != nil { + if err = oprot.WriteMessageEnd(); err != nil { return } - return true, err -} - -type messageServiceProcessorGetMessage struct { - handler MessageService + return oprot.Flush() } -func (p *messageServiceProcessorGetMessage) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := GetMessageArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getMessage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +func (p *MessageServiceClient) recvPrepare() (value *PrepareResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot } - - iprot.ReadMessageEnd() - result := GetMessageResult{} - var retval *GetMessageResponse - var err2 error - if retval, err2 = p.handler.GetMessage(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getMessage: "+err2.Error()) - oprot.WriteMessageBegin("getMessage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } else { - result.Success = retval + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return } - if err2 = oprot.WriteMessageBegin("getMessage", thrift.REPLY, seqId); err2 != nil { - err = err2 + if mTypeId == thrift.EXCEPTION { + error24 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error25 error + error25, err = error24.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error25 + return } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "prepare failed: out of sequence response") + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + result := PrepareResult{} + if err = result.Read(iprot); err != nil { + return } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err = iprot.ReadMessageEnd(); err != nil { + return } - if err != nil { + if result.E != nil { + err = result.E return } - return true, err + value = result.GetSuccess() + return } -type messageServiceProcessorGetTopicOffset struct { - handler MessageService +// Commit transaction message; +// +// +// Parameters: +// - Request +func (p *MessageServiceClient) Commit(request *CommitRequest) (r *CommitResponse, err error) { + if err = p.sendCommit(request); err != nil { + return + } + return p.recvCommit() } -func (p *messageServiceProcessorGetTopicOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := GetTopicOffsetArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getTopicOffset", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +func (p *MessageServiceClient) sendCommit(request *CommitRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot } - - iprot.ReadMessageEnd() - result := GetTopicOffsetResult{} - var retval *GetTopicOffsetResponse - var err2 error - if retval, err2 = p.handler.GetTopicOffset(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTopicOffset: "+err2.Error()) - oprot.WriteMessageBegin("getTopicOffset", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } else { - result.Success = retval + p.SeqId++ + if err = oprot.WriteMessageBegin("commit", thrift.CALL, p.SeqId); err != nil { + return } - if err2 = oprot.WriteMessageBegin("getTopicOffset", thrift.REPLY, seqId); err2 != nil { - err = err2 + args := CommitArgs{ + Request: request, } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err = args.Write(oprot); err != nil { + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteMessageEnd(); err != nil { + return } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + return oprot.Flush() +} + +func (p *MessageServiceClient) recvCommit() (value *CommitResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() if err != nil { return } - return true, err -} - -type messageServiceProcessorGetPartitionOffset struct { - handler MessageService + if mTypeId == thrift.EXCEPTION { + error26 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error27 error + error27, err = error26.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error27 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "commit failed: out of sequence response") + return + } + result := CommitResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + value = result.GetSuccess() + return } -func (p *messageServiceProcessorGetPartitionOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := GetPartitionOffsetArgs{} +// Rollback transaction message; +// +// +// Parameters: +// - Request +func (p *MessageServiceClient) Rollback(request *RollbackRequest) (r *RollbackResponse, err error) { + if err = p.sendRollback(request); err != nil { + return + } + return p.recvRollback() +} + +func (p *MessageServiceClient) sendRollback(request *RollbackRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("rollback", thrift.CALL, p.SeqId); err != nil { + return + } + args := RollbackArgs{ + Request: request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *MessageServiceClient) recvRollback() (value *RollbackResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if mTypeId == thrift.EXCEPTION { + error28 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error29 error + error29, err = error28.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error29 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "rollback failed: out of sequence response") + return + } + result := RollbackResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + value = result.GetSuccess() + return +} + +// get list of unkown status transaction for callback +// +// +// Parameters: +// - Request +func (p *MessageServiceClient) GetUnkownStateTransaction(request *GetUnkownStateTransactionRequest) (r *GetUnkownStateTransactionResponse, err error) { + if err = p.sendGetUnkownStateTransaction(request); err != nil { + return + } + return p.recvGetUnkownStateTransaction() +} + +func (p *MessageServiceClient) sendGetUnkownStateTransaction(request *GetUnkownStateTransactionRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getUnkownStateTransaction", thrift.CALL, p.SeqId); err != nil { + return + } + args := GetUnkownStateTransactionArgs{ + Request: request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *MessageServiceClient) recvGetUnkownStateTransaction() (value *GetUnkownStateTransactionResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if mTypeId == thrift.EXCEPTION { + error30 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error31 error + error31, err = error30.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error31 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getUnkownStateTransaction failed: out of sequence response") + return + } + result := GetUnkownStateTransactionResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + value = result.GetSuccess() + return +} + +// look up all topics and partition number that match topic pattern +// +// +// Parameters: +// - Request +func (p *MessageServiceClient) LookupTopics(request *LookupTopicsRequest) (r *LookupTopicsResponse, err error) { + if err = p.sendLookupTopics(request); err != nil { + return + } + return p.recvLookupTopics() +} + +func (p *MessageServiceClient) sendLookupTopics(request *LookupTopicsRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("lookupTopics", thrift.CALL, p.SeqId); err != nil { + return + } + args := LookupTopicsArgs{ + Request: request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *MessageServiceClient) recvLookupTopics() (value *LookupTopicsResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if mTypeId == thrift.EXCEPTION { + error32 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error33 error + error33, err = error32.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error33 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "lookupTopics failed: out of sequence response") + return + } + result := LookupTopicsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + value = result.GetSuccess() + return +} + +type MessageServiceProcessor struct { + *common.TalosBaseServiceProcessor +} + +func NewMessageServiceProcessor(handler MessageService) *MessageServiceProcessor { + self34 := &MessageServiceProcessor{common.NewTalosBaseServiceProcessor(handler)} + self34.AddToProcessorMap("putMessage", &messageServiceProcessorPutMessage{handler: handler}) + self34.AddToProcessorMap("getMessage", &messageServiceProcessorGetMessage{handler: handler}) + self34.AddToProcessorMap("getTopicOffset", &messageServiceProcessorGetTopicOffset{handler: handler}) + self34.AddToProcessorMap("getPartitionOffset", &messageServiceProcessorGetPartitionOffset{handler: handler}) + self34.AddToProcessorMap("getPartitionsOffset", &messageServiceProcessorGetPartitionsOffset{handler: handler}) + self34.AddToProcessorMap("getScheduleInfo", &messageServiceProcessorGetScheduleInfo{handler: handler}) + self34.AddToProcessorMap("prepare", &messageServiceProcessorPrepare{handler: handler}) + self34.AddToProcessorMap("commit", &messageServiceProcessorCommit{handler: handler}) + self34.AddToProcessorMap("rollback", &messageServiceProcessorRollback{handler: handler}) + self34.AddToProcessorMap("getUnkownStateTransaction", &messageServiceProcessorGetUnkownStateTransaction{handler: handler}) + self34.AddToProcessorMap("lookupTopics", &messageServiceProcessorLookupTopics{handler: handler}) + return self34 +} + +type messageServiceProcessorPutMessage struct { + handler MessageService +} + +func (p *messageServiceProcessorPutMessage) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PutMessageArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getPartitionOffset", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("putMessage", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -714,20 +970,25 @@ func (p *messageServiceProcessorGetPartitionOffset) Process(seqId int32, iprot, } iprot.ReadMessageEnd() - result := GetPartitionOffsetResult{} - var retval *GetPartitionOffsetResponse + result := PutMessageResult{} + var retval *PutMessageResponse var err2 error - if retval, err2 = p.handler.GetPartitionOffset(args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPartitionOffset: "+err2.Error()) - oprot.WriteMessageBegin("getPartitionOffset", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 + if retval, err2 = p.handler.PutMessage(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing putMessage: "+err2.Error()) + oprot.WriteMessageBegin("putMessage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("getPartitionOffset", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("putMessage", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -745,12 +1006,166 @@ func (p *messageServiceProcessorGetPartitionOffset) Process(seqId int32, iprot, return true, err } -type messageServiceProcessorGetPartitionsOffset struct { +type messageServiceProcessorGetMessage struct { handler MessageService } -func (p *messageServiceProcessorGetPartitionsOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := GetPartitionsOffsetArgs{} +func (p *messageServiceProcessorGetMessage) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetMessageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getMessage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := GetMessageResult{} + var retval *GetMessageResponse + var err2 error + if retval, err2 = p.handler.GetMessage(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getMessage: "+err2.Error()) + oprot.WriteMessageBegin("getMessage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getMessage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type messageServiceProcessorGetTopicOffset struct { + handler MessageService +} + +func (p *messageServiceProcessorGetTopicOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetTopicOffsetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getTopicOffset", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := GetTopicOffsetResult{} + var retval *GetTopicOffsetResponse + var err2 error + if retval, err2 = p.handler.GetTopicOffset(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTopicOffset: "+err2.Error()) + oprot.WriteMessageBegin("getTopicOffset", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getTopicOffset", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type messageServiceProcessorGetPartitionOffset struct { + handler MessageService +} + +func (p *messageServiceProcessorGetPartitionOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetPartitionOffsetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getPartitionOffset", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := GetPartitionOffsetResult{} + var retval *GetPartitionOffsetResponse + var err2 error + if retval, err2 = p.handler.GetPartitionOffset(args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPartitionOffset: "+err2.Error()) + oprot.WriteMessageBegin("getPartitionOffset", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getPartitionOffset", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type messageServiceProcessorGetPartitionsOffset struct { + handler MessageService +} + +func (p *messageServiceProcessorGetPartitionsOffset) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetPartitionsOffsetArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) @@ -761,114 +1176,1487 @@ func (p *messageServiceProcessorGetPartitionsOffset) Process(seqId int32, iprot, return false, err } - iprot.ReadMessageEnd() - result := GetPartitionsOffsetResult{} - var retval *GetPartitionsOffsetResponse - var err2 error - if retval, err2 = p.handler.GetPartitionsOffset(args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPartitionsOffset: "+err2.Error()) - oprot.WriteMessageBegin("getPartitionsOffset", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval + iprot.ReadMessageEnd() + result := GetPartitionsOffsetResult{} + var retval *GetPartitionsOffsetResponse + var err2 error + if retval, err2 = p.handler.GetPartitionsOffset(args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPartitionsOffset: "+err2.Error()) + oprot.WriteMessageBegin("getPartitionsOffset", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getPartitionsOffset", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type messageServiceProcessorGetScheduleInfo struct { + handler MessageService +} + +func (p *messageServiceProcessorGetScheduleInfo) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetScheduleInfoArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getScheduleInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := GetScheduleInfoResult{} + var retval *GetScheduleInfoResponse + var err2 error + if retval, err2 = p.handler.GetScheduleInfo(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getScheduleInfo: "+err2.Error()) + oprot.WriteMessageBegin("getScheduleInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getScheduleInfo", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type messageServiceProcessorPrepare struct { + handler MessageService +} + +func (p *messageServiceProcessorPrepare) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PrepareArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("prepare", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := PrepareResult{} + var retval *PrepareResponse + var err2 error + if retval, err2 = p.handler.Prepare(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing prepare: "+err2.Error()) + oprot.WriteMessageBegin("prepare", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("prepare", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type messageServiceProcessorCommit struct { + handler MessageService +} + +func (p *messageServiceProcessorCommit) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CommitArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("commit", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := CommitResult{} + var retval *CommitResponse + var err2 error + if retval, err2 = p.handler.Commit(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing commit: "+err2.Error()) + oprot.WriteMessageBegin("commit", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("commit", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type messageServiceProcessorRollback struct { + handler MessageService +} + +func (p *messageServiceProcessorRollback) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RollbackArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("rollback", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := RollbackResult{} + var retval *RollbackResponse + var err2 error + if retval, err2 = p.handler.Rollback(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rollback: "+err2.Error()) + oprot.WriteMessageBegin("rollback", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("rollback", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type messageServiceProcessorGetUnkownStateTransaction struct { + handler MessageService +} + +func (p *messageServiceProcessorGetUnkownStateTransaction) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetUnkownStateTransactionArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getUnkownStateTransaction", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := GetUnkownStateTransactionResult{} + var retval *GetUnkownStateTransactionResponse + var err2 error + if retval, err2 = p.handler.GetUnkownStateTransaction(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUnkownStateTransaction: "+err2.Error()) + oprot.WriteMessageBegin("getUnkownStateTransaction", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getUnkownStateTransaction", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type messageServiceProcessorLookupTopics struct { + handler MessageService +} + +func (p *messageServiceProcessorLookupTopics) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LookupTopicsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("lookupTopics", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := LookupTopicsResult{} + var retval *LookupTopicsResponse + var err2 error + if retval, err2 = p.handler.LookupTopics(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupTopics: "+err2.Error()) + oprot.WriteMessageBegin("lookupTopics", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("lookupTopics", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +// HELPER FUNCTIONS AND STRUCTURES + +type PutMessageArgs struct { + Request *PutMessageRequest `thrift:"request,1" json:"request"` +} + +func NewPutMessageArgs() *PutMessageArgs { + return &PutMessageArgs{} +} + +var PutMessageArgs_Request_DEFAULT *PutMessageRequest + +func (p *PutMessageArgs) GetRequest() *PutMessageRequest { + if !p.IsSetRequest() { + return PutMessageArgs_Request_DEFAULT + } + return p.Request +} +func (p *PutMessageArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *PutMessageArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *PutMessageArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &PutMessageRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *PutMessageArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("putMessage_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *PutMessageArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *PutMessageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PutMessageArgs(%+v)", *p) +} + +type PutMessageResult struct { + Success *PutMessageResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewPutMessageResult() *PutMessageResult { + return &PutMessageResult{} +} + +var PutMessageResult_Success_DEFAULT *PutMessageResponse + +func (p *PutMessageResult) GetSuccess() *PutMessageResponse { + if !p.IsSetSuccess() { + return PutMessageResult_Success_DEFAULT + } + return p.Success +} + +var PutMessageResult_E_DEFAULT *common.GalaxyTalosException + +func (p *PutMessageResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return PutMessageResult_E_DEFAULT + } + return p.E +} +func (p *PutMessageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *PutMessageResult) IsSetE() bool { + return p.E != nil +} + +func (p *PutMessageResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *PutMessageResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &PutMessageResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *PutMessageResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *PutMessageResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("putMessage_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *PutMessageResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *PutMessageResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *PutMessageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PutMessageResult(%+v)", *p) +} + +type GetMessageArgs struct { + Request *GetMessageRequest `thrift:"request,1" json:"request"` +} + +func NewGetMessageArgs() *GetMessageArgs { + return &GetMessageArgs{} +} + +var GetMessageArgs_Request_DEFAULT *GetMessageRequest + +func (p *GetMessageArgs) GetRequest() *GetMessageRequest { + if !p.IsSetRequest() { + return GetMessageArgs_Request_DEFAULT + } + return p.Request +} +func (p *GetMessageArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *GetMessageArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetMessageArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &GetMessageRequest{ + MaxGetMessageNumber: 2000, + + MaxGetMessageBytes: 10485760, + + ShowUnHandledMessageNumber: true, + } + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *GetMessageArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getMessage_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetMessageArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *GetMessageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetMessageArgs(%+v)", *p) +} + +type GetMessageResult struct { + Success *GetMessageResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewGetMessageResult() *GetMessageResult { + return &GetMessageResult{} +} + +var GetMessageResult_Success_DEFAULT *GetMessageResponse + +func (p *GetMessageResult) GetSuccess() *GetMessageResponse { + if !p.IsSetSuccess() { + return GetMessageResult_Success_DEFAULT + } + return p.Success +} + +var GetMessageResult_E_DEFAULT *common.GalaxyTalosException + +func (p *GetMessageResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return GetMessageResult_E_DEFAULT + } + return p.E +} +func (p *GetMessageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GetMessageResult) IsSetE() bool { + return p.E != nil +} + +func (p *GetMessageResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetMessageResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &GetMessageResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *GetMessageResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *GetMessageResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getMessage_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetMessageResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *GetMessageResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *GetMessageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetMessageResult(%+v)", *p) +} + +type GetTopicOffsetArgs struct { + Request *GetTopicOffsetRequest `thrift:"request,1" json:"request"` +} + +func NewGetTopicOffsetArgs() *GetTopicOffsetArgs { + return &GetTopicOffsetArgs{} +} + +var GetTopicOffsetArgs_Request_DEFAULT *GetTopicOffsetRequest + +func (p *GetTopicOffsetArgs) GetRequest() *GetTopicOffsetRequest { + if !p.IsSetRequest() { + return GetTopicOffsetArgs_Request_DEFAULT + } + return p.Request +} +func (p *GetTopicOffsetArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *GetTopicOffsetArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetTopicOffsetArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &GetTopicOffsetRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *GetTopicOffsetArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getTopicOffset_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetTopicOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *GetTopicOffsetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTopicOffsetArgs(%+v)", *p) +} + +type GetTopicOffsetResult struct { + Success *GetTopicOffsetResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewGetTopicOffsetResult() *GetTopicOffsetResult { + return &GetTopicOffsetResult{} +} + +var GetTopicOffsetResult_Success_DEFAULT *GetTopicOffsetResponse + +func (p *GetTopicOffsetResult) GetSuccess() *GetTopicOffsetResponse { + if !p.IsSetSuccess() { + return GetTopicOffsetResult_Success_DEFAULT + } + return p.Success +} + +var GetTopicOffsetResult_E_DEFAULT *common.GalaxyTalosException + +func (p *GetTopicOffsetResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return GetTopicOffsetResult_E_DEFAULT + } + return p.E +} +func (p *GetTopicOffsetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GetTopicOffsetResult) IsSetE() bool { + return p.E != nil +} + +func (p *GetTopicOffsetResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetTopicOffsetResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &GetTopicOffsetResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *GetTopicOffsetResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *GetTopicOffsetResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getTopicOffset_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetTopicOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *GetTopicOffsetResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *GetTopicOffsetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTopicOffsetResult(%+v)", *p) +} + +type GetPartitionOffsetArgs struct { + Request *GetPartitionOffsetRequest `thrift:"request,1" json:"request"` +} + +func NewGetPartitionOffsetArgs() *GetPartitionOffsetArgs { + return &GetPartitionOffsetArgs{} +} + +var GetPartitionOffsetArgs_Request_DEFAULT *GetPartitionOffsetRequest + +func (p *GetPartitionOffsetArgs) GetRequest() *GetPartitionOffsetRequest { + if !p.IsSetRequest() { + return GetPartitionOffsetArgs_Request_DEFAULT + } + return p.Request +} +func (p *GetPartitionOffsetArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *GetPartitionOffsetArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetPartitionOffsetArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &GetPartitionOffsetRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *GetPartitionOffsetArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getPartitionOffset_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetPartitionOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *GetPartitionOffsetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPartitionOffsetArgs(%+v)", *p) +} + +type GetPartitionOffsetResult struct { + Success *GetPartitionOffsetResponse `thrift:"success,0" json:"success"` +} + +func NewGetPartitionOffsetResult() *GetPartitionOffsetResult { + return &GetPartitionOffsetResult{} +} + +var GetPartitionOffsetResult_Success_DEFAULT *GetPartitionOffsetResponse + +func (p *GetPartitionOffsetResult) GetSuccess() *GetPartitionOffsetResponse { + if !p.IsSetSuccess() { + return GetPartitionOffsetResult_Success_DEFAULT + } + return p.Success +} +func (p *GetPartitionOffsetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GetPartitionOffsetResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetPartitionOffsetResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &GetPartitionOffsetResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *GetPartitionOffsetResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getPartitionOffset_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetPartitionOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *GetPartitionOffsetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPartitionOffsetResult(%+v)", *p) +} + +type GetPartitionsOffsetArgs struct { + Request *GetPartitionsOffsetRequest `thrift:"request,1" json:"request"` +} + +func NewGetPartitionsOffsetArgs() *GetPartitionsOffsetArgs { + return &GetPartitionsOffsetArgs{} +} + +var GetPartitionsOffsetArgs_Request_DEFAULT *GetPartitionsOffsetRequest + +func (p *GetPartitionsOffsetArgs) GetRequest() *GetPartitionsOffsetRequest { + if !p.IsSetRequest() { + return GetPartitionsOffsetArgs_Request_DEFAULT + } + return p.Request +} +func (p *GetPartitionsOffsetArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *GetPartitionsOffsetArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetPartitionsOffsetArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &GetPartitionsOffsetRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *GetPartitionsOffsetArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getPartitionsOffset_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) } - if err2 = oprot.WriteMessageBegin("getPartitionsOffset", thrift.REPLY, seqId); err2 != nil { - err = err2 + if err := p.writeField1(oprot); err != nil { + return err } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + return nil +} + +func (p *GetPartitionsOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } - if err != nil { - return + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) } - return true, err + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err } -type messageServiceProcessorGetScheduleInfo struct { - handler MessageService +func (p *GetPartitionsOffsetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPartitionsOffsetArgs(%+v)", *p) } -func (p *messageServiceProcessorGetScheduleInfo) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := GetScheduleInfoArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getScheduleInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +type GetPartitionsOffsetResult struct { + Success *GetPartitionsOffsetResponse `thrift:"success,0" json:"success"` +} + +func NewGetPartitionsOffsetResult() *GetPartitionsOffsetResult { + return &GetPartitionsOffsetResult{} +} + +var GetPartitionsOffsetResult_Success_DEFAULT *GetPartitionsOffsetResponse + +func (p *GetPartitionsOffsetResult) GetSuccess() *GetPartitionsOffsetResponse { + if !p.IsSetSuccess() { + return GetPartitionsOffsetResult_Success_DEFAULT } + return p.Success +} +func (p *GetPartitionsOffsetResult) IsSetSuccess() bool { + return p.Success != nil +} - iprot.ReadMessageEnd() - result := GetScheduleInfoResult{} - var retval *GetScheduleInfoResponse - var err2 error - if retval, err2 = p.handler.GetScheduleInfo(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v +func (p *GetPartitionsOffsetResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getScheduleInfo: "+err2.Error()) - oprot.WriteMessageBegin("getScheduleInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err } - } else { - result.Success = retval } - if err2 = oprot.WriteMessageBegin("getScheduleInfo", thrift.REPLY, seqId); err2 != nil { - err = err2 + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + return nil +} + +func (p *GetPartitionsOffsetResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &GetPartitionsOffsetResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return nil +} + +func (p *GetPartitionsOffsetResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getPartitionsOffset_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err := p.writeField0(oprot); err != nil { + return err } - if err != nil { - return + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) } - return true, err + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil } -// HELPER FUNCTIONS AND STRUCTURES +func (p *GetPartitionsOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} -type PutMessageArgs struct { - Request *PutMessageRequest `thrift:"request,1" json:"request"` +func (p *GetPartitionsOffsetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPartitionsOffsetResult(%+v)", *p) } -func NewPutMessageArgs() *PutMessageArgs { - return &PutMessageArgs{} +type GetScheduleInfoArgs struct { + Request *GetScheduleInfoRequest `thrift:"request,1" json:"request"` } -var PutMessageArgs_Request_DEFAULT *PutMessageRequest +func NewGetScheduleInfoArgs() *GetScheduleInfoArgs { + return &GetScheduleInfoArgs{} +} -func (p *PutMessageArgs) GetRequest() *PutMessageRequest { +var GetScheduleInfoArgs_Request_DEFAULT *GetScheduleInfoRequest + +func (p *GetScheduleInfoArgs) GetRequest() *GetScheduleInfoRequest { if !p.IsSetRequest() { - return PutMessageArgs_Request_DEFAULT + return GetScheduleInfoArgs_Request_DEFAULT } return p.Request } -func (p *PutMessageArgs) IsSetRequest() bool { +func (p *GetScheduleInfoArgs) IsSetRequest() bool { return p.Request != nil } -func (p *PutMessageArgs) Read(iprot thrift.TProtocol) error { +func (p *GetScheduleInfoArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -900,16 +2688,16 @@ func (p *PutMessageArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *PutMessageArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &PutMessageRequest{} +func (p *GetScheduleInfoArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &GetScheduleInfoRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *PutMessageArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("putMessage_args"); err != nil { +func (p *GetScheduleInfoArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getScheduleInfo_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -924,7 +2712,7 @@ func (p *PutMessageArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *PutMessageArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *GetScheduleInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -937,48 +2725,48 @@ func (p *PutMessageArgs) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *PutMessageArgs) String() string { +func (p *GetScheduleInfoArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PutMessageArgs(%+v)", *p) + return fmt.Sprintf("GetScheduleInfoArgs(%+v)", *p) } -type PutMessageResult struct { - Success *PutMessageResponse `thrift:"success,0" json:"success"` +type GetScheduleInfoResult struct { + Success *GetScheduleInfoResponse `thrift:"success,0" json:"success"` E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewPutMessageResult() *PutMessageResult { - return &PutMessageResult{} +func NewGetScheduleInfoResult() *GetScheduleInfoResult { + return &GetScheduleInfoResult{} } -var PutMessageResult_Success_DEFAULT *PutMessageResponse +var GetScheduleInfoResult_Success_DEFAULT *GetScheduleInfoResponse -func (p *PutMessageResult) GetSuccess() *PutMessageResponse { +func (p *GetScheduleInfoResult) GetSuccess() *GetScheduleInfoResponse { if !p.IsSetSuccess() { - return PutMessageResult_Success_DEFAULT + return GetScheduleInfoResult_Success_DEFAULT } return p.Success } -var PutMessageResult_E_DEFAULT *common.GalaxyTalosException +var GetScheduleInfoResult_E_DEFAULT *common.GalaxyTalosException -func (p *PutMessageResult) GetE() *common.GalaxyTalosException { +func (p *GetScheduleInfoResult) GetE() *common.GalaxyTalosException { if !p.IsSetE() { - return PutMessageResult_E_DEFAULT + return GetScheduleInfoResult_E_DEFAULT } return p.E } -func (p *PutMessageResult) IsSetSuccess() bool { +func (p *GetScheduleInfoResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PutMessageResult) IsSetE() bool { +func (p *GetScheduleInfoResult) IsSetE() bool { return p.E != nil } -func (p *PutMessageResult) Read(iprot thrift.TProtocol) error { +func (p *GetScheduleInfoResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1014,15 +2802,15 @@ func (p *PutMessageResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *PutMessageResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &PutMessageResponse{} +func (p *GetScheduleInfoResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &GetScheduleInfoResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *PutMessageResult) ReadField1(iprot thrift.TProtocol) error { +func (p *GetScheduleInfoResult) ReadField1(iprot thrift.TProtocol) error { p.E = &common.GalaxyTalosException{} if err := p.E.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.E, err) @@ -1030,8 +2818,8 @@ func (p *PutMessageResult) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *PutMessageResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("putMessage_result"); err != nil { +func (p *GetScheduleInfoResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getScheduleInfo_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { @@ -1049,7 +2837,7 @@ func (p *PutMessageResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *PutMessageResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *GetScheduleInfoResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -1064,7 +2852,7 @@ func (p *PutMessageResult) writeField0(oprot thrift.TProtocol) (err error) { return err } -func (p *PutMessageResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *GetScheduleInfoResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -1079,34 +2867,34 @@ func (p *PutMessageResult) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *PutMessageResult) String() string { +func (p *GetScheduleInfoResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PutMessageResult(%+v)", *p) + return fmt.Sprintf("GetScheduleInfoResult(%+v)", *p) } -type GetMessageArgs struct { - Request *GetMessageRequest `thrift:"request,1" json:"request"` +type PrepareArgs struct { + Request *PrepareRequest `thrift:"request,1" json:"request"` } - -func NewGetMessageArgs() *GetMessageArgs { - return &GetMessageArgs{} + +func NewPrepareArgs() *PrepareArgs { + return &PrepareArgs{} } -var GetMessageArgs_Request_DEFAULT *GetMessageRequest +var PrepareArgs_Request_DEFAULT *PrepareRequest -func (p *GetMessageArgs) GetRequest() *GetMessageRequest { +func (p *PrepareArgs) GetRequest() *PrepareRequest { if !p.IsSetRequest() { - return GetMessageArgs_Request_DEFAULT + return PrepareArgs_Request_DEFAULT } return p.Request } -func (p *GetMessageArgs) IsSetRequest() bool { +func (p *PrepareArgs) IsSetRequest() bool { return p.Request != nil } -func (p *GetMessageArgs) Read(iprot thrift.TProtocol) error { +func (p *PrepareArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1138,22 +2926,16 @@ func (p *GetMessageArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetMessageArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &GetMessageRequest{ - MaxGetMessageNumber: 2000, - - MaxGetMessageBytes: 10485760, - - ShowUnHandledMessageNumber: true, - } +func (p *PrepareArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &PrepareRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *GetMessageArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getMessage_args"); err != nil { +func (p *PrepareArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("prepare_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1168,7 +2950,7 @@ func (p *GetMessageArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetMessageArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PrepareArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -1181,48 +2963,48 @@ func (p *GetMessageArgs) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *GetMessageArgs) String() string { +func (p *PrepareArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("GetMessageArgs(%+v)", *p) + return fmt.Sprintf("PrepareArgs(%+v)", *p) } -type GetMessageResult struct { - Success *GetMessageResponse `thrift:"success,0" json:"success"` +type PrepareResult struct { + Success *PrepareResponse `thrift:"success,0" json:"success"` E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewGetMessageResult() *GetMessageResult { - return &GetMessageResult{} +func NewPrepareResult() *PrepareResult { + return &PrepareResult{} } -var GetMessageResult_Success_DEFAULT *GetMessageResponse +var PrepareResult_Success_DEFAULT *PrepareResponse -func (p *GetMessageResult) GetSuccess() *GetMessageResponse { +func (p *PrepareResult) GetSuccess() *PrepareResponse { if !p.IsSetSuccess() { - return GetMessageResult_Success_DEFAULT + return PrepareResult_Success_DEFAULT } return p.Success } -var GetMessageResult_E_DEFAULT *common.GalaxyTalosException +var PrepareResult_E_DEFAULT *common.GalaxyTalosException -func (p *GetMessageResult) GetE() *common.GalaxyTalosException { +func (p *PrepareResult) GetE() *common.GalaxyTalosException { if !p.IsSetE() { - return GetMessageResult_E_DEFAULT + return PrepareResult_E_DEFAULT } return p.E } -func (p *GetMessageResult) IsSetSuccess() bool { +func (p *PrepareResult) IsSetSuccess() bool { return p.Success != nil } -func (p *GetMessageResult) IsSetE() bool { +func (p *PrepareResult) IsSetE() bool { return p.E != nil } -func (p *GetMessageResult) Read(iprot thrift.TProtocol) error { +func (p *PrepareResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1258,15 +3040,15 @@ func (p *GetMessageResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetMessageResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &GetMessageResponse{} +func (p *PrepareResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &PrepareResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *GetMessageResult) ReadField1(iprot thrift.TProtocol) error { +func (p *PrepareResult) ReadField1(iprot thrift.TProtocol) error { p.E = &common.GalaxyTalosException{} if err := p.E.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.E, err) @@ -1274,8 +3056,8 @@ func (p *GetMessageResult) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *GetMessageResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getMessage_result"); err != nil { +func (p *PrepareResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("prepare_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { @@ -1293,7 +3075,7 @@ func (p *GetMessageResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetMessageResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PrepareResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -1308,7 +3090,7 @@ func (p *GetMessageResult) writeField0(oprot thrift.TProtocol) (err error) { return err } -func (p *GetMessageResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PrepareResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -1323,34 +3105,34 @@ func (p *GetMessageResult) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *GetMessageResult) String() string { +func (p *PrepareResult) String() string { if p == nil { return "" } - return fmt.Sprintf("GetMessageResult(%+v)", *p) + return fmt.Sprintf("PrepareResult(%+v)", *p) } -type GetTopicOffsetArgs struct { - Request *GetTopicOffsetRequest `thrift:"request,1" json:"request"` +type CommitArgs struct { + Request *CommitRequest `thrift:"request,1" json:"request"` } -func NewGetTopicOffsetArgs() *GetTopicOffsetArgs { - return &GetTopicOffsetArgs{} +func NewCommitArgs() *CommitArgs { + return &CommitArgs{} } -var GetTopicOffsetArgs_Request_DEFAULT *GetTopicOffsetRequest +var CommitArgs_Request_DEFAULT *CommitRequest -func (p *GetTopicOffsetArgs) GetRequest() *GetTopicOffsetRequest { +func (p *CommitArgs) GetRequest() *CommitRequest { if !p.IsSetRequest() { - return GetTopicOffsetArgs_Request_DEFAULT + return CommitArgs_Request_DEFAULT } return p.Request } -func (p *GetTopicOffsetArgs) IsSetRequest() bool { +func (p *CommitArgs) IsSetRequest() bool { return p.Request != nil } -func (p *GetTopicOffsetArgs) Read(iprot thrift.TProtocol) error { +func (p *CommitArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1382,16 +3164,16 @@ func (p *GetTopicOffsetArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetTopicOffsetArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &GetTopicOffsetRequest{} +func (p *CommitArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &CommitRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *GetTopicOffsetArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getTopicOffset_args"); err != nil { +func (p *CommitArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("commit_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1406,7 +3188,7 @@ func (p *GetTopicOffsetArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetTopicOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommitArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -1419,48 +3201,48 @@ func (p *GetTopicOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *GetTopicOffsetArgs) String() string { +func (p *CommitArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("GetTopicOffsetArgs(%+v)", *p) + return fmt.Sprintf("CommitArgs(%+v)", *p) } -type GetTopicOffsetResult struct { - Success *GetTopicOffsetResponse `thrift:"success,0" json:"success"` +type CommitResult struct { + Success *CommitResponse `thrift:"success,0" json:"success"` E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewGetTopicOffsetResult() *GetTopicOffsetResult { - return &GetTopicOffsetResult{} +func NewCommitResult() *CommitResult { + return &CommitResult{} } -var GetTopicOffsetResult_Success_DEFAULT *GetTopicOffsetResponse +var CommitResult_Success_DEFAULT *CommitResponse -func (p *GetTopicOffsetResult) GetSuccess() *GetTopicOffsetResponse { +func (p *CommitResult) GetSuccess() *CommitResponse { if !p.IsSetSuccess() { - return GetTopicOffsetResult_Success_DEFAULT + return CommitResult_Success_DEFAULT } return p.Success } -var GetTopicOffsetResult_E_DEFAULT *common.GalaxyTalosException +var CommitResult_E_DEFAULT *common.GalaxyTalosException -func (p *GetTopicOffsetResult) GetE() *common.GalaxyTalosException { +func (p *CommitResult) GetE() *common.GalaxyTalosException { if !p.IsSetE() { - return GetTopicOffsetResult_E_DEFAULT + return CommitResult_E_DEFAULT } return p.E } -func (p *GetTopicOffsetResult) IsSetSuccess() bool { +func (p *CommitResult) IsSetSuccess() bool { return p.Success != nil } -func (p *GetTopicOffsetResult) IsSetE() bool { +func (p *CommitResult) IsSetE() bool { return p.E != nil } -func (p *GetTopicOffsetResult) Read(iprot thrift.TProtocol) error { +func (p *CommitResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1496,15 +3278,15 @@ func (p *GetTopicOffsetResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetTopicOffsetResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &GetTopicOffsetResponse{} +func (p *CommitResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &CommitResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *GetTopicOffsetResult) ReadField1(iprot thrift.TProtocol) error { +func (p *CommitResult) ReadField1(iprot thrift.TProtocol) error { p.E = &common.GalaxyTalosException{} if err := p.E.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.E, err) @@ -1512,8 +3294,8 @@ func (p *GetTopicOffsetResult) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *GetTopicOffsetResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getTopicOffset_result"); err != nil { +func (p *CommitResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("commit_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { @@ -1531,7 +3313,7 @@ func (p *GetTopicOffsetResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetTopicOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CommitResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -1546,7 +3328,7 @@ func (p *GetTopicOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { return err } -func (p *GetTopicOffsetResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommitResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -1561,34 +3343,34 @@ func (p *GetTopicOffsetResult) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *GetTopicOffsetResult) String() string { +func (p *CommitResult) String() string { if p == nil { return "" } - return fmt.Sprintf("GetTopicOffsetResult(%+v)", *p) + return fmt.Sprintf("CommitResult(%+v)", *p) } -type GetPartitionOffsetArgs struct { - Request *GetPartitionOffsetRequest `thrift:"request,1" json:"request"` +type RollbackArgs struct { + Request *RollbackRequest `thrift:"request,1" json:"request"` } -func NewGetPartitionOffsetArgs() *GetPartitionOffsetArgs { - return &GetPartitionOffsetArgs{} +func NewRollbackArgs() *RollbackArgs { + return &RollbackArgs{} } -var GetPartitionOffsetArgs_Request_DEFAULT *GetPartitionOffsetRequest +var RollbackArgs_Request_DEFAULT *RollbackRequest -func (p *GetPartitionOffsetArgs) GetRequest() *GetPartitionOffsetRequest { +func (p *RollbackArgs) GetRequest() *RollbackRequest { if !p.IsSetRequest() { - return GetPartitionOffsetArgs_Request_DEFAULT + return RollbackArgs_Request_DEFAULT } return p.Request } -func (p *GetPartitionOffsetArgs) IsSetRequest() bool { +func (p *RollbackArgs) IsSetRequest() bool { return p.Request != nil } -func (p *GetPartitionOffsetArgs) Read(iprot thrift.TProtocol) error { +func (p *RollbackArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1620,16 +3402,16 @@ func (p *GetPartitionOffsetArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetPartitionOffsetArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &GetPartitionOffsetRequest{} +func (p *RollbackArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &RollbackRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *GetPartitionOffsetArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getPartitionOffset_args"); err != nil { +func (p *RollbackArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("rollback_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1644,7 +3426,7 @@ func (p *GetPartitionOffsetArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetPartitionOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *RollbackArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -1657,34 +3439,48 @@ func (p *GetPartitionOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) return err } -func (p *GetPartitionOffsetArgs) String() string { +func (p *RollbackArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("GetPartitionOffsetArgs(%+v)", *p) + return fmt.Sprintf("RollbackArgs(%+v)", *p) } -type GetPartitionOffsetResult struct { - Success *GetPartitionOffsetResponse `thrift:"success,0" json:"success"` +type RollbackResult struct { + Success *RollbackResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewGetPartitionOffsetResult() *GetPartitionOffsetResult { - return &GetPartitionOffsetResult{} +func NewRollbackResult() *RollbackResult { + return &RollbackResult{} } -var GetPartitionOffsetResult_Success_DEFAULT *GetPartitionOffsetResponse +var RollbackResult_Success_DEFAULT *RollbackResponse -func (p *GetPartitionOffsetResult) GetSuccess() *GetPartitionOffsetResponse { +func (p *RollbackResult) GetSuccess() *RollbackResponse { if !p.IsSetSuccess() { - return GetPartitionOffsetResult_Success_DEFAULT + return RollbackResult_Success_DEFAULT } return p.Success } -func (p *GetPartitionOffsetResult) IsSetSuccess() bool { + +var RollbackResult_E_DEFAULT *common.GalaxyTalosException + +func (p *RollbackResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return RollbackResult_E_DEFAULT + } + return p.E +} +func (p *RollbackResult) IsSetSuccess() bool { return p.Success != nil } -func (p *GetPartitionOffsetResult) Read(iprot thrift.TProtocol) error { +func (p *RollbackResult) IsSetE() bool { + return p.E != nil +} + +func (p *RollbackResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1701,6 +3497,10 @@ func (p *GetPartitionOffsetResult) Read(iprot thrift.TProtocol) error { if err := p.ReadField0(iprot); err != nil { return err } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -1716,21 +3516,32 @@ func (p *GetPartitionOffsetResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetPartitionOffsetResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &GetPartitionOffsetResponse{} +func (p *RollbackResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &RollbackResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *GetPartitionOffsetResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getPartitionOffset_result"); err != nil { +func (p *RollbackResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *RollbackResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("rollback_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField1(oprot); err != nil { + return err + } if err := oprot.WriteFieldStop(); err != nil { return fmt.Errorf("write field stop error: %s", err) } @@ -1740,7 +3551,7 @@ func (p *GetPartitionOffsetResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetPartitionOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *RollbackResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -1755,34 +3566,49 @@ func (p *GetPartitionOffsetResult) writeField0(oprot thrift.TProtocol) (err erro return err } -func (p *GetPartitionOffsetResult) String() string { +func (p *RollbackResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *RollbackResult) String() string { if p == nil { return "" } - return fmt.Sprintf("GetPartitionOffsetResult(%+v)", *p) + return fmt.Sprintf("RollbackResult(%+v)", *p) } -type GetPartitionsOffsetArgs struct { - Request *GetPartitionsOffsetRequest `thrift:"request,1" json:"request"` +type GetUnkownStateTransactionArgs struct { + Request *GetUnkownStateTransactionRequest `thrift:"request,1" json:"request"` } -func NewGetPartitionsOffsetArgs() *GetPartitionsOffsetArgs { - return &GetPartitionsOffsetArgs{} +func NewGetUnkownStateTransactionArgs() *GetUnkownStateTransactionArgs { + return &GetUnkownStateTransactionArgs{} } -var GetPartitionsOffsetArgs_Request_DEFAULT *GetPartitionsOffsetRequest +var GetUnkownStateTransactionArgs_Request_DEFAULT *GetUnkownStateTransactionRequest -func (p *GetPartitionsOffsetArgs) GetRequest() *GetPartitionsOffsetRequest { +func (p *GetUnkownStateTransactionArgs) GetRequest() *GetUnkownStateTransactionRequest { if !p.IsSetRequest() { - return GetPartitionsOffsetArgs_Request_DEFAULT + return GetUnkownStateTransactionArgs_Request_DEFAULT } return p.Request } -func (p *GetPartitionsOffsetArgs) IsSetRequest() bool { +func (p *GetUnkownStateTransactionArgs) IsSetRequest() bool { return p.Request != nil } -func (p *GetPartitionsOffsetArgs) Read(iprot thrift.TProtocol) error { +func (p *GetUnkownStateTransactionArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1814,16 +3640,16 @@ func (p *GetPartitionsOffsetArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetPartitionsOffsetArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &GetPartitionsOffsetRequest{} +func (p *GetUnkownStateTransactionArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &GetUnkownStateTransactionRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *GetPartitionsOffsetArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getPartitionsOffset_args"); err != nil { +func (p *GetUnkownStateTransactionArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getUnkownStateTransaction_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1838,7 +3664,7 @@ func (p *GetPartitionsOffsetArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetPartitionsOffsetArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *GetUnkownStateTransactionArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -1851,34 +3677,48 @@ func (p *GetPartitionsOffsetArgs) writeField1(oprot thrift.TProtocol) (err error return err } -func (p *GetPartitionsOffsetArgs) String() string { +func (p *GetUnkownStateTransactionArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("GetPartitionsOffsetArgs(%+v)", *p) + return fmt.Sprintf("GetUnkownStateTransactionArgs(%+v)", *p) } -type GetPartitionsOffsetResult struct { - Success *GetPartitionsOffsetResponse `thrift:"success,0" json:"success"` +type GetUnkownStateTransactionResult struct { + Success *GetUnkownStateTransactionResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewGetPartitionsOffsetResult() *GetPartitionsOffsetResult { - return &GetPartitionsOffsetResult{} +func NewGetUnkownStateTransactionResult() *GetUnkownStateTransactionResult { + return &GetUnkownStateTransactionResult{} } -var GetPartitionsOffsetResult_Success_DEFAULT *GetPartitionsOffsetResponse +var GetUnkownStateTransactionResult_Success_DEFAULT *GetUnkownStateTransactionResponse -func (p *GetPartitionsOffsetResult) GetSuccess() *GetPartitionsOffsetResponse { +func (p *GetUnkownStateTransactionResult) GetSuccess() *GetUnkownStateTransactionResponse { if !p.IsSetSuccess() { - return GetPartitionsOffsetResult_Success_DEFAULT + return GetUnkownStateTransactionResult_Success_DEFAULT } return p.Success } -func (p *GetPartitionsOffsetResult) IsSetSuccess() bool { + +var GetUnkownStateTransactionResult_E_DEFAULT *common.GalaxyTalosException + +func (p *GetUnkownStateTransactionResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return GetUnkownStateTransactionResult_E_DEFAULT + } + return p.E +} +func (p *GetUnkownStateTransactionResult) IsSetSuccess() bool { return p.Success != nil } -func (p *GetPartitionsOffsetResult) Read(iprot thrift.TProtocol) error { +func (p *GetUnkownStateTransactionResult) IsSetE() bool { + return p.E != nil +} + +func (p *GetUnkownStateTransactionResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1895,6 +3735,10 @@ func (p *GetPartitionsOffsetResult) Read(iprot thrift.TProtocol) error { if err := p.ReadField0(iprot); err != nil { return err } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -1910,21 +3754,32 @@ func (p *GetPartitionsOffsetResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetPartitionsOffsetResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &GetPartitionsOffsetResponse{} +func (p *GetUnkownStateTransactionResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &GetUnkownStateTransactionResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *GetPartitionsOffsetResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getPartitionsOffset_result"); err != nil { +func (p *GetUnkownStateTransactionResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *GetUnkownStateTransactionResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getUnkownStateTransaction_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField1(oprot); err != nil { + return err + } if err := oprot.WriteFieldStop(); err != nil { return fmt.Errorf("write field stop error: %s", err) } @@ -1934,7 +3789,7 @@ func (p *GetPartitionsOffsetResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetPartitionsOffsetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *GetUnkownStateTransactionResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -1949,34 +3804,49 @@ func (p *GetPartitionsOffsetResult) writeField0(oprot thrift.TProtocol) (err err return err } -func (p *GetPartitionsOffsetResult) String() string { +func (p *GetUnkownStateTransactionResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *GetUnkownStateTransactionResult) String() string { if p == nil { return "" } - return fmt.Sprintf("GetPartitionsOffsetResult(%+v)", *p) + return fmt.Sprintf("GetUnkownStateTransactionResult(%+v)", *p) } -type GetScheduleInfoArgs struct { - Request *GetScheduleInfoRequest `thrift:"request,1" json:"request"` +type LookupTopicsArgs struct { + Request *LookupTopicsRequest `thrift:"request,1" json:"request"` } -func NewGetScheduleInfoArgs() *GetScheduleInfoArgs { - return &GetScheduleInfoArgs{} +func NewLookupTopicsArgs() *LookupTopicsArgs { + return &LookupTopicsArgs{} } -var GetScheduleInfoArgs_Request_DEFAULT *GetScheduleInfoRequest +var LookupTopicsArgs_Request_DEFAULT *LookupTopicsRequest -func (p *GetScheduleInfoArgs) GetRequest() *GetScheduleInfoRequest { +func (p *LookupTopicsArgs) GetRequest() *LookupTopicsRequest { if !p.IsSetRequest() { - return GetScheduleInfoArgs_Request_DEFAULT + return LookupTopicsArgs_Request_DEFAULT } return p.Request } -func (p *GetScheduleInfoArgs) IsSetRequest() bool { +func (p *LookupTopicsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *GetScheduleInfoArgs) Read(iprot thrift.TProtocol) error { +func (p *LookupTopicsArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2008,16 +3878,16 @@ func (p *GetScheduleInfoArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetScheduleInfoArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &GetScheduleInfoRequest{} +func (p *LookupTopicsArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &LookupTopicsRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *GetScheduleInfoArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getScheduleInfo_args"); err != nil { +func (p *LookupTopicsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("lookupTopics_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -2032,7 +3902,7 @@ func (p *GetScheduleInfoArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetScheduleInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LookupTopicsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -2045,48 +3915,48 @@ func (p *GetScheduleInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *GetScheduleInfoArgs) String() string { +func (p *LookupTopicsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("GetScheduleInfoArgs(%+v)", *p) + return fmt.Sprintf("LookupTopicsArgs(%+v)", *p) } -type GetScheduleInfoResult struct { - Success *GetScheduleInfoResponse `thrift:"success,0" json:"success"` +type LookupTopicsResult struct { + Success *LookupTopicsResponse `thrift:"success,0" json:"success"` E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewGetScheduleInfoResult() *GetScheduleInfoResult { - return &GetScheduleInfoResult{} +func NewLookupTopicsResult() *LookupTopicsResult { + return &LookupTopicsResult{} } -var GetScheduleInfoResult_Success_DEFAULT *GetScheduleInfoResponse +var LookupTopicsResult_Success_DEFAULT *LookupTopicsResponse -func (p *GetScheduleInfoResult) GetSuccess() *GetScheduleInfoResponse { +func (p *LookupTopicsResult) GetSuccess() *LookupTopicsResponse { if !p.IsSetSuccess() { - return GetScheduleInfoResult_Success_DEFAULT + return LookupTopicsResult_Success_DEFAULT } return p.Success } -var GetScheduleInfoResult_E_DEFAULT *common.GalaxyTalosException +var LookupTopicsResult_E_DEFAULT *common.GalaxyTalosException -func (p *GetScheduleInfoResult) GetE() *common.GalaxyTalosException { +func (p *LookupTopicsResult) GetE() *common.GalaxyTalosException { if !p.IsSetE() { - return GetScheduleInfoResult_E_DEFAULT + return LookupTopicsResult_E_DEFAULT } return p.E } -func (p *GetScheduleInfoResult) IsSetSuccess() bool { +func (p *LookupTopicsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *GetScheduleInfoResult) IsSetE() bool { +func (p *LookupTopicsResult) IsSetE() bool { return p.E != nil } -func (p *GetScheduleInfoResult) Read(iprot thrift.TProtocol) error { +func (p *LookupTopicsResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2122,15 +3992,15 @@ func (p *GetScheduleInfoResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetScheduleInfoResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &GetScheduleInfoResponse{} +func (p *LookupTopicsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &LookupTopicsResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *GetScheduleInfoResult) ReadField1(iprot thrift.TProtocol) error { +func (p *LookupTopicsResult) ReadField1(iprot thrift.TProtocol) error { p.E = &common.GalaxyTalosException{} if err := p.E.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.E, err) @@ -2138,8 +4008,8 @@ func (p *GetScheduleInfoResult) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *GetScheduleInfoResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getScheduleInfo_result"); err != nil { +func (p *LookupTopicsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("lookupTopics_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { @@ -2157,7 +4027,7 @@ func (p *GetScheduleInfoResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetScheduleInfoResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *LookupTopicsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -2172,7 +4042,7 @@ func (p *GetScheduleInfoResult) writeField0(oprot thrift.TProtocol) (err error) return err } -func (p *GetScheduleInfoResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LookupTopicsResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -2187,9 +4057,9 @@ func (p *GetScheduleInfoResult) writeField1(oprot thrift.TProtocol) (err error) return err } -func (p *GetScheduleInfoResult) String() string { +func (p *LookupTopicsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("GetScheduleInfoResult(%+v)", *p) + return fmt.Sprintf("LookupTopicsResult(%+v)", *p) } diff --git a/thrift/message/ttypes.go b/thrift/message/ttypes.go index f10a4f9..8061a67 100644 --- a/thrift/message/ttypes.go +++ b/thrift/message/ttypes.go @@ -685,6 +685,196 @@ func (p *MessageIndex) String() string { return fmt.Sprintf("MessageIndex(%+v)", *p) } +type HdfsMessageIndex struct { + MessageOffset int64 `thrift:"messageOffset,1,required" json:"messageOffset"` + FilePath string `thrift:"filePath,2,required" json:"filePath"` + HdfsLogFileOffset int64 `thrift:"hdfsLogFileOffset,3,required" json:"hdfsLogFileOffset"` + MessageNumber int32 `thrift:"messageNumber,4,required" json:"messageNumber"` +} + +func NewHdfsMessageIndex() *HdfsMessageIndex { + return &HdfsMessageIndex{} +} + +func (p *HdfsMessageIndex) GetMessageOffset() int64 { + return p.MessageOffset +} + +func (p *HdfsMessageIndex) GetFilePath() string { + return p.FilePath +} + +func (p *HdfsMessageIndex) GetHdfsLogFileOffset() int64 { + return p.HdfsLogFileOffset +} + +func (p *HdfsMessageIndex) GetMessageNumber() int32 { + return p.MessageNumber +} +func (p *HdfsMessageIndex) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *HdfsMessageIndex) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.MessageOffset = v + } + return nil +} + +func (p *HdfsMessageIndex) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.FilePath = v + } + return nil +} + +func (p *HdfsMessageIndex) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.HdfsLogFileOffset = v + } + return nil +} + +func (p *HdfsMessageIndex) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return fmt.Errorf("error reading field 4: %s", err) + } else { + p.MessageNumber = v + } + return nil +} + +func (p *HdfsMessageIndex) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("HdfsMessageIndex"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *HdfsMessageIndex) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("messageOffset", thrift.I64, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:messageOffset: %s", p, err) + } + if err := oprot.WriteI64(int64(p.MessageOffset)); err != nil { + return fmt.Errorf("%T.messageOffset (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:messageOffset: %s", p, err) + } + return err +} + +func (p *HdfsMessageIndex) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("filePath", thrift.STRING, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:filePath: %s", p, err) + } + if err := oprot.WriteString(string(p.FilePath)); err != nil { + return fmt.Errorf("%T.filePath (2) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:filePath: %s", p, err) + } + return err +} + +func (p *HdfsMessageIndex) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hdfsLogFileOffset", thrift.I64, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:hdfsLogFileOffset: %s", p, err) + } + if err := oprot.WriteI64(int64(p.HdfsLogFileOffset)); err != nil { + return fmt.Errorf("%T.hdfsLogFileOffset (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:hdfsLogFileOffset: %s", p, err) + } + return err +} + +func (p *HdfsMessageIndex) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("messageNumber", thrift.I32, 4); err != nil { + return fmt.Errorf("%T write field begin error 4:messageNumber: %s", p, err) + } + if err := oprot.WriteI32(int32(p.MessageNumber)); err != nil { + return fmt.Errorf("%T.messageNumber (4) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 4:messageNumber: %s", p, err) + } + return err +} + +func (p *HdfsMessageIndex) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HdfsMessageIndex(%+v)", *p) +} + type MessageAndOffset struct { Message *Message `thrift:"message,1,required" json:"message"` MessageOffset int64 `thrift:"messageOffset,2,required" json:"messageOffset"` @@ -869,6 +1059,7 @@ type MessageBlock struct { AppendTimestamp *int64 `thrift:"appendTimestamp,6" json:"appendTimestamp"` CreateTimestamp *int64 `thrift:"createTimestamp,7" json:"createTimestamp"` CreateTimestampList []int64 `thrift:"createTimestampList,8" json:"createTimestampList"` + TransactionId *int64 `thrift:"transactionId,9" json:"transactionId"` } func NewMessageBlock() *MessageBlock { @@ -925,6 +1116,15 @@ var MessageBlock_CreateTimestampList_DEFAULT []int64 func (p *MessageBlock) GetCreateTimestampList() []int64 { return p.CreateTimestampList } + +var MessageBlock_TransactionId_DEFAULT int64 + +func (p *MessageBlock) GetTransactionId() int64 { + if !p.IsSetTransactionId() { + return MessageBlock_TransactionId_DEFAULT + } + return *p.TransactionId +} func (p *MessageBlock) IsSetMessageBlockSize() bool { return p.MessageBlockSize != nil } @@ -941,6 +1141,10 @@ func (p *MessageBlock) IsSetCreateTimestampList() bool { return p.CreateTimestampList != nil } +func (p *MessageBlock) IsSetTransactionId() bool { + return p.TransactionId != nil +} + func (p *MessageBlock) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) @@ -986,6 +1190,10 @@ func (p *MessageBlock) Read(iprot thrift.TProtocol) error { if err := p.ReadField8(iprot); err != nil { return err } + case 9: + if err := p.ReadField9(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -1087,6 +1295,15 @@ func (p *MessageBlock) ReadField8(iprot thrift.TProtocol) error { return nil } +func (p *MessageBlock) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 9: %s", err) + } else { + p.TransactionId = &v + } + return nil +} + func (p *MessageBlock) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("MessageBlock"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) @@ -1115,6 +1332,9 @@ func (p *MessageBlock) Write(oprot thrift.TProtocol) error { if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { + return err + } if err := oprot.WriteFieldStop(); err != nil { return fmt.Errorf("write field stop error: %s", err) } @@ -1244,6 +1464,21 @@ func (p *MessageBlock) writeField8(oprot thrift.TProtocol) (err error) { return err } +func (p *MessageBlock) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetTransactionId() { + if err := oprot.WriteFieldBegin("transactionId", thrift.I64, 9); err != nil { + return fmt.Errorf("%T write field begin error 9:transactionId: %s", p, err) + } + if err := oprot.WriteI64(int64(*p.TransactionId)); err != nil { + return fmt.Errorf("%T.transactionId (9) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 9:transactionId: %s", p, err) + } + } + return err +} + func (p *MessageBlock) String() string { if p == nil { return "" @@ -2257,74 +2492,65 @@ func (p *GetMessageResponse) String() string { return fmt.Sprintf("GetMessageResponse(%+v)", *p) } -type OffsetInfo struct { - PartitionId int32 `thrift:"partitionId,1,required" json:"partitionId"` - StartOffset *int64 `thrift:"startOffset,2" json:"startOffset"` - EndOffset *int64 `thrift:"endOffset,3" json:"endOffset"` - ErrorCode *common.ErrorCode `thrift:"errorCode,4" json:"errorCode"` - ErrorMsg *string `thrift:"errorMsg,5" json:"errorMsg"` -} - -func NewOffsetInfo() *OffsetInfo { - return &OffsetInfo{} +type PrepareRequest struct { + TopicAndPartition *topic.TopicAndPartition `thrift:"topicAndPartition,1,required" json:"topicAndPartition"` + MessageBlock *MessageBlock `thrift:"messageBlock,2,required" json:"messageBlock"` + MessageNumber int32 `thrift:"messageNumber,3,required" json:"messageNumber"` + SequenceId string `thrift:"sequenceId,4,required" json:"sequenceId"` + TimeoutTimestamp *int64 `thrift:"timeoutTimestamp,5" json:"timeoutTimestamp"` } -func (p *OffsetInfo) GetPartitionId() int32 { - return p.PartitionId +func NewPrepareRequest() *PrepareRequest { + return &PrepareRequest{} } -var OffsetInfo_StartOffset_DEFAULT int64 +var PrepareRequest_TopicAndPartition_DEFAULT *topic.TopicAndPartition -func (p *OffsetInfo) GetStartOffset() int64 { - if !p.IsSetStartOffset() { - return OffsetInfo_StartOffset_DEFAULT +func (p *PrepareRequest) GetTopicAndPartition() *topic.TopicAndPartition { + if !p.IsSetTopicAndPartition() { + return PrepareRequest_TopicAndPartition_DEFAULT } - return *p.StartOffset + return p.TopicAndPartition } -var OffsetInfo_EndOffset_DEFAULT int64 +var PrepareRequest_MessageBlock_DEFAULT *MessageBlock -func (p *OffsetInfo) GetEndOffset() int64 { - if !p.IsSetEndOffset() { - return OffsetInfo_EndOffset_DEFAULT +func (p *PrepareRequest) GetMessageBlock() *MessageBlock { + if !p.IsSetMessageBlock() { + return PrepareRequest_MessageBlock_DEFAULT } - return *p.EndOffset + return p.MessageBlock } -var OffsetInfo_ErrorCode_DEFAULT common.ErrorCode +func (p *PrepareRequest) GetMessageNumber() int32 { + return p.MessageNumber +} -func (p *OffsetInfo) GetErrorCode() common.ErrorCode { - if !p.IsSetErrorCode() { - return OffsetInfo_ErrorCode_DEFAULT - } - return *p.ErrorCode +func (p *PrepareRequest) GetSequenceId() string { + return p.SequenceId } -var OffsetInfo_ErrorMsg_DEFAULT string +var PrepareRequest_TimeoutTimestamp_DEFAULT int64 -func (p *OffsetInfo) GetErrorMsg() string { - if !p.IsSetErrorMsg() { - return OffsetInfo_ErrorMsg_DEFAULT +func (p *PrepareRequest) GetTimeoutTimestamp() int64 { + if !p.IsSetTimeoutTimestamp() { + return PrepareRequest_TimeoutTimestamp_DEFAULT } - return *p.ErrorMsg -} -func (p *OffsetInfo) IsSetStartOffset() bool { - return p.StartOffset != nil + return *p.TimeoutTimestamp } - -func (p *OffsetInfo) IsSetEndOffset() bool { - return p.EndOffset != nil +func (p *PrepareRequest) IsSetTopicAndPartition() bool { + return p.TopicAndPartition != nil } -func (p *OffsetInfo) IsSetErrorCode() bool { - return p.ErrorCode != nil +func (p *PrepareRequest) IsSetMessageBlock() bool { + return p.MessageBlock != nil } -func (p *OffsetInfo) IsSetErrorMsg() bool { - return p.ErrorMsg != nil +func (p *PrepareRequest) IsSetTimeoutTimestamp() bool { + return p.TimeoutTimestamp != nil } -func (p *OffsetInfo) Read(iprot thrift.TProtocol) error { +func (p *PrepareRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2372,29 +2598,1437 @@ func (p *OffsetInfo) Read(iprot thrift.TProtocol) error { return nil } -func (p *OffsetInfo) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { - return fmt.Errorf("error reading field 1: %s", err) - } else { - p.PartitionId = v +func (p *PrepareRequest) ReadField1(iprot thrift.TProtocol) error { + p.TopicAndPartition = &topic.TopicAndPartition{} + if err := p.TopicAndPartition.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicAndPartition, err) } return nil } -func (p *OffsetInfo) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return fmt.Errorf("error reading field 2: %s", err) - } else { - p.StartOffset = &v +func (p *PrepareRequest) ReadField2(iprot thrift.TProtocol) error { + p.MessageBlock = &MessageBlock{ + CompressionType: 0, + } + if err := p.MessageBlock.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.MessageBlock, err) } return nil } -func (p *OffsetInfo) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { +func (p *PrepareRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { return fmt.Errorf("error reading field 3: %s", err) } else { - p.EndOffset = &v + p.MessageNumber = v + } + return nil +} + +func (p *PrepareRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 4: %s", err) + } else { + p.SequenceId = v + } + return nil +} + +func (p *PrepareRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 5: %s", err) + } else { + p.TimeoutTimestamp = &v + } + return nil +} + +func (p *PrepareRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("PrepareRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := p.writeField5(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *PrepareRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicAndPartition", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicAndPartition: %s", p, err) + } + if err := p.TopicAndPartition.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicAndPartition, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicAndPartition: %s", p, err) + } + return err +} + +func (p *PrepareRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("messageBlock", thrift.STRUCT, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:messageBlock: %s", p, err) + } + if err := p.MessageBlock.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.MessageBlock, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:messageBlock: %s", p, err) + } + return err +} + +func (p *PrepareRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("messageNumber", thrift.I32, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:messageNumber: %s", p, err) + } + if err := oprot.WriteI32(int32(p.MessageNumber)); err != nil { + return fmt.Errorf("%T.messageNumber (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:messageNumber: %s", p, err) + } + return err +} + +func (p *PrepareRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sequenceId", thrift.STRING, 4); err != nil { + return fmt.Errorf("%T write field begin error 4:sequenceId: %s", p, err) + } + if err := oprot.WriteString(string(p.SequenceId)); err != nil { + return fmt.Errorf("%T.sequenceId (4) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 4:sequenceId: %s", p, err) + } + return err +} + +func (p *PrepareRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetTimeoutTimestamp() { + if err := oprot.WriteFieldBegin("timeoutTimestamp", thrift.I64, 5); err != nil { + return fmt.Errorf("%T write field begin error 5:timeoutTimestamp: %s", p, err) + } + if err := oprot.WriteI64(int64(*p.TimeoutTimestamp)); err != nil { + return fmt.Errorf("%T.timeoutTimestamp (5) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 5:timeoutTimestamp: %s", p, err) + } + } + return err +} + +func (p *PrepareRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PrepareRequest(%+v)", *p) +} + +type PrepareResponse struct { + TopicAndPartition *topic.TopicAndPartition `thrift:"topicAndPartition,1,required" json:"topicAndPartition"` + TransactionId int64 `thrift:"transactionId,2,required" json:"transactionId"` + IsTransfer *bool `thrift:"isTransfer,3" json:"isTransfer"` +} + +func NewPrepareResponse() *PrepareResponse { + return &PrepareResponse{} +} + +var PrepareResponse_TopicAndPartition_DEFAULT *topic.TopicAndPartition + +func (p *PrepareResponse) GetTopicAndPartition() *topic.TopicAndPartition { + if !p.IsSetTopicAndPartition() { + return PrepareResponse_TopicAndPartition_DEFAULT + } + return p.TopicAndPartition +} + +func (p *PrepareResponse) GetTransactionId() int64 { + return p.TransactionId +} + +var PrepareResponse_IsTransfer_DEFAULT bool + +func (p *PrepareResponse) GetIsTransfer() bool { + if !p.IsSetIsTransfer() { + return PrepareResponse_IsTransfer_DEFAULT + } + return *p.IsTransfer +} +func (p *PrepareResponse) IsSetTopicAndPartition() bool { + return p.TopicAndPartition != nil +} + +func (p *PrepareResponse) IsSetIsTransfer() bool { + return p.IsTransfer != nil +} + +func (p *PrepareResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *PrepareResponse) ReadField1(iprot thrift.TProtocol) error { + p.TopicAndPartition = &topic.TopicAndPartition{} + if err := p.TopicAndPartition.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicAndPartition, err) + } + return nil +} + +func (p *PrepareResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.TransactionId = v + } + return nil +} + +func (p *PrepareResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.IsTransfer = &v + } + return nil +} + +func (p *PrepareResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("PrepareResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *PrepareResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicAndPartition", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicAndPartition: %s", p, err) + } + if err := p.TopicAndPartition.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicAndPartition, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicAndPartition: %s", p, err) + } + return err +} + +func (p *PrepareResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("transactionId", thrift.I64, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:transactionId: %s", p, err) + } + if err := oprot.WriteI64(int64(p.TransactionId)); err != nil { + return fmt.Errorf("%T.transactionId (2) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:transactionId: %s", p, err) + } + return err +} + +func (p *PrepareResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetIsTransfer() { + if err := oprot.WriteFieldBegin("isTransfer", thrift.BOOL, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:isTransfer: %s", p, err) + } + if err := oprot.WriteBool(bool(*p.IsTransfer)); err != nil { + return fmt.Errorf("%T.isTransfer (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:isTransfer: %s", p, err) + } + } + return err +} + +func (p *PrepareResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PrepareResponse(%+v)", *p) +} + +type CommitRequest struct { + TopicAndPartition *topic.TopicAndPartition `thrift:"topicAndPartition,1,required" json:"topicAndPartition"` + TransactionId int64 `thrift:"transactionId,2,required" json:"transactionId"` + SequenceId string `thrift:"sequenceId,3,required" json:"sequenceId"` +} + +func NewCommitRequest() *CommitRequest { + return &CommitRequest{} +} + +var CommitRequest_TopicAndPartition_DEFAULT *topic.TopicAndPartition + +func (p *CommitRequest) GetTopicAndPartition() *topic.TopicAndPartition { + if !p.IsSetTopicAndPartition() { + return CommitRequest_TopicAndPartition_DEFAULT + } + return p.TopicAndPartition +} + +func (p *CommitRequest) GetTransactionId() int64 { + return p.TransactionId +} + +func (p *CommitRequest) GetSequenceId() string { + return p.SequenceId +} +func (p *CommitRequest) IsSetTopicAndPartition() bool { + return p.TopicAndPartition != nil +} + +func (p *CommitRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CommitRequest) ReadField1(iprot thrift.TProtocol) error { + p.TopicAndPartition = &topic.TopicAndPartition{} + if err := p.TopicAndPartition.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicAndPartition, err) + } + return nil +} + +func (p *CommitRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.TransactionId = v + } + return nil +} + +func (p *CommitRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.SequenceId = v + } + return nil +} + +func (p *CommitRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CommitRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CommitRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicAndPartition", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicAndPartition: %s", p, err) + } + if err := p.TopicAndPartition.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicAndPartition, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicAndPartition: %s", p, err) + } + return err +} + +func (p *CommitRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("transactionId", thrift.I64, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:transactionId: %s", p, err) + } + if err := oprot.WriteI64(int64(p.TransactionId)); err != nil { + return fmt.Errorf("%T.transactionId (2) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:transactionId: %s", p, err) + } + return err +} + +func (p *CommitRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sequenceId", thrift.STRING, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:sequenceId: %s", p, err) + } + if err := oprot.WriteString(string(p.SequenceId)); err != nil { + return fmt.Errorf("%T.sequenceId (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:sequenceId: %s", p, err) + } + return err +} + +func (p *CommitRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommitRequest(%+v)", *p) +} + +type CommitResponse struct { + TopicAndPartition *topic.TopicAndPartition `thrift:"topicAndPartition,1,required" json:"topicAndPartition"` + TransactionId int64 `thrift:"transactionId,2,required" json:"transactionId"` + IsTransfer *bool `thrift:"isTransfer,3" json:"isTransfer"` +} + +func NewCommitResponse() *CommitResponse { + return &CommitResponse{} +} + +var CommitResponse_TopicAndPartition_DEFAULT *topic.TopicAndPartition + +func (p *CommitResponse) GetTopicAndPartition() *topic.TopicAndPartition { + if !p.IsSetTopicAndPartition() { + return CommitResponse_TopicAndPartition_DEFAULT + } + return p.TopicAndPartition +} + +func (p *CommitResponse) GetTransactionId() int64 { + return p.TransactionId +} + +var CommitResponse_IsTransfer_DEFAULT bool + +func (p *CommitResponse) GetIsTransfer() bool { + if !p.IsSetIsTransfer() { + return CommitResponse_IsTransfer_DEFAULT + } + return *p.IsTransfer +} +func (p *CommitResponse) IsSetTopicAndPartition() bool { + return p.TopicAndPartition != nil +} + +func (p *CommitResponse) IsSetIsTransfer() bool { + return p.IsTransfer != nil +} + +func (p *CommitResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CommitResponse) ReadField1(iprot thrift.TProtocol) error { + p.TopicAndPartition = &topic.TopicAndPartition{} + if err := p.TopicAndPartition.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicAndPartition, err) + } + return nil +} + +func (p *CommitResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.TransactionId = v + } + return nil +} + +func (p *CommitResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.IsTransfer = &v + } + return nil +} + +func (p *CommitResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CommitResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CommitResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicAndPartition", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicAndPartition: %s", p, err) + } + if err := p.TopicAndPartition.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicAndPartition, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicAndPartition: %s", p, err) + } + return err +} + +func (p *CommitResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("transactionId", thrift.I64, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:transactionId: %s", p, err) + } + if err := oprot.WriteI64(int64(p.TransactionId)); err != nil { + return fmt.Errorf("%T.transactionId (2) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:transactionId: %s", p, err) + } + return err +} + +func (p *CommitResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetIsTransfer() { + if err := oprot.WriteFieldBegin("isTransfer", thrift.BOOL, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:isTransfer: %s", p, err) + } + if err := oprot.WriteBool(bool(*p.IsTransfer)); err != nil { + return fmt.Errorf("%T.isTransfer (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:isTransfer: %s", p, err) + } + } + return err +} + +func (p *CommitResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommitResponse(%+v)", *p) +} + +type RollbackRequest struct { + TopicAndPartition *topic.TopicAndPartition `thrift:"topicAndPartition,1,required" json:"topicAndPartition"` + TransactionId int64 `thrift:"transactionId,2,required" json:"transactionId"` + SequenceId string `thrift:"sequenceId,3,required" json:"sequenceId"` +} + +func NewRollbackRequest() *RollbackRequest { + return &RollbackRequest{} +} + +var RollbackRequest_TopicAndPartition_DEFAULT *topic.TopicAndPartition + +func (p *RollbackRequest) GetTopicAndPartition() *topic.TopicAndPartition { + if !p.IsSetTopicAndPartition() { + return RollbackRequest_TopicAndPartition_DEFAULT + } + return p.TopicAndPartition +} + +func (p *RollbackRequest) GetTransactionId() int64 { + return p.TransactionId +} + +func (p *RollbackRequest) GetSequenceId() string { + return p.SequenceId +} +func (p *RollbackRequest) IsSetTopicAndPartition() bool { + return p.TopicAndPartition != nil +} + +func (p *RollbackRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *RollbackRequest) ReadField1(iprot thrift.TProtocol) error { + p.TopicAndPartition = &topic.TopicAndPartition{} + if err := p.TopicAndPartition.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicAndPartition, err) + } + return nil +} + +func (p *RollbackRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.TransactionId = v + } + return nil +} + +func (p *RollbackRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.SequenceId = v + } + return nil +} + +func (p *RollbackRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("RollbackRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *RollbackRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicAndPartition", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicAndPartition: %s", p, err) + } + if err := p.TopicAndPartition.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicAndPartition, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicAndPartition: %s", p, err) + } + return err +} + +func (p *RollbackRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("transactionId", thrift.I64, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:transactionId: %s", p, err) + } + if err := oprot.WriteI64(int64(p.TransactionId)); err != nil { + return fmt.Errorf("%T.transactionId (2) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:transactionId: %s", p, err) + } + return err +} + +func (p *RollbackRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sequenceId", thrift.STRING, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:sequenceId: %s", p, err) + } + if err := oprot.WriteString(string(p.SequenceId)); err != nil { + return fmt.Errorf("%T.sequenceId (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:sequenceId: %s", p, err) + } + return err +} + +func (p *RollbackRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RollbackRequest(%+v)", *p) +} + +type RollbackResponse struct { + TopicAndPartition *topic.TopicAndPartition `thrift:"topicAndPartition,1,required" json:"topicAndPartition"` + TransactionId int64 `thrift:"transactionId,2,required" json:"transactionId"` + IsTransfer *bool `thrift:"isTransfer,3" json:"isTransfer"` +} + +func NewRollbackResponse() *RollbackResponse { + return &RollbackResponse{} +} + +var RollbackResponse_TopicAndPartition_DEFAULT *topic.TopicAndPartition + +func (p *RollbackResponse) GetTopicAndPartition() *topic.TopicAndPartition { + if !p.IsSetTopicAndPartition() { + return RollbackResponse_TopicAndPartition_DEFAULT + } + return p.TopicAndPartition +} + +func (p *RollbackResponse) GetTransactionId() int64 { + return p.TransactionId +} + +var RollbackResponse_IsTransfer_DEFAULT bool + +func (p *RollbackResponse) GetIsTransfer() bool { + if !p.IsSetIsTransfer() { + return RollbackResponse_IsTransfer_DEFAULT + } + return *p.IsTransfer +} +func (p *RollbackResponse) IsSetTopicAndPartition() bool { + return p.TopicAndPartition != nil +} + +func (p *RollbackResponse) IsSetIsTransfer() bool { + return p.IsTransfer != nil +} + +func (p *RollbackResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *RollbackResponse) ReadField1(iprot thrift.TProtocol) error { + p.TopicAndPartition = &topic.TopicAndPartition{} + if err := p.TopicAndPartition.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicAndPartition, err) + } + return nil +} + +func (p *RollbackResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.TransactionId = v + } + return nil +} + +func (p *RollbackResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.IsTransfer = &v + } + return nil +} + +func (p *RollbackResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("RollbackResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *RollbackResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicAndPartition", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicAndPartition: %s", p, err) + } + if err := p.TopicAndPartition.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicAndPartition, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicAndPartition: %s", p, err) + } + return err +} + +func (p *RollbackResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("transactionId", thrift.I64, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:transactionId: %s", p, err) + } + if err := oprot.WriteI64(int64(p.TransactionId)); err != nil { + return fmt.Errorf("%T.transactionId (2) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:transactionId: %s", p, err) + } + return err +} + +func (p *RollbackResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetIsTransfer() { + if err := oprot.WriteFieldBegin("isTransfer", thrift.BOOL, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:isTransfer: %s", p, err) + } + if err := oprot.WriteBool(bool(*p.IsTransfer)); err != nil { + return fmt.Errorf("%T.isTransfer (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:isTransfer: %s", p, err) + } + } + return err +} + +func (p *RollbackResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RollbackResponse(%+v)", *p) +} + +type GetUnkownStateTransactionRequest struct { + TopicAndPartition *topic.TopicAndPartition `thrift:"topicAndPartition,1,required" json:"topicAndPartition"` + TimeoutTimestamp *int64 `thrift:"timeoutTimestamp,2" json:"timeoutTimestamp"` +} + +func NewGetUnkownStateTransactionRequest() *GetUnkownStateTransactionRequest { + return &GetUnkownStateTransactionRequest{} +} + +var GetUnkownStateTransactionRequest_TopicAndPartition_DEFAULT *topic.TopicAndPartition + +func (p *GetUnkownStateTransactionRequest) GetTopicAndPartition() *topic.TopicAndPartition { + if !p.IsSetTopicAndPartition() { + return GetUnkownStateTransactionRequest_TopicAndPartition_DEFAULT + } + return p.TopicAndPartition +} + +var GetUnkownStateTransactionRequest_TimeoutTimestamp_DEFAULT int64 + +func (p *GetUnkownStateTransactionRequest) GetTimeoutTimestamp() int64 { + if !p.IsSetTimeoutTimestamp() { + return GetUnkownStateTransactionRequest_TimeoutTimestamp_DEFAULT + } + return *p.TimeoutTimestamp +} +func (p *GetUnkownStateTransactionRequest) IsSetTopicAndPartition() bool { + return p.TopicAndPartition != nil +} + +func (p *GetUnkownStateTransactionRequest) IsSetTimeoutTimestamp() bool { + return p.TimeoutTimestamp != nil +} + +func (p *GetUnkownStateTransactionRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetUnkownStateTransactionRequest) ReadField1(iprot thrift.TProtocol) error { + p.TopicAndPartition = &topic.TopicAndPartition{} + if err := p.TopicAndPartition.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicAndPartition, err) + } + return nil +} + +func (p *GetUnkownStateTransactionRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.TimeoutTimestamp = &v + } + return nil +} + +func (p *GetUnkownStateTransactionRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetUnkownStateTransactionRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetUnkownStateTransactionRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicAndPartition", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicAndPartition: %s", p, err) + } + if err := p.TopicAndPartition.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicAndPartition, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicAndPartition: %s", p, err) + } + return err +} + +func (p *GetUnkownStateTransactionRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetTimeoutTimestamp() { + if err := oprot.WriteFieldBegin("timeoutTimestamp", thrift.I64, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:timeoutTimestamp: %s", p, err) + } + if err := oprot.WriteI64(int64(*p.TimeoutTimestamp)); err != nil { + return fmt.Errorf("%T.timeoutTimestamp (2) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:timeoutTimestamp: %s", p, err) + } + } + return err +} + +func (p *GetUnkownStateTransactionRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUnkownStateTransactionRequest(%+v)", *p) +} + +type GetUnkownStateTransactionResponse struct { + UnknowStateTransactions map[int64]*MessageBlock `thrift:"unknowStateTransactions,1,required" json:"unknowStateTransactions"` + IsReadAllUnknowInfo bool `thrift:"isReadAllUnknowInfo,2,required" json:"isReadAllUnknowInfo"` +} + +func NewGetUnkownStateTransactionResponse() *GetUnkownStateTransactionResponse { + return &GetUnkownStateTransactionResponse{} +} + +func (p *GetUnkownStateTransactionResponse) GetUnknowStateTransactions() map[int64]*MessageBlock { + return p.UnknowStateTransactions +} + +func (p *GetUnkownStateTransactionResponse) GetIsReadAllUnknowInfo() bool { + return p.IsReadAllUnknowInfo +} +func (p *GetUnkownStateTransactionResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetUnkownStateTransactionResponse) ReadField1(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return fmt.Errorf("error reading map begin: %s", err) + } + tMap := make(map[int64]*MessageBlock, size) + p.UnknowStateTransactions = tMap + for i := 0; i < size; i++ { + var _key3 int64 + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + _key3 = v + } + _val4 := &MessageBlock{ + CompressionType: 0, + } + if err := _val4.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _val4, err) + } + p.UnknowStateTransactions[_key3] = _val4 + } + if err := iprot.ReadMapEnd(); err != nil { + return fmt.Errorf("error reading map end: %s", err) + } + return nil +} + +func (p *GetUnkownStateTransactionResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.IsReadAllUnknowInfo = v + } + return nil +} + +func (p *GetUnkownStateTransactionResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetUnkownStateTransactionResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetUnkownStateTransactionResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("unknowStateTransactions", thrift.MAP, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:unknowStateTransactions: %s", p, err) + } + if err := oprot.WriteMapBegin(thrift.I64, thrift.STRUCT, len(p.UnknowStateTransactions)); err != nil { + return fmt.Errorf("error writing map begin: %s", err) + } + for k, v := range p.UnknowStateTransactions { + if err := oprot.WriteI64(int64(k)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) + } + if err := v.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", v, err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return fmt.Errorf("error writing map end: %s", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:unknowStateTransactions: %s", p, err) + } + return err +} + +func (p *GetUnkownStateTransactionResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("isReadAllUnknowInfo", thrift.BOOL, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:isReadAllUnknowInfo: %s", p, err) + } + if err := oprot.WriteBool(bool(p.IsReadAllUnknowInfo)); err != nil { + return fmt.Errorf("%T.isReadAllUnknowInfo (2) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:isReadAllUnknowInfo: %s", p, err) + } + return err +} + +func (p *GetUnkownStateTransactionResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUnkownStateTransactionResponse(%+v)", *p) +} + +type OffsetInfo struct { + PartitionId int32 `thrift:"partitionId,1,required" json:"partitionId"` + StartOffset *int64 `thrift:"startOffset,2" json:"startOffset"` + EndOffset *int64 `thrift:"endOffset,3" json:"endOffset"` + ErrorCode *common.ErrorCode `thrift:"errorCode,4" json:"errorCode"` + ErrorMsg *string `thrift:"errorMsg,5" json:"errorMsg"` +} + +func NewOffsetInfo() *OffsetInfo { + return &OffsetInfo{} +} + +func (p *OffsetInfo) GetPartitionId() int32 { + return p.PartitionId +} + +var OffsetInfo_StartOffset_DEFAULT int64 + +func (p *OffsetInfo) GetStartOffset() int64 { + if !p.IsSetStartOffset() { + return OffsetInfo_StartOffset_DEFAULT + } + return *p.StartOffset +} + +var OffsetInfo_EndOffset_DEFAULT int64 + +func (p *OffsetInfo) GetEndOffset() int64 { + if !p.IsSetEndOffset() { + return OffsetInfo_EndOffset_DEFAULT + } + return *p.EndOffset +} + +var OffsetInfo_ErrorCode_DEFAULT common.ErrorCode + +func (p *OffsetInfo) GetErrorCode() common.ErrorCode { + if !p.IsSetErrorCode() { + return OffsetInfo_ErrorCode_DEFAULT + } + return *p.ErrorCode +} + +var OffsetInfo_ErrorMsg_DEFAULT string + +func (p *OffsetInfo) GetErrorMsg() string { + if !p.IsSetErrorMsg() { + return OffsetInfo_ErrorMsg_DEFAULT + } + return *p.ErrorMsg +} +func (p *OffsetInfo) IsSetStartOffset() bool { + return p.StartOffset != nil +} + +func (p *OffsetInfo) IsSetEndOffset() bool { + return p.EndOffset != nil +} + +func (p *OffsetInfo) IsSetErrorCode() bool { + return p.ErrorCode != nil +} + +func (p *OffsetInfo) IsSetErrorMsg() bool { + return p.ErrorMsg != nil +} + +func (p *OffsetInfo) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *OffsetInfo) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.PartitionId = v + } + return nil +} + +func (p *OffsetInfo) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.StartOffset = &v + } + return nil +} + +func (p *OffsetInfo) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.EndOffset = &v } return nil } @@ -2673,11 +4307,11 @@ func (p *GetTopicOffsetResponse) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*OffsetInfo, 0, size) p.OffsetInfoList = tSlice for i := 0; i < size; i++ { - _elem3 := &OffsetInfo{} - if err := _elem3.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", _elem3, err) + _elem5 := &OffsetInfo{} + if err := _elem5.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _elem5, err) } - p.OffsetInfoList = append(p.OffsetInfoList, _elem3) + p.OffsetInfoList = append(p.OffsetInfoList, _elem5) } if err := iprot.ReadListEnd(); err != nil { return fmt.Errorf("error reading list end: %s", err) @@ -2972,11 +4606,11 @@ func (p *GetPartitionsOffsetRequest) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*topic.TopicAndPartition, 0, size) p.TopicAndPartitionList = tSlice for i := 0; i < size; i++ { - _elem4 := &topic.TopicAndPartition{} - if err := _elem4.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", _elem4, err) + _elem6 := &topic.TopicAndPartition{} + if err := _elem6.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _elem6, err) } - p.TopicAndPartitionList = append(p.TopicAndPartitionList, _elem4) + p.TopicAndPartitionList = append(p.TopicAndPartitionList, _elem6) } if err := iprot.ReadListEnd(); err != nil { return fmt.Errorf("error reading list end: %s", err) @@ -3079,11 +4713,11 @@ func (p *GetPartitionsOffsetResponse) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*OffsetInfo, 0, size) p.OffsetInfoList = tSlice for i := 0; i < size; i++ { - _elem5 := &OffsetInfo{} - if err := _elem5.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", _elem5, err) + _elem7 := &OffsetInfo{} + if err := _elem7.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _elem7, err) } - p.OffsetInfoList = append(p.OffsetInfoList, _elem5) + p.OffsetInfoList = append(p.OffsetInfoList, _elem7) } if err := iprot.ReadListEnd(); err != nil { return fmt.Errorf("error reading list end: %s", err) @@ -3282,17 +4916,17 @@ func (p *GetScheduleInfoResponse) ReadField1(iprot thrift.TProtocol) error { tMap := make(map[*topic.TopicAndPartition]string, size) p.ScheduleInfo = tMap for i := 0; i < size; i++ { - _key6 := &topic.TopicAndPartition{} - if err := _key6.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", _key6, err) + _key8 := &topic.TopicAndPartition{} + if err := _key8.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _key8, err) } - var _val7 string + var _val9 string if v, err := iprot.ReadString(); err != nil { return fmt.Errorf("error reading field 0: %s", err) } else { - _val7 = v + _val9 = v } - p.ScheduleInfo[_key6] = _val7 + p.ScheduleInfo[_key8] = _val9 } if err := iprot.ReadMapEnd(); err != nil { return fmt.Errorf("error reading map end: %s", err) @@ -3346,3 +4980,209 @@ func (p *GetScheduleInfoResponse) String() string { } return fmt.Sprintf("GetScheduleInfoResponse(%+v)", *p) } + +type LookupTopicsRequest struct { + TopicPattern string `thrift:"topicPattern,1,required" json:"topicPattern"` +} + +func NewLookupTopicsRequest() *LookupTopicsRequest { + return &LookupTopicsRequest{} +} + +func (p *LookupTopicsRequest) GetTopicPattern() string { + return p.TopicPattern +} +func (p *LookupTopicsRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *LookupTopicsRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.TopicPattern = v + } + return nil +} + +func (p *LookupTopicsRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("LookupTopicsRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *LookupTopicsRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicPattern", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicPattern: %s", p, err) + } + if err := oprot.WriteString(string(p.TopicPattern)); err != nil { + return fmt.Errorf("%T.topicPattern (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicPattern: %s", p, err) + } + return err +} + +func (p *LookupTopicsRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LookupTopicsRequest(%+v)", *p) +} + +type LookupTopicsResponse struct { + Topics map[string]int32 `thrift:"topics,1,required" json:"topics"` +} + +func NewLookupTopicsResponse() *LookupTopicsResponse { + return &LookupTopicsResponse{} +} + +func (p *LookupTopicsResponse) GetTopics() map[string]int32 { + return p.Topics +} +func (p *LookupTopicsResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *LookupTopicsResponse) ReadField1(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return fmt.Errorf("error reading map begin: %s", err) + } + tMap := make(map[string]int32, size) + p.Topics = tMap + for i := 0; i < size; i++ { + var _key10 string + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + _key10 = v + } + var _val11 int32 + if v, err := iprot.ReadI32(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + _val11 = v + } + p.Topics[_key10] = _val11 + } + if err := iprot.ReadMapEnd(); err != nil { + return fmt.Errorf("error reading map end: %s", err) + } + return nil +} + +func (p *LookupTopicsResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("LookupTopicsResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *LookupTopicsResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topics", thrift.MAP, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topics: %s", p, err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.Topics)); err != nil { + return fmt.Errorf("error writing map begin: %s", err) + } + for k, v := range p.Topics { + if err := oprot.WriteString(string(k)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) + } + if err := oprot.WriteI32(int32(v)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return fmt.Errorf("error writing map end: %s", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topics: %s", p, err) + } + return err +} + +func (p *LookupTopicsResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LookupTopicsResponse(%+v)", *p) +} diff --git a/thrift/metric/metric_service-remote/metric_service-remote.go b/thrift/metric/metric_service-remote/metric_service-remote.go index c917733..89439a8 100755 --- a/thrift/metric/metric_service-remote/metric_service-remote.go +++ b/thrift/metric/metric_service-remote/metric_service-remote.go @@ -22,7 +22,6 @@ func Usage() { flag.PrintDefaults() fmt.Fprintln(os.Stderr, "\nFunctions:") fmt.Fprintln(os.Stderr, " ListTopicsInfoResponse listTopics()") - fmt.Fprintln(os.Stderr, " ListTopicsInfoResponse listTopicsByOrgId(string orgId)") fmt.Fprintln(os.Stderr, " QueryConsumerGroupResponse queryConsumerGroup(QueryConsumerGroupRequest request)") fmt.Fprintln(os.Stderr, " GetTopicConsumeUnitResponse getTopicConsumeUnit(GetTopicConsumeUnitRequest request)") fmt.Fprintln(os.Stderr, " QueryTopicConsumeUnitResponse queryTopicConsumeUnit(QueryTopicConsumeUnitRequest request)") @@ -131,34 +130,24 @@ func main() { fmt.Print(client.ListTopics()) fmt.Print("\n") break - case "listTopicsByOrgId": - if flag.NArg()-1 != 1 { - fmt.Fprintln(os.Stderr, "ListTopicsByOrgId requires 1 args") - flag.Usage() - } - argvalue0 := flag.Arg(1) - value0 := argvalue0 - fmt.Print(client.ListTopicsByOrgId(value0)) - fmt.Print("\n") - break case "queryConsumerGroup": if flag.NArg()-1 != 1 { fmt.Fprintln(os.Stderr, "QueryConsumerGroup requires 1 args") flag.Usage() } - arg23 := flag.Arg(1) - mbTrans24 := thrift.NewTMemoryBufferLen(len(arg23)) - defer mbTrans24.Close() - _, err25 := mbTrans24.WriteString(arg23) - if err25 != nil { + arg20 := flag.Arg(1) + mbTrans21 := thrift.NewTMemoryBufferLen(len(arg20)) + defer mbTrans21.Close() + _, err22 := mbTrans21.WriteString(arg20) + if err22 != nil { Usage() return } - factory26 := thrift.NewTSimpleJSONProtocolFactory() - jsProt27 := factory26.GetProtocol(mbTrans24) + factory23 := thrift.NewTSimpleJSONProtocolFactory() + jsProt24 := factory23.GetProtocol(mbTrans21) argvalue0 := metric.NewQueryConsumerGroupRequest() - err28 := argvalue0.Read(jsProt27) - if err28 != nil { + err25 := argvalue0.Read(jsProt24) + if err25 != nil { Usage() return } @@ -171,19 +160,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetTopicConsumeUnit requires 1 args") flag.Usage() } - arg29 := flag.Arg(1) - mbTrans30 := thrift.NewTMemoryBufferLen(len(arg29)) - defer mbTrans30.Close() - _, err31 := mbTrans30.WriteString(arg29) - if err31 != nil { + arg26 := flag.Arg(1) + mbTrans27 := thrift.NewTMemoryBufferLen(len(arg26)) + defer mbTrans27.Close() + _, err28 := mbTrans27.WriteString(arg26) + if err28 != nil { Usage() return } - factory32 := thrift.NewTSimpleJSONProtocolFactory() - jsProt33 := factory32.GetProtocol(mbTrans30) + factory29 := thrift.NewTSimpleJSONProtocolFactory() + jsProt30 := factory29.GetProtocol(mbTrans27) argvalue0 := metric.NewGetTopicConsumeUnitRequest() - err34 := argvalue0.Read(jsProt33) - if err34 != nil { + err31 := argvalue0.Read(jsProt30) + if err31 != nil { Usage() return } @@ -196,19 +185,19 @@ func main() { fmt.Fprintln(os.Stderr, "QueryTopicConsumeUnit requires 1 args") flag.Usage() } - arg35 := flag.Arg(1) - mbTrans36 := thrift.NewTMemoryBufferLen(len(arg35)) - defer mbTrans36.Close() - _, err37 := mbTrans36.WriteString(arg35) - if err37 != nil { + arg32 := flag.Arg(1) + mbTrans33 := thrift.NewTMemoryBufferLen(len(arg32)) + defer mbTrans33.Close() + _, err34 := mbTrans33.WriteString(arg32) + if err34 != nil { Usage() return } - factory38 := thrift.NewTSimpleJSONProtocolFactory() - jsProt39 := factory38.GetProtocol(mbTrans36) + factory35 := thrift.NewTSimpleJSONProtocolFactory() + jsProt36 := factory35.GetProtocol(mbTrans33) argvalue0 := metric.NewQueryTopicConsumeUnitRequest() - err40 := argvalue0.Read(jsProt39) - if err40 != nil { + err37 := argvalue0.Read(jsProt36) + if err37 != nil { Usage() return } @@ -221,19 +210,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetDataPreview requires 1 args") flag.Usage() } - arg41 := flag.Arg(1) - mbTrans42 := thrift.NewTMemoryBufferLen(len(arg41)) - defer mbTrans42.Close() - _, err43 := mbTrans42.WriteString(arg41) - if err43 != nil { + arg38 := flag.Arg(1) + mbTrans39 := thrift.NewTMemoryBufferLen(len(arg38)) + defer mbTrans39.Close() + _, err40 := mbTrans39.WriteString(arg38) + if err40 != nil { Usage() return } - factory44 := thrift.NewTSimpleJSONProtocolFactory() - jsProt45 := factory44.GetProtocol(mbTrans42) + factory41 := thrift.NewTSimpleJSONProtocolFactory() + jsProt42 := factory41.GetProtocol(mbTrans39) argvalue0 := metric.NewGetDataPreviewRequest() - err46 := argvalue0.Read(jsProt45) - if err46 != nil { + err43 := argvalue0.Read(jsProt42) + if err43 != nil { Usage() return } @@ -254,19 +243,19 @@ func main() { fmt.Fprintln(os.Stderr, "ValidClientVersion requires 1 args") flag.Usage() } - arg47 := flag.Arg(1) - mbTrans48 := thrift.NewTMemoryBufferLen(len(arg47)) - defer mbTrans48.Close() - _, err49 := mbTrans48.WriteString(arg47) - if err49 != nil { + arg44 := flag.Arg(1) + mbTrans45 := thrift.NewTMemoryBufferLen(len(arg44)) + defer mbTrans45.Close() + _, err46 := mbTrans45.WriteString(arg44) + if err46 != nil { Usage() return } - factory50 := thrift.NewTSimpleJSONProtocolFactory() - jsProt51 := factory50.GetProtocol(mbTrans48) + factory47 := thrift.NewTSimpleJSONProtocolFactory() + jsProt48 := factory47.GetProtocol(mbTrans45) argvalue0 := metric.NewVersion() - err52 := argvalue0.Read(jsProt51) - if err52 != nil { + err49 := argvalue0.Read(jsProt48) + if err49 != nil { Usage() return } diff --git a/thrift/metric/metricservice.go b/thrift/metric/metricservice.go index c7ff23f..fd782fc 100644 --- a/thrift/metric/metricservice.go +++ b/thrift/metric/metricservice.go @@ -27,13 +27,6 @@ type MetricService interface { // and its describe information. // ListTopics() (r *topic.ListTopicsInfoResponse, err error) - // listTopicsInfo will return the topics which owned by the call developer - // and unber the orgId and its describe information. - // - // - // Parameters: - // - OrgId - ListTopicsByOrgId(orgId string) (r *topic.ListTopicsInfoResponse, err error) // query ConsumerGroup // // @@ -144,83 +137,6 @@ func (p *MetricServiceClient) recvListTopics() (value *topic.ListTopicsInfoRespo return } -// listTopicsInfo will return the topics which owned by the call developer -// and unber the orgId and its describe information. -// -// -// Parameters: -// - OrgId -func (p *MetricServiceClient) ListTopicsByOrgId(orgId string) (r *topic.ListTopicsInfoResponse, err error) { - if err = p.sendListTopicsByOrgId(orgId); err != nil { - return - } - return p.recvListTopicsByOrgId() -} - -func (p *MetricServiceClient) sendListTopicsByOrgId(orgId string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("listTopicsByOrgId", thrift.CALL, p.SeqId); err != nil { - return - } - args := ListTopicsByOrgIdArgs{ - OrgId: orgId, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *MetricServiceClient) recvListTopicsByOrgId() (value *topic.ListTopicsInfoResponse, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - _, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if mTypeId == thrift.EXCEPTION { - error11 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error12 error - error12, err = error11.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error12 - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "listTopicsByOrgId failed: out of sequence response") - return - } - result := ListTopicsByOrgIdResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - if result.E != nil { - err = result.E - return - } - value = result.GetSuccess() - return -} - // query ConsumerGroup // // @@ -266,16 +182,16 @@ func (p *MetricServiceClient) recvQueryConsumerGroup() (value *QueryConsumerGrou return } if mTypeId == thrift.EXCEPTION { - error13 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error14 error - error14, err = error13.Read(iprot) + error11 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error12 error + error12, err = error11.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error14 + err = error12 return } if p.SeqId != seqId { @@ -342,16 +258,16 @@ func (p *MetricServiceClient) recvGetTopicConsumeUnit() (value *GetTopicConsumeU return } if mTypeId == thrift.EXCEPTION { - error15 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error16 error - error16, err = error15.Read(iprot) + error13 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error14 error + error14, err = error13.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error16 + err = error14 return } if p.SeqId != seqId { @@ -418,16 +334,16 @@ func (p *MetricServiceClient) recvQueryTopicConsumeUnit() (value *QueryTopicCons return } if mTypeId == thrift.EXCEPTION { - error17 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error18 error - error18, err = error17.Read(iprot) + error15 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error16 error + error16, err = error15.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error18 + err = error16 return } if p.SeqId != seqId { @@ -494,16 +410,16 @@ func (p *MetricServiceClient) recvGetDataPreview() (value *GetDataPreviewRespons return } if mTypeId == thrift.EXCEPTION { - error19 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error20 error - error20, err = error19.Read(iprot) + error17 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error18 error + error18, err = error17.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error20 + err = error18 return } if p.SeqId != seqId { @@ -530,14 +446,13 @@ type MetricServiceProcessor struct { } func NewMetricServiceProcessor(handler MetricService) *MetricServiceProcessor { - self21 := &MetricServiceProcessor{common.NewTalosBaseServiceProcessor(handler)} - self21.AddToProcessorMap("listTopics", &metricServiceProcessorListTopics{handler: handler}) - self21.AddToProcessorMap("listTopicsByOrgId", &metricServiceProcessorListTopicsByOrgId{handler: handler}) - self21.AddToProcessorMap("queryConsumerGroup", &metricServiceProcessorQueryConsumerGroup{handler: handler}) - self21.AddToProcessorMap("getTopicConsumeUnit", &metricServiceProcessorGetTopicConsumeUnit{handler: handler}) - self21.AddToProcessorMap("queryTopicConsumeUnit", &metricServiceProcessorQueryTopicConsumeUnit{handler: handler}) - self21.AddToProcessorMap("getDataPreview", &metricServiceProcessorGetDataPreview{handler: handler}) - return self21 + self19 := &MetricServiceProcessor{common.NewTalosBaseServiceProcessor(handler)} + self19.AddToProcessorMap("listTopics", &metricServiceProcessorListTopics{handler: handler}) + self19.AddToProcessorMap("queryConsumerGroup", &metricServiceProcessorQueryConsumerGroup{handler: handler}) + self19.AddToProcessorMap("getTopicConsumeUnit", &metricServiceProcessorGetTopicConsumeUnit{handler: handler}) + self19.AddToProcessorMap("queryTopicConsumeUnit", &metricServiceProcessorQueryTopicConsumeUnit{handler: handler}) + self19.AddToProcessorMap("getDataPreview", &metricServiceProcessorGetDataPreview{handler: handler}) + return self19 } type metricServiceProcessorListTopics struct { @@ -593,59 +508,6 @@ func (p *metricServiceProcessorListTopics) Process(seqId int32, iprot, oprot thr return true, err } -type metricServiceProcessorListTopicsByOrgId struct { - handler MetricService -} - -func (p *metricServiceProcessorListTopicsByOrgId) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ListTopicsByOrgIdArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("listTopicsByOrgId", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ListTopicsByOrgIdResult{} - var retval *topic.ListTopicsInfoResponse - var err2 error - if retval, err2 = p.handler.ListTopicsByOrgId(args.OrgId); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTopicsByOrgId: "+err2.Error()) - oprot.WriteMessageBegin("listTopicsByOrgId", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("listTopicsByOrgId", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - type metricServiceProcessorQueryConsumerGroup struct { handler MetricService } @@ -1054,236 +916,6 @@ func (p *ListTopicsResult) String() string { return fmt.Sprintf("ListTopicsResult(%+v)", *p) } -type ListTopicsByOrgIdArgs struct { - OrgId string `thrift:"orgId,1" json:"orgId"` -} - -func NewListTopicsByOrgIdArgs() *ListTopicsByOrgIdArgs { - return &ListTopicsByOrgIdArgs{} -} - -func (p *ListTopicsByOrgIdArgs) GetOrgId() string { - return p.OrgId -} -func (p *ListTopicsByOrgIdArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return fmt.Errorf("%T read error: %s", p, err) - } - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return fmt.Errorf("%T read struct end error: %s", p, err) - } - return nil -} - -func (p *ListTopicsByOrgIdArgs) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return fmt.Errorf("error reading field 1: %s", err) - } else { - p.OrgId = v - } - return nil -} - -func (p *ListTopicsByOrgIdArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("listTopicsByOrgId_args"); err != nil { - return fmt.Errorf("%T write struct begin error: %s", p, err) - } - if err := p.writeField1(oprot); err != nil { - return err - } - if err := oprot.WriteFieldStop(); err != nil { - return fmt.Errorf("write field stop error: %s", err) - } - if err := oprot.WriteStructEnd(); err != nil { - return fmt.Errorf("write struct stop error: %s", err) - } - return nil -} - -func (p *ListTopicsByOrgIdArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("orgId", thrift.STRING, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:orgId: %s", p, err) - } - if err := oprot.WriteString(string(p.OrgId)); err != nil { - return fmt.Errorf("%T.orgId (1) field write error: %s", p, err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:orgId: %s", p, err) - } - return err -} - -func (p *ListTopicsByOrgIdArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ListTopicsByOrgIdArgs(%+v)", *p) -} - -type ListTopicsByOrgIdResult struct { - Success *topic.ListTopicsInfoResponse `thrift:"success,0" json:"success"` - E *common.GalaxyTalosException `thrift:"e,1" json:"e"` -} - -func NewListTopicsByOrgIdResult() *ListTopicsByOrgIdResult { - return &ListTopicsByOrgIdResult{} -} - -var ListTopicsByOrgIdResult_Success_DEFAULT *topic.ListTopicsInfoResponse - -func (p *ListTopicsByOrgIdResult) GetSuccess() *topic.ListTopicsInfoResponse { - if !p.IsSetSuccess() { - return ListTopicsByOrgIdResult_Success_DEFAULT - } - return p.Success -} - -var ListTopicsByOrgIdResult_E_DEFAULT *common.GalaxyTalosException - -func (p *ListTopicsByOrgIdResult) GetE() *common.GalaxyTalosException { - if !p.IsSetE() { - return ListTopicsByOrgIdResult_E_DEFAULT - } - return p.E -} -func (p *ListTopicsByOrgIdResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ListTopicsByOrgIdResult) IsSetE() bool { - return p.E != nil -} - -func (p *ListTopicsByOrgIdResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return fmt.Errorf("%T read error: %s", p, err) - } - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return fmt.Errorf("%T read struct end error: %s", p, err) - } - return nil -} - -func (p *ListTopicsByOrgIdResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &topic.ListTopicsInfoResponse{} - if err := p.Success.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.Success, err) - } - return nil -} - -func (p *ListTopicsByOrgIdResult) ReadField1(iprot thrift.TProtocol) error { - p.E = &common.GalaxyTalosException{} - if err := p.E.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.E, err) - } - return nil -} - -func (p *ListTopicsByOrgIdResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("listTopicsByOrgId_result"); err != nil { - return fmt.Errorf("%T write struct begin error: %s", p, err) - } - if err := p.writeField0(oprot); err != nil { - return err - } - if err := p.writeField1(oprot); err != nil { - return err - } - if err := oprot.WriteFieldStop(); err != nil { - return fmt.Errorf("write field stop error: %s", err) - } - if err := oprot.WriteStructEnd(); err != nil { - return fmt.Errorf("write struct stop error: %s", err) - } - return nil -} - -func (p *ListTopicsByOrgIdResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return fmt.Errorf("%T write field begin error 0:success: %s", p, err) - } - if err := p.Success.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", p.Success, err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 0:success: %s", p, err) - } - } - return err -} - -func (p *ListTopicsByOrgIdResult) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetE() { - if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:e: %s", p, err) - } - if err := p.E.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", p.E, err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:e: %s", p, err) - } - } - return err -} - -func (p *ListTopicsByOrgIdResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ListTopicsByOrgIdResult(%+v)", *p) -} - type QueryConsumerGroupArgs struct { Request *QueryConsumerGroupRequest `thrift:"request,1" json:"request"` } diff --git a/thrift/topic/topic_service-remote/topic_service-remote.go b/thrift/topic/topic_service-remote/topic_service-remote.go index 5ab71df..2cdd67d 100755 --- a/thrift/topic/topic_service-remote/topic_service-remote.go +++ b/thrift/topic/topic_service-remote/topic_service-remote.go @@ -22,10 +22,16 @@ func Usage() { flag.PrintDefaults() fmt.Fprintln(os.Stderr, "\nFunctions:") fmt.Fprintln(os.Stderr, " CreateTopicResponse createTopic(CreateTopicRequest request)") + fmt.Fprintln(os.Stderr, " CreateTopicResponse createReplicationTopic(CreateReplicationTopicRequest request)") + fmt.Fprintln(os.Stderr, " CreateTopicGroupResponse createTopicGroup(CreateTopicGroupRequest request)") + fmt.Fprintln(os.Stderr, " DescribeTopicGroupResponse describeTopicGroup(DescribeTopicGroupRequest request)") + fmt.Fprintln(os.Stderr, " void deleteTopicGroup(DeleteTopicGroupRequest request)") + fmt.Fprintln(os.Stderr, " ListTopicGroupResponse listTopicGroup(ListTopicGroupRequest request)") fmt.Fprintln(os.Stderr, " void deleteTopic(DeleteTopicRequest request)") fmt.Fprintln(os.Stderr, " void changeTopicAttribute(ChangeTopicAttributeRequest request)") fmt.Fprintln(os.Stderr, " DescribeTopicResponse describeTopic(DescribeTopicRequest request)") fmt.Fprintln(os.Stderr, " GetDescribeInfoResponse getDescribeInfo(GetDescribeInfoRequest request)") + fmt.Fprintln(os.Stderr, " GetTopicAttributeResponse getTopicAttribute(GetTopicAttributeRequest request)") fmt.Fprintln(os.Stderr, " ListTopicsInfoResponse listTopicsInfo()") fmt.Fprintln(os.Stderr, " ListTopicsResponse listTopics()") fmt.Fprintln(os.Stderr, " ListTopicsResponse getBindTopics()") @@ -138,19 +144,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateTopic requires 1 args") flag.Usage() } - arg46 := flag.Arg(1) - mbTrans47 := thrift.NewTMemoryBufferLen(len(arg46)) - defer mbTrans47.Close() - _, err48 := mbTrans47.WriteString(arg46) - if err48 != nil { + arg62 := flag.Arg(1) + mbTrans63 := thrift.NewTMemoryBufferLen(len(arg62)) + defer mbTrans63.Close() + _, err64 := mbTrans63.WriteString(arg62) + if err64 != nil { Usage() return } - factory49 := thrift.NewTSimpleJSONProtocolFactory() - jsProt50 := factory49.GetProtocol(mbTrans47) + factory65 := thrift.NewTSimpleJSONProtocolFactory() + jsProt66 := factory65.GetProtocol(mbTrans63) argvalue0 := topic.NewCreateTopicRequest() - err51 := argvalue0.Read(jsProt50) - if err51 != nil { + err67 := argvalue0.Read(jsProt66) + if err67 != nil { Usage() return } @@ -158,24 +164,149 @@ func main() { fmt.Print(client.CreateTopic(value0)) fmt.Print("\n") break + case "createReplicationTopic": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "CreateReplicationTopic requires 1 args") + flag.Usage() + } + arg68 := flag.Arg(1) + mbTrans69 := thrift.NewTMemoryBufferLen(len(arg68)) + defer mbTrans69.Close() + _, err70 := mbTrans69.WriteString(arg68) + if err70 != nil { + Usage() + return + } + factory71 := thrift.NewTSimpleJSONProtocolFactory() + jsProt72 := factory71.GetProtocol(mbTrans69) + argvalue0 := topic.NewCreateReplicationTopicRequest() + err73 := argvalue0.Read(jsProt72) + if err73 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateReplicationTopic(value0)) + fmt.Print("\n") + break + case "createTopicGroup": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTopicGroup requires 1 args") + flag.Usage() + } + arg74 := flag.Arg(1) + mbTrans75 := thrift.NewTMemoryBufferLen(len(arg74)) + defer mbTrans75.Close() + _, err76 := mbTrans75.WriteString(arg74) + if err76 != nil { + Usage() + return + } + factory77 := thrift.NewTSimpleJSONProtocolFactory() + jsProt78 := factory77.GetProtocol(mbTrans75) + argvalue0 := topic.NewCreateTopicGroupRequest() + err79 := argvalue0.Read(jsProt78) + if err79 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTopicGroup(value0)) + fmt.Print("\n") + break + case "describeTopicGroup": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "DescribeTopicGroup requires 1 args") + flag.Usage() + } + arg80 := flag.Arg(1) + mbTrans81 := thrift.NewTMemoryBufferLen(len(arg80)) + defer mbTrans81.Close() + _, err82 := mbTrans81.WriteString(arg80) + if err82 != nil { + Usage() + return + } + factory83 := thrift.NewTSimpleJSONProtocolFactory() + jsProt84 := factory83.GetProtocol(mbTrans81) + argvalue0 := topic.NewDescribeTopicGroupRequest() + err85 := argvalue0.Read(jsProt84) + if err85 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DescribeTopicGroup(value0)) + fmt.Print("\n") + break + case "deleteTopicGroup": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteTopicGroup requires 1 args") + flag.Usage() + } + arg86 := flag.Arg(1) + mbTrans87 := thrift.NewTMemoryBufferLen(len(arg86)) + defer mbTrans87.Close() + _, err88 := mbTrans87.WriteString(arg86) + if err88 != nil { + Usage() + return + } + factory89 := thrift.NewTSimpleJSONProtocolFactory() + jsProt90 := factory89.GetProtocol(mbTrans87) + argvalue0 := topic.NewDeleteTopicGroupRequest() + err91 := argvalue0.Read(jsProt90) + if err91 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteTopicGroup(value0)) + fmt.Print("\n") + break + case "listTopicGroup": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "ListTopicGroup requires 1 args") + flag.Usage() + } + arg92 := flag.Arg(1) + mbTrans93 := thrift.NewTMemoryBufferLen(len(arg92)) + defer mbTrans93.Close() + _, err94 := mbTrans93.WriteString(arg92) + if err94 != nil { + Usage() + return + } + factory95 := thrift.NewTSimpleJSONProtocolFactory() + jsProt96 := factory95.GetProtocol(mbTrans93) + argvalue0 := topic.NewListTopicGroupRequest() + err97 := argvalue0.Read(jsProt96) + if err97 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTopicGroup(value0)) + fmt.Print("\n") + break case "deleteTopic": if flag.NArg()-1 != 1 { fmt.Fprintln(os.Stderr, "DeleteTopic requires 1 args") flag.Usage() } - arg52 := flag.Arg(1) - mbTrans53 := thrift.NewTMemoryBufferLen(len(arg52)) - defer mbTrans53.Close() - _, err54 := mbTrans53.WriteString(arg52) - if err54 != nil { + arg98 := flag.Arg(1) + mbTrans99 := thrift.NewTMemoryBufferLen(len(arg98)) + defer mbTrans99.Close() + _, err100 := mbTrans99.WriteString(arg98) + if err100 != nil { Usage() return } - factory55 := thrift.NewTSimpleJSONProtocolFactory() - jsProt56 := factory55.GetProtocol(mbTrans53) + factory101 := thrift.NewTSimpleJSONProtocolFactory() + jsProt102 := factory101.GetProtocol(mbTrans99) argvalue0 := topic.NewDeleteTopicRequest() - err57 := argvalue0.Read(jsProt56) - if err57 != nil { + err103 := argvalue0.Read(jsProt102) + if err103 != nil { Usage() return } @@ -188,19 +319,19 @@ func main() { fmt.Fprintln(os.Stderr, "ChangeTopicAttribute requires 1 args") flag.Usage() } - arg58 := flag.Arg(1) - mbTrans59 := thrift.NewTMemoryBufferLen(len(arg58)) - defer mbTrans59.Close() - _, err60 := mbTrans59.WriteString(arg58) - if err60 != nil { + arg104 := flag.Arg(1) + mbTrans105 := thrift.NewTMemoryBufferLen(len(arg104)) + defer mbTrans105.Close() + _, err106 := mbTrans105.WriteString(arg104) + if err106 != nil { Usage() return } - factory61 := thrift.NewTSimpleJSONProtocolFactory() - jsProt62 := factory61.GetProtocol(mbTrans59) + factory107 := thrift.NewTSimpleJSONProtocolFactory() + jsProt108 := factory107.GetProtocol(mbTrans105) argvalue0 := topic.NewChangeTopicAttributeRequest() - err63 := argvalue0.Read(jsProt62) - if err63 != nil { + err109 := argvalue0.Read(jsProt108) + if err109 != nil { Usage() return } @@ -213,19 +344,19 @@ func main() { fmt.Fprintln(os.Stderr, "DescribeTopic requires 1 args") flag.Usage() } - arg64 := flag.Arg(1) - mbTrans65 := thrift.NewTMemoryBufferLen(len(arg64)) - defer mbTrans65.Close() - _, err66 := mbTrans65.WriteString(arg64) - if err66 != nil { + arg110 := flag.Arg(1) + mbTrans111 := thrift.NewTMemoryBufferLen(len(arg110)) + defer mbTrans111.Close() + _, err112 := mbTrans111.WriteString(arg110) + if err112 != nil { Usage() return } - factory67 := thrift.NewTSimpleJSONProtocolFactory() - jsProt68 := factory67.GetProtocol(mbTrans65) + factory113 := thrift.NewTSimpleJSONProtocolFactory() + jsProt114 := factory113.GetProtocol(mbTrans111) argvalue0 := topic.NewDescribeTopicRequest() - err69 := argvalue0.Read(jsProt68) - if err69 != nil { + err115 := argvalue0.Read(jsProt114) + if err115 != nil { Usage() return } @@ -238,19 +369,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetDescribeInfo requires 1 args") flag.Usage() } - arg70 := flag.Arg(1) - mbTrans71 := thrift.NewTMemoryBufferLen(len(arg70)) - defer mbTrans71.Close() - _, err72 := mbTrans71.WriteString(arg70) - if err72 != nil { + arg116 := flag.Arg(1) + mbTrans117 := thrift.NewTMemoryBufferLen(len(arg116)) + defer mbTrans117.Close() + _, err118 := mbTrans117.WriteString(arg116) + if err118 != nil { Usage() return } - factory73 := thrift.NewTSimpleJSONProtocolFactory() - jsProt74 := factory73.GetProtocol(mbTrans71) + factory119 := thrift.NewTSimpleJSONProtocolFactory() + jsProt120 := factory119.GetProtocol(mbTrans117) argvalue0 := topic.NewGetDescribeInfoRequest() - err75 := argvalue0.Read(jsProt74) - if err75 != nil { + err121 := argvalue0.Read(jsProt120) + if err121 != nil { Usage() return } @@ -258,6 +389,31 @@ func main() { fmt.Print(client.GetDescribeInfo(value0)) fmt.Print("\n") break + case "getTopicAttribute": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "GetTopicAttribute requires 1 args") + flag.Usage() + } + arg122 := flag.Arg(1) + mbTrans123 := thrift.NewTMemoryBufferLen(len(arg122)) + defer mbTrans123.Close() + _, err124 := mbTrans123.WriteString(arg122) + if err124 != nil { + Usage() + return + } + factory125 := thrift.NewTSimpleJSONProtocolFactory() + jsProt126 := factory125.GetProtocol(mbTrans123) + argvalue0 := topic.NewGetTopicAttributeRequest() + err127 := argvalue0.Read(jsProt126) + if err127 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTopicAttribute(value0)) + fmt.Print("\n") + break case "listTopicsInfo": if flag.NArg()-1 != 0 { fmt.Fprintln(os.Stderr, "ListTopicsInfo requires 0 args") @@ -287,19 +443,19 @@ func main() { fmt.Fprintln(os.Stderr, "SetTopicQuota requires 1 args") flag.Usage() } - arg76 := flag.Arg(1) - mbTrans77 := thrift.NewTMemoryBufferLen(len(arg76)) - defer mbTrans77.Close() - _, err78 := mbTrans77.WriteString(arg76) - if err78 != nil { + arg128 := flag.Arg(1) + mbTrans129 := thrift.NewTMemoryBufferLen(len(arg128)) + defer mbTrans129.Close() + _, err130 := mbTrans129.WriteString(arg128) + if err130 != nil { Usage() return } - factory79 := thrift.NewTSimpleJSONProtocolFactory() - jsProt80 := factory79.GetProtocol(mbTrans77) + factory131 := thrift.NewTSimpleJSONProtocolFactory() + jsProt132 := factory131.GetProtocol(mbTrans129) argvalue0 := topic.NewSetTopicQuotaRequest() - err81 := argvalue0.Read(jsProt80) - if err81 != nil { + err133 := argvalue0.Read(jsProt132) + if err133 != nil { Usage() return } @@ -312,19 +468,19 @@ func main() { fmt.Fprintln(os.Stderr, "QueryTopicQuota requires 1 args") flag.Usage() } - arg82 := flag.Arg(1) - mbTrans83 := thrift.NewTMemoryBufferLen(len(arg82)) - defer mbTrans83.Close() - _, err84 := mbTrans83.WriteString(arg82) - if err84 != nil { + arg134 := flag.Arg(1) + mbTrans135 := thrift.NewTMemoryBufferLen(len(arg134)) + defer mbTrans135.Close() + _, err136 := mbTrans135.WriteString(arg134) + if err136 != nil { Usage() return } - factory85 := thrift.NewTSimpleJSONProtocolFactory() - jsProt86 := factory85.GetProtocol(mbTrans83) + factory137 := thrift.NewTSimpleJSONProtocolFactory() + jsProt138 := factory137.GetProtocol(mbTrans135) argvalue0 := topic.NewQueryTopicQuotaRequest() - err87 := argvalue0.Read(jsProt86) - if err87 != nil { + err139 := argvalue0.Read(jsProt138) + if err139 != nil { Usage() return } @@ -337,19 +493,19 @@ func main() { fmt.Fprintln(os.Stderr, "DeleteTopicQuota requires 1 args") flag.Usage() } - arg88 := flag.Arg(1) - mbTrans89 := thrift.NewTMemoryBufferLen(len(arg88)) - defer mbTrans89.Close() - _, err90 := mbTrans89.WriteString(arg88) - if err90 != nil { + arg140 := flag.Arg(1) + mbTrans141 := thrift.NewTMemoryBufferLen(len(arg140)) + defer mbTrans141.Close() + _, err142 := mbTrans141.WriteString(arg140) + if err142 != nil { Usage() return } - factory91 := thrift.NewTSimpleJSONProtocolFactory() - jsProt92 := factory91.GetProtocol(mbTrans89) + factory143 := thrift.NewTSimpleJSONProtocolFactory() + jsProt144 := factory143.GetProtocol(mbTrans141) argvalue0 := topic.NewDeleteTopicQuotaRequest() - err93 := argvalue0.Read(jsProt92) - if err93 != nil { + err145 := argvalue0.Read(jsProt144) + if err145 != nil { Usage() return } @@ -362,19 +518,19 @@ func main() { fmt.Fprintln(os.Stderr, "SetPermission requires 1 args") flag.Usage() } - arg94 := flag.Arg(1) - mbTrans95 := thrift.NewTMemoryBufferLen(len(arg94)) - defer mbTrans95.Close() - _, err96 := mbTrans95.WriteString(arg94) - if err96 != nil { + arg146 := flag.Arg(1) + mbTrans147 := thrift.NewTMemoryBufferLen(len(arg146)) + defer mbTrans147.Close() + _, err148 := mbTrans147.WriteString(arg146) + if err148 != nil { Usage() return } - factory97 := thrift.NewTSimpleJSONProtocolFactory() - jsProt98 := factory97.GetProtocol(mbTrans95) + factory149 := thrift.NewTSimpleJSONProtocolFactory() + jsProt150 := factory149.GetProtocol(mbTrans147) argvalue0 := topic.NewSetPermissionRequest() - err99 := argvalue0.Read(jsProt98) - if err99 != nil { + err151 := argvalue0.Read(jsProt150) + if err151 != nil { Usage() return } @@ -387,19 +543,19 @@ func main() { fmt.Fprintln(os.Stderr, "RevokePermission requires 1 args") flag.Usage() } - arg100 := flag.Arg(1) - mbTrans101 := thrift.NewTMemoryBufferLen(len(arg100)) - defer mbTrans101.Close() - _, err102 := mbTrans101.WriteString(arg100) - if err102 != nil { + arg152 := flag.Arg(1) + mbTrans153 := thrift.NewTMemoryBufferLen(len(arg152)) + defer mbTrans153.Close() + _, err154 := mbTrans153.WriteString(arg152) + if err154 != nil { Usage() return } - factory103 := thrift.NewTSimpleJSONProtocolFactory() - jsProt104 := factory103.GetProtocol(mbTrans101) + factory155 := thrift.NewTSimpleJSONProtocolFactory() + jsProt156 := factory155.GetProtocol(mbTrans153) argvalue0 := topic.NewRevokePermissionRequest() - err105 := argvalue0.Read(jsProt104) - if err105 != nil { + err157 := argvalue0.Read(jsProt156) + if err157 != nil { Usage() return } @@ -412,19 +568,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListPermission requires 1 args") flag.Usage() } - arg106 := flag.Arg(1) - mbTrans107 := thrift.NewTMemoryBufferLen(len(arg106)) - defer mbTrans107.Close() - _, err108 := mbTrans107.WriteString(arg106) - if err108 != nil { + arg158 := flag.Arg(1) + mbTrans159 := thrift.NewTMemoryBufferLen(len(arg158)) + defer mbTrans159.Close() + _, err160 := mbTrans159.WriteString(arg158) + if err160 != nil { Usage() return } - factory109 := thrift.NewTSimpleJSONProtocolFactory() - jsProt110 := factory109.GetProtocol(mbTrans107) + factory161 := thrift.NewTSimpleJSONProtocolFactory() + jsProt162 := factory161.GetProtocol(mbTrans159) argvalue0 := topic.NewListPermissionRequest() - err111 := argvalue0.Read(jsProt110) - if err111 != nil { + err163 := argvalue0.Read(jsProt162) + if err163 != nil { Usage() return } @@ -437,19 +593,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetPermission requires 1 args") flag.Usage() } - arg112 := flag.Arg(1) - mbTrans113 := thrift.NewTMemoryBufferLen(len(arg112)) - defer mbTrans113.Close() - _, err114 := mbTrans113.WriteString(arg112) - if err114 != nil { + arg164 := flag.Arg(1) + mbTrans165 := thrift.NewTMemoryBufferLen(len(arg164)) + defer mbTrans165.Close() + _, err166 := mbTrans165.WriteString(arg164) + if err166 != nil { Usage() return } - factory115 := thrift.NewTSimpleJSONProtocolFactory() - jsProt116 := factory115.GetProtocol(mbTrans113) + factory167 := thrift.NewTSimpleJSONProtocolFactory() + jsProt168 := factory167.GetProtocol(mbTrans165) argvalue0 := topic.NewGetPermissionRequest() - err117 := argvalue0.Read(jsProt116) - if err117 != nil { + err169 := argvalue0.Read(jsProt168) + if err169 != nil { Usage() return } @@ -462,19 +618,19 @@ func main() { fmt.Fprintln(os.Stderr, "AddSubResourceName requires 1 args") flag.Usage() } - arg118 := flag.Arg(1) - mbTrans119 := thrift.NewTMemoryBufferLen(len(arg118)) - defer mbTrans119.Close() - _, err120 := mbTrans119.WriteString(arg118) - if err120 != nil { + arg170 := flag.Arg(1) + mbTrans171 := thrift.NewTMemoryBufferLen(len(arg170)) + defer mbTrans171.Close() + _, err172 := mbTrans171.WriteString(arg170) + if err172 != nil { Usage() return } - factory121 := thrift.NewTSimpleJSONProtocolFactory() - jsProt122 := factory121.GetProtocol(mbTrans119) + factory173 := thrift.NewTSimpleJSONProtocolFactory() + jsProt174 := factory173.GetProtocol(mbTrans171) argvalue0 := topic.NewAddSubResourceNameRequest() - err123 := argvalue0.Read(jsProt122) - if err123 != nil { + err175 := argvalue0.Read(jsProt174) + if err175 != nil { Usage() return } @@ -495,19 +651,19 @@ func main() { fmt.Fprintln(os.Stderr, "ValidClientVersion requires 1 args") flag.Usage() } - arg124 := flag.Arg(1) - mbTrans125 := thrift.NewTMemoryBufferLen(len(arg124)) - defer mbTrans125.Close() - _, err126 := mbTrans125.WriteString(arg124) - if err126 != nil { + arg176 := flag.Arg(1) + mbTrans177 := thrift.NewTMemoryBufferLen(len(arg176)) + defer mbTrans177.Close() + _, err178 := mbTrans177.WriteString(arg176) + if err178 != nil { Usage() return } - factory127 := thrift.NewTSimpleJSONProtocolFactory() - jsProt128 := factory127.GetProtocol(mbTrans125) + factory179 := thrift.NewTSimpleJSONProtocolFactory() + jsProt180 := factory179.GetProtocol(mbTrans177) argvalue0 := topic.NewVersion() - err129 := argvalue0.Read(jsProt128) - if err129 != nil { + err181 := argvalue0.Read(jsProt180) + if err181 != nil { Usage() return } diff --git a/thrift/topic/topicservice.go b/thrift/topic/topicservice.go index 74b5b92..dac834f 100644 --- a/thrift/topic/topicservice.go +++ b/thrift/topic/topicservice.go @@ -6,7 +6,6 @@ package topic import ( "bytes" "fmt" - "github.com/XiaoMi/talos-sdk-golang/thrift/authorization" "github.com/XiaoMi/talos-sdk-golang/thrift/common" "github.com/XiaoMi/talos-sdk-golang/thrift/quota" @@ -31,6 +30,36 @@ type TopicService interface { // Parameters: // - Request CreateTopic(request *CreateTopicRequest) (r *CreateTopicResponse, err error) + // createReplicationTopic, one must be a Developer that call this method; + // + // + // Parameters: + // - Request + CreateReplicationTopic(request *CreateReplicationTopicRequest) (r *CreateTopicResponse, err error) + // createTopicGroup, one must be a Developer that call this method; + // + // + // Parameters: + // - Request + CreateTopicGroup(request *CreateTopicGroupRequest) (r *CreateTopicGroupResponse, err error) + // desribeTopicGroup; + // + // + // Parameters: + // - Request + DescribeTopicGroup(request *DescribeTopicGroupRequest) (r *DescribeTopicGroupResponse, err error) + // deleteTopicGroup; + // + // + // Parameters: + // - Request + DeleteTopicGroup(request *DeleteTopicGroupRequest) (err error) + // listTopicGroup; + // + // + // Parameters: + // - Request + ListTopicGroup(request *ListTopicGroupRequest) (r *ListTopicGroupResponse, err error) // deleteTopic, the caller must have CHANGE_TOPIC permission; // // @@ -55,6 +84,12 @@ type TopicService interface { // Parameters: // - Request GetDescribeInfo(request *GetDescribeInfoRequest) (r *GetDescribeInfoResponse, err error) + // getTopicAttribute, the caller must have DESCRIBE_TOPIC permission; + // + // + // Parameters: + // - Request + GetTopicAttribute(request *GetTopicAttributeRequest) (r *GetTopicAttributeResponse, err error) // listTopicsInfo will return the topics which owned by the call developer // and its describe information. // @@ -176,16 +211,16 @@ func (p *TopicServiceClient) recvCreateTopic() (value *CreateTopicResponse, err return } if mTypeId == thrift.EXCEPTION { - error13 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error14 error - error14, err = error13.Read(iprot) + error17 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error18 error + error18, err = error17.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error14 + err = error18 return } if p.SeqId != seqId { @@ -207,29 +242,29 @@ func (p *TopicServiceClient) recvCreateTopic() (value *CreateTopicResponse, err return } -// deleteTopic, the caller must have CHANGE_TOPIC permission; +// createReplicationTopic, one must be a Developer that call this method; // // // Parameters: // - Request -func (p *TopicServiceClient) DeleteTopic(request *DeleteTopicRequest) (err error) { - if err = p.sendDeleteTopic(request); err != nil { +func (p *TopicServiceClient) CreateReplicationTopic(request *CreateReplicationTopicRequest) (r *CreateTopicResponse, err error) { + if err = p.sendCreateReplicationTopic(request); err != nil { return } - return p.recvDeleteTopic() + return p.recvCreateReplicationTopic() } -func (p *TopicServiceClient) sendDeleteTopic(request *DeleteTopicRequest) (err error) { +func (p *TopicServiceClient) sendCreateReplicationTopic(request *CreateReplicationTopicRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("deleteTopic", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("createReplicationTopic", thrift.CALL, p.SeqId); err != nil { return } - args := DeleteTopicArgs{ + args := CreateReplicationTopicArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -241,7 +276,7 @@ func (p *TopicServiceClient) sendDeleteTopic(request *DeleteTopicRequest) (err e return oprot.Flush() } -func (p *TopicServiceClient) recvDeleteTopic() (err error) { +func (p *TopicServiceClient) recvCreateReplicationTopic() (value *CreateTopicResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -252,23 +287,23 @@ func (p *TopicServiceClient) recvDeleteTopic() (err error) { return } if mTypeId == thrift.EXCEPTION { - error15 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error16 error - error16, err = error15.Read(iprot) + error19 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error20 error + error20, err = error19.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error16 + err = error20 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "deleteTopic failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "createReplicationTopic failed: out of sequence response") return } - result := DeleteTopicResult{} + result := CreateReplicationTopicResult{} if err = result.Read(iprot); err != nil { return } @@ -279,32 +314,33 @@ func (p *TopicServiceClient) recvDeleteTopic() (err error) { err = result.E return } + value = result.GetSuccess() return } -// changeTopicAttribute, the caller must have CHANGE_TOPIC permission; +// createTopicGroup, one must be a Developer that call this method; // // // Parameters: // - Request -func (p *TopicServiceClient) ChangeTopicAttribute(request *ChangeTopicAttributeRequest) (err error) { - if err = p.sendChangeTopicAttribute(request); err != nil { +func (p *TopicServiceClient) CreateTopicGroup(request *CreateTopicGroupRequest) (r *CreateTopicGroupResponse, err error) { + if err = p.sendCreateTopicGroup(request); err != nil { return } - return p.recvChangeTopicAttribute() + return p.recvCreateTopicGroup() } -func (p *TopicServiceClient) sendChangeTopicAttribute(request *ChangeTopicAttributeRequest) (err error) { +func (p *TopicServiceClient) sendCreateTopicGroup(request *CreateTopicGroupRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("changeTopicAttribute", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("createTopicGroup", thrift.CALL, p.SeqId); err != nil { return } - args := ChangeTopicAttributeArgs{ + args := CreateTopicGroupArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -316,7 +352,7 @@ func (p *TopicServiceClient) sendChangeTopicAttribute(request *ChangeTopicAttrib return oprot.Flush() } -func (p *TopicServiceClient) recvChangeTopicAttribute() (err error) { +func (p *TopicServiceClient) recvCreateTopicGroup() (value *CreateTopicGroupResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -327,23 +363,23 @@ func (p *TopicServiceClient) recvChangeTopicAttribute() (err error) { return } if mTypeId == thrift.EXCEPTION { - error17 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error18 error - error18, err = error17.Read(iprot) + error21 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error22 error + error22, err = error21.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error18 + err = error22 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "changeTopicAttribute failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "createTopicGroup failed: out of sequence response") return } - result := ChangeTopicAttributeResult{} + result := CreateTopicGroupResult{} if err = result.Read(iprot); err != nil { return } @@ -354,32 +390,33 @@ func (p *TopicServiceClient) recvChangeTopicAttribute() (err error) { err = result.E return } + value = result.GetSuccess() return } -// describeTopic, the caller must have DESCRIBE_TOPIC permission; +// desribeTopicGroup; // // // Parameters: // - Request -func (p *TopicServiceClient) DescribeTopic(request *DescribeTopicRequest) (r *DescribeTopicResponse, err error) { - if err = p.sendDescribeTopic(request); err != nil { +func (p *TopicServiceClient) DescribeTopicGroup(request *DescribeTopicGroupRequest) (r *DescribeTopicGroupResponse, err error) { + if err = p.sendDescribeTopicGroup(request); err != nil { return } - return p.recvDescribeTopic() + return p.recvDescribeTopicGroup() } -func (p *TopicServiceClient) sendDescribeTopic(request *DescribeTopicRequest) (err error) { +func (p *TopicServiceClient) sendDescribeTopicGroup(request *DescribeTopicGroupRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("describeTopic", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("describeTopicGroup", thrift.CALL, p.SeqId); err != nil { return } - args := DescribeTopicArgs{ + args := DescribeTopicGroupArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -391,7 +428,7 @@ func (p *TopicServiceClient) sendDescribeTopic(request *DescribeTopicRequest) (e return oprot.Flush() } -func (p *TopicServiceClient) recvDescribeTopic() (value *DescribeTopicResponse, err error) { +func (p *TopicServiceClient) recvDescribeTopicGroup() (value *DescribeTopicGroupResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -402,23 +439,23 @@ func (p *TopicServiceClient) recvDescribeTopic() (value *DescribeTopicResponse, return } if mTypeId == thrift.EXCEPTION { - error19 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error20 error - error20, err = error19.Read(iprot) + error23 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error24 error + error24, err = error23.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error20 + err = error24 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "describeTopic failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "describeTopicGroup failed: out of sequence response") return } - result := DescribeTopicResult{} + result := DescribeTopicGroupResult{} if err = result.Read(iprot); err != nil { return } @@ -433,29 +470,29 @@ func (p *TopicServiceClient) recvDescribeTopic() (value *DescribeTopicResponse, return } -// getDescribeInfo, the caller must have DESCRIBE_TOPIC permission; +// deleteTopicGroup; // // // Parameters: // - Request -func (p *TopicServiceClient) GetDescribeInfo(request *GetDescribeInfoRequest) (r *GetDescribeInfoResponse, err error) { - if err = p.sendGetDescribeInfo(request); err != nil { +func (p *TopicServiceClient) DeleteTopicGroup(request *DeleteTopicGroupRequest) (err error) { + if err = p.sendDeleteTopicGroup(request); err != nil { return } - return p.recvGetDescribeInfo() + return p.recvDeleteTopicGroup() } -func (p *TopicServiceClient) sendGetDescribeInfo(request *GetDescribeInfoRequest) (err error) { +func (p *TopicServiceClient) sendDeleteTopicGroup(request *DeleteTopicGroupRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("getDescribeInfo", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("deleteTopicGroup", thrift.CALL, p.SeqId); err != nil { return } - args := GetDescribeInfoArgs{ + args := DeleteTopicGroupArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -467,7 +504,7 @@ func (p *TopicServiceClient) sendGetDescribeInfo(request *GetDescribeInfoRequest return oprot.Flush() } -func (p *TopicServiceClient) recvGetDescribeInfo() (value *GetDescribeInfoResponse, err error) { +func (p *TopicServiceClient) recvDeleteTopicGroup() (err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -478,23 +515,23 @@ func (p *TopicServiceClient) recvGetDescribeInfo() (value *GetDescribeInfoRespon return } if mTypeId == thrift.EXCEPTION { - error21 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error22 error - error22, err = error21.Read(iprot) + error25 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error26 error + error26, err = error25.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error22 + err = error26 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getDescribeInfo failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "deleteTopicGroup failed: out of sequence response") return } - result := GetDescribeInfoResult{} + result := DeleteTopicGroupResult{} if err = result.Read(iprot); err != nil { return } @@ -505,31 +542,34 @@ func (p *TopicServiceClient) recvGetDescribeInfo() (value *GetDescribeInfoRespon err = result.E return } - value = result.GetSuccess() return } -// listTopicsInfo will return the topics which owned by the call developer -// and its describe information. +// listTopicGroup; // -func (p *TopicServiceClient) ListTopicsInfo() (r *ListTopicsInfoResponse, err error) { - if err = p.sendListTopicsInfo(); err != nil { +// +// Parameters: +// - Request +func (p *TopicServiceClient) ListTopicGroup(request *ListTopicGroupRequest) (r *ListTopicGroupResponse, err error) { + if err = p.sendListTopicGroup(request); err != nil { return } - return p.recvListTopicsInfo() + return p.recvListTopicGroup() } -func (p *TopicServiceClient) sendListTopicsInfo() (err error) { +func (p *TopicServiceClient) sendListTopicGroup(request *ListTopicGroupRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("listTopicsInfo", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("listTopicGroup", thrift.CALL, p.SeqId); err != nil { return } - args := ListTopicsInfoArgs{} + args := ListTopicGroupArgs{ + Request: request, + } if err = args.Write(oprot); err != nil { return } @@ -539,7 +579,7 @@ func (p *TopicServiceClient) sendListTopicsInfo() (err error) { return oprot.Flush() } -func (p *TopicServiceClient) recvListTopicsInfo() (value *ListTopicsInfoResponse, err error) { +func (p *TopicServiceClient) recvListTopicGroup() (value *ListTopicGroupResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -550,23 +590,23 @@ func (p *TopicServiceClient) recvListTopicsInfo() (value *ListTopicsInfoResponse return } if mTypeId == thrift.EXCEPTION { - error23 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error24 error - error24, err = error23.Read(iprot) + error27 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error28 error + error28, err = error27.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error24 + err = error28 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "listTopicsInfo failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "listTopicGroup failed: out of sequence response") return } - result := ListTopicsInfoResult{} + result := ListTopicGroupResult{} if err = result.Read(iprot); err != nil { return } @@ -581,28 +621,31 @@ func (p *TopicServiceClient) recvListTopicsInfo() (value *ListTopicsInfoResponse return } -// listTopics for the developer that call this method, and this method will -// only return the topics that owned by the call developer, if none, -// listTopics will return nothing. +// deleteTopic, the caller must have CHANGE_TOPIC permission; // -func (p *TopicServiceClient) ListTopics() (r *ListTopicsResponse, err error) { - if err = p.sendListTopics(); err != nil { +// +// Parameters: +// - Request +func (p *TopicServiceClient) DeleteTopic(request *DeleteTopicRequest) (err error) { + if err = p.sendDeleteTopic(request); err != nil { return } - return p.recvListTopics() + return p.recvDeleteTopic() } -func (p *TopicServiceClient) sendListTopics() (err error) { +func (p *TopicServiceClient) sendDeleteTopic(request *DeleteTopicRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("listTopics", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("deleteTopic", thrift.CALL, p.SeqId); err != nil { return } - args := ListTopicsArgs{} + args := DeleteTopicArgs{ + Request: request, + } if err = args.Write(oprot); err != nil { return } @@ -612,7 +655,7 @@ func (p *TopicServiceClient) sendListTopics() (err error) { return oprot.Flush() } -func (p *TopicServiceClient) recvListTopics() (value *ListTopicsResponse, err error) { +func (p *TopicServiceClient) recvDeleteTopic() (err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -623,23 +666,23 @@ func (p *TopicServiceClient) recvListTopics() (value *ListTopicsResponse, err er return } if mTypeId == thrift.EXCEPTION { - error25 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error26 error - error26, err = error25.Read(iprot) + error29 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error30 error + error30, err = error29.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error26 + err = error30 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "listTopics failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "deleteTopic failed: out of sequence response") return } - result := ListTopicsResult{} + result := DeleteTopicResult{} if err = result.Read(iprot); err != nil { return } @@ -650,28 +693,34 @@ func (p *TopicServiceClient) recvListTopics() (value *ListTopicsResponse, err er err = result.E return } - value = result.GetSuccess() return } -func (p *TopicServiceClient) GetBindTopics() (r *ListTopicsResponse, err error) { - if err = p.sendGetBindTopics(); err != nil { +// changeTopicAttribute, the caller must have CHANGE_TOPIC permission; +// +// +// Parameters: +// - Request +func (p *TopicServiceClient) ChangeTopicAttribute(request *ChangeTopicAttributeRequest) (err error) { + if err = p.sendChangeTopicAttribute(request); err != nil { return } - return p.recvGetBindTopics() + return p.recvChangeTopicAttribute() } -func (p *TopicServiceClient) sendGetBindTopics() (err error) { +func (p *TopicServiceClient) sendChangeTopicAttribute(request *ChangeTopicAttributeRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("getBindTopics", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("changeTopicAttribute", thrift.CALL, p.SeqId); err != nil { return } - args := GetBindTopicsArgs{} + args := ChangeTopicAttributeArgs{ + Request: request, + } if err = args.Write(oprot); err != nil { return } @@ -681,7 +730,7 @@ func (p *TopicServiceClient) sendGetBindTopics() (err error) { return oprot.Flush() } -func (p *TopicServiceClient) recvGetBindTopics() (value *ListTopicsResponse, err error) { +func (p *TopicServiceClient) recvChangeTopicAttribute() (err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -692,23 +741,23 @@ func (p *TopicServiceClient) recvGetBindTopics() (value *ListTopicsResponse, err return } if mTypeId == thrift.EXCEPTION { - error27 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error28 error - error28, err = error27.Read(iprot) + error31 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error32 error + error32, err = error31.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error28 + err = error32 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getBindTopics failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "changeTopicAttribute failed: out of sequence response") return } - result := GetBindTopicsResult{} + result := ChangeTopicAttributeResult{} if err = result.Read(iprot); err != nil { return } @@ -719,33 +768,32 @@ func (p *TopicServiceClient) recvGetBindTopics() (value *ListTopicsResponse, err err = result.E return } - value = result.GetSuccess() return } -// setTopicQuota, the caller must be talos admin or topic owner +// describeTopic, the caller must have DESCRIBE_TOPIC permission; // // // Parameters: // - Request -func (p *TopicServiceClient) SetTopicQuota(request *SetTopicQuotaRequest) (err error) { - if err = p.sendSetTopicQuota(request); err != nil { +func (p *TopicServiceClient) DescribeTopic(request *DescribeTopicRequest) (r *DescribeTopicResponse, err error) { + if err = p.sendDescribeTopic(request); err != nil { return } - return p.recvSetTopicQuota() + return p.recvDescribeTopic() } -func (p *TopicServiceClient) sendSetTopicQuota(request *SetTopicQuotaRequest) (err error) { +func (p *TopicServiceClient) sendDescribeTopic(request *DescribeTopicRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("setTopicQuota", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("describeTopic", thrift.CALL, p.SeqId); err != nil { return } - args := SetTopicQuotaArgs{ + args := DescribeTopicArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -757,7 +805,7 @@ func (p *TopicServiceClient) sendSetTopicQuota(request *SetTopicQuotaRequest) (e return oprot.Flush() } -func (p *TopicServiceClient) recvSetTopicQuota() (err error) { +func (p *TopicServiceClient) recvDescribeTopic() (value *DescribeTopicResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -768,23 +816,23 @@ func (p *TopicServiceClient) recvSetTopicQuota() (err error) { return } if mTypeId == thrift.EXCEPTION { - error29 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error30 error - error30, err = error29.Read(iprot) + error33 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error34 error + error34, err = error33.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error30 + err = error34 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "setTopicQuota failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "describeTopic failed: out of sequence response") return } - result := SetTopicQuotaResult{} + result := DescribeTopicResult{} if err = result.Read(iprot); err != nil { return } @@ -795,32 +843,33 @@ func (p *TopicServiceClient) recvSetTopicQuota() (err error) { err = result.E return } + value = result.GetSuccess() return } -// queryTopicQuota, the caller must be talos admin or topic owner +// getDescribeInfo, the caller must have DESCRIBE_TOPIC permission; // // // Parameters: // - Request -func (p *TopicServiceClient) QueryTopicQuota(request *QueryTopicQuotaRequest) (r *QueryTopicQuotaResponse, err error) { - if err = p.sendQueryTopicQuota(request); err != nil { +func (p *TopicServiceClient) GetDescribeInfo(request *GetDescribeInfoRequest) (r *GetDescribeInfoResponse, err error) { + if err = p.sendGetDescribeInfo(request); err != nil { return } - return p.recvQueryTopicQuota() + return p.recvGetDescribeInfo() } -func (p *TopicServiceClient) sendQueryTopicQuota(request *QueryTopicQuotaRequest) (err error) { +func (p *TopicServiceClient) sendGetDescribeInfo(request *GetDescribeInfoRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("queryTopicQuota", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("getDescribeInfo", thrift.CALL, p.SeqId); err != nil { return } - args := QueryTopicQuotaArgs{ + args := GetDescribeInfoArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -832,7 +881,7 @@ func (p *TopicServiceClient) sendQueryTopicQuota(request *QueryTopicQuotaRequest return oprot.Flush() } -func (p *TopicServiceClient) recvQueryTopicQuota() (value *QueryTopicQuotaResponse, err error) { +func (p *TopicServiceClient) recvGetDescribeInfo() (value *GetDescribeInfoResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -843,23 +892,23 @@ func (p *TopicServiceClient) recvQueryTopicQuota() (value *QueryTopicQuotaRespon return } if mTypeId == thrift.EXCEPTION { - error31 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error32 error - error32, err = error31.Read(iprot) + error35 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error36 error + error36, err = error35.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error32 + err = error36 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "queryTopicQuota failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getDescribeInfo failed: out of sequence response") return } - result := QueryTopicQuotaResult{} + result := GetDescribeInfoResult{} if err = result.Read(iprot); err != nil { return } @@ -874,29 +923,29 @@ func (p *TopicServiceClient) recvQueryTopicQuota() (value *QueryTopicQuotaRespon return } -// deleteTopicQuota, the caller must be talos admin or topic owner +// getTopicAttribute, the caller must have DESCRIBE_TOPIC permission; // // // Parameters: // - Request -func (p *TopicServiceClient) DeleteTopicQuota(request *DeleteTopicQuotaRequest) (err error) { - if err = p.sendDeleteTopicQuota(request); err != nil { +func (p *TopicServiceClient) GetTopicAttribute(request *GetTopicAttributeRequest) (r *GetTopicAttributeResponse, err error) { + if err = p.sendGetTopicAttribute(request); err != nil { return } - return p.recvDeleteTopicQuota() + return p.recvGetTopicAttribute() } -func (p *TopicServiceClient) sendDeleteTopicQuota(request *DeleteTopicQuotaRequest) (err error) { +func (p *TopicServiceClient) sendGetTopicAttribute(request *GetTopicAttributeRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("deleteTopicQuota", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("getTopicAttribute", thrift.CALL, p.SeqId); err != nil { return } - args := DeleteTopicQuotaArgs{ + args := GetTopicAttributeArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -908,7 +957,7 @@ func (p *TopicServiceClient) sendDeleteTopicQuota(request *DeleteTopicQuotaReque return oprot.Flush() } -func (p *TopicServiceClient) recvDeleteTopicQuota() (err error) { +func (p *TopicServiceClient) recvGetTopicAttribute() (value *GetTopicAttributeResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -919,23 +968,23 @@ func (p *TopicServiceClient) recvDeleteTopicQuota() (err error) { return } if mTypeId == thrift.EXCEPTION { - error33 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error34 error - error34, err = error33.Read(iprot) + error37 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error38 error + error38, err = error37.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error34 + err = error38 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "deleteTopicQuota failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getTopicAttribute failed: out of sequence response") return } - result := DeleteTopicQuotaResult{} + result := GetTopicAttributeResult{} if err = result.Read(iprot); err != nil { return } @@ -946,36 +995,31 @@ func (p *TopicServiceClient) recvDeleteTopicQuota() (err error) { err = result.E return } + value = result.GetSuccess() return } -// setPermission, the caller must be owner/Talos admin, and the operation -// permission devolution is not be allowed, the old permission will be -// overwrite after setPermission. -// +// listTopicsInfo will return the topics which owned by the call developer +// and its describe information. // -// Parameters: -// - Request -func (p *TopicServiceClient) SetPermission(request *SetPermissionRequest) (err error) { - if err = p.sendSetPermission(request); err != nil { +func (p *TopicServiceClient) ListTopicsInfo() (r *ListTopicsInfoResponse, err error) { + if err = p.sendListTopicsInfo(); err != nil { return } - return p.recvSetPermission() + return p.recvListTopicsInfo() } -func (p *TopicServiceClient) sendSetPermission(request *SetPermissionRequest) (err error) { +func (p *TopicServiceClient) sendListTopicsInfo() (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("setPermission", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("listTopicsInfo", thrift.CALL, p.SeqId); err != nil { return } - args := SetPermissionArgs{ - Request: request, - } + args := ListTopicsInfoArgs{} if err = args.Write(oprot); err != nil { return } @@ -985,7 +1029,7 @@ func (p *TopicServiceClient) sendSetPermission(request *SetPermissionRequest) (e return oprot.Flush() } -func (p *TopicServiceClient) recvSetPermission() (err error) { +func (p *TopicServiceClient) recvListTopicsInfo() (value *ListTopicsInfoResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -996,23 +1040,23 @@ func (p *TopicServiceClient) recvSetPermission() (err error) { return } if mTypeId == thrift.EXCEPTION { - error35 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error36 error - error36, err = error35.Read(iprot) + error39 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error40 error + error40, err = error39.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error36 + err = error40 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "setPermission failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "listTopicsInfo failed: out of sequence response") return } - result := SetPermissionResult{} + result := ListTopicsInfoResult{} if err = result.Read(iprot); err != nil { return } @@ -1023,36 +1067,32 @@ func (p *TopicServiceClient) recvSetPermission() (err error) { err = result.E return } + value = result.GetSuccess() return } -// revokePermission, the caller must be owner/Talos admin, and you can't -// revokePermission for the topic owner, the accountId will have -// NONE permission after revokePermission; -// +// listTopics for the developer that call this method, and this method will +// only return the topics that owned by the call developer, if none, +// listTopics will return nothing. // -// Parameters: -// - Request -func (p *TopicServiceClient) RevokePermission(request *RevokePermissionRequest) (err error) { - if err = p.sendRevokePermission(request); err != nil { +func (p *TopicServiceClient) ListTopics() (r *ListTopicsResponse, err error) { + if err = p.sendListTopics(); err != nil { return } - return p.recvRevokePermission() + return p.recvListTopics() } -func (p *TopicServiceClient) sendRevokePermission(request *RevokePermissionRequest) (err error) { +func (p *TopicServiceClient) sendListTopics() (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("revokePermission", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("listTopics", thrift.CALL, p.SeqId); err != nil { return } - args := RevokePermissionArgs{ - Request: request, - } + args := ListTopicsArgs{} if err = args.Write(oprot); err != nil { return } @@ -1062,7 +1102,7 @@ func (p *TopicServiceClient) sendRevokePermission(request *RevokePermissionReque return oprot.Flush() } -func (p *TopicServiceClient) recvRevokePermission() (err error) { +func (p *TopicServiceClient) recvListTopics() (value *ListTopicsResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -1073,23 +1113,23 @@ func (p *TopicServiceClient) recvRevokePermission() (err error) { return } if mTypeId == thrift.EXCEPTION { - error37 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error38 error - error38, err = error37.Read(iprot) + error41 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error42 error + error42, err = error41.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error38 + err = error42 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "revokePermission failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "listTopics failed: out of sequence response") return } - result := RevokePermissionResult{} + result := ListTopicsResult{} if err = result.Read(iprot); err != nil { return } @@ -1100,34 +1140,28 @@ func (p *TopicServiceClient) recvRevokePermission() (err error) { err = result.E return } + value = result.GetSuccess() return } -// listPermission, the caller must have DESCRIBE_TOPIC permission; -// -// -// Parameters: -// - Request -func (p *TopicServiceClient) ListPermission(request *ListPermissionRequest) (r *ListPermissionResponse, err error) { - if err = p.sendListPermission(request); err != nil { +func (p *TopicServiceClient) GetBindTopics() (r *ListTopicsResponse, err error) { + if err = p.sendGetBindTopics(); err != nil { return } - return p.recvListPermission() + return p.recvGetBindTopics() } -func (p *TopicServiceClient) sendListPermission(request *ListPermissionRequest) (err error) { +func (p *TopicServiceClient) sendGetBindTopics() (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("listPermission", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("getBindTopics", thrift.CALL, p.SeqId); err != nil { return } - args := ListPermissionArgs{ - Request: request, - } + args := GetBindTopicsArgs{} if err = args.Write(oprot); err != nil { return } @@ -1137,7 +1171,7 @@ func (p *TopicServiceClient) sendListPermission(request *ListPermissionRequest) return oprot.Flush() } -func (p *TopicServiceClient) recvListPermission() (value *ListPermissionResponse, err error) { +func (p *TopicServiceClient) recvGetBindTopics() (value *ListTopicsResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -1148,23 +1182,23 @@ func (p *TopicServiceClient) recvListPermission() (value *ListPermissionResponse return } if mTypeId == thrift.EXCEPTION { - error39 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error40 error - error40, err = error39.Read(iprot) + error43 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error44 error + error44, err = error43.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error40 + err = error44 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "listPermission failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getBindTopics failed: out of sequence response") return } - result := ListPermissionResult{} + result := GetBindTopicsResult{} if err = result.Read(iprot); err != nil { return } @@ -1179,29 +1213,29 @@ func (p *TopicServiceClient) recvListPermission() (value *ListPermissionResponse return } -// getPermission, the caller must hava DESCRIBE_TOPIC permission; +// setTopicQuota, the caller must be talos admin or topic owner // // // Parameters: // - Request -func (p *TopicServiceClient) GetPermission(request *GetPermissionRequest) (r *GetPermissionResponse, err error) { - if err = p.sendGetPermission(request); err != nil { +func (p *TopicServiceClient) SetTopicQuota(request *SetTopicQuotaRequest) (err error) { + if err = p.sendSetTopicQuota(request); err != nil { return } - return p.recvGetPermission() + return p.recvSetTopicQuota() } -func (p *TopicServiceClient) sendGetPermission(request *GetPermissionRequest) (err error) { +func (p *TopicServiceClient) sendSetTopicQuota(request *SetTopicQuotaRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("getPermission", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("setTopicQuota", thrift.CALL, p.SeqId); err != nil { return } - args := GetPermissionArgs{ + args := SetTopicQuotaArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -1213,7 +1247,7 @@ func (p *TopicServiceClient) sendGetPermission(request *GetPermissionRequest) (e return oprot.Flush() } -func (p *TopicServiceClient) recvGetPermission() (value *GetPermissionResponse, err error) { +func (p *TopicServiceClient) recvSetTopicQuota() (err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -1224,23 +1258,23 @@ func (p *TopicServiceClient) recvGetPermission() (value *GetPermissionResponse, return } if mTypeId == thrift.EXCEPTION { - error41 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error42 error - error42, err = error41.Read(iprot) + error45 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error46 error + error46, err = error45.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error42 + err = error46 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getPermission failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "setTopicQuota failed: out of sequence response") return } - result := GetPermissionResult{} + result := SetTopicQuotaResult{} if err = result.Read(iprot); err != nil { return } @@ -1251,33 +1285,32 @@ func (p *TopicServiceClient) recvGetPermission() (value *GetPermissionResponse, err = result.E return } - value = result.GetSuccess() return } -// addSubResourceName, the caller must be a developer owner of topic +// queryTopicQuota, the caller must be talos admin or topic owner // // // Parameters: // - Request -func (p *TopicServiceClient) AddSubResourceName(request *AddSubResourceNameRequest) (err error) { - if err = p.sendAddSubResourceName(request); err != nil { +func (p *TopicServiceClient) QueryTopicQuota(request *QueryTopicQuotaRequest) (r *QueryTopicQuotaResponse, err error) { + if err = p.sendQueryTopicQuota(request); err != nil { return } - return p.recvAddSubResourceName() + return p.recvQueryTopicQuota() } -func (p *TopicServiceClient) sendAddSubResourceName(request *AddSubResourceNameRequest) (err error) { +func (p *TopicServiceClient) sendQueryTopicQuota(request *QueryTopicQuotaRequest) (err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("addSubResourceName", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("queryTopicQuota", thrift.CALL, p.SeqId); err != nil { return } - args := AddSubResourceNameArgs{ + args := QueryTopicQuotaArgs{ Request: request, } if err = args.Write(oprot); err != nil { @@ -1289,7 +1322,7 @@ func (p *TopicServiceClient) sendAddSubResourceName(request *AddSubResourceNameR return oprot.Flush() } -func (p *TopicServiceClient) recvAddSubResourceName() (err error) { +func (p *TopicServiceClient) recvQueryTopicQuota() (value *QueryTopicQuotaResponse, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -1300,23 +1333,23 @@ func (p *TopicServiceClient) recvAddSubResourceName() (err error) { return } if mTypeId == thrift.EXCEPTION { - error43 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error44 error - error44, err = error43.Read(iprot) + error47 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error48 error + error48, err = error47.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error44 + err = error48 return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "addSubResourceName failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "queryTopicQuota failed: out of sequence response") return } - result := AddSubResourceNameResult{} + result := QueryTopicQuotaResult{} if err = result.Read(iprot); err != nil { return } @@ -1327,485 +1360,533 @@ func (p *TopicServiceClient) recvAddSubResourceName() (err error) { err = result.E return } + value = result.GetSuccess() return } -type TopicServiceProcessor struct { - *common.TalosBaseServiceProcessor -} - -func NewTopicServiceProcessor(handler TopicService) *TopicServiceProcessor { - self45 := &TopicServiceProcessor{common.NewTalosBaseServiceProcessor(handler)} - self45.AddToProcessorMap("createTopic", &topicServiceProcessorCreateTopic{handler: handler}) - self45.AddToProcessorMap("deleteTopic", &topicServiceProcessorDeleteTopic{handler: handler}) - self45.AddToProcessorMap("changeTopicAttribute", &topicServiceProcessorChangeTopicAttribute{handler: handler}) - self45.AddToProcessorMap("describeTopic", &topicServiceProcessorDescribeTopic{handler: handler}) - self45.AddToProcessorMap("getDescribeInfo", &topicServiceProcessorGetDescribeInfo{handler: handler}) - self45.AddToProcessorMap("listTopicsInfo", &topicServiceProcessorListTopicsInfo{handler: handler}) - self45.AddToProcessorMap("listTopics", &topicServiceProcessorListTopics{handler: handler}) - self45.AddToProcessorMap("getBindTopics", &topicServiceProcessorGetBindTopics{handler: handler}) - self45.AddToProcessorMap("setTopicQuota", &topicServiceProcessorSetTopicQuota{handler: handler}) - self45.AddToProcessorMap("queryTopicQuota", &topicServiceProcessorQueryTopicQuota{handler: handler}) - self45.AddToProcessorMap("deleteTopicQuota", &topicServiceProcessorDeleteTopicQuota{handler: handler}) - self45.AddToProcessorMap("setPermission", &topicServiceProcessorSetPermission{handler: handler}) - self45.AddToProcessorMap("revokePermission", &topicServiceProcessorRevokePermission{handler: handler}) - self45.AddToProcessorMap("listPermission", &topicServiceProcessorListPermission{handler: handler}) - self45.AddToProcessorMap("getPermission", &topicServiceProcessorGetPermission{handler: handler}) - self45.AddToProcessorMap("addSubResourceName", &topicServiceProcessorAddSubResourceName{handler: handler}) - return self45 -} - -type topicServiceProcessorCreateTopic struct { - handler TopicService +// deleteTopicQuota, the caller must be talos admin or topic owner +// +// +// Parameters: +// - Request +func (p *TopicServiceClient) DeleteTopicQuota(request *DeleteTopicQuotaRequest) (err error) { + if err = p.sendDeleteTopicQuota(request); err != nil { + return + } + return p.recvDeleteTopicQuota() } -func (p *topicServiceProcessorCreateTopic) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := CreateTopicArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("createTopic", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +func (p *TopicServiceClient) sendDeleteTopicQuota(request *DeleteTopicQuotaRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot } - - iprot.ReadMessageEnd() - result := CreateTopicResult{} - var retval *CreateTopicResponse - var err2 error - if retval, err2 = p.handler.CreateTopic(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTopic: "+err2.Error()) - oprot.WriteMessageBegin("createTopic", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } else { - result.Success = retval + p.SeqId++ + if err = oprot.WriteMessageBegin("deleteTopicQuota", thrift.CALL, p.SeqId); err != nil { + return } - if err2 = oprot.WriteMessageBegin("createTopic", thrift.REPLY, seqId); err2 != nil { - err = err2 + args := DeleteTopicQuotaArgs{ + Request: request, } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err = args.Write(oprot); err != nil { + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteMessageEnd(); err != nil { + return } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + return oprot.Flush() +} + +func (p *TopicServiceClient) recvDeleteTopicQuota() (err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() if err != nil { return } - return true, err -} - -type topicServiceProcessorDeleteTopic struct { - handler TopicService -} - -func (p *topicServiceProcessorDeleteTopic) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := DeleteTopicArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("deleteTopic", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := DeleteTopicResult{} - var err2 error - if err2 = p.handler.DeleteTopic(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteTopic: "+err2.Error()) - oprot.WriteMessageBegin("deleteTopic", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 + if mTypeId == thrift.EXCEPTION { + error49 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error50 error + error50, err = error49.Read(iprot) + if err != nil { + return } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error50 + return } - if err2 = oprot.WriteMessageBegin("deleteTopic", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "deleteTopicQuota failed: out of sequence response") + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + result := DeleteTopicQuotaResult{} + if err = result.Read(iprot); err != nil { + return } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err = iprot.ReadMessageEnd(); err != nil { + return } - if err != nil { + if result.E != nil { + err = result.E return } - return true, err -} - -type topicServiceProcessorChangeTopicAttribute struct { - handler TopicService + return } -func (p *topicServiceProcessorChangeTopicAttribute) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ChangeTopicAttributeArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("changeTopicAttribute", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +// setPermission, the caller must be owner/Talos admin, and the operation +// permission devolution is not be allowed, the old permission will be +// overwrite after setPermission. +// +// +// Parameters: +// - Request +func (p *TopicServiceClient) SetPermission(request *SetPermissionRequest) (err error) { + if err = p.sendSetPermission(request); err != nil { + return } + return p.recvSetPermission() +} - iprot.ReadMessageEnd() - result := ChangeTopicAttributeResult{} - var err2 error - if err2 = p.handler.ChangeTopicAttribute(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing changeTopicAttribute: "+err2.Error()) - oprot.WriteMessageBegin("changeTopicAttribute", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } - if err2 = oprot.WriteMessageBegin("changeTopicAttribute", thrift.REPLY, seqId); err2 != nil { - err = err2 +func (p *TopicServiceClient) sendSetPermission(request *SetPermissionRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + p.SeqId++ + if err = oprot.WriteMessageBegin("setPermission", thrift.CALL, p.SeqId); err != nil { + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + args := SetPermissionArgs{ + Request: request, } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err = args.Write(oprot); err != nil { + return } - if err != nil { + if err = oprot.WriteMessageEnd(); err != nil { return } - return true, err -} - -type topicServiceProcessorDescribeTopic struct { - handler TopicService + return oprot.Flush() } -func (p *topicServiceProcessorDescribeTopic) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := DescribeTopicArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("describeTopic", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +func (p *TopicServiceClient) recvSetPermission() (err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot } - - iprot.ReadMessageEnd() - result := DescribeTopicResult{} - var retval *DescribeTopicResponse - var err2 error - if retval, err2 = p.handler.DescribeTopic(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing describeTopic: "+err2.Error()) - oprot.WriteMessageBegin("describeTopic", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } else { - result.Success = retval + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return } - if err2 = oprot.WriteMessageBegin("describeTopic", thrift.REPLY, seqId); err2 != nil { - err = err2 + if mTypeId == thrift.EXCEPTION { + error51 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error52 error + error52, err = error51.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error52 + return } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "setPermission failed: out of sequence response") + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + result := SetPermissionResult{} + if err = result.Read(iprot); err != nil { + return } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err = iprot.ReadMessageEnd(); err != nil { + return } - if err != nil { + if result.E != nil { + err = result.E return } - return true, err + return } -type topicServiceProcessorGetDescribeInfo struct { - handler TopicService +// revokePermission, the caller must be owner/Talos admin, and you can't +// revokePermission for the topic owner, the accountId will have +// NONE permission after revokePermission; +// +// +// Parameters: +// - Request +func (p *TopicServiceClient) RevokePermission(request *RevokePermissionRequest) (err error) { + if err = p.sendRevokePermission(request); err != nil { + return + } + return p.recvRevokePermission() } -func (p *topicServiceProcessorGetDescribeInfo) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := GetDescribeInfoArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getDescribeInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +func (p *TopicServiceClient) sendRevokePermission(request *RevokePermissionRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot } - - iprot.ReadMessageEnd() - result := GetDescribeInfoResult{} - var retval *GetDescribeInfoResponse - var err2 error - if retval, err2 = p.handler.GetDescribeInfo(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getDescribeInfo: "+err2.Error()) - oprot.WriteMessageBegin("getDescribeInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } else { - result.Success = retval + p.SeqId++ + if err = oprot.WriteMessageBegin("revokePermission", thrift.CALL, p.SeqId); err != nil { + return } - if err2 = oprot.WriteMessageBegin("getDescribeInfo", thrift.REPLY, seqId); err2 != nil { - err = err2 + args := RevokePermissionArgs{ + Request: request, } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err = args.Write(oprot); err != nil { + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteMessageEnd(); err != nil { + return } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + return oprot.Flush() +} + +func (p *TopicServiceClient) recvRevokePermission() (err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() if err != nil { return } - return true, err -} - -type topicServiceProcessorListTopicsInfo struct { - handler TopicService -} - -func (p *topicServiceProcessorListTopicsInfo) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ListTopicsInfoArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("listTopicsInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ListTopicsInfoResult{} - var retval *ListTopicsInfoResponse - var err2 error - if retval, err2 = p.handler.ListTopicsInfo(); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTopicsInfo: "+err2.Error()) - oprot.WriteMessageBegin("listTopicsInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 + if mTypeId == thrift.EXCEPTION { + error53 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error54 error + error54, err = error53.Read(iprot) + if err != nil { + return } - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("listTopicsInfo", thrift.REPLY, seqId); err2 != nil { - err = err2 + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error54 + return } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "revokePermission failed: out of sequence response") + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + result := RevokePermissionResult{} + if err = result.Read(iprot); err != nil { + return } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err = iprot.ReadMessageEnd(); err != nil { + return } - if err != nil { + if result.E != nil { + err = result.E return } - return true, err -} - -type topicServiceProcessorListTopics struct { - handler TopicService + return } -func (p *topicServiceProcessorListTopics) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ListTopicsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("listTopics", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +// listPermission, the caller must have DESCRIBE_TOPIC permission; +// +// +// Parameters: +// - Request +func (p *TopicServiceClient) ListPermission(request *ListPermissionRequest) (r *ListPermissionResponse, err error) { + if err = p.sendListPermission(request); err != nil { + return } + return p.recvListPermission() +} - iprot.ReadMessageEnd() - result := ListTopicsResult{} - var retval *ListTopicsResponse - var err2 error - if retval, err2 = p.handler.ListTopics(); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTopics: "+err2.Error()) - oprot.WriteMessageBegin("listTopics", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("listTopics", thrift.REPLY, seqId); err2 != nil { - err = err2 +func (p *TopicServiceClient) sendListPermission(request *ListPermissionRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + p.SeqId++ + if err = oprot.WriteMessageBegin("listPermission", thrift.CALL, p.SeqId); err != nil { + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + args := ListPermissionArgs{ + Request: request, } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err = args.Write(oprot); err != nil { + return } - if err != nil { + if err = oprot.WriteMessageEnd(); err != nil { return } - return true, err -} - -type topicServiceProcessorGetBindTopics struct { - handler TopicService + return oprot.Flush() } -func (p *topicServiceProcessorGetBindTopics) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := GetBindTopicsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getBindTopics", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +func (p *TopicServiceClient) recvListPermission() (value *ListPermissionResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot } - - iprot.ReadMessageEnd() - result := GetBindTopicsResult{} - var retval *ListTopicsResponse - var err2 error - if retval, err2 = p.handler.GetBindTopics(); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getBindTopics: "+err2.Error()) - oprot.WriteMessageBegin("getBindTopics", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } else { - result.Success = retval + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return } - if err2 = oprot.WriteMessageBegin("getBindTopics", thrift.REPLY, seqId); err2 != nil { - err = err2 + if mTypeId == thrift.EXCEPTION { + error55 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error56 error + error56, err = error55.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error56 + return } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "listPermission failed: out of sequence response") + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + result := ListPermissionResult{} + if err = result.Read(iprot); err != nil { + return } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err = iprot.ReadMessageEnd(); err != nil { + return } - if err != nil { + if result.E != nil { + err = result.E return } - return true, err + value = result.GetSuccess() + return } -type topicServiceProcessorSetTopicQuota struct { - handler TopicService +// getPermission, the caller must hava DESCRIBE_TOPIC permission; +// +// +// Parameters: +// - Request +func (p *TopicServiceClient) GetPermission(request *GetPermissionRequest) (r *GetPermissionResponse, err error) { + if err = p.sendGetPermission(request); err != nil { + return + } + return p.recvGetPermission() } -func (p *topicServiceProcessorSetTopicQuota) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := SetTopicQuotaArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("setTopicQuota", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +func (p *TopicServiceClient) sendGetPermission(request *GetPermissionRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getPermission", thrift.CALL, p.SeqId); err != nil { + return + } + args := GetPermissionArgs{ + Request: request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *TopicServiceClient) recvGetPermission() (value *GetPermissionResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if mTypeId == thrift.EXCEPTION { + error57 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error58 error + error58, err = error57.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error58 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getPermission failed: out of sequence response") + return + } + result := GetPermissionResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + value = result.GetSuccess() + return +} + +// addSubResourceName, the caller must be a developer owner of topic +// +// +// Parameters: +// - Request +func (p *TopicServiceClient) AddSubResourceName(request *AddSubResourceNameRequest) (err error) { + if err = p.sendAddSubResourceName(request); err != nil { + return + } + return p.recvAddSubResourceName() +} + +func (p *TopicServiceClient) sendAddSubResourceName(request *AddSubResourceNameRequest) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addSubResourceName", thrift.CALL, p.SeqId); err != nil { + return + } + args := AddSubResourceNameArgs{ + Request: request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *TopicServiceClient) recvAddSubResourceName() (err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + _, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if mTypeId == thrift.EXCEPTION { + error59 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error60 error + error60, err = error59.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error60 + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "addSubResourceName failed: out of sequence response") + return + } + result := AddSubResourceNameResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + if result.E != nil { + err = result.E + return + } + return +} + +type TopicServiceProcessor struct { + *common.TalosBaseServiceProcessor +} + +func NewTopicServiceProcessor(handler TopicService) *TopicServiceProcessor { + self61 := &TopicServiceProcessor{common.NewTalosBaseServiceProcessor(handler)} + self61.AddToProcessorMap("createTopic", &topicServiceProcessorCreateTopic{handler: handler}) + self61.AddToProcessorMap("createReplicationTopic", &topicServiceProcessorCreateReplicationTopic{handler: handler}) + self61.AddToProcessorMap("createTopicGroup", &topicServiceProcessorCreateTopicGroup{handler: handler}) + self61.AddToProcessorMap("describeTopicGroup", &topicServiceProcessorDescribeTopicGroup{handler: handler}) + self61.AddToProcessorMap("deleteTopicGroup", &topicServiceProcessorDeleteTopicGroup{handler: handler}) + self61.AddToProcessorMap("listTopicGroup", &topicServiceProcessorListTopicGroup{handler: handler}) + self61.AddToProcessorMap("deleteTopic", &topicServiceProcessorDeleteTopic{handler: handler}) + self61.AddToProcessorMap("changeTopicAttribute", &topicServiceProcessorChangeTopicAttribute{handler: handler}) + self61.AddToProcessorMap("describeTopic", &topicServiceProcessorDescribeTopic{handler: handler}) + self61.AddToProcessorMap("getDescribeInfo", &topicServiceProcessorGetDescribeInfo{handler: handler}) + self61.AddToProcessorMap("getTopicAttribute", &topicServiceProcessorGetTopicAttribute{handler: handler}) + self61.AddToProcessorMap("listTopicsInfo", &topicServiceProcessorListTopicsInfo{handler: handler}) + self61.AddToProcessorMap("listTopics", &topicServiceProcessorListTopics{handler: handler}) + self61.AddToProcessorMap("getBindTopics", &topicServiceProcessorGetBindTopics{handler: handler}) + self61.AddToProcessorMap("setTopicQuota", &topicServiceProcessorSetTopicQuota{handler: handler}) + self61.AddToProcessorMap("queryTopicQuota", &topicServiceProcessorQueryTopicQuota{handler: handler}) + self61.AddToProcessorMap("deleteTopicQuota", &topicServiceProcessorDeleteTopicQuota{handler: handler}) + self61.AddToProcessorMap("setPermission", &topicServiceProcessorSetPermission{handler: handler}) + self61.AddToProcessorMap("revokePermission", &topicServiceProcessorRevokePermission{handler: handler}) + self61.AddToProcessorMap("listPermission", &topicServiceProcessorListPermission{handler: handler}) + self61.AddToProcessorMap("getPermission", &topicServiceProcessorGetPermission{handler: handler}) + self61.AddToProcessorMap("addSubResourceName", &topicServiceProcessorAddSubResourceName{handler: handler}) + return self61 +} + +type topicServiceProcessorCreateTopic struct { + handler TopicService +} + +func (p *topicServiceProcessorCreateTopic) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CreateTopicArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("createTopic", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err } iprot.ReadMessageEnd() - result := SetTopicQuotaResult{} + result := CreateTopicResult{} + var retval *CreateTopicResponse var err2 error - if err2 = p.handler.SetTopicQuota(args.Request); err2 != nil { + if retval, err2 = p.handler.CreateTopic(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setTopicQuota: "+err2.Error()) - oprot.WriteMessageBegin("setTopicQuota", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTopic: "+err2.Error()) + oprot.WriteMessageBegin("createTopic", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() return true, err2 } + } else { + result.Success = retval } - if err2 = oprot.WriteMessageBegin("setTopicQuota", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("createTopic", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -1823,16 +1904,16 @@ func (p *topicServiceProcessorSetTopicQuota) Process(seqId int32, iprot, oprot t return true, err } -type topicServiceProcessorQueryTopicQuota struct { +type topicServiceProcessorCreateReplicationTopic struct { handler TopicService } -func (p *topicServiceProcessorQueryTopicQuota) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := QueryTopicQuotaArgs{} +func (p *topicServiceProcessorCreateReplicationTopic) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CreateReplicationTopicArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("queryTopicQuota", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("createReplicationTopic", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1840,16 +1921,16 @@ func (p *topicServiceProcessorQueryTopicQuota) Process(seqId int32, iprot, oprot } iprot.ReadMessageEnd() - result := QueryTopicQuotaResult{} - var retval *QueryTopicQuotaResponse + result := CreateReplicationTopicResult{} + var retval *CreateTopicResponse var err2 error - if retval, err2 = p.handler.QueryTopicQuota(args.Request); err2 != nil { + if retval, err2 = p.handler.CreateReplicationTopic(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryTopicQuota: "+err2.Error()) - oprot.WriteMessageBegin("queryTopicQuota", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createReplicationTopic: "+err2.Error()) + oprot.WriteMessageBegin("createReplicationTopic", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1858,7 +1939,7 @@ func (p *topicServiceProcessorQueryTopicQuota) Process(seqId int32, iprot, oprot } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("queryTopicQuota", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("createReplicationTopic", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -1876,16 +1957,16 @@ func (p *topicServiceProcessorQueryTopicQuota) Process(seqId int32, iprot, oprot return true, err } -type topicServiceProcessorDeleteTopicQuota struct { +type topicServiceProcessorCreateTopicGroup struct { handler TopicService } -func (p *topicServiceProcessorDeleteTopicQuota) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := DeleteTopicQuotaArgs{} +func (p *topicServiceProcessorCreateTopicGroup) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CreateTopicGroupArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("deleteTopicQuota", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("createTopicGroup", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1893,22 +1974,25 @@ func (p *topicServiceProcessorDeleteTopicQuota) Process(seqId int32, iprot, opro } iprot.ReadMessageEnd() - result := DeleteTopicQuotaResult{} + result := CreateTopicGroupResult{} + var retval *CreateTopicGroupResponse var err2 error - if err2 = p.handler.DeleteTopicQuota(args.Request); err2 != nil { + if retval, err2 = p.handler.CreateTopicGroup(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteTopicQuota: "+err2.Error()) - oprot.WriteMessageBegin("deleteTopicQuota", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTopicGroup: "+err2.Error()) + oprot.WriteMessageBegin("createTopicGroup", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() return true, err2 } + } else { + result.Success = retval } - if err2 = oprot.WriteMessageBegin("deleteTopicQuota", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("createTopicGroup", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -1926,16 +2010,16 @@ func (p *topicServiceProcessorDeleteTopicQuota) Process(seqId int32, iprot, opro return true, err } -type topicServiceProcessorSetPermission struct { +type topicServiceProcessorDescribeTopicGroup struct { handler TopicService } -func (p *topicServiceProcessorSetPermission) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := SetPermissionArgs{} +func (p *topicServiceProcessorDescribeTopicGroup) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := DescribeTopicGroupArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("setPermission", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("describeTopicGroup", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1943,22 +2027,25 @@ func (p *topicServiceProcessorSetPermission) Process(seqId int32, iprot, oprot t } iprot.ReadMessageEnd() - result := SetPermissionResult{} + result := DescribeTopicGroupResult{} + var retval *DescribeTopicGroupResponse var err2 error - if err2 = p.handler.SetPermission(args.Request); err2 != nil { + if retval, err2 = p.handler.DescribeTopicGroup(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setPermission: "+err2.Error()) - oprot.WriteMessageBegin("setPermission", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing describeTopicGroup: "+err2.Error()) + oprot.WriteMessageBegin("describeTopicGroup", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() return true, err2 } + } else { + result.Success = retval } - if err2 = oprot.WriteMessageBegin("setPermission", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("describeTopicGroup", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -1976,16 +2063,16 @@ func (p *topicServiceProcessorSetPermission) Process(seqId int32, iprot, oprot t return true, err } -type topicServiceProcessorRevokePermission struct { +type topicServiceProcessorDeleteTopicGroup struct { handler TopicService } -func (p *topicServiceProcessorRevokePermission) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := RevokePermissionArgs{} +func (p *topicServiceProcessorDeleteTopicGroup) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := DeleteTopicGroupArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("revokePermission", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("deleteTopicGroup", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -1993,22 +2080,75 @@ func (p *topicServiceProcessorRevokePermission) Process(seqId int32, iprot, opro } iprot.ReadMessageEnd() - result := RevokePermissionResult{} + result := DeleteTopicGroupResult{} var err2 error - if err2 = p.handler.RevokePermission(args.Request); err2 != nil { + if err2 = p.handler.DeleteTopicGroup(args.Request); err2 != nil { switch v := err2.(type) { case *common.GalaxyTalosException: result.E = v default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing revokePermission: "+err2.Error()) - oprot.WriteMessageBegin("revokePermission", thrift.EXCEPTION, seqId) + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteTopicGroup: "+err2.Error()) + oprot.WriteMessageBegin("deleteTopicGroup", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() return true, err2 } } - if err2 = oprot.WriteMessageBegin("revokePermission", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("deleteTopicGroup", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorListTopicGroup struct { + handler TopicService +} + +func (p *topicServiceProcessorListTopicGroup) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ListTopicGroupArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("listTopicGroup", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := ListTopicGroupResult{} + var retval *ListTopicGroupResponse + var err2 error + if retval, err2 = p.handler.ListTopicGroup(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTopicGroup: "+err2.Error()) + oprot.WriteMessageBegin("listTopicGroup", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("listTopicGroup", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -2017,194 +2157,2011 @@ func (p *topicServiceProcessorRevokePermission) Process(seqId int32, iprot, opro if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { err = err2 } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorDeleteTopic struct { + handler TopicService +} + +func (p *topicServiceProcessorDeleteTopic) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := DeleteTopicArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("deleteTopic", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := DeleteTopicResult{} + var err2 error + if err2 = p.handler.DeleteTopic(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteTopic: "+err2.Error()) + oprot.WriteMessageBegin("deleteTopic", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } + if err2 = oprot.WriteMessageBegin("deleteTopic", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorChangeTopicAttribute struct { + handler TopicService +} + +func (p *topicServiceProcessorChangeTopicAttribute) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ChangeTopicAttributeArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("changeTopicAttribute", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := ChangeTopicAttributeResult{} + var err2 error + if err2 = p.handler.ChangeTopicAttribute(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing changeTopicAttribute: "+err2.Error()) + oprot.WriteMessageBegin("changeTopicAttribute", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } + if err2 = oprot.WriteMessageBegin("changeTopicAttribute", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorDescribeTopic struct { + handler TopicService +} + +func (p *topicServiceProcessorDescribeTopic) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := DescribeTopicArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("describeTopic", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := DescribeTopicResult{} + var retval *DescribeTopicResponse + var err2 error + if retval, err2 = p.handler.DescribeTopic(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing describeTopic: "+err2.Error()) + oprot.WriteMessageBegin("describeTopic", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("describeTopic", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorGetDescribeInfo struct { + handler TopicService +} + +func (p *topicServiceProcessorGetDescribeInfo) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetDescribeInfoArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getDescribeInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := GetDescribeInfoResult{} + var retval *GetDescribeInfoResponse + var err2 error + if retval, err2 = p.handler.GetDescribeInfo(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getDescribeInfo: "+err2.Error()) + oprot.WriteMessageBegin("getDescribeInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getDescribeInfo", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorGetTopicAttribute struct { + handler TopicService +} + +func (p *topicServiceProcessorGetTopicAttribute) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetTopicAttributeArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getTopicAttribute", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := GetTopicAttributeResult{} + var retval *GetTopicAttributeResponse + var err2 error + if retval, err2 = p.handler.GetTopicAttribute(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTopicAttribute: "+err2.Error()) + oprot.WriteMessageBegin("getTopicAttribute", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getTopicAttribute", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorListTopicsInfo struct { + handler TopicService +} + +func (p *topicServiceProcessorListTopicsInfo) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ListTopicsInfoArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("listTopicsInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := ListTopicsInfoResult{} + var retval *ListTopicsInfoResponse + var err2 error + if retval, err2 = p.handler.ListTopicsInfo(); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTopicsInfo: "+err2.Error()) + oprot.WriteMessageBegin("listTopicsInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("listTopicsInfo", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorListTopics struct { + handler TopicService +} + +func (p *topicServiceProcessorListTopics) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ListTopicsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("listTopics", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := ListTopicsResult{} + var retval *ListTopicsResponse + var err2 error + if retval, err2 = p.handler.ListTopics(); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTopics: "+err2.Error()) + oprot.WriteMessageBegin("listTopics", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("listTopics", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorGetBindTopics struct { + handler TopicService +} + +func (p *topicServiceProcessorGetBindTopics) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetBindTopicsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getBindTopics", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := GetBindTopicsResult{} + var retval *ListTopicsResponse + var err2 error + if retval, err2 = p.handler.GetBindTopics(); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getBindTopics: "+err2.Error()) + oprot.WriteMessageBegin("getBindTopics", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getBindTopics", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorSetTopicQuota struct { + handler TopicService +} + +func (p *topicServiceProcessorSetTopicQuota) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := SetTopicQuotaArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("setTopicQuota", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := SetTopicQuotaResult{} + var err2 error + if err2 = p.handler.SetTopicQuota(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setTopicQuota: "+err2.Error()) + oprot.WriteMessageBegin("setTopicQuota", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } + if err2 = oprot.WriteMessageBegin("setTopicQuota", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorQueryTopicQuota struct { + handler TopicService +} + +func (p *topicServiceProcessorQueryTopicQuota) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := QueryTopicQuotaArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("queryTopicQuota", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := QueryTopicQuotaResult{} + var retval *QueryTopicQuotaResponse + var err2 error + if retval, err2 = p.handler.QueryTopicQuota(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryTopicQuota: "+err2.Error()) + oprot.WriteMessageBegin("queryTopicQuota", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("queryTopicQuota", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorDeleteTopicQuota struct { + handler TopicService +} + +func (p *topicServiceProcessorDeleteTopicQuota) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := DeleteTopicQuotaArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("deleteTopicQuota", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := DeleteTopicQuotaResult{} + var err2 error + if err2 = p.handler.DeleteTopicQuota(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteTopicQuota: "+err2.Error()) + oprot.WriteMessageBegin("deleteTopicQuota", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } + if err2 = oprot.WriteMessageBegin("deleteTopicQuota", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorSetPermission struct { + handler TopicService +} + +func (p *topicServiceProcessorSetPermission) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := SetPermissionArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("setPermission", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := SetPermissionResult{} + var err2 error + if err2 = p.handler.SetPermission(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setPermission: "+err2.Error()) + oprot.WriteMessageBegin("setPermission", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } + if err2 = oprot.WriteMessageBegin("setPermission", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorRevokePermission struct { + handler TopicService +} + +func (p *topicServiceProcessorRevokePermission) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RevokePermissionArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("revokePermission", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := RevokePermissionResult{} + var err2 error + if err2 = p.handler.RevokePermission(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing revokePermission: "+err2.Error()) + oprot.WriteMessageBegin("revokePermission", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } + if err2 = oprot.WriteMessageBegin("revokePermission", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorListPermission struct { + handler TopicService +} + +func (p *topicServiceProcessorListPermission) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ListPermissionArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("listPermission", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := ListPermissionResult{} + var retval *ListPermissionResponse + var err2 error + if retval, err2 = p.handler.ListPermission(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listPermission: "+err2.Error()) + oprot.WriteMessageBegin("listPermission", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("listPermission", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorGetPermission struct { + handler TopicService +} + +func (p *topicServiceProcessorGetPermission) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GetPermissionArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getPermission", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := GetPermissionResult{} + var retval *GetPermissionResponse + var err2 error + if retval, err2 = p.handler.GetPermission(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPermission: "+err2.Error()) + oprot.WriteMessageBegin("getPermission", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getPermission", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type topicServiceProcessorAddSubResourceName struct { + handler TopicService +} + +func (p *topicServiceProcessorAddSubResourceName) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AddSubResourceNameArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("addSubResourceName", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := AddSubResourceNameResult{} + var err2 error + if err2 = p.handler.AddSubResourceName(args.Request); err2 != nil { + switch v := err2.(type) { + case *common.GalaxyTalosException: + result.E = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addSubResourceName: "+err2.Error()) + oprot.WriteMessageBegin("addSubResourceName", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + } + if err2 = oprot.WriteMessageBegin("addSubResourceName", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +// HELPER FUNCTIONS AND STRUCTURES + +type CreateTopicArgs struct { + Request *CreateTopicRequest `thrift:"request,1" json:"request"` +} + +func NewCreateTopicArgs() *CreateTopicArgs { + return &CreateTopicArgs{} +} + +var CreateTopicArgs_Request_DEFAULT *CreateTopicRequest + +func (p *CreateTopicArgs) GetRequest() *CreateTopicRequest { + if !p.IsSetRequest() { + return CreateTopicArgs_Request_DEFAULT + } + return p.Request +} +func (p *CreateTopicArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *CreateTopicArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CreateTopicArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &CreateTopicRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *CreateTopicArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("createTopic_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CreateTopicArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *CreateTopicArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateTopicArgs(%+v)", *p) +} + +type CreateTopicResult struct { + Success *CreateTopicResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewCreateTopicResult() *CreateTopicResult { + return &CreateTopicResult{} +} + +var CreateTopicResult_Success_DEFAULT *CreateTopicResponse + +func (p *CreateTopicResult) GetSuccess() *CreateTopicResponse { + if !p.IsSetSuccess() { + return CreateTopicResult_Success_DEFAULT + } + return p.Success +} + +var CreateTopicResult_E_DEFAULT *common.GalaxyTalosException + +func (p *CreateTopicResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return CreateTopicResult_E_DEFAULT + } + return p.E +} +func (p *CreateTopicResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CreateTopicResult) IsSetE() bool { + return p.E != nil +} + +func (p *CreateTopicResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CreateTopicResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &CreateTopicResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *CreateTopicResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *CreateTopicResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("createTopic_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CreateTopicResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *CreateTopicResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *CreateTopicResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateTopicResult(%+v)", *p) +} + +type CreateReplicationTopicArgs struct { + Request *CreateReplicationTopicRequest `thrift:"request,1" json:"request"` +} + +func NewCreateReplicationTopicArgs() *CreateReplicationTopicArgs { + return &CreateReplicationTopicArgs{} +} + +var CreateReplicationTopicArgs_Request_DEFAULT *CreateReplicationTopicRequest + +func (p *CreateReplicationTopicArgs) GetRequest() *CreateReplicationTopicRequest { + if !p.IsSetRequest() { + return CreateReplicationTopicArgs_Request_DEFAULT + } + return p.Request +} +func (p *CreateReplicationTopicArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *CreateReplicationTopicArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CreateReplicationTopicArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &CreateReplicationTopicRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *CreateReplicationTopicArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("createReplicationTopic_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CreateReplicationTopicArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *CreateReplicationTopicArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateReplicationTopicArgs(%+v)", *p) +} + +type CreateReplicationTopicResult struct { + Success *CreateTopicResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewCreateReplicationTopicResult() *CreateReplicationTopicResult { + return &CreateReplicationTopicResult{} +} + +var CreateReplicationTopicResult_Success_DEFAULT *CreateTopicResponse + +func (p *CreateReplicationTopicResult) GetSuccess() *CreateTopicResponse { + if !p.IsSetSuccess() { + return CreateReplicationTopicResult_Success_DEFAULT + } + return p.Success +} + +var CreateReplicationTopicResult_E_DEFAULT *common.GalaxyTalosException + +func (p *CreateReplicationTopicResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return CreateReplicationTopicResult_E_DEFAULT + } + return p.E +} +func (p *CreateReplicationTopicResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CreateReplicationTopicResult) IsSetE() bool { + return p.E != nil +} + +func (p *CreateReplicationTopicResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CreateReplicationTopicResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &CreateTopicResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *CreateReplicationTopicResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *CreateReplicationTopicResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("createReplicationTopic_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CreateReplicationTopicResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *CreateReplicationTopicResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *CreateReplicationTopicResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateReplicationTopicResult(%+v)", *p) +} + +type CreateTopicGroupArgs struct { + Request *CreateTopicGroupRequest `thrift:"request,1" json:"request"` +} + +func NewCreateTopicGroupArgs() *CreateTopicGroupArgs { + return &CreateTopicGroupArgs{} +} + +var CreateTopicGroupArgs_Request_DEFAULT *CreateTopicGroupRequest + +func (p *CreateTopicGroupArgs) GetRequest() *CreateTopicGroupRequest { + if !p.IsSetRequest() { + return CreateTopicGroupArgs_Request_DEFAULT + } + return p.Request +} +func (p *CreateTopicGroupArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *CreateTopicGroupArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CreateTopicGroupArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &CreateTopicGroupRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *CreateTopicGroupArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("createTopicGroup_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CreateTopicGroupArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *CreateTopicGroupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateTopicGroupArgs(%+v)", *p) +} + +type CreateTopicGroupResult struct { + Success *CreateTopicGroupResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewCreateTopicGroupResult() *CreateTopicGroupResult { + return &CreateTopicGroupResult{} +} + +var CreateTopicGroupResult_Success_DEFAULT *CreateTopicGroupResponse + +func (p *CreateTopicGroupResult) GetSuccess() *CreateTopicGroupResponse { + if !p.IsSetSuccess() { + return CreateTopicGroupResult_Success_DEFAULT + } + return p.Success +} + +var CreateTopicGroupResult_E_DEFAULT *common.GalaxyTalosException + +func (p *CreateTopicGroupResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return CreateTopicGroupResult_E_DEFAULT + } + return p.E +} +func (p *CreateTopicGroupResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CreateTopicGroupResult) IsSetE() bool { + return p.E != nil +} + +func (p *CreateTopicGroupResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CreateTopicGroupResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &CreateTopicGroupResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *CreateTopicGroupResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *CreateTopicGroupResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("createTopicGroup_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CreateTopicGroupResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *CreateTopicGroupResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *CreateTopicGroupResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateTopicGroupResult(%+v)", *p) +} + +type DescribeTopicGroupArgs struct { + Request *DescribeTopicGroupRequest `thrift:"request,1" json:"request"` +} + +func NewDescribeTopicGroupArgs() *DescribeTopicGroupArgs { + return &DescribeTopicGroupArgs{} +} + +var DescribeTopicGroupArgs_Request_DEFAULT *DescribeTopicGroupRequest + +func (p *DescribeTopicGroupArgs) GetRequest() *DescribeTopicGroupRequest { + if !p.IsSetRequest() { + return DescribeTopicGroupArgs_Request_DEFAULT + } + return p.Request +} +func (p *DescribeTopicGroupArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *DescribeTopicGroupArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *DescribeTopicGroupArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &DescribeTopicGroupRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *DescribeTopicGroupArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("describeTopicGroup_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *DescribeTopicGroupArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *DescribeTopicGroupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DescribeTopicGroupArgs(%+v)", *p) +} + +type DescribeTopicGroupResult struct { + Success *DescribeTopicGroupResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewDescribeTopicGroupResult() *DescribeTopicGroupResult { + return &DescribeTopicGroupResult{} +} + +var DescribeTopicGroupResult_Success_DEFAULT *DescribeTopicGroupResponse + +func (p *DescribeTopicGroupResult) GetSuccess() *DescribeTopicGroupResponse { + if !p.IsSetSuccess() { + return DescribeTopicGroupResult_Success_DEFAULT + } + return p.Success +} + +var DescribeTopicGroupResult_E_DEFAULT *common.GalaxyTalosException + +func (p *DescribeTopicGroupResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return DescribeTopicGroupResult_E_DEFAULT + } + return p.E +} +func (p *DescribeTopicGroupResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *DescribeTopicGroupResult) IsSetE() bool { + return p.E != nil +} + +func (p *DescribeTopicGroupResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *DescribeTopicGroupResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &DescribeTopicGroupResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *DescribeTopicGroupResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *DescribeTopicGroupResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("describeTopicGroup_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *DescribeTopicGroupResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *DescribeTopicGroupResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } } - if err != nil { - return + return err +} + +func (p *DescribeTopicGroupResult) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("DescribeTopicGroupResult(%+v)", *p) } -type topicServiceProcessorListPermission struct { - handler TopicService +type DeleteTopicGroupArgs struct { + Request *DeleteTopicGroupRequest `thrift:"request,1" json:"request"` } -func (p *topicServiceProcessorListPermission) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ListPermissionArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("listPermission", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +func NewDeleteTopicGroupArgs() *DeleteTopicGroupArgs { + return &DeleteTopicGroupArgs{} +} + +var DeleteTopicGroupArgs_Request_DEFAULT *DeleteTopicGroupRequest + +func (p *DeleteTopicGroupArgs) GetRequest() *DeleteTopicGroupRequest { + if !p.IsSetRequest() { + return DeleteTopicGroupArgs_Request_DEFAULT } + return p.Request +} +func (p *DeleteTopicGroupArgs) IsSetRequest() bool { + return p.Request != nil +} - iprot.ReadMessageEnd() - result := ListPermissionResult{} - var retval *ListPermissionResponse - var err2 error - if retval, err2 = p.handler.ListPermission(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v +func (p *DeleteTopicGroupArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listPermission: "+err2.Error()) - oprot.WriteMessageBegin("listPermission", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err } - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("listPermission", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 } - if err != nil { - return + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) } - return true, err + return nil } -type topicServiceProcessorGetPermission struct { - handler TopicService +func (p *DeleteTopicGroupArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &DeleteTopicGroupRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil } -func (p *topicServiceProcessorGetPermission) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := GetPermissionArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getPermission", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +func (p *DeleteTopicGroupArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("deleteTopicGroup_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) } - - iprot.ReadMessageEnd() - result := GetPermissionResult{} - var retval *GetPermissionResponse - var err2 error - if retval, err2 = p.handler.GetPermission(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v - default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPermission: "+err2.Error()) - oprot.WriteMessageBegin("getPermission", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } - } else { - result.Success = retval + if err := p.writeField1(oprot); err != nil { + return err } - if err2 = oprot.WriteMessageBegin("getPermission", thrift.REPLY, seqId); err2 != nil { - err = err2 + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return nil +} + +func (p *DeleteTopicGroupArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) } - if err != nil { - return + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) } - return true, err + return err } -type topicServiceProcessorAddSubResourceName struct { - handler TopicService +func (p *DeleteTopicGroupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteTopicGroupArgs(%+v)", *p) } -func (p *topicServiceProcessorAddSubResourceName) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AddSubResourceNameArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("addSubResourceName", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err +type DeleteTopicGroupResult struct { + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewDeleteTopicGroupResult() *DeleteTopicGroupResult { + return &DeleteTopicGroupResult{} +} + +var DeleteTopicGroupResult_E_DEFAULT *common.GalaxyTalosException + +func (p *DeleteTopicGroupResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return DeleteTopicGroupResult_E_DEFAULT } + return p.E +} +func (p *DeleteTopicGroupResult) IsSetE() bool { + return p.E != nil +} - iprot.ReadMessageEnd() - result := AddSubResourceNameResult{} - var err2 error - if err2 = p.handler.AddSubResourceName(args.Request); err2 != nil { - switch v := err2.(type) { - case *common.GalaxyTalosException: - result.E = v +func (p *DeleteTopicGroupResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } default: - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addSubResourceName: "+err2.Error()) - oprot.WriteMessageBegin("addSubResourceName", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err } } - if err2 = oprot.WriteMessageBegin("addSubResourceName", thrift.REPLY, seqId); err2 != nil { - err = err2 + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + return nil +} + +func (p *DeleteTopicGroupResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return nil +} + +func (p *DeleteTopicGroupResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("deleteTopicGroup_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 + if err := p.writeField1(oprot); err != nil { + return err } - if err != nil { - return + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *DeleteTopicGroupResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } } - return true, err + return err } -// HELPER FUNCTIONS AND STRUCTURES +func (p *DeleteTopicGroupResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteTopicGroupResult(%+v)", *p) +} -type CreateTopicArgs struct { - Request *CreateTopicRequest `thrift:"request,1" json:"request"` +type ListTopicGroupArgs struct { + Request *ListTopicGroupRequest `thrift:"request,1" json:"request"` } -func NewCreateTopicArgs() *CreateTopicArgs { - return &CreateTopicArgs{} +func NewListTopicGroupArgs() *ListTopicGroupArgs { + return &ListTopicGroupArgs{} } -var CreateTopicArgs_Request_DEFAULT *CreateTopicRequest +var ListTopicGroupArgs_Request_DEFAULT *ListTopicGroupRequest -func (p *CreateTopicArgs) GetRequest() *CreateTopicRequest { +func (p *ListTopicGroupArgs) GetRequest() *ListTopicGroupRequest { if !p.IsSetRequest() { - return CreateTopicArgs_Request_DEFAULT + return ListTopicGroupArgs_Request_DEFAULT } return p.Request } -func (p *CreateTopicArgs) IsSetRequest() bool { +func (p *ListTopicGroupArgs) IsSetRequest() bool { return p.Request != nil } -func (p *CreateTopicArgs) Read(iprot thrift.TProtocol) error { +func (p *ListTopicGroupArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2236,16 +4193,16 @@ func (p *CreateTopicArgs) Read(iprot thrift.TProtocol) error { return nil } -func (p *CreateTopicArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &CreateTopicRequest{} +func (p *ListTopicGroupArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &ListTopicGroupRequest{} if err := p.Request.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Request, err) } return nil } -func (p *CreateTopicArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("createTopic_args"); err != nil { +func (p *ListTopicGroupArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("listTopicGroup_args"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -2260,7 +4217,7 @@ func (p *CreateTopicArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *CreateTopicArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *ListTopicGroupArgs) writeField1(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:request: %s", p, err) } @@ -2273,48 +4230,48 @@ func (p *CreateTopicArgs) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *CreateTopicArgs) String() string { +func (p *ListTopicGroupArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("CreateTopicArgs(%+v)", *p) + return fmt.Sprintf("ListTopicGroupArgs(%+v)", *p) } -type CreateTopicResult struct { - Success *CreateTopicResponse `thrift:"success,0" json:"success"` +type ListTopicGroupResult struct { + Success *ListTopicGroupResponse `thrift:"success,0" json:"success"` E *common.GalaxyTalosException `thrift:"e,1" json:"e"` } -func NewCreateTopicResult() *CreateTopicResult { - return &CreateTopicResult{} +func NewListTopicGroupResult() *ListTopicGroupResult { + return &ListTopicGroupResult{} } -var CreateTopicResult_Success_DEFAULT *CreateTopicResponse +var ListTopicGroupResult_Success_DEFAULT *ListTopicGroupResponse -func (p *CreateTopicResult) GetSuccess() *CreateTopicResponse { +func (p *ListTopicGroupResult) GetSuccess() *ListTopicGroupResponse { if !p.IsSetSuccess() { - return CreateTopicResult_Success_DEFAULT + return ListTopicGroupResult_Success_DEFAULT } return p.Success } -var CreateTopicResult_E_DEFAULT *common.GalaxyTalosException +var ListTopicGroupResult_E_DEFAULT *common.GalaxyTalosException -func (p *CreateTopicResult) GetE() *common.GalaxyTalosException { +func (p *ListTopicGroupResult) GetE() *common.GalaxyTalosException { if !p.IsSetE() { - return CreateTopicResult_E_DEFAULT + return ListTopicGroupResult_E_DEFAULT } return p.E } -func (p *CreateTopicResult) IsSetSuccess() bool { +func (p *ListTopicGroupResult) IsSetSuccess() bool { return p.Success != nil } -func (p *CreateTopicResult) IsSetE() bool { +func (p *ListTopicGroupResult) IsSetE() bool { return p.E != nil } -func (p *CreateTopicResult) Read(iprot thrift.TProtocol) error { +func (p *ListTopicGroupResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2350,15 +4307,15 @@ func (p *CreateTopicResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *CreateTopicResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &CreateTopicResponse{} +func (p *ListTopicGroupResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ListTopicGroupResponse{} if err := p.Success.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.Success, err) } return nil } -func (p *CreateTopicResult) ReadField1(iprot thrift.TProtocol) error { +func (p *ListTopicGroupResult) ReadField1(iprot thrift.TProtocol) error { p.E = &common.GalaxyTalosException{} if err := p.E.Read(iprot); err != nil { return fmt.Errorf("%T error reading struct: %s", p.E, err) @@ -2366,8 +4323,8 @@ func (p *CreateTopicResult) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *CreateTopicResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("createTopic_result"); err != nil { +func (p *ListTopicGroupResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("listTopicGroup_result"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField0(oprot); err != nil { @@ -2385,7 +4342,7 @@ func (p *CreateTopicResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *CreateTopicResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *ListTopicGroupResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return fmt.Errorf("%T write field begin error 0:success: %s", p, err) @@ -2400,7 +4357,7 @@ func (p *CreateTopicResult) writeField0(oprot thrift.TProtocol) (err error) { return err } -func (p *CreateTopicResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *ListTopicGroupResult) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetE() { if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { return fmt.Errorf("%T write field begin error 1:e: %s", p, err) @@ -2415,11 +4372,11 @@ func (p *CreateTopicResult) writeField1(oprot thrift.TProtocol) (err error) { return err } -func (p *CreateTopicResult) String() string { +func (p *ListTopicGroupResult) String() string { if p == nil { return "" } - return fmt.Sprintf("CreateTopicResult(%+v)", *p) + return fmt.Sprintf("ListTopicGroupResult(%+v)", *p) } type DeleteTopicArgs struct { @@ -3286,6 +5243,244 @@ func (p *GetDescribeInfoResult) String() string { return fmt.Sprintf("GetDescribeInfoResult(%+v)", *p) } +type GetTopicAttributeArgs struct { + Request *GetTopicAttributeRequest `thrift:"request,1" json:"request"` +} + +func NewGetTopicAttributeArgs() *GetTopicAttributeArgs { + return &GetTopicAttributeArgs{} +} + +var GetTopicAttributeArgs_Request_DEFAULT *GetTopicAttributeRequest + +func (p *GetTopicAttributeArgs) GetRequest() *GetTopicAttributeRequest { + if !p.IsSetRequest() { + return GetTopicAttributeArgs_Request_DEFAULT + } + return p.Request +} +func (p *GetTopicAttributeArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *GetTopicAttributeArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetTopicAttributeArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &GetTopicAttributeRequest{} + if err := p.Request.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Request, err) + } + return nil +} + +func (p *GetTopicAttributeArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getTopicAttribute_args"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetTopicAttributeArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:request: %s", p, err) + } + if err := p.Request.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Request, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:request: %s", p, err) + } + return err +} + +func (p *GetTopicAttributeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTopicAttributeArgs(%+v)", *p) +} + +type GetTopicAttributeResult struct { + Success *GetTopicAttributeResponse `thrift:"success,0" json:"success"` + E *common.GalaxyTalosException `thrift:"e,1" json:"e"` +} + +func NewGetTopicAttributeResult() *GetTopicAttributeResult { + return &GetTopicAttributeResult{} +} + +var GetTopicAttributeResult_Success_DEFAULT *GetTopicAttributeResponse + +func (p *GetTopicAttributeResult) GetSuccess() *GetTopicAttributeResponse { + if !p.IsSetSuccess() { + return GetTopicAttributeResult_Success_DEFAULT + } + return p.Success +} + +var GetTopicAttributeResult_E_DEFAULT *common.GalaxyTalosException + +func (p *GetTopicAttributeResult) GetE() *common.GalaxyTalosException { + if !p.IsSetE() { + return GetTopicAttributeResult_E_DEFAULT + } + return p.E +} +func (p *GetTopicAttributeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GetTopicAttributeResult) IsSetE() bool { + return p.E != nil +} + +func (p *GetTopicAttributeResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetTopicAttributeResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &GetTopicAttributeResponse{} + if err := p.Success.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.Success, err) + } + return nil +} + +func (p *GetTopicAttributeResult) ReadField1(iprot thrift.TProtocol) error { + p.E = &common.GalaxyTalosException{} + if err := p.E.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.E, err) + } + return nil +} + +func (p *GetTopicAttributeResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getTopicAttribute_result"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetTopicAttributeResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return fmt.Errorf("%T write field begin error 0:success: %s", p, err) + } + if err := p.Success.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.Success, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 0:success: %s", p, err) + } + } + return err +} + +func (p *GetTopicAttributeResult) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetE() { + if err := oprot.WriteFieldBegin("e", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:e: %s", p, err) + } + if err := p.E.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.E, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:e: %s", p, err) + } + } + return err +} + +func (p *GetTopicAttributeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTopicAttributeResult(%+v)", *p) +} + type ListTopicsInfoArgs struct { } diff --git a/thrift/topic/ttypes.go b/thrift/topic/ttypes.go index 0cc3212..69c0cf6 100644 --- a/thrift/topic/ttypes.go +++ b/thrift/topic/ttypes.go @@ -61,6 +61,35 @@ func TopicStatusFromString(s string) (TopicStatus, error) { func TopicStatusPtr(v TopicStatus) *TopicStatus { return &v } +type TopicGroupType int64 + +const ( + TopicGroupType_TOPIC_PATTERN TopicGroupType = 0 + TopicGroupType_TOPIC_SET TopicGroupType = 1 +) + +func (p TopicGroupType) String() string { + switch p { + case TopicGroupType_TOPIC_PATTERN: + return "TopicGroupType_TOPIC_PATTERN" + case TopicGroupType_TOPIC_SET: + return "TopicGroupType_TOPIC_SET" + } + return "" +} + +func TopicGroupTypeFromString(s string) (TopicGroupType, error) { + switch s { + case "TopicGroupType_TOPIC_PATTERN": + return TopicGroupType_TOPIC_PATTERN, nil + case "TopicGroupType_TOPIC_SET": + return TopicGroupType_TOPIC_SET, nil + } + return TopicGroupType(0), fmt.Errorf("not a valid TopicGroupType string") +} + +func TopicGroupTypePtr(v TopicGroupType) *TopicGroupType { return &v } + type Permission int64 const ( @@ -565,6 +594,7 @@ type TopicAttribute struct { PartitionNumber *int32 `thrift:"partitionNumber,1" json:"partitionNumber"` MessageRetentionSecs *int32 `thrift:"messageRetentionSecs,2" json:"messageRetentionSecs"` Attributes map[string]string `thrift:"attributes,3" json:"attributes"` + OldPartitionNumber *int32 `thrift:"oldPartitionNumber,4" json:"oldPartitionNumber"` } func NewTopicAttribute() *TopicAttribute { @@ -594,6 +624,15 @@ var TopicAttribute_Attributes_DEFAULT map[string]string func (p *TopicAttribute) GetAttributes() map[string]string { return p.Attributes } + +var TopicAttribute_OldPartitionNumber_DEFAULT int32 + +func (p *TopicAttribute) GetOldPartitionNumber() int32 { + if !p.IsSetOldPartitionNumber() { + return TopicAttribute_OldPartitionNumber_DEFAULT + } + return *p.OldPartitionNumber +} func (p *TopicAttribute) IsSetPartitionNumber() bool { return p.PartitionNumber != nil } @@ -606,6 +645,10 @@ func (p *TopicAttribute) IsSetAttributes() bool { return p.Attributes != nil } +func (p *TopicAttribute) IsSetOldPartitionNumber() bool { + return p.OldPartitionNumber != nil +} + func (p *TopicAttribute) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) @@ -631,6 +674,10 @@ func (p *TopicAttribute) Read(iprot thrift.TProtocol) error { if err := p.ReadField3(iprot); err != nil { return err } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -692,6 +739,15 @@ func (p *TopicAttribute) ReadField3(iprot thrift.TProtocol) error { return nil } +func (p *TopicAttribute) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return fmt.Errorf("error reading field 4: %s", err) + } else { + p.OldPartitionNumber = &v + } + return nil +} + func (p *TopicAttribute) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("TopicAttribute"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) @@ -705,6 +761,9 @@ func (p *TopicAttribute) Write(oprot thrift.TProtocol) error { if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { + return err + } if err := oprot.WriteFieldStop(); err != nil { return fmt.Errorf("write field stop error: %s", err) } @@ -770,6 +829,21 @@ func (p *TopicAttribute) writeField3(oprot thrift.TProtocol) (err error) { return err } +func (p *TopicAttribute) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetOldPartitionNumber() { + if err := oprot.WriteFieldBegin("oldPartitionNumber", thrift.I32, 4); err != nil { + return fmt.Errorf("%T write field begin error 4:oldPartitionNumber: %s", p, err) + } + if err := oprot.WriteI32(int32(*p.OldPartitionNumber)); err != nil { + return fmt.Errorf("%T.oldPartitionNumber (4) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 4:oldPartitionNumber: %s", p, err) + } + } + return err +} + func (p *TopicAttribute) String() string { if p == nil { return "" @@ -1721,57 +1795,73 @@ func (p *Topic) String() string { return fmt.Sprintf("Topic(%+v)", *p) } -type CreateTopicRequest struct { - TopicName string `thrift:"topicName,1,required" json:"topicName"` - TopicAttribute *TopicAttribute `thrift:"topicAttribute,2,required" json:"topicAttribute"` - TopicQuota *quota.BaseQuota `thrift:"topicQuota,3" json:"topicQuota"` - AclMap map[*authorization.Grantee]Permission `thrift:"aclMap,4" json:"aclMap"` +type TopicGroup struct { + TopicGroupName string `thrift:"topicGroupName,1,required" json:"topicGroupName"` + OwnerId string `thrift:"ownerId,2,required" json:"ownerId"` + TypeA1 *TopicGroupType `thrift:"type,3" json:"type"` + TopicPattern *string `thrift:"topicPattern,4" json:"topicPattern"` + TopicSet []string `thrift:"topicSet,5" json:"topicSet"` + ExclusiveTopics []string `thrift:"exclusiveTopics,6" json:"exclusiveTopics"` } -func NewCreateTopicRequest() *CreateTopicRequest { - return &CreateTopicRequest{} +func NewTopicGroup() *TopicGroup { + return &TopicGroup{} } -func (p *CreateTopicRequest) GetTopicName() string { - return p.TopicName +func (p *TopicGroup) GetTopicGroupName() string { + return p.TopicGroupName } -var CreateTopicRequest_TopicAttribute_DEFAULT *TopicAttribute +func (p *TopicGroup) GetOwnerId() string { + return p.OwnerId +} -func (p *CreateTopicRequest) GetTopicAttribute() *TopicAttribute { - if !p.IsSetTopicAttribute() { - return CreateTopicRequest_TopicAttribute_DEFAULT +var TopicGroup_TypeA1_DEFAULT TopicGroupType + +func (p *TopicGroup) GetTypeA1() TopicGroupType { + if !p.IsSetTypeA1() { + return TopicGroup_TypeA1_DEFAULT } - return p.TopicAttribute + return *p.TypeA1 } -var CreateTopicRequest_TopicQuota_DEFAULT *quota.BaseQuota +var TopicGroup_TopicPattern_DEFAULT string -func (p *CreateTopicRequest) GetTopicQuota() *quota.BaseQuota { - if !p.IsSetTopicQuota() { - return CreateTopicRequest_TopicQuota_DEFAULT +func (p *TopicGroup) GetTopicPattern() string { + if !p.IsSetTopicPattern() { + return TopicGroup_TopicPattern_DEFAULT } - return p.TopicQuota + return *p.TopicPattern } -var CreateTopicRequest_AclMap_DEFAULT map[*authorization.Grantee]Permission +var TopicGroup_TopicSet_DEFAULT []string -func (p *CreateTopicRequest) GetAclMap() map[*authorization.Grantee]Permission { - return p.AclMap +func (p *TopicGroup) GetTopicSet() []string { + return p.TopicSet } -func (p *CreateTopicRequest) IsSetTopicAttribute() bool { - return p.TopicAttribute != nil + +var TopicGroup_ExclusiveTopics_DEFAULT []string + +func (p *TopicGroup) GetExclusiveTopics() []string { + return p.ExclusiveTopics +} +func (p *TopicGroup) IsSetTypeA1() bool { + return p.TypeA1 != nil } -func (p *CreateTopicRequest) IsSetTopicQuota() bool { - return p.TopicQuota != nil +func (p *TopicGroup) IsSetTopicPattern() bool { + return p.TopicPattern != nil } -func (p *CreateTopicRequest) IsSetAclMap() bool { - return p.AclMap != nil +func (p *TopicGroup) IsSetTopicSet() bool { + return p.TopicSet != nil } -func (p *CreateTopicRequest) Read(iprot thrift.TProtocol) error { +func (p *TopicGroup) IsSetExclusiveTopics() bool { + return p.ExclusiveTopics != nil +} + +func (p *TopicGroup) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -1800,6 +1890,14 @@ func (p *CreateTopicRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField4(iprot); err != nil { return err } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -1815,60 +1913,89 @@ func (p *CreateTopicRequest) Read(iprot thrift.TProtocol) error { return nil } -func (p *CreateTopicRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *TopicGroup) ReadField1(iprot thrift.TProtocol) error { if v, err := iprot.ReadString(); err != nil { return fmt.Errorf("error reading field 1: %s", err) } else { - p.TopicName = v + p.TopicGroupName = v } return nil } -func (p *CreateTopicRequest) ReadField2(iprot thrift.TProtocol) error { - p.TopicAttribute = &TopicAttribute{} - if err := p.TopicAttribute.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.TopicAttribute, err) +func (p *TopicGroup) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.OwnerId = v } return nil } -func (p *CreateTopicRequest) ReadField3(iprot thrift.TProtocol) error { - p.TopicQuota = "a.BaseQuota{} - if err := p.TopicQuota.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.TopicQuota, err) +func (p *TopicGroup) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + temp := TopicGroupType(v) + p.TypeA1 = &temp } return nil } -func (p *CreateTopicRequest) ReadField4(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() +func (p *TopicGroup) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 4: %s", err) + } else { + p.TopicPattern = &v + } + return nil +} + +func (p *TopicGroup) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() if err != nil { - return fmt.Errorf("error reading map begin: %s", err) + return fmt.Errorf("error reading list begin: %s", err) } - tMap := make(map[*authorization.Grantee]Permission, size) - p.AclMap = tMap + tSlice := make([]string, 0, size) + p.TopicSet = tSlice for i := 0; i < size; i++ { - _key5 := &authorization.Grantee{} - if err := _key5.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", _key5, err) + var _elem5 string + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + _elem5 = v } - var _val6 Permission - if v, err := iprot.ReadI32(); err != nil { + p.TopicSet = append(p.TopicSet, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return fmt.Errorf("error reading list end: %s", err) + } + return nil +} + +func (p *TopicGroup) ReadField6(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return fmt.Errorf("error reading list begin: %s", err) + } + tSlice := make([]string, 0, size) + p.ExclusiveTopics = tSlice + for i := 0; i < size; i++ { + var _elem6 string + if v, err := iprot.ReadString(); err != nil { return fmt.Errorf("error reading field 0: %s", err) } else { - temp := Permission(v) - _val6 = temp + _elem6 = v } - p.AclMap[_key5] = _val6 + p.ExclusiveTopics = append(p.ExclusiveTopics, _elem6) } - if err := iprot.ReadMapEnd(); err != nil { - return fmt.Errorf("error reading map end: %s", err) + if err := iprot.ReadListEnd(); err != nil { + return fmt.Errorf("error reading list end: %s", err) } return nil } -func (p *CreateTopicRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CreateTopicRequest"); err != nil { +func (p *TopicGroup) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("TopicGroup"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -1883,6 +2010,12 @@ func (p *CreateTopicRequest) Write(oprot thrift.TProtocol) error { if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } if err := oprot.WriteFieldStop(); err != nil { return fmt.Errorf("write field stop error: %s", err) } @@ -1892,120 +2025,1314 @@ func (p *CreateTopicRequest) Write(oprot thrift.TProtocol) error { return nil } -func (p *CreateTopicRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("topicName", thrift.STRING, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:topicName: %s", p, err) +func (p *TopicGroup) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicGroupName", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicGroupName: %s", p, err) } - if err := oprot.WriteString(string(p.TopicName)); err != nil { - return fmt.Errorf("%T.topicName (1) field write error: %s", p, err) + if err := oprot.WriteString(string(p.TopicGroupName)); err != nil { + return fmt.Errorf("%T.topicGroupName (1) field write error: %s", p, err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:topicName: %s", p, err) + return fmt.Errorf("%T write field end error 1:topicGroupName: %s", p, err) } return err } -func (p *CreateTopicRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("topicAttribute", thrift.STRUCT, 2); err != nil { - return fmt.Errorf("%T write field begin error 2:topicAttribute: %s", p, err) +func (p *TopicGroup) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ownerId", thrift.STRING, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:ownerId: %s", p, err) } - if err := p.TopicAttribute.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", p.TopicAttribute, err) + if err := oprot.WriteString(string(p.OwnerId)); err != nil { + return fmt.Errorf("%T.ownerId (2) field write error: %s", p, err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 2:topicAttribute: %s", p, err) + return fmt.Errorf("%T write field end error 2:ownerId: %s", p, err) } return err } -func (p *CreateTopicRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetTopicQuota() { - if err := oprot.WriteFieldBegin("topicQuota", thrift.STRUCT, 3); err != nil { - return fmt.Errorf("%T write field begin error 3:topicQuota: %s", p, err) +func (p *TopicGroup) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetTypeA1() { + if err := oprot.WriteFieldBegin("type", thrift.I32, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:type: %s", p, err) } - if err := p.TopicQuota.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", p.TopicQuota, err) + if err := oprot.WriteI32(int32(*p.TypeA1)); err != nil { + return fmt.Errorf("%T.type (3) field write error: %s", p, err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 3:topicQuota: %s", p, err) + return fmt.Errorf("%T write field end error 3:type: %s", p, err) } } return err } -func (p *CreateTopicRequest) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetAclMap() { - if err := oprot.WriteFieldBegin("aclMap", thrift.MAP, 4); err != nil { - return fmt.Errorf("%T write field begin error 4:aclMap: %s", p, err) +func (p *TopicGroup) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetTopicPattern() { + if err := oprot.WriteFieldBegin("topicPattern", thrift.STRING, 4); err != nil { + return fmt.Errorf("%T write field begin error 4:topicPattern: %s", p, err) } - if err := oprot.WriteMapBegin(thrift.STRUCT, thrift.I32, len(p.AclMap)); err != nil { - return fmt.Errorf("error writing map begin: %s", err) + if err := oprot.WriteString(string(*p.TopicPattern)); err != nil { + return fmt.Errorf("%T.topicPattern (4) field write error: %s", p, err) } - for k, v := range p.AclMap { - if err := k.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", k, err) + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 4:topicPattern: %s", p, err) + } + } + return err +} + +func (p *TopicGroup) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetTopicSet() { + if err := oprot.WriteFieldBegin("topicSet", thrift.LIST, 5); err != nil { + return fmt.Errorf("%T write field begin error 5:topicSet: %s", p, err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.TopicSet)); err != nil { + return fmt.Errorf("error writing list begin: %s", err) + } + for _, v := range p.TopicSet { + if err := oprot.WriteString(string(v)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) } - if err := oprot.WriteI32(int32(v)); err != nil { + } + if err := oprot.WriteListEnd(); err != nil { + return fmt.Errorf("error writing list end: %s", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 5:topicSet: %s", p, err) + } + } + return err +} + +func (p *TopicGroup) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetExclusiveTopics() { + if err := oprot.WriteFieldBegin("exclusiveTopics", thrift.LIST, 6); err != nil { + return fmt.Errorf("%T write field begin error 6:exclusiveTopics: %s", p, err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ExclusiveTopics)); err != nil { + return fmt.Errorf("error writing list begin: %s", err) + } + for _, v := range p.ExclusiveTopics { + if err := oprot.WriteString(string(v)); err != nil { return fmt.Errorf("%T. (0) field write error: %s", p, err) } } - if err := oprot.WriteMapEnd(); err != nil { - return fmt.Errorf("error writing map end: %s", err) + if err := oprot.WriteListEnd(); err != nil { + return fmt.Errorf("error writing list end: %s", err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 4:aclMap: %s", p, err) + return fmt.Errorf("%T write field end error 6:exclusiveTopics: %s", p, err) } } return err } -func (p *CreateTopicRequest) String() string { +func (p *TopicGroup) String() string { if p == nil { return "" } - return fmt.Sprintf("CreateTopicRequest(%+v)", *p) + return fmt.Sprintf("TopicGroup(%+v)", *p) } -type CreateTopicResponse struct { - TopicInfo *TopicInfo `thrift:"topicInfo,1,required" json:"topicInfo"` +type CreateTopicRequest struct { + TopicName string `thrift:"topicName,1,required" json:"topicName"` + TopicAttribute *TopicAttribute `thrift:"topicAttribute,2,required" json:"topicAttribute"` + TopicQuota *quota.BaseQuota `thrift:"topicQuota,3" json:"topicQuota"` + AclMap map[*authorization.Grantee]Permission `thrift:"aclMap,4" json:"aclMap"` } -func NewCreateTopicResponse() *CreateTopicResponse { - return &CreateTopicResponse{} +func NewCreateTopicRequest() *CreateTopicRequest { + return &CreateTopicRequest{} } -var CreateTopicResponse_TopicInfo_DEFAULT *TopicInfo +func (p *CreateTopicRequest) GetTopicName() string { + return p.TopicName +} -func (p *CreateTopicResponse) GetTopicInfo() *TopicInfo { - if !p.IsSetTopicInfo() { - return CreateTopicResponse_TopicInfo_DEFAULT +var CreateTopicRequest_TopicAttribute_DEFAULT *TopicAttribute + +func (p *CreateTopicRequest) GetTopicAttribute() *TopicAttribute { + if !p.IsSetTopicAttribute() { + return CreateTopicRequest_TopicAttribute_DEFAULT } - return p.TopicInfo -} -func (p *CreateTopicResponse) IsSetTopicInfo() bool { - return p.TopicInfo != nil + return p.TopicAttribute } -func (p *CreateTopicResponse) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return fmt.Errorf("%T read error: %s", p, err) +var CreateTopicRequest_TopicQuota_DEFAULT *quota.BaseQuota + +func (p *CreateTopicRequest) GetTopicQuota() *quota.BaseQuota { + if !p.IsSetTopicQuota() { + return CreateTopicRequest_TopicQuota_DEFAULT } - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err + return p.TopicQuota +} + +var CreateTopicRequest_AclMap_DEFAULT map[*authorization.Grantee]Permission + +func (p *CreateTopicRequest) GetAclMap() map[*authorization.Grantee]Permission { + return p.AclMap +} +func (p *CreateTopicRequest) IsSetTopicAttribute() bool { + return p.TopicAttribute != nil +} + +func (p *CreateTopicRequest) IsSetTopicQuota() bool { + return p.TopicQuota != nil +} + +func (p *CreateTopicRequest) IsSetAclMap() bool { + return p.AclMap != nil +} + +func (p *CreateTopicRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CreateTopicRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.TopicName = v + } + return nil +} + +func (p *CreateTopicRequest) ReadField2(iprot thrift.TProtocol) error { + p.TopicAttribute = &TopicAttribute{} + if err := p.TopicAttribute.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicAttribute, err) + } + return nil +} + +func (p *CreateTopicRequest) ReadField3(iprot thrift.TProtocol) error { + p.TopicQuota = "a.BaseQuota{} + if err := p.TopicQuota.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicQuota, err) + } + return nil +} + +func (p *CreateTopicRequest) ReadField4(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return fmt.Errorf("error reading map begin: %s", err) + } + tMap := make(map[*authorization.Grantee]Permission, size) + p.AclMap = tMap + for i := 0; i < size; i++ { + _key7 := &authorization.Grantee{} + if err := _key7.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _key7, err) + } + var _val8 Permission + if v, err := iprot.ReadI32(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + temp := Permission(v) + _val8 = temp + } + p.AclMap[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return fmt.Errorf("error reading map end: %s", err) + } + return nil +} + +func (p *CreateTopicRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CreateTopicRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CreateTopicRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicName", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicName: %s", p, err) + } + if err := oprot.WriteString(string(p.TopicName)); err != nil { + return fmt.Errorf("%T.topicName (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicName: %s", p, err) + } + return err +} + +func (p *CreateTopicRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicAttribute", thrift.STRUCT, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:topicAttribute: %s", p, err) + } + if err := p.TopicAttribute.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicAttribute, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:topicAttribute: %s", p, err) + } + return err +} + +func (p *CreateTopicRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetTopicQuota() { + if err := oprot.WriteFieldBegin("topicQuota", thrift.STRUCT, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:topicQuota: %s", p, err) + } + if err := p.TopicQuota.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicQuota, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:topicQuota: %s", p, err) + } + } + return err +} + +func (p *CreateTopicRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetAclMap() { + if err := oprot.WriteFieldBegin("aclMap", thrift.MAP, 4); err != nil { + return fmt.Errorf("%T write field begin error 4:aclMap: %s", p, err) + } + if err := oprot.WriteMapBegin(thrift.STRUCT, thrift.I32, len(p.AclMap)); err != nil { + return fmt.Errorf("error writing map begin: %s", err) + } + for k, v := range p.AclMap { + if err := k.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", k, err) + } + if err := oprot.WriteI32(int32(v)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return fmt.Errorf("error writing map end: %s", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 4:aclMap: %s", p, err) + } + } + return err +} + +func (p *CreateTopicRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateTopicRequest(%+v)", *p) +} + +type CreateReplicationTopicRequest struct { + TopicName string `thrift:"topicName,1,required" json:"topicName"` + SourceClusterList string `thrift:"sourceClusterList,2,required" json:"sourceClusterList"` + SourceTopicName string `thrift:"sourceTopicName,3,required" json:"sourceTopicName"` +} + +func NewCreateReplicationTopicRequest() *CreateReplicationTopicRequest { + return &CreateReplicationTopicRequest{} +} + +func (p *CreateReplicationTopicRequest) GetTopicName() string { + return p.TopicName +} + +func (p *CreateReplicationTopicRequest) GetSourceClusterList() string { + return p.SourceClusterList +} + +func (p *CreateReplicationTopicRequest) GetSourceTopicName() string { + return p.SourceTopicName +} +func (p *CreateReplicationTopicRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CreateReplicationTopicRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.TopicName = v + } + return nil +} + +func (p *CreateReplicationTopicRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.SourceClusterList = v + } + return nil +} + +func (p *CreateReplicationTopicRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.SourceTopicName = v + } + return nil +} + +func (p *CreateReplicationTopicRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CreateReplicationTopicRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CreateReplicationTopicRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicName", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicName: %s", p, err) + } + if err := oprot.WriteString(string(p.TopicName)); err != nil { + return fmt.Errorf("%T.topicName (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicName: %s", p, err) + } + return err +} + +func (p *CreateReplicationTopicRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sourceClusterList", thrift.STRING, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:sourceClusterList: %s", p, err) + } + if err := oprot.WriteString(string(p.SourceClusterList)); err != nil { + return fmt.Errorf("%T.sourceClusterList (2) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:sourceClusterList: %s", p, err) + } + return err +} + +func (p *CreateReplicationTopicRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sourceTopicName", thrift.STRING, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:sourceTopicName: %s", p, err) + } + if err := oprot.WriteString(string(p.SourceTopicName)); err != nil { + return fmt.Errorf("%T.sourceTopicName (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:sourceTopicName: %s", p, err) + } + return err +} + +func (p *CreateReplicationTopicRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateReplicationTopicRequest(%+v)", *p) +} + +type CreateTopicResponse struct { + TopicInfo *TopicInfo `thrift:"topicInfo,1,required" json:"topicInfo"` +} + +func NewCreateTopicResponse() *CreateTopicResponse { + return &CreateTopicResponse{} +} + +var CreateTopicResponse_TopicInfo_DEFAULT *TopicInfo + +func (p *CreateTopicResponse) GetTopicInfo() *TopicInfo { + if !p.IsSetTopicInfo() { + return CreateTopicResponse_TopicInfo_DEFAULT + } + return p.TopicInfo +} +func (p *CreateTopicResponse) IsSetTopicInfo() bool { + return p.TopicInfo != nil +} + +func (p *CreateTopicResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *CreateTopicResponse) ReadField1(iprot thrift.TProtocol) error { + p.TopicInfo = &TopicInfo{} + if err := p.TopicInfo.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicInfo, err) + } + return nil +} + +func (p *CreateTopicResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CreateTopicResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *CreateTopicResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicInfo", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicInfo: %s", p, err) + } + if err := p.TopicInfo.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicInfo, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicInfo: %s", p, err) + } + return err +} + +func (p *CreateTopicResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateTopicResponse(%+v)", *p) +} + +type DeleteTopicRequest struct { + TopicTalosResourceName *TopicTalosResourceName `thrift:"topicTalosResourceName,1,required" json:"topicTalosResourceName"` +} + +func NewDeleteTopicRequest() *DeleteTopicRequest { + return &DeleteTopicRequest{} +} + +var DeleteTopicRequest_TopicTalosResourceName_DEFAULT *TopicTalosResourceName + +func (p *DeleteTopicRequest) GetTopicTalosResourceName() *TopicTalosResourceName { + if !p.IsSetTopicTalosResourceName() { + return DeleteTopicRequest_TopicTalosResourceName_DEFAULT + } + return p.TopicTalosResourceName +} +func (p *DeleteTopicRequest) IsSetTopicTalosResourceName() bool { + return p.TopicTalosResourceName != nil +} + +func (p *DeleteTopicRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *DeleteTopicRequest) ReadField1(iprot thrift.TProtocol) error { + p.TopicTalosResourceName = &TopicTalosResourceName{} + if err := p.TopicTalosResourceName.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicTalosResourceName, err) + } + return nil +} + +func (p *DeleteTopicRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("DeleteTopicRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *DeleteTopicRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicTalosResourceName", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicTalosResourceName: %s", p, err) + } + if err := p.TopicTalosResourceName.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicTalosResourceName, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicTalosResourceName: %s", p, err) + } + return err +} + +func (p *DeleteTopicRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteTopicRequest(%+v)", *p) +} + +type ChangeTopicAttributeRequest struct { + TopicTalosResourceName *TopicTalosResourceName `thrift:"topicTalosResourceName,1,required" json:"topicTalosResourceName"` + TopicAttribute *TopicAttribute `thrift:"topicAttribute,2,required" json:"topicAttribute"` +} + +func NewChangeTopicAttributeRequest() *ChangeTopicAttributeRequest { + return &ChangeTopicAttributeRequest{} +} + +var ChangeTopicAttributeRequest_TopicTalosResourceName_DEFAULT *TopicTalosResourceName + +func (p *ChangeTopicAttributeRequest) GetTopicTalosResourceName() *TopicTalosResourceName { + if !p.IsSetTopicTalosResourceName() { + return ChangeTopicAttributeRequest_TopicTalosResourceName_DEFAULT + } + return p.TopicTalosResourceName +} + +var ChangeTopicAttributeRequest_TopicAttribute_DEFAULT *TopicAttribute + +func (p *ChangeTopicAttributeRequest) GetTopicAttribute() *TopicAttribute { + if !p.IsSetTopicAttribute() { + return ChangeTopicAttributeRequest_TopicAttribute_DEFAULT + } + return p.TopicAttribute +} +func (p *ChangeTopicAttributeRequest) IsSetTopicTalosResourceName() bool { + return p.TopicTalosResourceName != nil +} + +func (p *ChangeTopicAttributeRequest) IsSetTopicAttribute() bool { + return p.TopicAttribute != nil +} + +func (p *ChangeTopicAttributeRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *ChangeTopicAttributeRequest) ReadField1(iprot thrift.TProtocol) error { + p.TopicTalosResourceName = &TopicTalosResourceName{} + if err := p.TopicTalosResourceName.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicTalosResourceName, err) + } + return nil +} + +func (p *ChangeTopicAttributeRequest) ReadField2(iprot thrift.TProtocol) error { + p.TopicAttribute = &TopicAttribute{} + if err := p.TopicAttribute.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicAttribute, err) + } + return nil +} + +func (p *ChangeTopicAttributeRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ChangeTopicAttributeRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *ChangeTopicAttributeRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicTalosResourceName", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicTalosResourceName: %s", p, err) + } + if err := p.TopicTalosResourceName.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicTalosResourceName, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicTalosResourceName: %s", p, err) + } + return err +} + +func (p *ChangeTopicAttributeRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicAttribute", thrift.STRUCT, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:topicAttribute: %s", p, err) + } + if err := p.TopicAttribute.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicAttribute, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:topicAttribute: %s", p, err) + } + return err +} + +func (p *ChangeTopicAttributeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeTopicAttributeRequest(%+v)", *p) +} + +type DescribeTopicRequest struct { + TopicName string `thrift:"topicName,1,required" json:"topicName"` +} + +func NewDescribeTopicRequest() *DescribeTopicRequest { + return &DescribeTopicRequest{} +} + +func (p *DescribeTopicRequest) GetTopicName() string { + return p.TopicName +} +func (p *DescribeTopicRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *DescribeTopicRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.TopicName = v + } + return nil +} + +func (p *DescribeTopicRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("DescribeTopicRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *DescribeTopicRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicName", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicName: %s", p, err) + } + if err := oprot.WriteString(string(p.TopicName)); err != nil { + return fmt.Errorf("%T.topicName (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicName: %s", p, err) + } + return err +} + +func (p *DescribeTopicRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DescribeTopicRequest(%+v)", *p) +} + +type GetDescribeInfoRequest struct { + TopicName string `thrift:"topicName,1,required" json:"topicName"` +} + +func NewGetDescribeInfoRequest() *GetDescribeInfoRequest { + return &GetDescribeInfoRequest{} +} + +func (p *GetDescribeInfoRequest) GetTopicName() string { + return p.TopicName +} +func (p *GetDescribeInfoRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetDescribeInfoRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.TopicName = v + } + return nil +} + +func (p *GetDescribeInfoRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetDescribeInfoRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetDescribeInfoRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicName", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicName: %s", p, err) + } + if err := oprot.WriteString(string(p.TopicName)); err != nil { + return fmt.Errorf("%T.topicName (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicName: %s", p, err) + } + return err +} + +func (p *GetDescribeInfoRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetDescribeInfoRequest(%+v)", *p) +} + +type GetTopicAttributeRequest struct { + TopicName string `thrift:"topicName,1,required" json:"topicName"` +} + +func NewGetTopicAttributeRequest() *GetTopicAttributeRequest { + return &GetTopicAttributeRequest{} +} + +func (p *GetTopicAttributeRequest) GetTopicName() string { + return p.TopicName +} +func (p *GetTopicAttributeRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetTopicAttributeRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.TopicName = v + } + return nil +} + +func (p *GetTopicAttributeRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetTopicAttributeRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetTopicAttributeRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicName", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicName: %s", p, err) + } + if err := oprot.WriteString(string(p.TopicName)); err != nil { + return fmt.Errorf("%T.topicName (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicName: %s", p, err) + } + return err +} + +func (p *GetTopicAttributeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTopicAttributeRequest(%+v)", *p) +} + +type AddSubResourceNameRequest struct { + TopicTalosResourceName *TopicTalosResourceName `thrift:"topicTalosResourceName,1,required" json:"topicTalosResourceName"` + OrgId string `thrift:"orgId,2,required" json:"orgId"` + AdminTeamId string `thrift:"adminTeamId,3,required" json:"adminTeamId"` +} + +func NewAddSubResourceNameRequest() *AddSubResourceNameRequest { + return &AddSubResourceNameRequest{} +} + +var AddSubResourceNameRequest_TopicTalosResourceName_DEFAULT *TopicTalosResourceName + +func (p *AddSubResourceNameRequest) GetTopicTalosResourceName() *TopicTalosResourceName { + if !p.IsSetTopicTalosResourceName() { + return AddSubResourceNameRequest_TopicTalosResourceName_DEFAULT + } + return p.TopicTalosResourceName +} + +func (p *AddSubResourceNameRequest) GetOrgId() string { + return p.OrgId +} + +func (p *AddSubResourceNameRequest) GetAdminTeamId() string { + return p.AdminTeamId +} +func (p *AddSubResourceNameRequest) IsSetTopicTalosResourceName() bool { + return p.TopicTalosResourceName != nil +} + +func (p *AddSubResourceNameRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *AddSubResourceNameRequest) ReadField1(iprot thrift.TProtocol) error { + p.TopicTalosResourceName = &TopicTalosResourceName{} + if err := p.TopicTalosResourceName.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicTalosResourceName, err) + } + return nil +} + +func (p *AddSubResourceNameRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 2: %s", err) + } else { + p.OrgId = v + } + return nil +} + +func (p *AddSubResourceNameRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 3: %s", err) + } else { + p.AdminTeamId = v + } + return nil +} + +func (p *AddSubResourceNameRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("AddSubResourceNameRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *AddSubResourceNameRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicTalosResourceName", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicTalosResourceName: %s", p, err) + } + if err := p.TopicTalosResourceName.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicTalosResourceName, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicTalosResourceName: %s", p, err) + } + return err +} + +func (p *AddSubResourceNameRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("orgId", thrift.STRING, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:orgId: %s", p, err) + } + if err := oprot.WriteString(string(p.OrgId)); err != nil { + return fmt.Errorf("%T.orgId (2) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:orgId: %s", p, err) + } + return err +} + +func (p *AddSubResourceNameRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("adminTeamId", thrift.STRING, 3); err != nil { + return fmt.Errorf("%T write field begin error 3:adminTeamId: %s", p, err) + } + if err := oprot.WriteString(string(p.AdminTeamId)); err != nil { + return fmt.Errorf("%T.adminTeamId (3) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 3:adminTeamId: %s", p, err) + } + return err +} + +func (p *AddSubResourceNameRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddSubResourceNameRequest(%+v)", *p) +} + +type CreateTopicGroupRequest struct { + TopicGroup *TopicGroup `thrift:"topicGroup,1,required" json:"topicGroup"` +} + +func NewCreateTopicGroupRequest() *CreateTopicGroupRequest { + return &CreateTopicGroupRequest{} +} + +var CreateTopicGroupRequest_TopicGroup_DEFAULT *TopicGroup + +func (p *CreateTopicGroupRequest) GetTopicGroup() *TopicGroup { + if !p.IsSetTopicGroup() { + return CreateTopicGroupRequest_TopicGroup_DEFAULT + } + return p.TopicGroup +} +func (p *CreateTopicGroupRequest) IsSetTopicGroup() bool { + return p.TopicGroup != nil +} + +func (p *CreateTopicGroupRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err } } if err := iprot.ReadFieldEnd(); err != nil { @@ -2018,16 +3345,16 @@ func (p *CreateTopicResponse) Read(iprot thrift.TProtocol) error { return nil } -func (p *CreateTopicResponse) ReadField1(iprot thrift.TProtocol) error { - p.TopicInfo = &TopicInfo{} - if err := p.TopicInfo.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.TopicInfo, err) +func (p *CreateTopicGroupRequest) ReadField1(iprot thrift.TProtocol) error { + p.TopicGroup = &TopicGroup{} + if err := p.TopicGroup.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicGroup, err) } return nil } -func (p *CreateTopicResponse) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CreateTopicResponse"); err != nil { +func (p *CreateTopicGroupRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CreateTopicGroupRequest"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -2042,47 +3369,47 @@ func (p *CreateTopicResponse) Write(oprot thrift.TProtocol) error { return nil } -func (p *CreateTopicResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("topicInfo", thrift.STRUCT, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:topicInfo: %s", p, err) +func (p *CreateTopicGroupRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicGroup", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicGroup: %s", p, err) } - if err := p.TopicInfo.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", p.TopicInfo, err) + if err := p.TopicGroup.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicGroup, err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:topicInfo: %s", p, err) + return fmt.Errorf("%T write field end error 1:topicGroup: %s", p, err) } return err } -func (p *CreateTopicResponse) String() string { +func (p *CreateTopicGroupRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("CreateTopicResponse(%+v)", *p) + return fmt.Sprintf("CreateTopicGroupRequest(%+v)", *p) } -type DeleteTopicRequest struct { - TopicTalosResourceName *TopicTalosResourceName `thrift:"topicTalosResourceName,1,required" json:"topicTalosResourceName"` +type CreateTopicGroupResponse struct { + TopicGroup *TopicGroup `thrift:"topicGroup,1,required" json:"topicGroup"` } -func NewDeleteTopicRequest() *DeleteTopicRequest { - return &DeleteTopicRequest{} +func NewCreateTopicGroupResponse() *CreateTopicGroupResponse { + return &CreateTopicGroupResponse{} } -var DeleteTopicRequest_TopicTalosResourceName_DEFAULT *TopicTalosResourceName +var CreateTopicGroupResponse_TopicGroup_DEFAULT *TopicGroup -func (p *DeleteTopicRequest) GetTopicTalosResourceName() *TopicTalosResourceName { - if !p.IsSetTopicTalosResourceName() { - return DeleteTopicRequest_TopicTalosResourceName_DEFAULT +func (p *CreateTopicGroupResponse) GetTopicGroup() *TopicGroup { + if !p.IsSetTopicGroup() { + return CreateTopicGroupResponse_TopicGroup_DEFAULT } - return p.TopicTalosResourceName + return p.TopicGroup } -func (p *DeleteTopicRequest) IsSetTopicTalosResourceName() bool { - return p.TopicTalosResourceName != nil +func (p *CreateTopicGroupResponse) IsSetTopicGroup() bool { + return p.TopicGroup != nil } -func (p *DeleteTopicRequest) Read(iprot thrift.TProtocol) error { +func (p *CreateTopicGroupResponse) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2114,16 +3441,16 @@ func (p *DeleteTopicRequest) Read(iprot thrift.TProtocol) error { return nil } -func (p *DeleteTopicRequest) ReadField1(iprot thrift.TProtocol) error { - p.TopicTalosResourceName = &TopicTalosResourceName{} - if err := p.TopicTalosResourceName.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.TopicTalosResourceName, err) +func (p *CreateTopicGroupResponse) ReadField1(iprot thrift.TProtocol) error { + p.TopicGroup = &TopicGroup{} + if err := p.TopicGroup.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicGroup, err) } return nil } -func (p *DeleteTopicRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("DeleteTopicRequest"); err != nil { +func (p *CreateTopicGroupResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CreateTopicGroupResponse"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -2138,61 +3465,135 @@ func (p *DeleteTopicRequest) Write(oprot thrift.TProtocol) error { return nil } -func (p *DeleteTopicRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("topicTalosResourceName", thrift.STRUCT, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:topicTalosResourceName: %s", p, err) +func (p *CreateTopicGroupResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicGroup", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicGroup: %s", p, err) } - if err := p.TopicTalosResourceName.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", p.TopicTalosResourceName, err) + if err := p.TopicGroup.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicGroup, err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:topicTalosResourceName: %s", p, err) + return fmt.Errorf("%T write field end error 1:topicGroup: %s", p, err) } return err } -func (p *DeleteTopicRequest) String() string { +func (p *CreateTopicGroupResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("DeleteTopicRequest(%+v)", *p) + return fmt.Sprintf("CreateTopicGroupResponse(%+v)", *p) } -type ChangeTopicAttributeRequest struct { - TopicTalosResourceName *TopicTalosResourceName `thrift:"topicTalosResourceName,1,required" json:"topicTalosResourceName"` - TopicAttribute *TopicAttribute `thrift:"topicAttribute,2,required" json:"topicAttribute"` +type DescribeTopicGroupRequest struct { + TopicGroupName string `thrift:"topicGroupName,1,required" json:"topicGroupName"` } -func NewChangeTopicAttributeRequest() *ChangeTopicAttributeRequest { - return &ChangeTopicAttributeRequest{} +func NewDescribeTopicGroupRequest() *DescribeTopicGroupRequest { + return &DescribeTopicGroupRequest{} } -var ChangeTopicAttributeRequest_TopicTalosResourceName_DEFAULT *TopicTalosResourceName +func (p *DescribeTopicGroupRequest) GetTopicGroupName() string { + return p.TopicGroupName +} +func (p *DescribeTopicGroupRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} -func (p *ChangeTopicAttributeRequest) GetTopicTalosResourceName() *TopicTalosResourceName { - if !p.IsSetTopicTalosResourceName() { - return ChangeTopicAttributeRequest_TopicTalosResourceName_DEFAULT +func (p *DescribeTopicGroupRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 1: %s", err) + } else { + p.TopicGroupName = v } - return p.TopicTalosResourceName + return nil } -var ChangeTopicAttributeRequest_TopicAttribute_DEFAULT *TopicAttribute +func (p *DescribeTopicGroupRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("DescribeTopicGroupRequest"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} -func (p *ChangeTopicAttributeRequest) GetTopicAttribute() *TopicAttribute { - if !p.IsSetTopicAttribute() { - return ChangeTopicAttributeRequest_TopicAttribute_DEFAULT +func (p *DescribeTopicGroupRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicGroupName", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicGroupName: %s", p, err) } - return p.TopicAttribute + if err := oprot.WriteString(string(p.TopicGroupName)); err != nil { + return fmt.Errorf("%T.topicGroupName (1) field write error: %s", p, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicGroupName: %s", p, err) + } + return err } -func (p *ChangeTopicAttributeRequest) IsSetTopicTalosResourceName() bool { - return p.TopicTalosResourceName != nil + +func (p *DescribeTopicGroupRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DescribeTopicGroupRequest(%+v)", *p) } -func (p *ChangeTopicAttributeRequest) IsSetTopicAttribute() bool { - return p.TopicAttribute != nil +type DescribeTopicGroupResponse struct { + TopicGroup *TopicGroup `thrift:"topicGroup,1,required" json:"topicGroup"` } -func (p *ChangeTopicAttributeRequest) Read(iprot thrift.TProtocol) error { +func NewDescribeTopicGroupResponse() *DescribeTopicGroupResponse { + return &DescribeTopicGroupResponse{} +} + +var DescribeTopicGroupResponse_TopicGroup_DEFAULT *TopicGroup + +func (p *DescribeTopicGroupResponse) GetTopicGroup() *TopicGroup { + if !p.IsSetTopicGroup() { + return DescribeTopicGroupResponse_TopicGroup_DEFAULT + } + return p.TopicGroup +} +func (p *DescribeTopicGroupResponse) IsSetTopicGroup() bool { + return p.TopicGroup != nil +} + +func (p *DescribeTopicGroupResponse) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2209,10 +3610,6 @@ func (p *ChangeTopicAttributeRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField1(iprot); err != nil { return err } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -2228,32 +3625,21 @@ func (p *ChangeTopicAttributeRequest) Read(iprot thrift.TProtocol) error { return nil } -func (p *ChangeTopicAttributeRequest) ReadField1(iprot thrift.TProtocol) error { - p.TopicTalosResourceName = &TopicTalosResourceName{} - if err := p.TopicTalosResourceName.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.TopicTalosResourceName, err) - } - return nil -} - -func (p *ChangeTopicAttributeRequest) ReadField2(iprot thrift.TProtocol) error { - p.TopicAttribute = &TopicAttribute{} - if err := p.TopicAttribute.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.TopicAttribute, err) +func (p *DescribeTopicGroupResponse) ReadField1(iprot thrift.TProtocol) error { + p.TopicGroup = &TopicGroup{} + if err := p.TopicGroup.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicGroup, err) } return nil } -func (p *ChangeTopicAttributeRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("ChangeTopicAttributeRequest"); err != nil { +func (p *DescribeTopicGroupResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("DescribeTopicGroupResponse"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { - return err - } if err := oprot.WriteFieldStop(); err != nil { return fmt.Errorf("write field stop error: %s", err) } @@ -2263,51 +3649,38 @@ func (p *ChangeTopicAttributeRequest) Write(oprot thrift.TProtocol) error { return nil } -func (p *ChangeTopicAttributeRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("topicTalosResourceName", thrift.STRUCT, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:topicTalosResourceName: %s", p, err) - } - if err := p.TopicTalosResourceName.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", p.TopicTalosResourceName, err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:topicTalosResourceName: %s", p, err) - } - return err -} - -func (p *ChangeTopicAttributeRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("topicAttribute", thrift.STRUCT, 2); err != nil { - return fmt.Errorf("%T write field begin error 2:topicAttribute: %s", p, err) +func (p *DescribeTopicGroupResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicGroup", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicGroup: %s", p, err) } - if err := p.TopicAttribute.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", p.TopicAttribute, err) + if err := p.TopicGroup.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicGroup, err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 2:topicAttribute: %s", p, err) + return fmt.Errorf("%T write field end error 1:topicGroup: %s", p, err) } return err } -func (p *ChangeTopicAttributeRequest) String() string { +func (p *DescribeTopicGroupResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("ChangeTopicAttributeRequest(%+v)", *p) + return fmt.Sprintf("DescribeTopicGroupResponse(%+v)", *p) } -type DescribeTopicRequest struct { - TopicName string `thrift:"topicName,1,required" json:"topicName"` +type DeleteTopicGroupRequest struct { + TopicGroupName string `thrift:"topicGroupName,1,required" json:"topicGroupName"` } -func NewDescribeTopicRequest() *DescribeTopicRequest { - return &DescribeTopicRequest{} +func NewDeleteTopicGroupRequest() *DeleteTopicGroupRequest { + return &DeleteTopicGroupRequest{} } -func (p *DescribeTopicRequest) GetTopicName() string { - return p.TopicName +func (p *DeleteTopicGroupRequest) GetTopicGroupName() string { + return p.TopicGroupName } -func (p *DescribeTopicRequest) Read(iprot thrift.TProtocol) error { +func (p *DeleteTopicGroupRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2339,17 +3712,17 @@ func (p *DescribeTopicRequest) Read(iprot thrift.TProtocol) error { return nil } -func (p *DescribeTopicRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *DeleteTopicGroupRequest) ReadField1(iprot thrift.TProtocol) error { if v, err := iprot.ReadString(); err != nil { return fmt.Errorf("error reading field 1: %s", err) } else { - p.TopicName = v + p.TopicGroupName = v } return nil } -func (p *DescribeTopicRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("DescribeTopicRequest"); err != nil { +func (p *DeleteTopicGroupRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("DeleteTopicGroupRequest"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -2364,38 +3737,38 @@ func (p *DescribeTopicRequest) Write(oprot thrift.TProtocol) error { return nil } -func (p *DescribeTopicRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("topicName", thrift.STRING, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:topicName: %s", p, err) +func (p *DeleteTopicGroupRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicGroupName", thrift.STRING, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicGroupName: %s", p, err) } - if err := oprot.WriteString(string(p.TopicName)); err != nil { - return fmt.Errorf("%T.topicName (1) field write error: %s", p, err) + if err := oprot.WriteString(string(p.TopicGroupName)); err != nil { + return fmt.Errorf("%T.topicGroupName (1) field write error: %s", p, err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:topicName: %s", p, err) + return fmt.Errorf("%T write field end error 1:topicGroupName: %s", p, err) } return err } -func (p *DescribeTopicRequest) String() string { +func (p *DeleteTopicGroupRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("DescribeTopicRequest(%+v)", *p) + return fmt.Sprintf("DeleteTopicGroupRequest(%+v)", *p) } -type GetDescribeInfoRequest struct { - TopicName string `thrift:"topicName,1,required" json:"topicName"` +type ListTopicGroupRequest struct { + OrgList []string `thrift:"orgList,1,required" json:"orgList"` } -func NewGetDescribeInfoRequest() *GetDescribeInfoRequest { - return &GetDescribeInfoRequest{} +func NewListTopicGroupRequest() *ListTopicGroupRequest { + return &ListTopicGroupRequest{} } -func (p *GetDescribeInfoRequest) GetTopicName() string { - return p.TopicName +func (p *ListTopicGroupRequest) GetOrgList() []string { + return p.OrgList } -func (p *GetDescribeInfoRequest) Read(iprot thrift.TProtocol) error { +func (p *ListTopicGroupRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2427,17 +3800,30 @@ func (p *GetDescribeInfoRequest) Read(iprot thrift.TProtocol) error { return nil } -func (p *GetDescribeInfoRequest) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return fmt.Errorf("error reading field 1: %s", err) - } else { - p.TopicName = v +func (p *ListTopicGroupRequest) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return fmt.Errorf("error reading list begin: %s", err) + } + tSlice := make([]string, 0, size) + p.OrgList = tSlice + for i := 0; i < size; i++ { + var _elem9 string + if v, err := iprot.ReadString(); err != nil { + return fmt.Errorf("error reading field 0: %s", err) + } else { + _elem9 = v + } + p.OrgList = append(p.OrgList, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return fmt.Errorf("error reading list end: %s", err) } return nil } -func (p *GetDescribeInfoRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetDescribeInfoRequest"); err != nil { +func (p *ListTopicGroupRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ListTopicGroupRequest"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { @@ -2452,57 +3838,46 @@ func (p *GetDescribeInfoRequest) Write(oprot thrift.TProtocol) error { return nil } -func (p *GetDescribeInfoRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("topicName", thrift.STRING, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:topicName: %s", p, err) +func (p *ListTopicGroupRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("orgList", thrift.LIST, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:orgList: %s", p, err) } - if err := oprot.WriteString(string(p.TopicName)); err != nil { - return fmt.Errorf("%T.topicName (1) field write error: %s", p, err) + if err := oprot.WriteListBegin(thrift.STRING, len(p.OrgList)); err != nil { + return fmt.Errorf("error writing list begin: %s", err) + } + for _, v := range p.OrgList { + if err := oprot.WriteString(string(v)); err != nil { + return fmt.Errorf("%T. (0) field write error: %s", p, err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return fmt.Errorf("error writing list end: %s", err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:topicName: %s", p, err) + return fmt.Errorf("%T write field end error 1:orgList: %s", p, err) } return err } -func (p *GetDescribeInfoRequest) String() string { +func (p *ListTopicGroupRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDescribeInfoRequest(%+v)", *p) -} - -type AddSubResourceNameRequest struct { - TopicTalosResourceName *TopicTalosResourceName `thrift:"topicTalosResourceName,1,required" json:"topicTalosResourceName"` - OrgId string `thrift:"orgId,2,required" json:"orgId"` - AdminTeamId string `thrift:"adminTeamId,3,required" json:"adminTeamId"` + return fmt.Sprintf("ListTopicGroupRequest(%+v)", *p) } -func NewAddSubResourceNameRequest() *AddSubResourceNameRequest { - return &AddSubResourceNameRequest{} -} - -var AddSubResourceNameRequest_TopicTalosResourceName_DEFAULT *TopicTalosResourceName - -func (p *AddSubResourceNameRequest) GetTopicTalosResourceName() *TopicTalosResourceName { - if !p.IsSetTopicTalosResourceName() { - return AddSubResourceNameRequest_TopicTalosResourceName_DEFAULT - } - return p.TopicTalosResourceName +type ListTopicGroupResponse struct { + TopicGroupList []*TopicGroup `thrift:"topicGroupList,1,required" json:"topicGroupList"` } -func (p *AddSubResourceNameRequest) GetOrgId() string { - return p.OrgId +func NewListTopicGroupResponse() *ListTopicGroupResponse { + return &ListTopicGroupResponse{} } -func (p *AddSubResourceNameRequest) GetAdminTeamId() string { - return p.AdminTeamId -} -func (p *AddSubResourceNameRequest) IsSetTopicTalosResourceName() bool { - return p.TopicTalosResourceName != nil +func (p *ListTopicGroupResponse) GetTopicGroupList() []*TopicGroup { + return p.TopicGroupList } - -func (p *AddSubResourceNameRequest) Read(iprot thrift.TProtocol) error { +func (p *ListTopicGroupResponse) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return fmt.Errorf("%T read error: %s", p, err) } @@ -2519,14 +3894,6 @@ func (p *AddSubResourceNameRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField1(iprot); err != nil { return err } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -2542,45 +3909,33 @@ func (p *AddSubResourceNameRequest) Read(iprot thrift.TProtocol) error { return nil } -func (p *AddSubResourceNameRequest) ReadField1(iprot thrift.TProtocol) error { - p.TopicTalosResourceName = &TopicTalosResourceName{} - if err := p.TopicTalosResourceName.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", p.TopicTalosResourceName, err) +func (p *ListTopicGroupResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return fmt.Errorf("error reading list begin: %s", err) } - return nil -} - -func (p *AddSubResourceNameRequest) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return fmt.Errorf("error reading field 2: %s", err) - } else { - p.OrgId = v + tSlice := make([]*TopicGroup, 0, size) + p.TopicGroupList = tSlice + for i := 0; i < size; i++ { + _elem10 := &TopicGroup{} + if err := _elem10.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _elem10, err) + } + p.TopicGroupList = append(p.TopicGroupList, _elem10) } - return nil -} - -func (p *AddSubResourceNameRequest) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return fmt.Errorf("error reading field 3: %s", err) - } else { - p.AdminTeamId = v + if err := iprot.ReadListEnd(); err != nil { + return fmt.Errorf("error reading list end: %s", err) } return nil } -func (p *AddSubResourceNameRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("AddSubResourceNameRequest"); err != nil { +func (p *ListTopicGroupResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ListTopicGroupResponse"); err != nil { return fmt.Errorf("%T write struct begin error: %s", p, err) } if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { - return err - } - if err := p.writeField3(oprot); err != nil { - return err - } if err := oprot.WriteFieldStop(); err != nil { return fmt.Errorf("write field stop error: %s", err) } @@ -2590,50 +3945,32 @@ func (p *AddSubResourceNameRequest) Write(oprot thrift.TProtocol) error { return nil } -func (p *AddSubResourceNameRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("topicTalosResourceName", thrift.STRUCT, 1); err != nil { - return fmt.Errorf("%T write field begin error 1:topicTalosResourceName: %s", p, err) - } - if err := p.TopicTalosResourceName.Write(oprot); err != nil { - return fmt.Errorf("%T error writing struct: %s", p.TopicTalosResourceName, err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 1:topicTalosResourceName: %s", p, err) - } - return err -} - -func (p *AddSubResourceNameRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("orgId", thrift.STRING, 2); err != nil { - return fmt.Errorf("%T write field begin error 2:orgId: %s", p, err) - } - if err := oprot.WriteString(string(p.OrgId)); err != nil { - return fmt.Errorf("%T.orgId (2) field write error: %s", p, err) +func (p *ListTopicGroupResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicGroupList", thrift.LIST, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicGroupList: %s", p, err) } - if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 2:orgId: %s", p, err) + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TopicGroupList)); err != nil { + return fmt.Errorf("error writing list begin: %s", err) } - return err -} - -func (p *AddSubResourceNameRequest) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("adminTeamId", thrift.STRING, 3); err != nil { - return fmt.Errorf("%T write field begin error 3:adminTeamId: %s", p, err) + for _, v := range p.TopicGroupList { + if err := v.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", v, err) + } } - if err := oprot.WriteString(string(p.AdminTeamId)); err != nil { - return fmt.Errorf("%T.adminTeamId (3) field write error: %s", p, err) + if err := oprot.WriteListEnd(); err != nil { + return fmt.Errorf("error writing list end: %s", err) } if err := oprot.WriteFieldEnd(); err != nil { - return fmt.Errorf("%T write field end error 3:adminTeamId: %s", p, err) + return fmt.Errorf("%T write field end error 1:topicGroupList: %s", p, err) } return err } -func (p *AddSubResourceNameRequest) String() string { +func (p *ListTopicGroupResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("AddSubResourceNameRequest(%+v)", *p) + return fmt.Sprintf("ListTopicGroupResponse(%+v)", *p) } type DescribeTopicResponse struct { @@ -2791,19 +4128,19 @@ func (p *DescribeTopicResponse) ReadField5(iprot thrift.TProtocol) error { tMap := make(map[string]int32, size) p.AclMap = tMap for i := 0; i < size; i++ { - var _key7 string + var _key11 string if v, err := iprot.ReadString(); err != nil { return fmt.Errorf("error reading field 0: %s", err) } else { - _key7 = v + _key11 = v } - var _val8 int32 + var _val12 int32 if v, err := iprot.ReadI32(); err != nil { return fmt.Errorf("error reading field 0: %s", err) } else { - _val8 = v + _val12 = v } - p.AclMap[_key7] = _val8 + p.AclMap[_key11] = _val12 } if err := iprot.ReadMapEnd(); err != nil { return fmt.Errorf("error reading map end: %s", err) @@ -3052,6 +4389,144 @@ func (p *GetDescribeInfoResponse) String() string { return fmt.Sprintf("GetDescribeInfoResponse(%+v)", *p) } +type GetTopicAttributeResponse struct { + TopicTalosResourceName *TopicTalosResourceName `thrift:"topicTalosResourceName,1,required" json:"topicTalosResourceName"` + TopicAttribute *TopicAttribute `thrift:"topicAttribute,2,required" json:"topicAttribute"` +} + +func NewGetTopicAttributeResponse() *GetTopicAttributeResponse { + return &GetTopicAttributeResponse{} +} + +var GetTopicAttributeResponse_TopicTalosResourceName_DEFAULT *TopicTalosResourceName + +func (p *GetTopicAttributeResponse) GetTopicTalosResourceName() *TopicTalosResourceName { + if !p.IsSetTopicTalosResourceName() { + return GetTopicAttributeResponse_TopicTalosResourceName_DEFAULT + } + return p.TopicTalosResourceName +} + +var GetTopicAttributeResponse_TopicAttribute_DEFAULT *TopicAttribute + +func (p *GetTopicAttributeResponse) GetTopicAttribute() *TopicAttribute { + if !p.IsSetTopicAttribute() { + return GetTopicAttributeResponse_TopicAttribute_DEFAULT + } + return p.TopicAttribute +} +func (p *GetTopicAttributeResponse) IsSetTopicTalosResourceName() bool { + return p.TopicTalosResourceName != nil +} + +func (p *GetTopicAttributeResponse) IsSetTopicAttribute() bool { + return p.TopicAttribute != nil +} + +func (p *GetTopicAttributeResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return fmt.Errorf("%T read error: %s", p, err) + } + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return fmt.Errorf("%T field %d read error: %s", p, fieldId, err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return fmt.Errorf("%T read struct end error: %s", p, err) + } + return nil +} + +func (p *GetTopicAttributeResponse) ReadField1(iprot thrift.TProtocol) error { + p.TopicTalosResourceName = &TopicTalosResourceName{} + if err := p.TopicTalosResourceName.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicTalosResourceName, err) + } + return nil +} + +func (p *GetTopicAttributeResponse) ReadField2(iprot thrift.TProtocol) error { + p.TopicAttribute = &TopicAttribute{} + if err := p.TopicAttribute.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", p.TopicAttribute, err) + } + return nil +} + +func (p *GetTopicAttributeResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetTopicAttributeResponse"); err != nil { + return fmt.Errorf("%T write struct begin error: %s", p, err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return fmt.Errorf("write field stop error: %s", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return fmt.Errorf("write struct stop error: %s", err) + } + return nil +} + +func (p *GetTopicAttributeResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicTalosResourceName", thrift.STRUCT, 1); err != nil { + return fmt.Errorf("%T write field begin error 1:topicTalosResourceName: %s", p, err) + } + if err := p.TopicTalosResourceName.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicTalosResourceName, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 1:topicTalosResourceName: %s", p, err) + } + return err +} + +func (p *GetTopicAttributeResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("topicAttribute", thrift.STRUCT, 2); err != nil { + return fmt.Errorf("%T write field begin error 2:topicAttribute: %s", p, err) + } + if err := p.TopicAttribute.Write(oprot); err != nil { + return fmt.Errorf("%T error writing struct: %s", p.TopicAttribute, err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return fmt.Errorf("%T write field end error 2:topicAttribute: %s", p, err) + } + return err +} + +func (p *GetTopicAttributeResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTopicAttributeResponse(%+v)", *p) +} + type ListTopicsResponse struct { TopicInfos []*TopicInfo `thrift:"topicInfos,1,required" json:"topicInfos"` } @@ -3103,11 +4578,11 @@ func (p *ListTopicsResponse) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*TopicInfo, 0, size) p.TopicInfos = tSlice for i := 0; i < size; i++ { - _elem9 := &TopicInfo{} - if err := _elem9.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", _elem9, err) + _elem13 := &TopicInfo{} + if err := _elem13.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _elem13, err) } - p.TopicInfos = append(p.TopicInfos, _elem9) + p.TopicInfos = append(p.TopicInfos, _elem13) } if err := iprot.ReadListEnd(); err != nil { return fmt.Errorf("error reading list end: %s", err) @@ -3210,11 +4685,11 @@ func (p *ListTopicsInfoResponse) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*Topic, 0, size) p.TopicList = tSlice for i := 0; i < size; i++ { - _elem10 := &Topic{} - if err := _elem10.Read(iprot); err != nil { - return fmt.Errorf("%T error reading struct: %s", _elem10, err) + _elem14 := &Topic{} + if err := _elem14.Read(iprot); err != nil { + return fmt.Errorf("%T error reading struct: %s", _elem14, err) } - p.TopicList = append(p.TopicList, _elem10) + p.TopicList = append(p.TopicList, _elem14) } if err := iprot.ReadListEnd(); err != nil { return fmt.Errorf("error reading list end: %s", err) @@ -4150,19 +5625,19 @@ func (p *ListPermissionResponse) ReadField1(iprot thrift.TProtocol) error { tMap := make(map[string]int32, size) p.Permissions = tMap for i := 0; i < size; i++ { - var _key11 string + var _key15 string if v, err := iprot.ReadString(); err != nil { return fmt.Errorf("error reading field 0: %s", err) } else { - _key11 = v + _key15 = v } - var _val12 int32 + var _val16 int32 if v, err := iprot.ReadI32(); err != nil { return fmt.Errorf("error reading field 0: %s", err) } else { - _val12 = v + _val16 = v } - p.Permissions[_key11] = _val12 + p.Permissions[_key15] = _val16 } if err := iprot.ReadMapEnd(); err != nil { return fmt.Errorf("error reading map end: %s", err)