diff --git a/.generated/go/admin/admin.go b/.generated/go/admin/admin.go index f25d0e3..eb978a4 100644 --- a/.generated/go/admin/admin.go +++ b/.generated/go/admin/admin.go @@ -4766,6 +4766,386 @@ func (p *ExtentsUnreachableRequest) String() string { return fmt.Sprintf("ExtentsUnreachableRequest(%+v)", *p) } +// Attributes: +// - ExtentUUID +// - StartTime +// - LastMsgReplicatedTime +// - TotalMsgReplicated +type ReplicatorConnection struct { + ExtentUUID *string `thrift:"extentUUID,1" db:"extentUUID" json:"extentUUID,omitempty"` + StartTime *int64 `thrift:"startTime,2" db:"startTime" json:"startTime,omitempty"` + LastMsgReplicatedTime *int64 `thrift:"lastMsgReplicatedTime,3" db:"lastMsgReplicatedTime" json:"lastMsgReplicatedTime,omitempty"` + TotalMsgReplicated *int32 `thrift:"totalMsgReplicated,4" db:"totalMsgReplicated" json:"totalMsgReplicated,omitempty"` +} + +func NewReplicatorConnection() *ReplicatorConnection { + return &ReplicatorConnection{} +} + +var ReplicatorConnection_ExtentUUID_DEFAULT string +func (p *ReplicatorConnection) GetExtentUUID() string { + if !p.IsSetExtentUUID() { + return ReplicatorConnection_ExtentUUID_DEFAULT + } +return *p.ExtentUUID +} +var ReplicatorConnection_StartTime_DEFAULT int64 +func (p *ReplicatorConnection) GetStartTime() int64 { + if !p.IsSetStartTime() { + return ReplicatorConnection_StartTime_DEFAULT + } +return *p.StartTime +} +var ReplicatorConnection_LastMsgReplicatedTime_DEFAULT int64 +func (p *ReplicatorConnection) GetLastMsgReplicatedTime() int64 { + if !p.IsSetLastMsgReplicatedTime() { + return ReplicatorConnection_LastMsgReplicatedTime_DEFAULT + } +return *p.LastMsgReplicatedTime +} +var ReplicatorConnection_TotalMsgReplicated_DEFAULT int32 +func (p *ReplicatorConnection) GetTotalMsgReplicated() int32 { + if !p.IsSetTotalMsgReplicated() { + return ReplicatorConnection_TotalMsgReplicated_DEFAULT + } +return *p.TotalMsgReplicated +} +func (p *ReplicatorConnection) IsSetExtentUUID() bool { + return p.ExtentUUID != nil +} + +func (p *ReplicatorConnection) IsSetStartTime() bool { + return p.StartTime != nil +} + +func (p *ReplicatorConnection) IsSetLastMsgReplicatedTime() bool { + return p.LastMsgReplicatedTime != nil +} + +func (p *ReplicatorConnection) IsSetTotalMsgReplicated() bool { + return p.TotalMsgReplicated != nil +} + +func (p *ReplicatorConnection) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", 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 thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ReplicatorConnection) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ExtentUUID = &v +} + return nil +} + +func (p *ReplicatorConnection) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ReplicatorConnection) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.LastMsgReplicatedTime = &v +} + return nil +} + +func (p *ReplicatorConnection) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.TotalMsgReplicated = &v +} + return nil +} + +func (p *ReplicatorConnection) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ReplicatorConnection"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + 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 thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ReplicatorConnection) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetExtentUUID() { + if err := oprot.WriteFieldBegin("extentUUID", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:extentUUID: ", p), err) } + if err := oprot.WriteString(string(*p.ExtentUUID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.extentUUID (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:extentUUID: ", p), err) } + } + return err +} + +func (p *ReplicatorConnection) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin("startTime", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:startTime: ", p), err) } + if err := oprot.WriteI64(int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startTime (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:startTime: ", p), err) } + } + return err +} + +func (p *ReplicatorConnection) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetLastMsgReplicatedTime() { + if err := oprot.WriteFieldBegin("lastMsgReplicatedTime", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:lastMsgReplicatedTime: ", p), err) } + if err := oprot.WriteI64(int64(*p.LastMsgReplicatedTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.lastMsgReplicatedTime (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:lastMsgReplicatedTime: ", p), err) } + } + return err +} + +func (p *ReplicatorConnection) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetTotalMsgReplicated() { + if err := oprot.WriteFieldBegin("totalMsgReplicated", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:totalMsgReplicated: ", p), err) } + if err := oprot.WriteI32(int32(*p.TotalMsgReplicated)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.totalMsgReplicated (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:totalMsgReplicated: ", p), err) } + } + return err +} + +func (p *ReplicatorConnection) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicatorConnection(%+v)", *p) +} + +// Attributes: +// - RemoteReplicatorConn +// - StorehostConn +type ReplicatorConnectionStatus struct { + RemoteReplicatorConn []*ReplicatorConnection `thrift:"remoteReplicatorConn,1" db:"remoteReplicatorConn" json:"remoteReplicatorConn,omitempty"` + StorehostConn []*ReplicatorConnection `thrift:"storehostConn,2" db:"storehostConn" json:"storehostConn,omitempty"` +} + +func NewReplicatorConnectionStatus() *ReplicatorConnectionStatus { + return &ReplicatorConnectionStatus{} +} + +var ReplicatorConnectionStatus_RemoteReplicatorConn_DEFAULT []*ReplicatorConnection + +func (p *ReplicatorConnectionStatus) GetRemoteReplicatorConn() []*ReplicatorConnection { + return p.RemoteReplicatorConn +} +var ReplicatorConnectionStatus_StorehostConn_DEFAULT []*ReplicatorConnection + +func (p *ReplicatorConnectionStatus) GetStorehostConn() []*ReplicatorConnection { + return p.StorehostConn +} +func (p *ReplicatorConnectionStatus) IsSetRemoteReplicatorConn() bool { + return p.RemoteReplicatorConn != nil +} + +func (p *ReplicatorConnectionStatus) IsSetStorehostConn() bool { + return p.StorehostConn != nil +} + +func (p *ReplicatorConnectionStatus) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", 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 thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ReplicatorConnectionStatus) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ReplicatorConnection, 0, size) + p.RemoteReplicatorConn = tSlice + for i := 0; i < size; i ++ { + _elem16 := &ReplicatorConnection{} + if err := _elem16.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) + } + p.RemoteReplicatorConn = append(p.RemoteReplicatorConn, _elem16) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ReplicatorConnectionStatus) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ReplicatorConnection, 0, size) + p.StorehostConn = tSlice + for i := 0; i < size; i ++ { + _elem17 := &ReplicatorConnection{} + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + } + p.StorehostConn = append(p.StorehostConn, _elem17) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ReplicatorConnectionStatus) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ReplicatorConnectionStatus"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + 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 thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ReplicatorConnectionStatus) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteReplicatorConn() { + if err := oprot.WriteFieldBegin("remoteReplicatorConn", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:remoteReplicatorConn: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.RemoteReplicatorConn)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.RemoteReplicatorConn { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:remoteReplicatorConn: ", p), err) } + } + return err +} + +func (p *ReplicatorConnectionStatus) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetStorehostConn() { + if err := oprot.WriteFieldBegin("storehostConn", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:storehostConn: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StorehostConn)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StorehostConn { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:storehostConn: ", p), err) } + } + return err +} + +func (p *ReplicatorConnectionStatus) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicatorConnectionStatus(%+v)", *p) +} + type InputHostAdmin interface { // Parameters: // - Request @@ -4857,16 +5237,16 @@ func (p *InputHostAdminClient) recvDestinationsUpdated() (err error) { return } if mTypeId == thrift.EXCEPTION { - error16 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error17 error - error17, err = error16.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 = error17 + err = error19 return } if mTypeId != thrift.REPLY { @@ -4932,16 +5312,16 @@ func (p *InputHostAdminClient) recvUnloadDestinations() (err error) { return } if mTypeId == thrift.EXCEPTION { - error18 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error19 error - error19, err = error18.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 = error19 + err = error21 return } if mTypeId != thrift.REPLY { @@ -5004,16 +5384,16 @@ func (p *InputHostAdminClient) recvListLoadedDestinations() (value *ListLoadedDe return } if mTypeId == thrift.EXCEPTION { - error20 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error21 error - error21, err = error20.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 = error21 + err = error23 return } if mTypeId != thrift.REPLY { @@ -5080,16 +5460,16 @@ func (p *InputHostAdminClient) recvReadDestState() (value *ReadDestinationStateR return } if mTypeId == thrift.EXCEPTION { - error22 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error23 error - error23, err = error22.Read(iprot) + 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 = error23 + err = error25 return } if mTypeId != thrift.REPLY { @@ -5156,16 +5536,16 @@ func (p *InputHostAdminClient) recvDrainExtent() (err error) { return } if mTypeId == thrift.EXCEPTION { - error24 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error25 error - error25, err = error24.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 = error25 + err = error27 return } if mTypeId != thrift.REPLY { @@ -5207,13 +5587,13 @@ func (p *InputHostAdminProcessor) ProcessorMap() map[string]thrift.TProcessorFun func NewInputHostAdminProcessor(handler InputHostAdmin) *InputHostAdminProcessor { - self26 := &InputHostAdminProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self26.processorMap["destinationsUpdated"] = &inputHostAdminProcessorDestinationsUpdated{handler:handler} - self26.processorMap["unloadDestinations"] = &inputHostAdminProcessorUnloadDestinations{handler:handler} - self26.processorMap["listLoadedDestinations"] = &inputHostAdminProcessorListLoadedDestinations{handler:handler} - self26.processorMap["readDestState"] = &inputHostAdminProcessorReadDestState{handler:handler} - self26.processorMap["drainExtent"] = &inputHostAdminProcessorDrainExtent{handler:handler} -return self26 + self28 := &InputHostAdminProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self28.processorMap["destinationsUpdated"] = &inputHostAdminProcessorDestinationsUpdated{handler:handler} + self28.processorMap["unloadDestinations"] = &inputHostAdminProcessorUnloadDestinations{handler:handler} + self28.processorMap["listLoadedDestinations"] = &inputHostAdminProcessorListLoadedDestinations{handler:handler} + self28.processorMap["readDestState"] = &inputHostAdminProcessorReadDestState{handler:handler} + self28.processorMap["drainExtent"] = &inputHostAdminProcessorDrainExtent{handler:handler} +return self28 } func (p *InputHostAdminProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -5224,12 +5604,12 @@ func (p *InputHostAdminProcessor) Process(iprot, oprot thrift.TProtocol) (succes } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x27 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + x29 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x27.Write(oprot) + x29.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() - return false, x27 + return false, x29 } @@ -6364,16 +6744,16 @@ func (p *OutputHostAdminClient) recvConsumerGroupsUpdated() (err error) { return } if mTypeId == thrift.EXCEPTION { - error52 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error53 error - error53, err = error52.Read(iprot) + error54 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error55 error + error55, err = error54.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error53 + err = error55 return } if mTypeId != thrift.REPLY { @@ -6439,16 +6819,16 @@ func (p *OutputHostAdminClient) recvUnloadConsumerGroups() (err error) { return } if mTypeId == thrift.EXCEPTION { - error54 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error55 error - error55, err = error54.Read(iprot) + error56 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error57 error + error57, err = error56.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error55 + err = error57 return } if mTypeId != thrift.REPLY { @@ -6514,16 +6894,16 @@ func (p *OutputHostAdminClient) recvReadCgState() (value *ReadConsumerGroupState return } if mTypeId == thrift.EXCEPTION { - error56 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error57 error - error57, err = error56.Read(iprot) + error58 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error59 error + error59, err = error58.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error57 + err = error59 return } if mTypeId != thrift.REPLY { @@ -6587,16 +6967,16 @@ func (p *OutputHostAdminClient) recvListLoadedConsumerGroups() (value *ListConsu return } if mTypeId == thrift.EXCEPTION { - error58 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error59 error - error59, err = error58.Read(iprot) + error60 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error61 error + error61, err = error60.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error59 + err = error61 return } if mTypeId != thrift.REPLY { @@ -6635,12 +7015,12 @@ func (p *OutputHostAdminProcessor) ProcessorMap() map[string]thrift.TProcessorFu func NewOutputHostAdminProcessor(handler OutputHostAdmin) *OutputHostAdminProcessor { - self60 := &OutputHostAdminProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self60.processorMap["consumerGroupsUpdated"] = &outputHostAdminProcessorConsumerGroupsUpdated{handler:handler} - self60.processorMap["unloadConsumerGroups"] = &outputHostAdminProcessorUnloadConsumerGroups{handler:handler} - self60.processorMap["readCgState"] = &outputHostAdminProcessorReadCgState{handler:handler} - self60.processorMap["listLoadedConsumerGroups"] = &outputHostAdminProcessorListLoadedConsumerGroups{handler:handler} -return self60 + self62 := &OutputHostAdminProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self62.processorMap["consumerGroupsUpdated"] = &outputHostAdminProcessorConsumerGroupsUpdated{handler:handler} + self62.processorMap["unloadConsumerGroups"] = &outputHostAdminProcessorUnloadConsumerGroups{handler:handler} + self62.processorMap["readCgState"] = &outputHostAdminProcessorReadCgState{handler:handler} + self62.processorMap["listLoadedConsumerGroups"] = &outputHostAdminProcessorListLoadedConsumerGroups{handler:handler} +return self62 } func (p *OutputHostAdminProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -6651,12 +7031,12 @@ func (p *OutputHostAdminProcessor) Process(iprot, oprot thrift.TProtocol) (succe } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x61 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + x63 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x61.Write(oprot) + x63.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() - return false, x61 + return false, x63 } @@ -7200,7 +7580,163 @@ func (p *OutputHostAdminReadCgStateArgs) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("readCgState_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *OutputHostAdminReadCgStateArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) } + if err := p.Request.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) } + return err +} + +func (p *OutputHostAdminReadCgStateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("OutputHostAdminReadCgStateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type OutputHostAdminReadCgStateResult struct { + Success *ReadConsumerGroupStateResult_ `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewOutputHostAdminReadCgStateResult() *OutputHostAdminReadCgStateResult { + return &OutputHostAdminReadCgStateResult{} +} + +var OutputHostAdminReadCgStateResult_Success_DEFAULT *ReadConsumerGroupStateResult_ +func (p *OutputHostAdminReadCgStateResult) GetSuccess() *ReadConsumerGroupStateResult_ { + if !p.IsSetSuccess() { + return OutputHostAdminReadCgStateResult_Success_DEFAULT + } +return p.Success +} +func (p *OutputHostAdminReadCgStateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *OutputHostAdminReadCgStateResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", 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 thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *OutputHostAdminReadCgStateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ReadConsumerGroupStateResult_{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *OutputHostAdminReadCgStateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("readCgState_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *OutputHostAdminReadCgStateResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *OutputHostAdminReadCgStateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("OutputHostAdminReadCgStateResult(%+v)", *p) +} + +type OutputHostAdminListLoadedConsumerGroupsArgs struct { +} + +func NewOutputHostAdminListLoadedConsumerGroupsArgs() *OutputHostAdminListLoadedConsumerGroupsArgs { + return &OutputHostAdminListLoadedConsumerGroupsArgs{} +} + +func (p *OutputHostAdminListLoadedConsumerGroupsArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *OutputHostAdminListLoadedConsumerGroupsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("listLoadedConsumerGroups_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -7209,46 +7745,35 @@ func (p *OutputHostAdminReadCgStateArgs) Write(oprot thrift.TProtocol) error { return nil } -func (p *OutputHostAdminReadCgStateArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) } - if err := p.Request.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) } - return err -} - -func (p *OutputHostAdminReadCgStateArgs) String() string { +func (p *OutputHostAdminListLoadedConsumerGroupsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("OutputHostAdminReadCgStateArgs(%+v)", *p) + return fmt.Sprintf("OutputHostAdminListLoadedConsumerGroupsArgs(%+v)", *p) } // Attributes: // - Success -type OutputHostAdminReadCgStateResult struct { - Success *ReadConsumerGroupStateResult_ `thrift:"success,0" db:"success" json:"success,omitempty"` +type OutputHostAdminListLoadedConsumerGroupsResult struct { + Success *ListConsumerGroupsResult_ `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewOutputHostAdminReadCgStateResult() *OutputHostAdminReadCgStateResult { - return &OutputHostAdminReadCgStateResult{} +func NewOutputHostAdminListLoadedConsumerGroupsResult() *OutputHostAdminListLoadedConsumerGroupsResult { + return &OutputHostAdminListLoadedConsumerGroupsResult{} } -var OutputHostAdminReadCgStateResult_Success_DEFAULT *ReadConsumerGroupStateResult_ -func (p *OutputHostAdminReadCgStateResult) GetSuccess() *ReadConsumerGroupStateResult_ { +var OutputHostAdminListLoadedConsumerGroupsResult_Success_DEFAULT *ListConsumerGroupsResult_ +func (p *OutputHostAdminListLoadedConsumerGroupsResult) GetSuccess() *ListConsumerGroupsResult_ { if !p.IsSetSuccess() { - return OutputHostAdminReadCgStateResult_Success_DEFAULT + return OutputHostAdminListLoadedConsumerGroupsResult_Success_DEFAULT } return p.Success } -func (p *OutputHostAdminReadCgStateResult) IsSetSuccess() bool { +func (p *OutputHostAdminListLoadedConsumerGroupsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *OutputHostAdminReadCgStateResult) Read(iprot thrift.TProtocol) error { +func (p *OutputHostAdminListLoadedConsumerGroupsResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -7280,16 +7805,16 @@ func (p *OutputHostAdminReadCgStateResult) Read(iprot thrift.TProtocol) error { return nil } -func (p *OutputHostAdminReadCgStateResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &ReadConsumerGroupStateResult_{} +func (p *OutputHostAdminListLoadedConsumerGroupsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ListConsumerGroupsResult_{} if err := p.Success.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) } return nil } -func (p *OutputHostAdminReadCgStateResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("readCgState_result"); err != nil { +func (p *OutputHostAdminListLoadedConsumerGroupsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("listLoadedConsumerGroups_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { if err := p.writeField0(oprot); err != nil { return err } @@ -7301,7 +7826,7 @@ func (p *OutputHostAdminReadCgStateResult) Write(oprot thrift.TProtocol) error { return nil } -func (p *OutputHostAdminReadCgStateResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *OutputHostAdminListLoadedConsumerGroupsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } @@ -7314,21 +7839,234 @@ func (p *OutputHostAdminReadCgStateResult) writeField0(oprot thrift.TProtocol) ( return err } -func (p *OutputHostAdminReadCgStateResult) String() string { +func (p *OutputHostAdminListLoadedConsumerGroupsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("OutputHostAdminReadCgStateResult(%+v)", *p) + return fmt.Sprintf("OutputHostAdminListLoadedConsumerGroupsResult(%+v)", *p) } -type OutputHostAdminListLoadedConsumerGroupsArgs struct { + +type ControllerHostAdmin interface { + // Parameters: + // - Request + ExtentsUnreachable(request *ExtentsUnreachableRequest) (err error) +} + +type ControllerHostAdminClient struct { + Transport thrift.TTransport + ProtocolFactory thrift.TProtocolFactory + InputProtocol thrift.TProtocol + OutputProtocol thrift.TProtocol + SeqId int32 +} + +func NewControllerHostAdminClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ControllerHostAdminClient { + return &ControllerHostAdminClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewControllerHostAdminClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ControllerHostAdminClient { + return &ControllerHostAdminClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +// Parameters: +// - Request +func (p *ControllerHostAdminClient) ExtentsUnreachable(request *ExtentsUnreachableRequest) (err error) { + if err = p.sendExtentsUnreachable(request); err != nil { return } + return p.recvExtentsUnreachable() +} + +func (p *ControllerHostAdminClient) sendExtentsUnreachable(request *ExtentsUnreachableRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("extentsUnreachable", thrift.CALL, p.SeqId); err != nil { + return + } + args := ControllerHostAdminExtentsUnreachableArgs{ + Request : request, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *ControllerHostAdminClient) recvExtentsUnreachable() (err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "extentsUnreachable" { + err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "extentsUnreachable failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "extentsUnreachable failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error82 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error83 error + error83, err = error82.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error83 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "extentsUnreachable failed: invalid message type") + return + } + result := ControllerHostAdminExtentsUnreachableResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + return +} + + +type ControllerHostAdminProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler ControllerHostAdmin +} + +func (p *ControllerHostAdminProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *ControllerHostAdminProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *ControllerHostAdminProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewControllerHostAdminProcessor(handler ControllerHostAdmin) *ControllerHostAdminProcessor { + + self84 := &ControllerHostAdminProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self84.processorMap["extentsUnreachable"] = &controllerHostAdminProcessorExtentsUnreachable{handler:handler} +return self84 +} + +func (p *ControllerHostAdminProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { return false, err } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x85 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x85.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, x85 + +} + +type controllerHostAdminProcessorExtentsUnreachable struct { + handler ControllerHostAdmin +} + +func (p *controllerHostAdminProcessorExtentsUnreachable) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ControllerHostAdminExtentsUnreachableArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("extentsUnreachable", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := ControllerHostAdminExtentsUnreachableResult{} + var err2 error + if err2 = p.handler.ExtentsUnreachable(args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing extentsUnreachable: " + err2.Error()) + oprot.WriteMessageBegin("extentsUnreachable", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } + if err2 = oprot.WriteMessageBegin("extentsUnreachable", 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 + +// Attributes: +// - Request +type ControllerHostAdminExtentsUnreachableArgs struct { + Request *ExtentsUnreachableRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewControllerHostAdminExtentsUnreachableArgs() *ControllerHostAdminExtentsUnreachableArgs { + return &ControllerHostAdminExtentsUnreachableArgs{} +} + +var ControllerHostAdminExtentsUnreachableArgs_Request_DEFAULT *ExtentsUnreachableRequest +func (p *ControllerHostAdminExtentsUnreachableArgs) GetRequest() *ExtentsUnreachableRequest { + if !p.IsSetRequest() { + return ControllerHostAdminExtentsUnreachableArgs_Request_DEFAULT + } +return p.Request } - -func NewOutputHostAdminListLoadedConsumerGroupsArgs() *OutputHostAdminListLoadedConsumerGroupsArgs { - return &OutputHostAdminListLoadedConsumerGroupsArgs{} +func (p *ControllerHostAdminExtentsUnreachableArgs) IsSetRequest() bool { + return p.Request != nil } -func (p *OutputHostAdminListLoadedConsumerGroupsArgs) Read(iprot thrift.TProtocol) error { +func (p *ControllerHostAdminExtentsUnreachableArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -7340,8 +8078,15 @@ func (p *OutputHostAdminListLoadedConsumerGroupsArgs) Read(iprot thrift.TProtoco return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } if fieldTypeId == thrift.STOP { break; } - if err := iprot.Skip(fieldTypeId); err != nil { - return err + 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 @@ -7353,10 +8098,19 @@ func (p *OutputHostAdminListLoadedConsumerGroupsArgs) Read(iprot thrift.TProtoco return nil } -func (p *OutputHostAdminListLoadedConsumerGroupsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("listLoadedConsumerGroups_args"); err != nil { +func (p *ControllerHostAdminExtentsUnreachableArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &ExtentsUnreachableRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *ControllerHostAdminExtentsUnreachableArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("extentsUnreachable_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { + if err := p.writeField1(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -7365,35 +8119,32 @@ func (p *OutputHostAdminListLoadedConsumerGroupsArgs) Write(oprot thrift.TProtoc return nil } -func (p *OutputHostAdminListLoadedConsumerGroupsArgs) String() string { - if p == nil { - return "" +func (p *ControllerHostAdminExtentsUnreachableArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) } + if err := p.Request.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) } - return fmt.Sprintf("OutputHostAdminListLoadedConsumerGroupsArgs(%+v)", *p) + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) } + return err } -// Attributes: -// - Success -type OutputHostAdminListLoadedConsumerGroupsResult struct { - Success *ListConsumerGroupsResult_ `thrift:"success,0" db:"success" json:"success,omitempty"` +func (p *ControllerHostAdminExtentsUnreachableArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ControllerHostAdminExtentsUnreachableArgs(%+v)", *p) } -func NewOutputHostAdminListLoadedConsumerGroupsResult() *OutputHostAdminListLoadedConsumerGroupsResult { - return &OutputHostAdminListLoadedConsumerGroupsResult{} +type ControllerHostAdminExtentsUnreachableResult struct { } -var OutputHostAdminListLoadedConsumerGroupsResult_Success_DEFAULT *ListConsumerGroupsResult_ -func (p *OutputHostAdminListLoadedConsumerGroupsResult) GetSuccess() *ListConsumerGroupsResult_ { - if !p.IsSetSuccess() { - return OutputHostAdminListLoadedConsumerGroupsResult_Success_DEFAULT - } -return p.Success -} -func (p *OutputHostAdminListLoadedConsumerGroupsResult) IsSetSuccess() bool { - return p.Success != nil +func NewControllerHostAdminExtentsUnreachableResult() *ControllerHostAdminExtentsUnreachableResult { + return &ControllerHostAdminExtentsUnreachableResult{} } -func (p *OutputHostAdminListLoadedConsumerGroupsResult) Read(iprot thrift.TProtocol) error { +func (p *ControllerHostAdminExtentsUnreachableResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -7405,15 +8156,8 @@ func (p *OutputHostAdminListLoadedConsumerGroupsResult) Read(iprot thrift.TProto return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", 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.Skip(fieldTypeId); err != nil { + return err } if err := iprot.ReadFieldEnd(); err != nil { return err @@ -7425,19 +8169,10 @@ func (p *OutputHostAdminListLoadedConsumerGroupsResult) Read(iprot thrift.TProto return nil } -func (p *OutputHostAdminListLoadedConsumerGroupsResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &ListConsumerGroupsResult_{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *OutputHostAdminListLoadedConsumerGroupsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("listLoadedConsumerGroups_result"); err != nil { +func (p *ControllerHostAdminExtentsUnreachableResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("extentsUnreachable_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -7446,34 +8181,19 @@ func (p *OutputHostAdminListLoadedConsumerGroupsResult) Write(oprot thrift.TProt return nil } -func (p *OutputHostAdminListLoadedConsumerGroupsResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *OutputHostAdminListLoadedConsumerGroupsResult) String() string { +func (p *ControllerHostAdminExtentsUnreachableResult) String() string { if p == nil { return "" } - return fmt.Sprintf("OutputHostAdminListLoadedConsumerGroupsResult(%+v)", *p) + return fmt.Sprintf("ControllerHostAdminExtentsUnreachableResult(%+v)", *p) } -type ControllerHostAdmin interface { - // Parameters: - // - Request - ExtentsUnreachable(request *ExtentsUnreachableRequest) (err error) +type ReplicatorAdmin interface { + DumpConnectionStatus() (r *ReplicatorConnectionStatus, err error) } -type ControllerHostAdminClient struct { +type ReplicatorAdminClient struct { Transport thrift.TTransport ProtocolFactory thrift.TProtocolFactory InputProtocol thrift.TProtocol @@ -7481,8 +8201,8 @@ type ControllerHostAdminClient struct { SeqId int32 } -func NewControllerHostAdminClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ControllerHostAdminClient { - return &ControllerHostAdminClient{Transport: t, +func NewReplicatorAdminClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ReplicatorAdminClient { + return &ReplicatorAdminClient{Transport: t, ProtocolFactory: f, InputProtocol: f.GetProtocol(t), OutputProtocol: f.GetProtocol(t), @@ -7490,8 +8210,8 @@ func NewControllerHostAdminClientFactory(t thrift.TTransport, f thrift.TProtocol } } -func NewControllerHostAdminClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ControllerHostAdminClient { - return &ControllerHostAdminClient{Transport: t, +func NewReplicatorAdminClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ReplicatorAdminClient { + return &ReplicatorAdminClient{Transport: t, ProtocolFactory: nil, InputProtocol: iprot, OutputProtocol: oprot, @@ -7499,25 +8219,22 @@ func NewControllerHostAdminClientProtocol(t thrift.TTransport, iprot thrift.TPro } } -// Parameters: -// - Request -func (p *ControllerHostAdminClient) ExtentsUnreachable(request *ExtentsUnreachableRequest) (err error) { - if err = p.sendExtentsUnreachable(request); err != nil { return } - return p.recvExtentsUnreachable() +func (p *ReplicatorAdminClient) DumpConnectionStatus() (r *ReplicatorConnectionStatus, err error) { + if err = p.sendDumpConnectionStatus(); err != nil { return } + return p.recvDumpConnectionStatus() } -func (p *ControllerHostAdminClient) sendExtentsUnreachable(request *ExtentsUnreachableRequest)(err error) { +func (p *ReplicatorAdminClient) sendDumpConnectionStatus()(err error) { oprot := p.OutputProtocol if oprot == nil { oprot = p.ProtocolFactory.GetProtocol(p.Transport) p.OutputProtocol = oprot } p.SeqId++ - if err = oprot.WriteMessageBegin("extentsUnreachable", thrift.CALL, p.SeqId); err != nil { + if err = oprot.WriteMessageBegin("dumpConnectionStatus", thrift.CALL, p.SeqId); err != nil { return } - args := ControllerHostAdminExtentsUnreachableArgs{ - Request : request, + args := ReplicatorAdminDumpConnectionStatusArgs{ } if err = args.Write(oprot); err != nil { return @@ -7529,7 +8246,7 @@ func (p *ControllerHostAdminClient) sendExtentsUnreachable(request *ExtentsUnrea } -func (p *ControllerHostAdminClient) recvExtentsUnreachable() (err error) { +func (p *ReplicatorAdminClient) recvDumpConnectionStatus() (value *ReplicatorConnectionStatus, err error) { iprot := p.InputProtocol if iprot == nil { iprot = p.ProtocolFactory.GetProtocol(p.Transport) @@ -7539,68 +8256,69 @@ func (p *ControllerHostAdminClient) recvExtentsUnreachable() (err error) { if err != nil { return } - if method != "extentsUnreachable" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "extentsUnreachable failed: wrong method name") + if method != "dumpConnectionStatus" { + err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "dumpConnectionStatus failed: wrong method name") return } if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "extentsUnreachable failed: out of sequence response") + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "dumpConnectionStatus failed: out of sequence response") return } if mTypeId == thrift.EXCEPTION { - error80 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error81 error - error81, err = error80.Read(iprot) + error92 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error93 error + error93, err = error92.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error81 + err = error93 return } if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "extentsUnreachable failed: invalid message type") + err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dumpConnectionStatus failed: invalid message type") return } - result := ControllerHostAdminExtentsUnreachableResult{} + result := ReplicatorAdminDumpConnectionStatusResult{} if err = result.Read(iprot); err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } + value = result.GetSuccess() return } -type ControllerHostAdminProcessor struct { +type ReplicatorAdminProcessor struct { processorMap map[string]thrift.TProcessorFunction - handler ControllerHostAdmin + handler ReplicatorAdmin } -func (p *ControllerHostAdminProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { +func (p *ReplicatorAdminProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { p.processorMap[key] = processor } -func (p *ControllerHostAdminProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { +func (p *ReplicatorAdminProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { processor, ok = p.processorMap[key] return processor, ok } -func (p *ControllerHostAdminProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { +func (p *ReplicatorAdminProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { return p.processorMap } -func NewControllerHostAdminProcessor(handler ControllerHostAdmin) *ControllerHostAdminProcessor { +func NewReplicatorAdminProcessor(handler ReplicatorAdmin) *ReplicatorAdminProcessor { - self82 := &ControllerHostAdminProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self82.processorMap["extentsUnreachable"] = &controllerHostAdminProcessorExtentsUnreachable{handler:handler} -return self82 + self94 := &ReplicatorAdminProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self94.processorMap["dumpConnectionStatus"] = &replicatorAdminProcessorDumpConnectionStatus{handler:handler} +return self94 } -func (p *ControllerHostAdminProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { +func (p *ReplicatorAdminProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { name, _, seqId, err := iprot.ReadMessageBegin() if err != nil { return false, err } if processor, ok := p.GetProcessorFunction(name); ok { @@ -7608,25 +8326,25 @@ func (p *ControllerHostAdminProcessor) Process(iprot, oprot thrift.TProtocol) (s } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x83 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + x95 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x83.Write(oprot) + x95.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() - return false, x83 + return false, x95 } -type controllerHostAdminProcessorExtentsUnreachable struct { - handler ControllerHostAdmin +type replicatorAdminProcessorDumpConnectionStatus struct { + handler ReplicatorAdmin } -func (p *controllerHostAdminProcessorExtentsUnreachable) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ControllerHostAdminExtentsUnreachableArgs{} +func (p *replicatorAdminProcessorDumpConnectionStatus) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReplicatorAdminDumpConnectionStatusArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("extentsUnreachable", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("dumpConnectionStatus", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() @@ -7634,17 +8352,20 @@ func (p *controllerHostAdminProcessorExtentsUnreachable) Process(seqId int32, ip } iprot.ReadMessageEnd() - result := ControllerHostAdminExtentsUnreachableResult{} + result := ReplicatorAdminDumpConnectionStatusResult{} +var retval *ReplicatorConnectionStatus var err2 error - if err2 = p.handler.ExtentsUnreachable(args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing extentsUnreachable: " + err2.Error()) - oprot.WriteMessageBegin("extentsUnreachable", thrift.EXCEPTION, seqId) + if retval, err2 = p.handler.DumpConnectionStatus(); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dumpConnectionStatus: " + err2.Error()) + oprot.WriteMessageBegin("dumpConnectionStatus", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() return true, err2 - } - if err2 = oprot.WriteMessageBegin("extentsUnreachable", thrift.REPLY, seqId); err2 != nil { + } else { + result.Success = retval +} + if err2 = oprot.WriteMessageBegin("dumpConnectionStatus", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -7665,28 +8386,14 @@ func (p *controllerHostAdminProcessorExtentsUnreachable) Process(seqId int32, ip // HELPER FUNCTIONS AND STRUCTURES -// Attributes: -// - Request -type ControllerHostAdminExtentsUnreachableArgs struct { - Request *ExtentsUnreachableRequest `thrift:"request,1" db:"request" json:"request"` -} - -func NewControllerHostAdminExtentsUnreachableArgs() *ControllerHostAdminExtentsUnreachableArgs { - return &ControllerHostAdminExtentsUnreachableArgs{} +type ReplicatorAdminDumpConnectionStatusArgs struct { } -var ControllerHostAdminExtentsUnreachableArgs_Request_DEFAULT *ExtentsUnreachableRequest -func (p *ControllerHostAdminExtentsUnreachableArgs) GetRequest() *ExtentsUnreachableRequest { - if !p.IsSetRequest() { - return ControllerHostAdminExtentsUnreachableArgs_Request_DEFAULT - } -return p.Request -} -func (p *ControllerHostAdminExtentsUnreachableArgs) IsSetRequest() bool { - return p.Request != nil +func NewReplicatorAdminDumpConnectionStatusArgs() *ReplicatorAdminDumpConnectionStatusArgs { + return &ReplicatorAdminDumpConnectionStatusArgs{} } -func (p *ControllerHostAdminExtentsUnreachableArgs) Read(iprot thrift.TProtocol) error { +func (p *ReplicatorAdminDumpConnectionStatusArgs) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -7698,15 +8405,8 @@ func (p *ControllerHostAdminExtentsUnreachableArgs) Read(iprot thrift.TProtocol) return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", 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.Skip(fieldTypeId); err != nil { + return err } if err := iprot.ReadFieldEnd(); err != nil { return err @@ -7718,19 +8418,10 @@ func (p *ControllerHostAdminExtentsUnreachableArgs) Read(iprot thrift.TProtocol) return nil } -func (p *ControllerHostAdminExtentsUnreachableArgs) ReadField1(iprot thrift.TProtocol) error { - p.Request = &ExtentsUnreachableRequest{} - if err := p.Request.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) - } - return nil -} - -func (p *ControllerHostAdminExtentsUnreachableArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("extentsUnreachable_args"); err != nil { +func (p *ReplicatorAdminDumpConnectionStatusArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("dumpConnectionStatus_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -7739,32 +8430,35 @@ func (p *ControllerHostAdminExtentsUnreachableArgs) Write(oprot thrift.TProtocol return nil } -func (p *ControllerHostAdminExtentsUnreachableArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) } - if err := p.Request.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) } - return err -} - -func (p *ControllerHostAdminExtentsUnreachableArgs) String() string { +func (p *ReplicatorAdminDumpConnectionStatusArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("ControllerHostAdminExtentsUnreachableArgs(%+v)", *p) + return fmt.Sprintf("ReplicatorAdminDumpConnectionStatusArgs(%+v)", *p) } -type ControllerHostAdminExtentsUnreachableResult struct { +// Attributes: +// - Success +type ReplicatorAdminDumpConnectionStatusResult struct { + Success *ReplicatorConnectionStatus `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewControllerHostAdminExtentsUnreachableResult() *ControllerHostAdminExtentsUnreachableResult { - return &ControllerHostAdminExtentsUnreachableResult{} +func NewReplicatorAdminDumpConnectionStatusResult() *ReplicatorAdminDumpConnectionStatusResult { + return &ReplicatorAdminDumpConnectionStatusResult{} } -func (p *ControllerHostAdminExtentsUnreachableResult) Read(iprot thrift.TProtocol) error { +var ReplicatorAdminDumpConnectionStatusResult_Success_DEFAULT *ReplicatorConnectionStatus +func (p *ReplicatorAdminDumpConnectionStatusResult) GetSuccess() *ReplicatorConnectionStatus { + if !p.IsSetSuccess() { + return ReplicatorAdminDumpConnectionStatusResult_Success_DEFAULT + } +return p.Success +} +func (p *ReplicatorAdminDumpConnectionStatusResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReplicatorAdminDumpConnectionStatusResult) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -7776,8 +8470,15 @@ func (p *ControllerHostAdminExtentsUnreachableResult) Read(iprot thrift.TProtoco return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } if fieldTypeId == thrift.STOP { break; } - if err := iprot.Skip(fieldTypeId); err != nil { - return err + 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 @@ -7789,10 +8490,19 @@ func (p *ControllerHostAdminExtentsUnreachableResult) Read(iprot thrift.TProtoco return nil } -func (p *ControllerHostAdminExtentsUnreachableResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("extentsUnreachable_result"); err != nil { +func (p *ReplicatorAdminDumpConnectionStatusResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ReplicatorConnectionStatus{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReplicatorAdminDumpConnectionStatusResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("dumpConnectionStatus_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { + if err := p.writeField0(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -7801,11 +8511,24 @@ func (p *ControllerHostAdminExtentsUnreachableResult) Write(oprot thrift.TProtoc return nil } -func (p *ControllerHostAdminExtentsUnreachableResult) String() string { +func (p *ReplicatorAdminDumpConnectionStatusResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *ReplicatorAdminDumpConnectionStatusResult) String() string { if p == nil { return "" } - return fmt.Sprintf("ControllerHostAdminExtentsUnreachableResult(%+v)", *p) + return fmt.Sprintf("ReplicatorAdminDumpConnectionStatusResult(%+v)", *p) } diff --git a/.generated/go/admin/tchan-admin.go b/.generated/go/admin/tchan-admin.go index 6d2f7e3..d8a1e88 100644 --- a/.generated/go/admin/tchan-admin.go +++ b/.generated/go/admin/tchan-admin.go @@ -54,6 +54,11 @@ type TChanOutputHostAdmin interface { UnloadConsumerGroups(ctx thrift.Context, request *UnloadConsumerGroupsRequest) error } +// TChanReplicatorAdmin is the interface that defines the server handler and client interface. +type TChanReplicatorAdmin interface { + DumpConnectionStatus(ctx thrift.Context) (*ReplicatorConnectionStatus, error) +} + // Implementation of a client and service handler. type tchanControllerHostAdminClient struct { @@ -80,6 +85,10 @@ func (c *tchanControllerHostAdminClient) ExtentsUnreachable(ctx thrift.Context, } success, err := c.client.Call(ctx, c.thriftService, "extentsUnreachable", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for extentsUnreachable") + } } return err @@ -160,6 +169,10 @@ func (c *tchanInputHostAdminClient) DestinationsUpdated(ctx thrift.Context, requ } success, err := c.client.Call(ctx, c.thriftService, "destinationsUpdated", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for destinationsUpdated") + } } return err @@ -172,8 +185,11 @@ func (c *tchanInputHostAdminClient) DrainExtent(ctx thrift.Context, drainRequest } success, err := c.client.Call(ctx, c.thriftService, "drainExtent", &args, &resp) if err == nil && !success { - if e := resp.DrainError; e != nil { - err = e + switch { + case resp.DrainError != nil: + err = resp.DrainError + default: + err = fmt.Errorf("received no result or unknown exception for drainExtent") } } @@ -185,6 +201,10 @@ func (c *tchanInputHostAdminClient) ListLoadedDestinations(ctx thrift.Context) ( args := InputHostAdminListLoadedDestinationsArgs{} success, err := c.client.Call(ctx, c.thriftService, "listLoadedDestinations", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for listLoadedDestinations") + } } return resp.GetSuccess(), err @@ -197,6 +217,10 @@ func (c *tchanInputHostAdminClient) ReadDestState(ctx thrift.Context, request *R } success, err := c.client.Call(ctx, c.thriftService, "readDestState", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for readDestState") + } } return resp.GetSuccess(), err @@ -209,6 +233,10 @@ func (c *tchanInputHostAdminClient) UnloadDestinations(ctx thrift.Context, reque } success, err := c.client.Call(ctx, c.thriftService, "unloadDestinations", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for unloadDestinations") + } } return err @@ -387,6 +415,10 @@ func (c *tchanOutputHostAdminClient) ConsumerGroupsUpdated(ctx thrift.Context, r } success, err := c.client.Call(ctx, c.thriftService, "consumerGroupsUpdated", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for consumerGroupsUpdated") + } } return err @@ -397,6 +429,10 @@ func (c *tchanOutputHostAdminClient) ListLoadedConsumerGroups(ctx thrift.Context args := OutputHostAdminListLoadedConsumerGroupsArgs{} success, err := c.client.Call(ctx, c.thriftService, "listLoadedConsumerGroups", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for listLoadedConsumerGroups") + } } return resp.GetSuccess(), err @@ -409,6 +445,10 @@ func (c *tchanOutputHostAdminClient) ReadCgState(ctx thrift.Context, request *Re } success, err := c.client.Call(ctx, c.thriftService, "readCgState", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for readCgState") + } } return resp.GetSuccess(), err @@ -421,6 +461,10 @@ func (c *tchanOutputHostAdminClient) UnloadConsumerGroups(ctx thrift.Context, re } success, err := c.client.Call(ctx, c.thriftService, "unloadConsumerGroups", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for unloadConsumerGroups") + } } return err @@ -544,3 +588,86 @@ func (s *tchanOutputHostAdminServer) handleUnloadConsumerGroups(ctx thrift.Conte return err == nil, &res, nil } + +type tchanReplicatorAdminClient struct { + thriftService string + client thrift.TChanClient +} + +func NewTChanReplicatorAdminInheritedClient(thriftService string, client thrift.TChanClient) *tchanReplicatorAdminClient { + return &tchanReplicatorAdminClient{ + thriftService, + client, + } +} + +// NewTChanReplicatorAdminClient creates a client that can be used to make remote calls. +func NewTChanReplicatorAdminClient(client thrift.TChanClient) TChanReplicatorAdmin { + return NewTChanReplicatorAdminInheritedClient("ReplicatorAdmin", client) +} + +func (c *tchanReplicatorAdminClient) DumpConnectionStatus(ctx thrift.Context) (*ReplicatorConnectionStatus, error) { + var resp ReplicatorAdminDumpConnectionStatusResult + args := ReplicatorAdminDumpConnectionStatusArgs{} + success, err := c.client.Call(ctx, c.thriftService, "dumpConnectionStatus", &args, &resp) + if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for dumpConnectionStatus") + } + } + + return resp.GetSuccess(), err +} + +type tchanReplicatorAdminServer struct { + handler TChanReplicatorAdmin +} + +// NewTChanReplicatorAdminServer wraps a handler for TChanReplicatorAdmin so it can be +// registered with a thrift.Server. +func NewTChanReplicatorAdminServer(handler TChanReplicatorAdmin) thrift.TChanServer { + return &tchanReplicatorAdminServer{ + handler, + } +} + +func (s *tchanReplicatorAdminServer) Service() string { + return "ReplicatorAdmin" +} + +func (s *tchanReplicatorAdminServer) Methods() []string { + return []string{ + "dumpConnectionStatus", + } +} + +func (s *tchanReplicatorAdminServer) Handle(ctx thrift.Context, methodName string, protocol athrift.TProtocol) (bool, athrift.TStruct, error) { + switch methodName { + case "dumpConnectionStatus": + return s.handleDumpConnectionStatus(ctx, protocol) + + default: + return false, nil, fmt.Errorf("method %v not found in service %v", methodName, s.Service()) + } +} + +func (s *tchanReplicatorAdminServer) handleDumpConnectionStatus(ctx thrift.Context, protocol athrift.TProtocol) (bool, athrift.TStruct, error) { + var req ReplicatorAdminDumpConnectionStatusArgs + var res ReplicatorAdminDumpConnectionStatusResult + + if err := req.Read(protocol); err != nil { + return false, nil, err + } + + r, err := + s.handler.DumpConnectionStatus(ctx) + + if err != nil { + return false, nil, err + } else { + res.Success = r + } + + return err == nil, &res, nil +} diff --git a/idl/cherami_server/admin.thrift b/idl/cherami_server/admin.thrift index fe990aa..7d10bec 100644 --- a/idl/cherami_server/admin.thrift +++ b/idl/cherami_server/admin.thrift @@ -222,3 +222,19 @@ service ControllerHostAdmin { */ void extentsUnreachable(1: ExtentsUnreachableRequest request) } + +struct ReplicatorConnection { + 1: optional string extentUUID + 2: optional i64 startTime + 3: optional i64 lastMsgReplicatedTime + 4: optional i32 totalMsgReplicated +} + +struct ReplicatorConnectionStatus { + 1: optional list remoteReplicatorConn + 2: optional list storehostConn +} + +service ReplicatorAdmin { + ReplicatorConnectionStatus dumpConnectionStatus() +}