From 1ea072e1a4003f0e8375ea92ffae2190adc80594 Mon Sep 17 00:00:00 2001 From: lengyuexuexuan <46274877+lengyuexuexuan@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:18:51 +0800 Subject: [PATCH] chore(go-client): add generation thrift files of go-client (#1917) https://github.com/apache/incubator-pegasus/issues/1881 By uploading generation thrift files, the go client can be used directly by users through "go get" without the need to compile it locally. --- .gitignore | 5 - .licenserc.yaml | 10 +- go-client/admin/client_test.go | 2 +- go-client/idl/admin/GoUnusedProtection__.go | 6 + go-client/idl/admin/backup-consts.go | 27 + go-client/idl/admin/backup.go | 5299 +++++ go-client/idl/admin/bulk_load-consts.go | 27 + go-client/idl/admin/bulk_load.go | 4536 +++++ go-client/idl/admin/duplication-consts.go | 27 + go-client/idl/admin/duplication.go | 2606 +++ go-client/idl/admin/meta_admin-consts.go | 27 + go-client/idl/admin/meta_admin.go | 16081 ++++++++++++++++ go-client/idl/admin/metadata-consts.go | 27 + go-client/idl/admin/metadata.go | 1373 ++ go-client/idl/admin/partition_split-consts.go | 27 + go-client/idl/admin/partition_split.go | 3245 ++++ go-client/idl/cmd/GoUnusedProtection__.go | 6 + go-client/idl/cmd/command-consts.go | 22 + go-client/idl/cmd/command.go | 535 + go-client/idl/radmin/GoUnusedProtection__.go | 6 + go-client/idl/radmin/replica_admin-consts.go | 29 + go-client/idl/radmin/replica_admin.go | 3681 ++++ .../idl/replication/GoUnusedProtection__.go | 6 + .../idl/replication/dsn.layer2-consts.go | 25 + go-client/idl/replication/dsn.layer2.go | 2136 ++ go-client/idl/rrdb/GoUnusedProtection__.go | 6 + go-client/idl/rrdb/meta-remote/meta-remote.go | 183 + go-client/idl/rrdb/rrdb-consts.go | 27 + go-client/idl/rrdb/rrdb-remote/rrdb-remote.go | 536 + go-client/idl/rrdb/rrdb.go | 12123 ++++++++++++ 30 files changed, 52636 insertions(+), 10 deletions(-) create mode 100644 go-client/idl/admin/GoUnusedProtection__.go create mode 100644 go-client/idl/admin/backup-consts.go create mode 100644 go-client/idl/admin/backup.go create mode 100644 go-client/idl/admin/bulk_load-consts.go create mode 100644 go-client/idl/admin/bulk_load.go create mode 100644 go-client/idl/admin/duplication-consts.go create mode 100644 go-client/idl/admin/duplication.go create mode 100644 go-client/idl/admin/meta_admin-consts.go create mode 100644 go-client/idl/admin/meta_admin.go create mode 100644 go-client/idl/admin/metadata-consts.go create mode 100644 go-client/idl/admin/metadata.go create mode 100644 go-client/idl/admin/partition_split-consts.go create mode 100644 go-client/idl/admin/partition_split.go create mode 100644 go-client/idl/cmd/GoUnusedProtection__.go create mode 100644 go-client/idl/cmd/command-consts.go create mode 100644 go-client/idl/cmd/command.go create mode 100644 go-client/idl/radmin/GoUnusedProtection__.go create mode 100644 go-client/idl/radmin/replica_admin-consts.go create mode 100644 go-client/idl/radmin/replica_admin.go create mode 100644 go-client/idl/replication/GoUnusedProtection__.go create mode 100644 go-client/idl/replication/dsn.layer2-consts.go create mode 100644 go-client/idl/replication/dsn.layer2.go create mode 100644 go-client/idl/rrdb/GoUnusedProtection__.go create mode 100755 go-client/idl/rrdb/meta-remote/meta-remote.go create mode 100644 go-client/idl/rrdb/rrdb-consts.go create mode 100755 go-client/idl/rrdb/rrdb-remote/rrdb-remote.go create mode 100644 go-client/idl/rrdb/rrdb.go diff --git a/.gitignore b/.gitignore index 8873dcf800..d458cd5c10 100644 --- a/.gitignore +++ b/.gitignore @@ -342,11 +342,6 @@ package-lock.json # ============= # go-client/bin go-client/coverage.txt -go-client/idl/admin/ -go-client/idl/cmd/ -go-client/idl/radmin/ -go-client/idl/replication/ -go-client/idl/rrdb/ thirdparty/output/ diff --git a/.licenserc.yaml b/.licenserc.yaml index 3a15f3201d..6128a75b7c 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -42,10 +42,12 @@ header: - '**/*.pdf' # Special files for golang. - '**/go.sum' - # TODO(wangdan): Generated files for go client, could generate dynamically? - - 'go-client/idl/base/GoUnusedProtection__.go' - - 'go-client/idl/base/dsn_err_string.go' - - 'go-client/idl/base/rocskdb_err_string.go' + - 'go-client/idl/admin/**' + - 'go-client/idl/base/**' + - 'go-client/idl/cmd/**' + - 'go-client/idl/radmin/**' + - 'go-client/idl/replication/**' + - 'go-client/idl/rrdb/**' # Special files for nodejs. - '**/.npmigonre' # Special files for python. diff --git a/go-client/admin/client_test.go b/go-client/admin/client_test.go index 6d8b12adec..ac15550770 100644 --- a/go-client/admin/client_test.go +++ b/go-client/admin/client_test.go @@ -175,7 +175,7 @@ func TestAdmin_ListNodes(t *testing.T) { for i, node := range nodes { // Each node should be alive. assert.Equal(t, admin.NodeStatus_NS_ALIVE, node.Status) - actualReplicaServerPorts[i] = node.Address.GetPort() + actualReplicaServerPorts[i] = node.GetNode().GetPort() } // Match elements without extra ordering. diff --git a/go-client/idl/admin/GoUnusedProtection__.go b/go-client/idl/admin/GoUnusedProtection__.go new file mode 100644 index 0000000000..86e6c7e055 --- /dev/null +++ b/go-client/idl/admin/GoUnusedProtection__.go @@ -0,0 +1,6 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +var GoUnusedProtection__ int diff --git a/go-client/idl/admin/backup-consts.go b/go-client/idl/admin/backup-consts.go new file mode 100644 index 0000000000..757b943ef3 --- /dev/null +++ b/go-client/idl/admin/backup-consts.go @@ -0,0 +1,27 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +func init() { +} diff --git a/go-client/idl/admin/backup.go b/go-client/idl/admin/backup.go new file mode 100644 index 0000000000..268cb2a5ab --- /dev/null +++ b/go-client/idl/admin/backup.go @@ -0,0 +1,5299 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +// Attributes: +// - PolicyName +// - BackupProviderType +type PolicyInfo struct { + PolicyName string `thrift:"policy_name,1" db:"policy_name" json:"policy_name"` + BackupProviderType string `thrift:"backup_provider_type,2" db:"backup_provider_type" json:"backup_provider_type"` +} + +func NewPolicyInfo() *PolicyInfo { + return &PolicyInfo{} +} + +func (p *PolicyInfo) GetPolicyName() string { + return p.PolicyName +} + +func (p *PolicyInfo) GetBackupProviderType() string { + return p.BackupProviderType +} +func (p *PolicyInfo) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *PolicyInfo) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.PolicyName = v + } + return nil +} + +func (p *PolicyInfo) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.BackupProviderType = v + } + return nil +} + +func (p *PolicyInfo) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("policy_info"); 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 *PolicyInfo) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("policy_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:policy_name: ", p), err) + } + if err := oprot.WriteString(string(p.PolicyName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.policy_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:policy_name: ", p), err) + } + return err +} + +func (p *PolicyInfo) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_provider_type", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:backup_provider_type: ", p), err) + } + if err := oprot.WriteString(string(p.BackupProviderType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_provider_type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:backup_provider_type: ", p), err) + } + return err +} + +func (p *PolicyInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PolicyInfo(%+v)", *p) +} + +// Attributes: +// - ClusterName +// - PolicyName +// - TimeStamp +// - AppName +// - AppID +// - NewAppName_ +// - BackupProviderName +// - SkipBadPartition +// - RestorePath +type ConfigurationRestoreRequest struct { + ClusterName string `thrift:"cluster_name,1" db:"cluster_name" json:"cluster_name"` + PolicyName string `thrift:"policy_name,2" db:"policy_name" json:"policy_name"` + TimeStamp int64 `thrift:"time_stamp,3" db:"time_stamp" json:"time_stamp"` + AppName string `thrift:"app_name,4" db:"app_name" json:"app_name"` + AppID int32 `thrift:"app_id,5" db:"app_id" json:"app_id"` + NewAppName_ string `thrift:"new_app_name,6" db:"new_app_name" json:"new_app_name"` + BackupProviderName string `thrift:"backup_provider_name,7" db:"backup_provider_name" json:"backup_provider_name"` + SkipBadPartition bool `thrift:"skip_bad_partition,8" db:"skip_bad_partition" json:"skip_bad_partition"` + RestorePath *string `thrift:"restore_path,9" db:"restore_path" json:"restore_path,omitempty"` +} + +func NewConfigurationRestoreRequest() *ConfigurationRestoreRequest { + return &ConfigurationRestoreRequest{} +} + +func (p *ConfigurationRestoreRequest) GetClusterName() string { + return p.ClusterName +} + +func (p *ConfigurationRestoreRequest) GetPolicyName() string { + return p.PolicyName +} + +func (p *ConfigurationRestoreRequest) GetTimeStamp() int64 { + return p.TimeStamp +} + +func (p *ConfigurationRestoreRequest) GetAppName() string { + return p.AppName +} + +func (p *ConfigurationRestoreRequest) GetAppID() int32 { + return p.AppID +} + +func (p *ConfigurationRestoreRequest) GetNewAppName_() string { + return p.NewAppName_ +} + +func (p *ConfigurationRestoreRequest) GetBackupProviderName() string { + return p.BackupProviderName +} + +func (p *ConfigurationRestoreRequest) GetSkipBadPartition() bool { + return p.SkipBadPartition +} + +var ConfigurationRestoreRequest_RestorePath_DEFAULT string + +func (p *ConfigurationRestoreRequest) GetRestorePath() string { + if !p.IsSetRestorePath() { + return ConfigurationRestoreRequest_RestorePath_DEFAULT + } + return *p.RestorePath +} +func (p *ConfigurationRestoreRequest) IsSetRestorePath() bool { + return p.RestorePath != nil +} + +func (p *ConfigurationRestoreRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.STRING { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationRestoreRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ClusterName = v + } + return nil +} + +func (p *ConfigurationRestoreRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.PolicyName = v + } + return nil +} + +func (p *ConfigurationRestoreRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TimeStamp = v + } + return nil +} + +func (p *ConfigurationRestoreRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *ConfigurationRestoreRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *ConfigurationRestoreRequest) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.NewAppName_ = v + } + return nil +} + +func (p *ConfigurationRestoreRequest) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.BackupProviderName = v + } + return nil +} + +func (p *ConfigurationRestoreRequest) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.SkipBadPartition = v + } + return nil +} + +func (p *ConfigurationRestoreRequest) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.RestorePath = &v + } + return nil +} + +func (p *ConfigurationRestoreRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_restore_request"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + 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 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 *ConfigurationRestoreRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("cluster_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cluster_name: ", p), err) + } + if err := oprot.WriteString(string(p.ClusterName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cluster_name: ", p), err) + } + return err +} + +func (p *ConfigurationRestoreRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("policy_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:policy_name: ", p), err) + } + if err := oprot.WriteString(string(p.PolicyName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.policy_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:policy_name: ", p), err) + } + return err +} + +func (p *ConfigurationRestoreRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("time_stamp", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:time_stamp: ", p), err) + } + if err := oprot.WriteI64(int64(p.TimeStamp)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.time_stamp (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:time_stamp: ", p), err) + } + return err +} + +func (p *ConfigurationRestoreRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:app_name: ", p), err) + } + return err +} + +func (p *ConfigurationRestoreRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:app_id: ", p), err) + } + return err +} + +func (p *ConfigurationRestoreRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("new_app_name", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:new_app_name: ", p), err) + } + if err := oprot.WriteString(string(p.NewAppName_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_app_name (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:new_app_name: ", p), err) + } + return err +} + +func (p *ConfigurationRestoreRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_provider_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:backup_provider_name: ", p), err) + } + if err := oprot.WriteString(string(p.BackupProviderName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_provider_name (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:backup_provider_name: ", p), err) + } + return err +} + +func (p *ConfigurationRestoreRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("skip_bad_partition", thrift.BOOL, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:skip_bad_partition: ", p), err) + } + if err := oprot.WriteBool(bool(p.SkipBadPartition)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.skip_bad_partition (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:skip_bad_partition: ", p), err) + } + return err +} + +func (p *ConfigurationRestoreRequest) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetRestorePath() { + if err := oprot.WriteFieldBegin("restore_path", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:restore_path: ", p), err) + } + if err := oprot.WriteString(string(*p.RestorePath)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.restore_path (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:restore_path: ", p), err) + } + } + return err +} + +func (p *ConfigurationRestoreRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationRestoreRequest(%+v)", *p) +} + +// Attributes: +// - Pid +// - Policy +// - AppName +// - BackupID +// - BackupPath +type BackupRequest struct { + Pid *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"` + Policy *PolicyInfo `thrift:"policy,2" db:"policy" json:"policy"` + AppName string `thrift:"app_name,3" db:"app_name" json:"app_name"` + BackupID int64 `thrift:"backup_id,4" db:"backup_id" json:"backup_id"` + BackupPath *string `thrift:"backup_path,5" db:"backup_path" json:"backup_path,omitempty"` +} + +func NewBackupRequest() *BackupRequest { + return &BackupRequest{} +} + +var BackupRequest_Pid_DEFAULT *base.Gpid + +func (p *BackupRequest) GetPid() *base.Gpid { + if !p.IsSetPid() { + return BackupRequest_Pid_DEFAULT + } + return p.Pid +} + +var BackupRequest_Policy_DEFAULT *PolicyInfo + +func (p *BackupRequest) GetPolicy() *PolicyInfo { + if !p.IsSetPolicy() { + return BackupRequest_Policy_DEFAULT + } + return p.Policy +} + +func (p *BackupRequest) GetAppName() string { + return p.AppName +} + +func (p *BackupRequest) GetBackupID() int64 { + return p.BackupID +} + +var BackupRequest_BackupPath_DEFAULT string + +func (p *BackupRequest) GetBackupPath() string { + if !p.IsSetBackupPath() { + return BackupRequest_BackupPath_DEFAULT + } + return *p.BackupPath +} +func (p *BackupRequest) IsSetPid() bool { + return p.Pid != nil +} + +func (p *BackupRequest) IsSetPolicy() bool { + return p.Policy != nil +} + +func (p *BackupRequest) IsSetBackupPath() bool { + return p.BackupPath != nil +} + +func (p *BackupRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *BackupRequest) ReadField1(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *BackupRequest) ReadField2(iprot thrift.TProtocol) error { + p.Policy = &PolicyInfo{} + if err := p.Policy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Policy), err) + } + return nil +} + +func (p *BackupRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *BackupRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.BackupID = v + } + return nil +} + +func (p *BackupRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.BackupPath = &v + } + return nil +} + +func (p *BackupRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("backup_request"); 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 := p.writeField5(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 *BackupRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err) + } + return err +} + +func (p *BackupRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("policy", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:policy: ", p), err) + } + if err := p.Policy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Policy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:policy: ", p), err) + } + return err +} + +func (p *BackupRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_name: ", p), err) + } + return err +} + +func (p *BackupRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_id", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:backup_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.BackupID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_id (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:backup_id: ", p), err) + } + return err +} + +func (p *BackupRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetBackupPath() { + if err := oprot.WriteFieldBegin("backup_path", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:backup_path: ", p), err) + } + if err := oprot.WriteString(string(*p.BackupPath)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_path (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:backup_path: ", p), err) + } + } + return err +} + +func (p *BackupRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BackupRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Pid +// - Progress +// - PolicyName +// - BackupID +// - CheckpointTotalSize +type BackupResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Pid *base.Gpid `thrift:"pid,2" db:"pid" json:"pid"` + Progress int32 `thrift:"progress,3" db:"progress" json:"progress"` + PolicyName string `thrift:"policy_name,4" db:"policy_name" json:"policy_name"` + BackupID int64 `thrift:"backup_id,5" db:"backup_id" json:"backup_id"` + CheckpointTotalSize int64 `thrift:"checkpoint_total_size,6" db:"checkpoint_total_size" json:"checkpoint_total_size"` +} + +func NewBackupResponse() *BackupResponse { + return &BackupResponse{} +} + +var BackupResponse_Err_DEFAULT *base.ErrorCode + +func (p *BackupResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return BackupResponse_Err_DEFAULT + } + return p.Err +} + +var BackupResponse_Pid_DEFAULT *base.Gpid + +func (p *BackupResponse) GetPid() *base.Gpid { + if !p.IsSetPid() { + return BackupResponse_Pid_DEFAULT + } + return p.Pid +} + +func (p *BackupResponse) GetProgress() int32 { + return p.Progress +} + +func (p *BackupResponse) GetPolicyName() string { + return p.PolicyName +} + +func (p *BackupResponse) GetBackupID() int64 { + return p.BackupID +} + +func (p *BackupResponse) GetCheckpointTotalSize() int64 { + return p.CheckpointTotalSize +} +func (p *BackupResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *BackupResponse) IsSetPid() bool { + return p.Pid != nil +} + +func (p *BackupResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *BackupResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *BackupResponse) ReadField2(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *BackupResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Progress = v + } + return nil +} + +func (p *BackupResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.PolicyName = v + } + return nil +} + +func (p *BackupResponse) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.BackupID = v + } + return nil +} + +func (p *BackupResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.CheckpointTotalSize = v + } + return nil +} + +func (p *BackupResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("backup_response"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(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 *BackupResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *BackupResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:pid: ", p), err) + } + return err +} + +func (p *BackupResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("progress", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:progress: ", p), err) + } + if err := oprot.WriteI32(int32(p.Progress)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.progress (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:progress: ", p), err) + } + return err +} + +func (p *BackupResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("policy_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:policy_name: ", p), err) + } + if err := oprot.WriteString(string(p.PolicyName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.policy_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:policy_name: ", p), err) + } + return err +} + +func (p *BackupResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_id", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:backup_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.BackupID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_id (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:backup_id: ", p), err) + } + return err +} + +func (p *BackupResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("checkpoint_total_size", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:checkpoint_total_size: ", p), err) + } + if err := oprot.WriteI64(int64(p.CheckpointTotalSize)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.checkpoint_total_size (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:checkpoint_total_size: ", p), err) + } + return err +} + +func (p *BackupResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BackupResponse(%+v)", *p) +} + +// Attributes: +// - Pid +// - PolicyName +type BackupClearRequest struct { + Pid *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"` + PolicyName string `thrift:"policy_name,2" db:"policy_name" json:"policy_name"` +} + +func NewBackupClearRequest() *BackupClearRequest { + return &BackupClearRequest{} +} + +var BackupClearRequest_Pid_DEFAULT *base.Gpid + +func (p *BackupClearRequest) GetPid() *base.Gpid { + if !p.IsSetPid() { + return BackupClearRequest_Pid_DEFAULT + } + return p.Pid +} + +func (p *BackupClearRequest) GetPolicyName() string { + return p.PolicyName +} +func (p *BackupClearRequest) IsSetPid() bool { + return p.Pid != nil +} + +func (p *BackupClearRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *BackupClearRequest) ReadField1(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *BackupClearRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.PolicyName = v + } + return nil +} + +func (p *BackupClearRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("backup_clear_request"); 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 *BackupClearRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err) + } + return err +} + +func (p *BackupClearRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("policy_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:policy_name: ", p), err) + } + if err := oprot.WriteString(string(p.PolicyName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.policy_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:policy_name: ", p), err) + } + return err +} + +func (p *BackupClearRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BackupClearRequest(%+v)", *p) +} + +// Attributes: +// - PolicyName +// - AddAppids +// - RemovalAppids +// - NewBackupIntervalSec_ +// - BackupHistoryCountToKeep +// - IsDisable +// - StartTime +type ConfigurationModifyBackupPolicyRequest struct { + PolicyName string `thrift:"policy_name,1" db:"policy_name" json:"policy_name"` + AddAppids []int32 `thrift:"add_appids,2" db:"add_appids" json:"add_appids,omitempty"` + RemovalAppids []int32 `thrift:"removal_appids,3" db:"removal_appids" json:"removal_appids,omitempty"` + NewBackupIntervalSec_ *int64 `thrift:"new_backup_interval_sec,4" db:"new_backup_interval_sec" json:"new_backup_interval_sec,omitempty"` + BackupHistoryCountToKeep *int32 `thrift:"backup_history_count_to_keep,5" db:"backup_history_count_to_keep" json:"backup_history_count_to_keep,omitempty"` + IsDisable *bool `thrift:"is_disable,6" db:"is_disable" json:"is_disable,omitempty"` + StartTime *string `thrift:"start_time,7" db:"start_time" json:"start_time,omitempty"` +} + +func NewConfigurationModifyBackupPolicyRequest() *ConfigurationModifyBackupPolicyRequest { + return &ConfigurationModifyBackupPolicyRequest{} +} + +func (p *ConfigurationModifyBackupPolicyRequest) GetPolicyName() string { + return p.PolicyName +} + +var ConfigurationModifyBackupPolicyRequest_AddAppids_DEFAULT []int32 + +func (p *ConfigurationModifyBackupPolicyRequest) GetAddAppids() []int32 { + return p.AddAppids +} + +var ConfigurationModifyBackupPolicyRequest_RemovalAppids_DEFAULT []int32 + +func (p *ConfigurationModifyBackupPolicyRequest) GetRemovalAppids() []int32 { + return p.RemovalAppids +} + +var ConfigurationModifyBackupPolicyRequest_NewBackupIntervalSec__DEFAULT int64 + +func (p *ConfigurationModifyBackupPolicyRequest) GetNewBackupIntervalSec_() int64 { + if !p.IsSetNewBackupIntervalSec_() { + return ConfigurationModifyBackupPolicyRequest_NewBackupIntervalSec__DEFAULT + } + return *p.NewBackupIntervalSec_ +} + +var ConfigurationModifyBackupPolicyRequest_BackupHistoryCountToKeep_DEFAULT int32 + +func (p *ConfigurationModifyBackupPolicyRequest) GetBackupHistoryCountToKeep() int32 { + if !p.IsSetBackupHistoryCountToKeep() { + return ConfigurationModifyBackupPolicyRequest_BackupHistoryCountToKeep_DEFAULT + } + return *p.BackupHistoryCountToKeep +} + +var ConfigurationModifyBackupPolicyRequest_IsDisable_DEFAULT bool + +func (p *ConfigurationModifyBackupPolicyRequest) GetIsDisable() bool { + if !p.IsSetIsDisable() { + return ConfigurationModifyBackupPolicyRequest_IsDisable_DEFAULT + } + return *p.IsDisable +} + +var ConfigurationModifyBackupPolicyRequest_StartTime_DEFAULT string + +func (p *ConfigurationModifyBackupPolicyRequest) GetStartTime() string { + if !p.IsSetStartTime() { + return ConfigurationModifyBackupPolicyRequest_StartTime_DEFAULT + } + return *p.StartTime +} +func (p *ConfigurationModifyBackupPolicyRequest) IsSetAddAppids() bool { + return p.AddAppids != nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) IsSetRemovalAppids() bool { + return p.RemovalAppids != nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) IsSetNewBackupIntervalSec_() bool { + return p.NewBackupIntervalSec_ != nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) IsSetBackupHistoryCountToKeep() bool { + return p.BackupHistoryCountToKeep != nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) IsSetIsDisable() bool { + return p.IsDisable != nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) IsSetStartTime() bool { + return p.StartTime != nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationModifyBackupPolicyRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.PolicyName = v + } + return nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int32, 0, size) + p.AddAppids = tSlice + for i := 0; i < size; i++ { + var _elem0 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem0 = v + } + p.AddAppids = append(p.AddAppids, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int32, 0, size) + p.RemovalAppids = tSlice + for i := 0; i < size; i++ { + var _elem1 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem1 = v + } + p.RemovalAppids = append(p.RemovalAppids, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.NewBackupIntervalSec_ = &v + } + return nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.BackupHistoryCountToKeep = &v + } + return nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.IsDisable = &v + } + return nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.StartTime = &v + } + return nil +} + +func (p *ConfigurationModifyBackupPolicyRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_modify_backup_policy_request"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(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 *ConfigurationModifyBackupPolicyRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("policy_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:policy_name: ", p), err) + } + if err := oprot.WriteString(string(p.PolicyName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.policy_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:policy_name: ", p), err) + } + return err +} + +func (p *ConfigurationModifyBackupPolicyRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetAddAppids() { + if err := oprot.WriteFieldBegin("add_appids", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:add_appids: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(p.AddAppids)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.AddAppids { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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:add_appids: ", p), err) + } + } + return err +} + +func (p *ConfigurationModifyBackupPolicyRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetRemovalAppids() { + if err := oprot.WriteFieldBegin("removal_appids", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:removal_appids: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(p.RemovalAppids)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.RemovalAppids { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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 3:removal_appids: ", p), err) + } + } + return err +} + +func (p *ConfigurationModifyBackupPolicyRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetNewBackupIntervalSec_() { + if err := oprot.WriteFieldBegin("new_backup_interval_sec", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:new_backup_interval_sec: ", p), err) + } + if err := oprot.WriteI64(int64(*p.NewBackupIntervalSec_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_backup_interval_sec (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:new_backup_interval_sec: ", p), err) + } + } + return err +} + +func (p *ConfigurationModifyBackupPolicyRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetBackupHistoryCountToKeep() { + if err := oprot.WriteFieldBegin("backup_history_count_to_keep", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:backup_history_count_to_keep: ", p), err) + } + if err := oprot.WriteI32(int32(*p.BackupHistoryCountToKeep)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_history_count_to_keep (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:backup_history_count_to_keep: ", p), err) + } + } + return err +} + +func (p *ConfigurationModifyBackupPolicyRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetIsDisable() { + if err := oprot.WriteFieldBegin("is_disable", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:is_disable: ", p), err) + } + if err := oprot.WriteBool(bool(*p.IsDisable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_disable (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:is_disable: ", p), err) + } + } + return err +} + +func (p *ConfigurationModifyBackupPolicyRequest) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin("start_time", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:start_time: ", p), err) + } + if err := oprot.WriteString(string(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:start_time: ", p), err) + } + } + return err +} + +func (p *ConfigurationModifyBackupPolicyRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationModifyBackupPolicyRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMessage +type ConfigurationModifyBackupPolicyResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMessage string `thrift:"hint_message,2" db:"hint_message" json:"hint_message"` +} + +func NewConfigurationModifyBackupPolicyResponse() *ConfigurationModifyBackupPolicyResponse { + return &ConfigurationModifyBackupPolicyResponse{} +} + +var ConfigurationModifyBackupPolicyResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationModifyBackupPolicyResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationModifyBackupPolicyResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationModifyBackupPolicyResponse) GetHintMessage() string { + return p.HintMessage +} +func (p *ConfigurationModifyBackupPolicyResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationModifyBackupPolicyResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationModifyBackupPolicyResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationModifyBackupPolicyResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMessage = v + } + return nil +} + +func (p *ConfigurationModifyBackupPolicyResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_modify_backup_policy_response"); 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 *ConfigurationModifyBackupPolicyResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationModifyBackupPolicyResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_message", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_message: ", p), err) + } + if err := oprot.WriteString(string(p.HintMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_message (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_message: ", p), err) + } + return err +} + +func (p *ConfigurationModifyBackupPolicyResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationModifyBackupPolicyResponse(%+v)", *p) +} + +// Attributes: +// - BackupProviderType +// - PolicyName +// - AppIds +// - BackupIntervalSeconds +// - BackupHistoryCountToKeep +// - StartTime +type ConfigurationAddBackupPolicyRequest struct { + BackupProviderType string `thrift:"backup_provider_type,1" db:"backup_provider_type" json:"backup_provider_type"` + PolicyName string `thrift:"policy_name,2" db:"policy_name" json:"policy_name"` + AppIds []int32 `thrift:"app_ids,3" db:"app_ids" json:"app_ids"` + BackupIntervalSeconds int64 `thrift:"backup_interval_seconds,4" db:"backup_interval_seconds" json:"backup_interval_seconds"` + BackupHistoryCountToKeep int32 `thrift:"backup_history_count_to_keep,5" db:"backup_history_count_to_keep" json:"backup_history_count_to_keep"` + StartTime string `thrift:"start_time,6" db:"start_time" json:"start_time"` +} + +func NewConfigurationAddBackupPolicyRequest() *ConfigurationAddBackupPolicyRequest { + return &ConfigurationAddBackupPolicyRequest{} +} + +func (p *ConfigurationAddBackupPolicyRequest) GetBackupProviderType() string { + return p.BackupProviderType +} + +func (p *ConfigurationAddBackupPolicyRequest) GetPolicyName() string { + return p.PolicyName +} + +func (p *ConfigurationAddBackupPolicyRequest) GetAppIds() []int32 { + return p.AppIds +} + +func (p *ConfigurationAddBackupPolicyRequest) GetBackupIntervalSeconds() int64 { + return p.BackupIntervalSeconds +} + +func (p *ConfigurationAddBackupPolicyRequest) GetBackupHistoryCountToKeep() int32 { + return p.BackupHistoryCountToKeep +} + +func (p *ConfigurationAddBackupPolicyRequest) GetStartTime() string { + return p.StartTime +} +func (p *ConfigurationAddBackupPolicyRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationAddBackupPolicyRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.BackupProviderType = v + } + return nil +} + +func (p *ConfigurationAddBackupPolicyRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.PolicyName = v + } + return nil +} + +func (p *ConfigurationAddBackupPolicyRequest) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int32, 0, size) + p.AppIds = tSlice + for i := 0; i < size; i++ { + var _elem2 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem2 = v + } + p.AppIds = append(p.AppIds, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationAddBackupPolicyRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.BackupIntervalSeconds = v + } + return nil +} + +func (p *ConfigurationAddBackupPolicyRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.BackupHistoryCountToKeep = v + } + return nil +} + +func (p *ConfigurationAddBackupPolicyRequest) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.StartTime = v + } + return nil +} + +func (p *ConfigurationAddBackupPolicyRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_add_backup_policy_request"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(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 *ConfigurationAddBackupPolicyRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_provider_type", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_provider_type: ", p), err) + } + if err := oprot.WriteString(string(p.BackupProviderType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_provider_type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_provider_type: ", p), err) + } + return err +} + +func (p *ConfigurationAddBackupPolicyRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("policy_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:policy_name: ", p), err) + } + if err := oprot.WriteString(string(p.PolicyName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.policy_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:policy_name: ", p), err) + } + return err +} + +func (p *ConfigurationAddBackupPolicyRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_ids", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_ids: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(p.AppIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.AppIds { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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 3:app_ids: ", p), err) + } + return err +} + +func (p *ConfigurationAddBackupPolicyRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_interval_seconds", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:backup_interval_seconds: ", p), err) + } + if err := oprot.WriteI64(int64(p.BackupIntervalSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_interval_seconds (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:backup_interval_seconds: ", p), err) + } + return err +} + +func (p *ConfigurationAddBackupPolicyRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_history_count_to_keep", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:backup_history_count_to_keep: ", p), err) + } + if err := oprot.WriteI32(int32(p.BackupHistoryCountToKeep)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_history_count_to_keep (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:backup_history_count_to_keep: ", p), err) + } + return err +} + +func (p *ConfigurationAddBackupPolicyRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err) + } + if err := oprot.WriteString(string(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) + } + return err +} + +func (p *ConfigurationAddBackupPolicyRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationAddBackupPolicyRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMessage +type ConfigurationAddBackupPolicyResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMessage string `thrift:"hint_message,2" db:"hint_message" json:"hint_message"` +} + +func NewConfigurationAddBackupPolicyResponse() *ConfigurationAddBackupPolicyResponse { + return &ConfigurationAddBackupPolicyResponse{} +} + +var ConfigurationAddBackupPolicyResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationAddBackupPolicyResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationAddBackupPolicyResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationAddBackupPolicyResponse) GetHintMessage() string { + return p.HintMessage +} +func (p *ConfigurationAddBackupPolicyResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationAddBackupPolicyResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationAddBackupPolicyResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationAddBackupPolicyResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMessage = v + } + return nil +} + +func (p *ConfigurationAddBackupPolicyResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_add_backup_policy_response"); 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 *ConfigurationAddBackupPolicyResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationAddBackupPolicyResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_message", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_message: ", p), err) + } + if err := oprot.WriteString(string(p.HintMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_message (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_message: ", p), err) + } + return err +} + +func (p *ConfigurationAddBackupPolicyResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationAddBackupPolicyResponse(%+v)", *p) +} + +// Attributes: +// - PolicyName +// - BackupProviderType +// - BackupIntervalSeconds +// - AppIds +// - BackupHistoryCountToKeep +// - StartTime +// - IsDisable +type PolicyEntry struct { + PolicyName string `thrift:"policy_name,1" db:"policy_name" json:"policy_name"` + BackupProviderType string `thrift:"backup_provider_type,2" db:"backup_provider_type" json:"backup_provider_type"` + BackupIntervalSeconds string `thrift:"backup_interval_seconds,3" db:"backup_interval_seconds" json:"backup_interval_seconds"` + AppIds []int32 `thrift:"app_ids,4" db:"app_ids" json:"app_ids"` + BackupHistoryCountToKeep int32 `thrift:"backup_history_count_to_keep,5" db:"backup_history_count_to_keep" json:"backup_history_count_to_keep"` + StartTime string `thrift:"start_time,6" db:"start_time" json:"start_time"` + IsDisable bool `thrift:"is_disable,7" db:"is_disable" json:"is_disable"` +} + +func NewPolicyEntry() *PolicyEntry { + return &PolicyEntry{} +} + +func (p *PolicyEntry) GetPolicyName() string { + return p.PolicyName +} + +func (p *PolicyEntry) GetBackupProviderType() string { + return p.BackupProviderType +} + +func (p *PolicyEntry) GetBackupIntervalSeconds() string { + return p.BackupIntervalSeconds +} + +func (p *PolicyEntry) GetAppIds() []int32 { + return p.AppIds +} + +func (p *PolicyEntry) GetBackupHistoryCountToKeep() int32 { + return p.BackupHistoryCountToKeep +} + +func (p *PolicyEntry) GetStartTime() string { + return p.StartTime +} + +func (p *PolicyEntry) GetIsDisable() bool { + return p.IsDisable +} +func (p *PolicyEntry) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.SET { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *PolicyEntry) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.PolicyName = v + } + return nil +} + +func (p *PolicyEntry) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.BackupProviderType = v + } + return nil +} + +func (p *PolicyEntry) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.BackupIntervalSeconds = v + } + return nil +} + +func (p *PolicyEntry) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]int32, 0, size) + p.AppIds = tSet + for i := 0; i < size; i++ { + var _elem3 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem3 = v + } + p.AppIds = append(p.AppIds, _elem3) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + return nil +} + +func (p *PolicyEntry) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.BackupHistoryCountToKeep = v + } + return nil +} + +func (p *PolicyEntry) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.StartTime = v + } + return nil +} + +func (p *PolicyEntry) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.IsDisable = v + } + return nil +} + +func (p *PolicyEntry) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("policy_entry"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(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 *PolicyEntry) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("policy_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:policy_name: ", p), err) + } + if err := oprot.WriteString(string(p.PolicyName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.policy_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:policy_name: ", p), err) + } + return err +} + +func (p *PolicyEntry) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_provider_type", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:backup_provider_type: ", p), err) + } + if err := oprot.WriteString(string(p.BackupProviderType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_provider_type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:backup_provider_type: ", p), err) + } + return err +} + +func (p *PolicyEntry) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_interval_seconds", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_interval_seconds: ", p), err) + } + if err := oprot.WriteString(string(p.BackupIntervalSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_interval_seconds (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:backup_interval_seconds: ", p), err) + } + return err +} + +func (p *PolicyEntry) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_ids", thrift.SET, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:app_ids: ", p), err) + } + if err := oprot.WriteSetBegin(thrift.I32, len(p.AppIds)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + for i := 0; i < len(p.AppIds); i++ { + for j := i + 1; j < len(p.AppIds); j++ { + if reflect.DeepEqual(p.AppIds[i], p.AppIds[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.AppIds[i])) + } + } + } + for _, v := range p.AppIds { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:app_ids: ", p), err) + } + return err +} + +func (p *PolicyEntry) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_history_count_to_keep", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:backup_history_count_to_keep: ", p), err) + } + if err := oprot.WriteI32(int32(p.BackupHistoryCountToKeep)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_history_count_to_keep (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:backup_history_count_to_keep: ", p), err) + } + return err +} + +func (p *PolicyEntry) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err) + } + if err := oprot.WriteString(string(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) + } + return err +} + +func (p *PolicyEntry) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_disable", thrift.BOOL, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:is_disable: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsDisable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_disable (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:is_disable: ", p), err) + } + return err +} + +func (p *PolicyEntry) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PolicyEntry(%+v)", *p) +} + +// Attributes: +// - BackupID +// - StartTimeMs +// - EndTimeMs +// - AppIds +type BackupEntry struct { + BackupID int64 `thrift:"backup_id,1" db:"backup_id" json:"backup_id"` + StartTimeMs int64 `thrift:"start_time_ms,2" db:"start_time_ms" json:"start_time_ms"` + EndTimeMs int64 `thrift:"end_time_ms,3" db:"end_time_ms" json:"end_time_ms"` + AppIds []int32 `thrift:"app_ids,4" db:"app_ids" json:"app_ids"` +} + +func NewBackupEntry() *BackupEntry { + return &BackupEntry{} +} + +func (p *BackupEntry) GetBackupID() int64 { + return p.BackupID +} + +func (p *BackupEntry) GetStartTimeMs() int64 { + return p.StartTimeMs +} + +func (p *BackupEntry) GetEndTimeMs() int64 { + return p.EndTimeMs +} + +func (p *BackupEntry) GetAppIds() []int32 { + return p.AppIds +} +func (p *BackupEntry) 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 fieldTypeId == thrift.I64 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.SET { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *BackupEntry) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.BackupID = v + } + return nil +} + +func (p *BackupEntry) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.StartTimeMs = v + } + return nil +} + +func (p *BackupEntry) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.EndTimeMs = v + } + return nil +} + +func (p *BackupEntry) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]int32, 0, size) + p.AppIds = tSet + for i := 0; i < size; i++ { + var _elem4 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem4 = v + } + p.AppIds = append(p.AppIds, _elem4) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + return nil +} + +func (p *BackupEntry) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("backup_entry"); 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 *BackupEntry) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.BackupID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_id: ", p), err) + } + return err +} + +func (p *BackupEntry) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("start_time_ms", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:start_time_ms: ", p), err) + } + if err := oprot.WriteI64(int64(p.StartTimeMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time_ms (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:start_time_ms: ", p), err) + } + return err +} + +func (p *BackupEntry) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("end_time_ms", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:end_time_ms: ", p), err) + } + if err := oprot.WriteI64(int64(p.EndTimeMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time_ms (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:end_time_ms: ", p), err) + } + return err +} + +func (p *BackupEntry) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_ids", thrift.SET, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:app_ids: ", p), err) + } + if err := oprot.WriteSetBegin(thrift.I32, len(p.AppIds)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + for i := 0; i < len(p.AppIds); i++ { + for j := i + 1; j < len(p.AppIds); j++ { + if reflect.DeepEqual(p.AppIds[i], p.AppIds[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.AppIds[i])) + } + } + } + for _, v := range p.AppIds { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:app_ids: ", p), err) + } + return err +} + +func (p *BackupEntry) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BackupEntry(%+v)", *p) +} + +// Attributes: +// - PolicyNames +// - BackupInfoCount +type ConfigurationQueryBackupPolicyRequest struct { + PolicyNames []string `thrift:"policy_names,1" db:"policy_names" json:"policy_names"` + BackupInfoCount int32 `thrift:"backup_info_count,2" db:"backup_info_count" json:"backup_info_count"` +} + +func NewConfigurationQueryBackupPolicyRequest() *ConfigurationQueryBackupPolicyRequest { + return &ConfigurationQueryBackupPolicyRequest{} +} + +func (p *ConfigurationQueryBackupPolicyRequest) GetPolicyNames() []string { + return p.PolicyNames +} + +func (p *ConfigurationQueryBackupPolicyRequest) GetBackupInfoCount() int32 { + return p.BackupInfoCount +} +func (p *ConfigurationQueryBackupPolicyRequest) 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 fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationQueryBackupPolicyRequest) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.PolicyNames = tSlice + for i := 0; i < size; i++ { + var _elem5 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem5 = v + } + p.PolicyNames = append(p.PolicyNames, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationQueryBackupPolicyRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.BackupInfoCount = v + } + return nil +} + +func (p *ConfigurationQueryBackupPolicyRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_query_backup_policy_request"); 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 *ConfigurationQueryBackupPolicyRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("policy_names", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:policy_names: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.PolicyNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PolicyNames { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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:policy_names: ", p), err) + } + return err +} + +func (p *ConfigurationQueryBackupPolicyRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_info_count", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:backup_info_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.BackupInfoCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_info_count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:backup_info_count: ", p), err) + } + return err +} + +func (p *ConfigurationQueryBackupPolicyRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationQueryBackupPolicyRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Policys +// - BackupInfos +// - HintMsg +type ConfigurationQueryBackupPolicyResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Policys []*PolicyEntry `thrift:"policys,2" db:"policys" json:"policys"` + BackupInfos [][]*BackupEntry `thrift:"backup_infos,3" db:"backup_infos" json:"backup_infos"` + HintMsg *string `thrift:"hint_msg,4" db:"hint_msg" json:"hint_msg,omitempty"` +} + +func NewConfigurationQueryBackupPolicyResponse() *ConfigurationQueryBackupPolicyResponse { + return &ConfigurationQueryBackupPolicyResponse{} +} + +var ConfigurationQueryBackupPolicyResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationQueryBackupPolicyResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationQueryBackupPolicyResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationQueryBackupPolicyResponse) GetPolicys() []*PolicyEntry { + return p.Policys +} + +func (p *ConfigurationQueryBackupPolicyResponse) GetBackupInfos() [][]*BackupEntry { + return p.BackupInfos +} + +var ConfigurationQueryBackupPolicyResponse_HintMsg_DEFAULT string + +func (p *ConfigurationQueryBackupPolicyResponse) GetHintMsg() string { + if !p.IsSetHintMsg() { + return ConfigurationQueryBackupPolicyResponse_HintMsg_DEFAULT + } + return *p.HintMsg +} +func (p *ConfigurationQueryBackupPolicyResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationQueryBackupPolicyResponse) IsSetHintMsg() bool { + return p.HintMsg != nil +} + +func (p *ConfigurationQueryBackupPolicyResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationQueryBackupPolicyResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationQueryBackupPolicyResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PolicyEntry, 0, size) + p.Policys = tSlice + for i := 0; i < size; i++ { + _elem6 := &PolicyEntry{} + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.Policys = append(p.Policys, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationQueryBackupPolicyResponse) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]*BackupEntry, 0, size) + p.BackupInfos = tSlice + for i := 0; i < size; i++ { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BackupEntry, 0, size) + _elem7 := tSlice + for i := 0; i < size; i++ { + _elem8 := &BackupEntry{} + if err := _elem8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + } + _elem7 = append(_elem7, _elem8) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.BackupInfos = append(p.BackupInfos, _elem7) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationQueryBackupPolicyResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.HintMsg = &v + } + return nil +} + +func (p *ConfigurationQueryBackupPolicyResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_query_backup_policy_response"); 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 *ConfigurationQueryBackupPolicyResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationQueryBackupPolicyResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("policys", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:policys: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Policys)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Policys { + 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:policys: ", p), err) + } + return err +} + +func (p *ConfigurationQueryBackupPolicyResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_infos", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_infos: ", p), err) + } + if err := oprot.WriteListBegin(thrift.LIST, len(p.BackupInfos)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.BackupInfos { + if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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 3:backup_infos: ", p), err) + } + return err +} + +func (p *ConfigurationQueryBackupPolicyResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetHintMsg() { + if err := oprot.WriteFieldBegin("hint_msg", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hint_msg: ", p), err) + } + if err := oprot.WriteString(string(*p.HintMsg)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_msg (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:hint_msg: ", p), err) + } + } + return err +} + +func (p *ConfigurationQueryBackupPolicyResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationQueryBackupPolicyResponse(%+v)", *p) +} + +// Attributes: +// - Pid +// - RestoreStatus +// - Progress +// - Reason +type ConfigurationReportRestoreStatusRequest struct { + Pid *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"` + RestoreStatus *base.ErrorCode `thrift:"restore_status,2" db:"restore_status" json:"restore_status"` + Progress int32 `thrift:"progress,3" db:"progress" json:"progress"` + Reason *string `thrift:"reason,4" db:"reason" json:"reason,omitempty"` +} + +func NewConfigurationReportRestoreStatusRequest() *ConfigurationReportRestoreStatusRequest { + return &ConfigurationReportRestoreStatusRequest{} +} + +var ConfigurationReportRestoreStatusRequest_Pid_DEFAULT *base.Gpid + +func (p *ConfigurationReportRestoreStatusRequest) GetPid() *base.Gpid { + if !p.IsSetPid() { + return ConfigurationReportRestoreStatusRequest_Pid_DEFAULT + } + return p.Pid +} + +var ConfigurationReportRestoreStatusRequest_RestoreStatus_DEFAULT *base.ErrorCode + +func (p *ConfigurationReportRestoreStatusRequest) GetRestoreStatus() *base.ErrorCode { + if !p.IsSetRestoreStatus() { + return ConfigurationReportRestoreStatusRequest_RestoreStatus_DEFAULT + } + return p.RestoreStatus +} + +func (p *ConfigurationReportRestoreStatusRequest) GetProgress() int32 { + return p.Progress +} + +var ConfigurationReportRestoreStatusRequest_Reason_DEFAULT string + +func (p *ConfigurationReportRestoreStatusRequest) GetReason() string { + if !p.IsSetReason() { + return ConfigurationReportRestoreStatusRequest_Reason_DEFAULT + } + return *p.Reason +} +func (p *ConfigurationReportRestoreStatusRequest) IsSetPid() bool { + return p.Pid != nil +} + +func (p *ConfigurationReportRestoreStatusRequest) IsSetRestoreStatus() bool { + return p.RestoreStatus != nil +} + +func (p *ConfigurationReportRestoreStatusRequest) IsSetReason() bool { + return p.Reason != nil +} + +func (p *ConfigurationReportRestoreStatusRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationReportRestoreStatusRequest) ReadField1(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *ConfigurationReportRestoreStatusRequest) ReadField2(iprot thrift.TProtocol) error { + p.RestoreStatus = &base.ErrorCode{} + if err := p.RestoreStatus.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RestoreStatus), err) + } + return nil +} + +func (p *ConfigurationReportRestoreStatusRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Progress = v + } + return nil +} + +func (p *ConfigurationReportRestoreStatusRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Reason = &v + } + return nil +} + +func (p *ConfigurationReportRestoreStatusRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_report_restore_status_request"); 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 *ConfigurationReportRestoreStatusRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err) + } + return err +} + +func (p *ConfigurationReportRestoreStatusRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("restore_status", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:restore_status: ", p), err) + } + if err := p.RestoreStatus.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RestoreStatus), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:restore_status: ", p), err) + } + return err +} + +func (p *ConfigurationReportRestoreStatusRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("progress", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:progress: ", p), err) + } + if err := oprot.WriteI32(int32(p.Progress)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.progress (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:progress: ", p), err) + } + return err +} + +func (p *ConfigurationReportRestoreStatusRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetReason() { + if err := oprot.WriteFieldBegin("reason", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:reason: ", p), err) + } + if err := oprot.WriteString(string(*p.Reason)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.reason (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:reason: ", p), err) + } + } + return err +} + +func (p *ConfigurationReportRestoreStatusRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationReportRestoreStatusRequest(%+v)", *p) +} + +// Attributes: +// - Err +type ConfigurationReportRestoreStatusResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` +} + +func NewConfigurationReportRestoreStatusResponse() *ConfigurationReportRestoreStatusResponse { + return &ConfigurationReportRestoreStatusResponse{} +} + +var ConfigurationReportRestoreStatusResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationReportRestoreStatusResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationReportRestoreStatusResponse_Err_DEFAULT + } + return p.Err +} +func (p *ConfigurationReportRestoreStatusResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationReportRestoreStatusResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationReportRestoreStatusResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationReportRestoreStatusResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_report_restore_status_response"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigurationReportRestoreStatusResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationReportRestoreStatusResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationReportRestoreStatusResponse(%+v)", *p) +} + +// Attributes: +// - RestoreAppID +type ConfigurationQueryRestoreRequest struct { + RestoreAppID int32 `thrift:"restore_app_id,1" db:"restore_app_id" json:"restore_app_id"` +} + +func NewConfigurationQueryRestoreRequest() *ConfigurationQueryRestoreRequest { + return &ConfigurationQueryRestoreRequest{} +} + +func (p *ConfigurationQueryRestoreRequest) GetRestoreAppID() int32 { + return p.RestoreAppID +} +func (p *ConfigurationQueryRestoreRequest) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationQueryRestoreRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.RestoreAppID = v + } + return nil +} + +func (p *ConfigurationQueryRestoreRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_query_restore_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigurationQueryRestoreRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("restore_app_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:restore_app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.RestoreAppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.restore_app_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:restore_app_id: ", p), err) + } + return err +} + +func (p *ConfigurationQueryRestoreRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationQueryRestoreRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - RestoreStatus +// - RestoreProgress +type ConfigurationQueryRestoreResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + RestoreStatus []*base.ErrorCode `thrift:"restore_status,2" db:"restore_status" json:"restore_status"` + RestoreProgress []int32 `thrift:"restore_progress,3" db:"restore_progress" json:"restore_progress"` +} + +func NewConfigurationQueryRestoreResponse() *ConfigurationQueryRestoreResponse { + return &ConfigurationQueryRestoreResponse{} +} + +var ConfigurationQueryRestoreResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationQueryRestoreResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationQueryRestoreResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationQueryRestoreResponse) GetRestoreStatus() []*base.ErrorCode { + return p.RestoreStatus +} + +func (p *ConfigurationQueryRestoreResponse) GetRestoreProgress() []int32 { + return p.RestoreProgress +} +func (p *ConfigurationQueryRestoreResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationQueryRestoreResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationQueryRestoreResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationQueryRestoreResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*base.ErrorCode, 0, size) + p.RestoreStatus = tSlice + for i := 0; i < size; i++ { + _elem9 := &base.ErrorCode{} + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.RestoreStatus = append(p.RestoreStatus, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationQueryRestoreResponse) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int32, 0, size) + p.RestoreProgress = tSlice + for i := 0; i < size; i++ { + var _elem10 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem10 = v + } + p.RestoreProgress = append(p.RestoreProgress, _elem10) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationQueryRestoreResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_query_restore_response"); 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 := 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 *ConfigurationQueryRestoreResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationQueryRestoreResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("restore_status", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:restore_status: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.RestoreStatus)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.RestoreStatus { + 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:restore_status: ", p), err) + } + return err +} + +func (p *ConfigurationQueryRestoreResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("restore_progress", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:restore_progress: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(p.RestoreProgress)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.RestoreProgress { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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 3:restore_progress: ", p), err) + } + return err +} + +func (p *ConfigurationQueryRestoreResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationQueryRestoreResponse(%+v)", *p) +} + +// Attributes: +// - BackupProviderType +// - AppID +// - BackupPath +type StartBackupAppRequest struct { + BackupProviderType string `thrift:"backup_provider_type,1" db:"backup_provider_type" json:"backup_provider_type"` + AppID int32 `thrift:"app_id,2" db:"app_id" json:"app_id"` + BackupPath *string `thrift:"backup_path,3" db:"backup_path" json:"backup_path,omitempty"` +} + +func NewStartBackupAppRequest() *StartBackupAppRequest { + return &StartBackupAppRequest{} +} + +func (p *StartBackupAppRequest) GetBackupProviderType() string { + return p.BackupProviderType +} + +func (p *StartBackupAppRequest) GetAppID() int32 { + return p.AppID +} + +var StartBackupAppRequest_BackupPath_DEFAULT string + +func (p *StartBackupAppRequest) GetBackupPath() string { + if !p.IsSetBackupPath() { + return StartBackupAppRequest_BackupPath_DEFAULT + } + return *p.BackupPath +} +func (p *StartBackupAppRequest) IsSetBackupPath() bool { + return p.BackupPath != nil +} + +func (p *StartBackupAppRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *StartBackupAppRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.BackupProviderType = v + } + return nil +} + +func (p *StartBackupAppRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *StartBackupAppRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.BackupPath = &v + } + return nil +} + +func (p *StartBackupAppRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_backup_app_request"); 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 := 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 *StartBackupAppRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_provider_type", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_provider_type: ", p), err) + } + if err := oprot.WriteString(string(p.BackupProviderType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_provider_type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_provider_type: ", p), err) + } + return err +} + +func (p *StartBackupAppRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:app_id: ", p), err) + } + return err +} + +func (p *StartBackupAppRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetBackupPath() { + if err := oprot.WriteFieldBegin("backup_path", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_path: ", p), err) + } + if err := oprot.WriteString(string(*p.BackupPath)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_path (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:backup_path: ", p), err) + } + } + return err +} + +func (p *StartBackupAppRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StartBackupAppRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMessage +// - BackupID +type StartBackupAppResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMessage string `thrift:"hint_message,2" db:"hint_message" json:"hint_message"` + BackupID *int64 `thrift:"backup_id,3" db:"backup_id" json:"backup_id,omitempty"` +} + +func NewStartBackupAppResponse() *StartBackupAppResponse { + return &StartBackupAppResponse{} +} + +var StartBackupAppResponse_Err_DEFAULT *base.ErrorCode + +func (p *StartBackupAppResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return StartBackupAppResponse_Err_DEFAULT + } + return p.Err +} + +func (p *StartBackupAppResponse) GetHintMessage() string { + return p.HintMessage +} + +var StartBackupAppResponse_BackupID_DEFAULT int64 + +func (p *StartBackupAppResponse) GetBackupID() int64 { + if !p.IsSetBackupID() { + return StartBackupAppResponse_BackupID_DEFAULT + } + return *p.BackupID +} +func (p *StartBackupAppResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *StartBackupAppResponse) IsSetBackupID() bool { + return p.BackupID != nil +} + +func (p *StartBackupAppResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *StartBackupAppResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *StartBackupAppResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMessage = v + } + return nil +} + +func (p *StartBackupAppResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.BackupID = &v + } + return nil +} + +func (p *StartBackupAppResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_backup_app_response"); 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 := 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 *StartBackupAppResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *StartBackupAppResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_message", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_message: ", p), err) + } + if err := oprot.WriteString(string(p.HintMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_message (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_message: ", p), err) + } + return err +} + +func (p *StartBackupAppResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetBackupID() { + if err := oprot.WriteFieldBegin("backup_id", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_id: ", p), err) + } + if err := oprot.WriteI64(int64(*p.BackupID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:backup_id: ", p), err) + } + } + return err +} + +func (p *StartBackupAppResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StartBackupAppResponse(%+v)", *p) +} + +// Attributes: +// - BackupID +// - AppName +// - BackupProviderType +// - BackupPath +// - StartTimeMs +// - EndTimeMs +// - IsBackupFailed +type BackupItem struct { + BackupID int64 `thrift:"backup_id,1" db:"backup_id" json:"backup_id"` + AppName string `thrift:"app_name,2" db:"app_name" json:"app_name"` + BackupProviderType string `thrift:"backup_provider_type,3" db:"backup_provider_type" json:"backup_provider_type"` + BackupPath string `thrift:"backup_path,4" db:"backup_path" json:"backup_path"` + StartTimeMs int64 `thrift:"start_time_ms,5" db:"start_time_ms" json:"start_time_ms"` + EndTimeMs int64 `thrift:"end_time_ms,6" db:"end_time_ms" json:"end_time_ms"` + IsBackupFailed bool `thrift:"is_backup_failed,7" db:"is_backup_failed" json:"is_backup_failed"` +} + +func NewBackupItem() *BackupItem { + return &BackupItem{} +} + +func (p *BackupItem) GetBackupID() int64 { + return p.BackupID +} + +func (p *BackupItem) GetAppName() string { + return p.AppName +} + +func (p *BackupItem) GetBackupProviderType() string { + return p.BackupProviderType +} + +func (p *BackupItem) GetBackupPath() string { + return p.BackupPath +} + +func (p *BackupItem) GetStartTimeMs() int64 { + return p.StartTimeMs +} + +func (p *BackupItem) GetEndTimeMs() int64 { + return p.EndTimeMs +} + +func (p *BackupItem) GetIsBackupFailed() bool { + return p.IsBackupFailed +} +func (p *BackupItem) 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 fieldTypeId == thrift.I64 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *BackupItem) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.BackupID = v + } + return nil +} + +func (p *BackupItem) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *BackupItem) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.BackupProviderType = v + } + return nil +} + +func (p *BackupItem) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.BackupPath = v + } + return nil +} + +func (p *BackupItem) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.StartTimeMs = v + } + return nil +} + +func (p *BackupItem) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.EndTimeMs = v + } + return nil +} + +func (p *BackupItem) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.IsBackupFailed = v + } + return nil +} + +func (p *BackupItem) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("backup_item"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(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 *BackupItem) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.BackupID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_id: ", p), err) + } + return err +} + +func (p *BackupItem) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:app_name: ", p), err) + } + return err +} + +func (p *BackupItem) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_provider_type", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_provider_type: ", p), err) + } + if err := oprot.WriteString(string(p.BackupProviderType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_provider_type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:backup_provider_type: ", p), err) + } + return err +} + +func (p *BackupItem) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backup_path", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:backup_path: ", p), err) + } + if err := oprot.WriteString(string(p.BackupPath)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_path (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:backup_path: ", p), err) + } + return err +} + +func (p *BackupItem) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("start_time_ms", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:start_time_ms: ", p), err) + } + if err := oprot.WriteI64(int64(p.StartTimeMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time_ms (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:start_time_ms: ", p), err) + } + return err +} + +func (p *BackupItem) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("end_time_ms", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:end_time_ms: ", p), err) + } + if err := oprot.WriteI64(int64(p.EndTimeMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time_ms (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:end_time_ms: ", p), err) + } + return err +} + +func (p *BackupItem) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_backup_failed", thrift.BOOL, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:is_backup_failed: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsBackupFailed)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_backup_failed (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:is_backup_failed: ", p), err) + } + return err +} + +func (p *BackupItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BackupItem(%+v)", *p) +} + +// Attributes: +// - AppID +// - BackupID +type QueryBackupStatusRequest struct { + AppID int32 `thrift:"app_id,1" db:"app_id" json:"app_id"` + BackupID *int64 `thrift:"backup_id,2" db:"backup_id" json:"backup_id,omitempty"` +} + +func NewQueryBackupStatusRequest() *QueryBackupStatusRequest { + return &QueryBackupStatusRequest{} +} + +func (p *QueryBackupStatusRequest) GetAppID() int32 { + return p.AppID +} + +var QueryBackupStatusRequest_BackupID_DEFAULT int64 + +func (p *QueryBackupStatusRequest) GetBackupID() int64 { + if !p.IsSetBackupID() { + return QueryBackupStatusRequest_BackupID_DEFAULT + } + return *p.BackupID +} +func (p *QueryBackupStatusRequest) IsSetBackupID() bool { + return p.BackupID != nil +} + +func (p *QueryBackupStatusRequest) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryBackupStatusRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *QueryBackupStatusRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.BackupID = &v + } + return nil +} + +func (p *QueryBackupStatusRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_backup_status_request"); 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 *QueryBackupStatusRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_id: ", p), err) + } + return err +} + +func (p *QueryBackupStatusRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetBackupID() { + if err := oprot.WriteFieldBegin("backup_id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:backup_id: ", p), err) + } + if err := oprot.WriteI64(int64(*p.BackupID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:backup_id: ", p), err) + } + } + return err +} + +func (p *QueryBackupStatusRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryBackupStatusRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMessage +// - BackupItems +type QueryBackupStatusResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMessage string `thrift:"hint_message,2" db:"hint_message" json:"hint_message"` + BackupItems []*BackupItem `thrift:"backup_items,3" db:"backup_items" json:"backup_items,omitempty"` +} + +func NewQueryBackupStatusResponse() *QueryBackupStatusResponse { + return &QueryBackupStatusResponse{} +} + +var QueryBackupStatusResponse_Err_DEFAULT *base.ErrorCode + +func (p *QueryBackupStatusResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return QueryBackupStatusResponse_Err_DEFAULT + } + return p.Err +} + +func (p *QueryBackupStatusResponse) GetHintMessage() string { + return p.HintMessage +} + +var QueryBackupStatusResponse_BackupItems_DEFAULT []*BackupItem + +func (p *QueryBackupStatusResponse) GetBackupItems() []*BackupItem { + return p.BackupItems +} +func (p *QueryBackupStatusResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *QueryBackupStatusResponse) IsSetBackupItems() bool { + return p.BackupItems != nil +} + +func (p *QueryBackupStatusResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryBackupStatusResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *QueryBackupStatusResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMessage = v + } + return nil +} + +func (p *QueryBackupStatusResponse) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BackupItem, 0, size) + p.BackupItems = tSlice + for i := 0; i < size; i++ { + _elem11 := &BackupItem{} + if err := _elem11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + } + p.BackupItems = append(p.BackupItems, _elem11) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *QueryBackupStatusResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_backup_status_response"); 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 := 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 *QueryBackupStatusResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *QueryBackupStatusResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_message", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_message: ", p), err) + } + if err := oprot.WriteString(string(p.HintMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_message (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_message: ", p), err) + } + return err +} + +func (p *QueryBackupStatusResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetBackupItems() { + if err := oprot.WriteFieldBegin("backup_items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.BackupItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.BackupItems { + 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 3:backup_items: ", p), err) + } + } + return err +} + +func (p *QueryBackupStatusResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryBackupStatusResponse(%+v)", *p) +} diff --git a/go-client/idl/admin/bulk_load-consts.go b/go-client/idl/admin/bulk_load-consts.go new file mode 100644 index 0000000000..757b943ef3 --- /dev/null +++ b/go-client/idl/admin/bulk_load-consts.go @@ -0,0 +1,27 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +func init() { +} diff --git a/go-client/idl/admin/bulk_load.go b/go-client/idl/admin/bulk_load.go new file mode 100644 index 0000000000..f7529538c8 --- /dev/null +++ b/go-client/idl/admin/bulk_load.go @@ -0,0 +1,4536 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +type BulkLoadStatus int64 + +const ( + BulkLoadStatus_BLS_INVALID BulkLoadStatus = 0 + BulkLoadStatus_BLS_DOWNLOADING BulkLoadStatus = 1 + BulkLoadStatus_BLS_DOWNLOADED BulkLoadStatus = 2 + BulkLoadStatus_BLS_INGESTING BulkLoadStatus = 3 + BulkLoadStatus_BLS_SUCCEED BulkLoadStatus = 4 + BulkLoadStatus_BLS_FAILED BulkLoadStatus = 5 + BulkLoadStatus_BLS_PAUSING BulkLoadStatus = 6 + BulkLoadStatus_BLS_PAUSED BulkLoadStatus = 7 + BulkLoadStatus_BLS_CANCELED BulkLoadStatus = 8 +) + +func (p BulkLoadStatus) String() string { + switch p { + case BulkLoadStatus_BLS_INVALID: + return "BLS_INVALID" + case BulkLoadStatus_BLS_DOWNLOADING: + return "BLS_DOWNLOADING" + case BulkLoadStatus_BLS_DOWNLOADED: + return "BLS_DOWNLOADED" + case BulkLoadStatus_BLS_INGESTING: + return "BLS_INGESTING" + case BulkLoadStatus_BLS_SUCCEED: + return "BLS_SUCCEED" + case BulkLoadStatus_BLS_FAILED: + return "BLS_FAILED" + case BulkLoadStatus_BLS_PAUSING: + return "BLS_PAUSING" + case BulkLoadStatus_BLS_PAUSED: + return "BLS_PAUSED" + case BulkLoadStatus_BLS_CANCELED: + return "BLS_CANCELED" + } + return "" +} + +func BulkLoadStatusFromString(s string) (BulkLoadStatus, error) { + switch s { + case "BLS_INVALID": + return BulkLoadStatus_BLS_INVALID, nil + case "BLS_DOWNLOADING": + return BulkLoadStatus_BLS_DOWNLOADING, nil + case "BLS_DOWNLOADED": + return BulkLoadStatus_BLS_DOWNLOADED, nil + case "BLS_INGESTING": + return BulkLoadStatus_BLS_INGESTING, nil + case "BLS_SUCCEED": + return BulkLoadStatus_BLS_SUCCEED, nil + case "BLS_FAILED": + return BulkLoadStatus_BLS_FAILED, nil + case "BLS_PAUSING": + return BulkLoadStatus_BLS_PAUSING, nil + case "BLS_PAUSED": + return BulkLoadStatus_BLS_PAUSED, nil + case "BLS_CANCELED": + return BulkLoadStatus_BLS_CANCELED, nil + } + return BulkLoadStatus(0), fmt.Errorf("not a valid BulkLoadStatus string") +} + +func BulkLoadStatusPtr(v BulkLoadStatus) *BulkLoadStatus { return &v } + +func (p BulkLoadStatus) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *BulkLoadStatus) UnmarshalText(text []byte) error { + q, err := BulkLoadStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *BulkLoadStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = BulkLoadStatus(v) + return nil +} + +func (p *BulkLoadStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type IngestionStatus int64 + +const ( + IngestionStatus_IS_INVALID IngestionStatus = 0 + IngestionStatus_IS_RUNNING IngestionStatus = 1 + IngestionStatus_IS_SUCCEED IngestionStatus = 2 + IngestionStatus_IS_FAILED IngestionStatus = 3 +) + +func (p IngestionStatus) String() string { + switch p { + case IngestionStatus_IS_INVALID: + return "IS_INVALID" + case IngestionStatus_IS_RUNNING: + return "IS_RUNNING" + case IngestionStatus_IS_SUCCEED: + return "IS_SUCCEED" + case IngestionStatus_IS_FAILED: + return "IS_FAILED" + } + return "" +} + +func IngestionStatusFromString(s string) (IngestionStatus, error) { + switch s { + case "IS_INVALID": + return IngestionStatus_IS_INVALID, nil + case "IS_RUNNING": + return IngestionStatus_IS_RUNNING, nil + case "IS_SUCCEED": + return IngestionStatus_IS_SUCCEED, nil + case "IS_FAILED": + return IngestionStatus_IS_FAILED, nil + } + return IngestionStatus(0), fmt.Errorf("not a valid IngestionStatus string") +} + +func IngestionStatusPtr(v IngestionStatus) *IngestionStatus { return &v } + +func (p IngestionStatus) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *IngestionStatus) UnmarshalText(text []byte) error { + q, err := IngestionStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *IngestionStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = IngestionStatus(v) + return nil +} + +func (p *IngestionStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type BulkLoadControlType int64 + +const ( + BulkLoadControlType_BLC_PAUSE BulkLoadControlType = 0 + BulkLoadControlType_BLC_RESTART BulkLoadControlType = 1 + BulkLoadControlType_BLC_CANCEL BulkLoadControlType = 2 + BulkLoadControlType_BLC_FORCE_CANCEL BulkLoadControlType = 3 +) + +func (p BulkLoadControlType) String() string { + switch p { + case BulkLoadControlType_BLC_PAUSE: + return "BLC_PAUSE" + case BulkLoadControlType_BLC_RESTART: + return "BLC_RESTART" + case BulkLoadControlType_BLC_CANCEL: + return "BLC_CANCEL" + case BulkLoadControlType_BLC_FORCE_CANCEL: + return "BLC_FORCE_CANCEL" + } + return "" +} + +func BulkLoadControlTypeFromString(s string) (BulkLoadControlType, error) { + switch s { + case "BLC_PAUSE": + return BulkLoadControlType_BLC_PAUSE, nil + case "BLC_RESTART": + return BulkLoadControlType_BLC_RESTART, nil + case "BLC_CANCEL": + return BulkLoadControlType_BLC_CANCEL, nil + case "BLC_FORCE_CANCEL": + return BulkLoadControlType_BLC_FORCE_CANCEL, nil + } + return BulkLoadControlType(0), fmt.Errorf("not a valid BulkLoadControlType string") +} + +func BulkLoadControlTypePtr(v BulkLoadControlType) *BulkLoadControlType { return &v } + +func (p BulkLoadControlType) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *BulkLoadControlType) UnmarshalText(text []byte) error { + q, err := BulkLoadControlTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *BulkLoadControlType) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = BulkLoadControlType(v) + return nil +} + +func (p *BulkLoadControlType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +// Attributes: +// - Files +// - FileTotalSize +type BulkLoadMetadata struct { + Files []*FileMeta `thrift:"files,1" db:"files" json:"files"` + FileTotalSize int64 `thrift:"file_total_size,2" db:"file_total_size" json:"file_total_size"` +} + +func NewBulkLoadMetadata() *BulkLoadMetadata { + return &BulkLoadMetadata{} +} + +func (p *BulkLoadMetadata) GetFiles() []*FileMeta { + return p.Files +} + +func (p *BulkLoadMetadata) GetFileTotalSize() int64 { + return p.FileTotalSize +} +func (p *BulkLoadMetadata) 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 fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *BulkLoadMetadata) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FileMeta, 0, size) + p.Files = tSlice + for i := 0; i < size; i++ { + _elem0 := &FileMeta{} + if err := _elem0.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Files = append(p.Files, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BulkLoadMetadata) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.FileTotalSize = v + } + return nil +} + +func (p *BulkLoadMetadata) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("bulk_load_metadata"); 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 *BulkLoadMetadata) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("files", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:files: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Files)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Files { + 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:files: ", p), err) + } + return err +} + +func (p *BulkLoadMetadata) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("file_total_size", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:file_total_size: ", p), err) + } + if err := oprot.WriteI64(int64(p.FileTotalSize)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.file_total_size (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:file_total_size: ", p), err) + } + return err +} + +func (p *BulkLoadMetadata) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BulkLoadMetadata(%+v)", *p) +} + +// Attributes: +// - AppName +// - ClusterName +// - FileProviderType +// - RemoteRootPath +// - IngestBehind +type StartBulkLoadRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + ClusterName string `thrift:"cluster_name,2" db:"cluster_name" json:"cluster_name"` + FileProviderType string `thrift:"file_provider_type,3" db:"file_provider_type" json:"file_provider_type"` + RemoteRootPath string `thrift:"remote_root_path,4" db:"remote_root_path" json:"remote_root_path"` + IngestBehind bool `thrift:"ingest_behind,5" db:"ingest_behind" json:"ingest_behind"` +} + +func NewStartBulkLoadRequest() *StartBulkLoadRequest { + return &StartBulkLoadRequest{} +} + +func (p *StartBulkLoadRequest) GetAppName() string { + return p.AppName +} + +func (p *StartBulkLoadRequest) GetClusterName() string { + return p.ClusterName +} + +func (p *StartBulkLoadRequest) GetFileProviderType() string { + return p.FileProviderType +} + +func (p *StartBulkLoadRequest) GetRemoteRootPath() string { + return p.RemoteRootPath +} + +func (p *StartBulkLoadRequest) GetIngestBehind() bool { + return p.IngestBehind +} +func (p *StartBulkLoadRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *StartBulkLoadRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *StartBulkLoadRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ClusterName = v + } + return nil +} + +func (p *StartBulkLoadRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.FileProviderType = v + } + return nil +} + +func (p *StartBulkLoadRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.RemoteRootPath = v + } + return nil +} + +func (p *StartBulkLoadRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.IngestBehind = v + } + return nil +} + +func (p *StartBulkLoadRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_bulk_load_request"); 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 := p.writeField5(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 *StartBulkLoadRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *StartBulkLoadRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("cluster_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:cluster_name: ", p), err) + } + if err := oprot.WriteString(string(p.ClusterName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:cluster_name: ", p), err) + } + return err +} + +func (p *StartBulkLoadRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("file_provider_type", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:file_provider_type: ", p), err) + } + if err := oprot.WriteString(string(p.FileProviderType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.file_provider_type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:file_provider_type: ", p), err) + } + return err +} + +func (p *StartBulkLoadRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("remote_root_path", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:remote_root_path: ", p), err) + } + if err := oprot.WriteString(string(p.RemoteRootPath)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_root_path (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:remote_root_path: ", p), err) + } + return err +} + +func (p *StartBulkLoadRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ingest_behind", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ingest_behind: ", p), err) + } + if err := oprot.WriteBool(bool(p.IngestBehind)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ingest_behind (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ingest_behind: ", p), err) + } + return err +} + +func (p *StartBulkLoadRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StartBulkLoadRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMsg +type StartBulkLoadResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMsg string `thrift:"hint_msg,2" db:"hint_msg" json:"hint_msg"` +} + +func NewStartBulkLoadResponse() *StartBulkLoadResponse { + return &StartBulkLoadResponse{} +} + +var StartBulkLoadResponse_Err_DEFAULT *base.ErrorCode + +func (p *StartBulkLoadResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return StartBulkLoadResponse_Err_DEFAULT + } + return p.Err +} + +func (p *StartBulkLoadResponse) GetHintMsg() string { + return p.HintMsg +} +func (p *StartBulkLoadResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *StartBulkLoadResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *StartBulkLoadResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *StartBulkLoadResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMsg = v + } + return nil +} + +func (p *StartBulkLoadResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_bulk_load_response"); 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 *StartBulkLoadResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *StartBulkLoadResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_msg: ", p), err) + } + if err := oprot.WriteString(string(p.HintMsg)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_msg (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_msg: ", p), err) + } + return err +} + +func (p *StartBulkLoadResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StartBulkLoadResponse(%+v)", *p) +} + +// Attributes: +// - DownloadProgress +// - DownloadStatus +// - IngestStatus +// - IsCleanedUp +// - IsPaused +type PartitionBulkLoadState struct { + DownloadProgress int32 `thrift:"download_progress,1" db:"download_progress" json:"download_progress"` + DownloadStatus *base.ErrorCode `thrift:"download_status,2" db:"download_status" json:"download_status,omitempty"` + IngestStatus IngestionStatus `thrift:"ingest_status,3" db:"ingest_status" json:"ingest_status"` + IsCleanedUp bool `thrift:"is_cleaned_up,4" db:"is_cleaned_up" json:"is_cleaned_up"` + IsPaused bool `thrift:"is_paused,5" db:"is_paused" json:"is_paused"` +} + +func NewPartitionBulkLoadState() *PartitionBulkLoadState { + return &PartitionBulkLoadState{ + IngestStatus: 0, + } +} + +var PartitionBulkLoadState_DownloadProgress_DEFAULT int32 = 0 + +func (p *PartitionBulkLoadState) GetDownloadProgress() int32 { + return p.DownloadProgress +} + +var PartitionBulkLoadState_DownloadStatus_DEFAULT *base.ErrorCode + +func (p *PartitionBulkLoadState) GetDownloadStatus() *base.ErrorCode { + if !p.IsSetDownloadStatus() { + return PartitionBulkLoadState_DownloadStatus_DEFAULT + } + return p.DownloadStatus +} + +var PartitionBulkLoadState_IngestStatus_DEFAULT IngestionStatus = 0 + +func (p *PartitionBulkLoadState) GetIngestStatus() IngestionStatus { + return p.IngestStatus +} + +var PartitionBulkLoadState_IsCleanedUp_DEFAULT bool = false + +func (p *PartitionBulkLoadState) GetIsCleanedUp() bool { + return p.IsCleanedUp +} + +var PartitionBulkLoadState_IsPaused_DEFAULT bool = false + +func (p *PartitionBulkLoadState) GetIsPaused() bool { + return p.IsPaused +} +func (p *PartitionBulkLoadState) IsSetDownloadProgress() bool { + return p.DownloadProgress != PartitionBulkLoadState_DownloadProgress_DEFAULT +} + +func (p *PartitionBulkLoadState) IsSetDownloadStatus() bool { + return p.DownloadStatus != nil +} + +func (p *PartitionBulkLoadState) IsSetIngestStatus() bool { + return p.IngestStatus != PartitionBulkLoadState_IngestStatus_DEFAULT +} + +func (p *PartitionBulkLoadState) IsSetIsCleanedUp() bool { + return p.IsCleanedUp != PartitionBulkLoadState_IsCleanedUp_DEFAULT +} + +func (p *PartitionBulkLoadState) IsSetIsPaused() bool { + return p.IsPaused != PartitionBulkLoadState_IsPaused_DEFAULT +} + +func (p *PartitionBulkLoadState) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *PartitionBulkLoadState) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.DownloadProgress = v + } + return nil +} + +func (p *PartitionBulkLoadState) ReadField2(iprot thrift.TProtocol) error { + p.DownloadStatus = &base.ErrorCode{} + if err := p.DownloadStatus.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DownloadStatus), err) + } + return nil +} + +func (p *PartitionBulkLoadState) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := IngestionStatus(v) + p.IngestStatus = temp + } + return nil +} + +func (p *PartitionBulkLoadState) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.IsCleanedUp = v + } + return nil +} + +func (p *PartitionBulkLoadState) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.IsPaused = v + } + return nil +} + +func (p *PartitionBulkLoadState) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("partition_bulk_load_state"); 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 := p.writeField5(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 *PartitionBulkLoadState) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetDownloadProgress() { + if err := oprot.WriteFieldBegin("download_progress", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:download_progress: ", p), err) + } + if err := oprot.WriteI32(int32(p.DownloadProgress)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.download_progress (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:download_progress: ", p), err) + } + } + return err +} + +func (p *PartitionBulkLoadState) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDownloadStatus() { + if err := oprot.WriteFieldBegin("download_status", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:download_status: ", p), err) + } + if err := p.DownloadStatus.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DownloadStatus), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:download_status: ", p), err) + } + } + return err +} + +func (p *PartitionBulkLoadState) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetIngestStatus() { + if err := oprot.WriteFieldBegin("ingest_status", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:ingest_status: ", p), err) + } + if err := oprot.WriteI32(int32(p.IngestStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ingest_status (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:ingest_status: ", p), err) + } + } + return err +} + +func (p *PartitionBulkLoadState) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetIsCleanedUp() { + if err := oprot.WriteFieldBegin("is_cleaned_up", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:is_cleaned_up: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsCleanedUp)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_cleaned_up (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:is_cleaned_up: ", p), err) + } + } + return err +} + +func (p *PartitionBulkLoadState) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetIsPaused() { + if err := oprot.WriteFieldBegin("is_paused", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:is_paused: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsPaused)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_paused (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:is_paused: ", p), err) + } + } + return err +} + +func (p *PartitionBulkLoadState) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartitionBulkLoadState(%+v)", *p) +} + +// Attributes: +// - Pid +// - AppName +// - Primary +// - RemoteProviderName +// - ClusterName +// - Ballot +// - MetaBulkLoadStatus +// - QueryBulkLoadMetadata +// - RemoteRootPath +// - HpPrimary +type BulkLoadRequest struct { + Pid *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"` + AppName string `thrift:"app_name,2" db:"app_name" json:"app_name"` + Primary *base.RPCAddress `thrift:"primary,3" db:"primary" json:"primary"` + RemoteProviderName string `thrift:"remote_provider_name,4" db:"remote_provider_name" json:"remote_provider_name"` + ClusterName string `thrift:"cluster_name,5" db:"cluster_name" json:"cluster_name"` + Ballot int64 `thrift:"ballot,6" db:"ballot" json:"ballot"` + MetaBulkLoadStatus BulkLoadStatus `thrift:"meta_bulk_load_status,7" db:"meta_bulk_load_status" json:"meta_bulk_load_status"` + QueryBulkLoadMetadata bool `thrift:"query_bulk_load_metadata,8" db:"query_bulk_load_metadata" json:"query_bulk_load_metadata"` + RemoteRootPath string `thrift:"remote_root_path,9" db:"remote_root_path" json:"remote_root_path"` + HpPrimary *base.HostPort `thrift:"hp_primary,10" db:"hp_primary" json:"hp_primary,omitempty"` +} + +func NewBulkLoadRequest() *BulkLoadRequest { + return &BulkLoadRequest{} +} + +var BulkLoadRequest_Pid_DEFAULT *base.Gpid + +func (p *BulkLoadRequest) GetPid() *base.Gpid { + if !p.IsSetPid() { + return BulkLoadRequest_Pid_DEFAULT + } + return p.Pid +} + +func (p *BulkLoadRequest) GetAppName() string { + return p.AppName +} + +var BulkLoadRequest_Primary_DEFAULT *base.RPCAddress + +func (p *BulkLoadRequest) GetPrimary() *base.RPCAddress { + if !p.IsSetPrimary() { + return BulkLoadRequest_Primary_DEFAULT + } + return p.Primary +} + +func (p *BulkLoadRequest) GetRemoteProviderName() string { + return p.RemoteProviderName +} + +func (p *BulkLoadRequest) GetClusterName() string { + return p.ClusterName +} + +func (p *BulkLoadRequest) GetBallot() int64 { + return p.Ballot +} + +func (p *BulkLoadRequest) GetMetaBulkLoadStatus() BulkLoadStatus { + return p.MetaBulkLoadStatus +} + +func (p *BulkLoadRequest) GetQueryBulkLoadMetadata() bool { + return p.QueryBulkLoadMetadata +} + +func (p *BulkLoadRequest) GetRemoteRootPath() string { + return p.RemoteRootPath +} + +var BulkLoadRequest_HpPrimary_DEFAULT *base.HostPort + +func (p *BulkLoadRequest) GetHpPrimary() *base.HostPort { + if !p.IsSetHpPrimary() { + return BulkLoadRequest_HpPrimary_DEFAULT + } + return p.HpPrimary +} +func (p *BulkLoadRequest) IsSetPid() bool { + return p.Pid != nil +} + +func (p *BulkLoadRequest) IsSetPrimary() bool { + return p.Primary != nil +} + +func (p *BulkLoadRequest) IsSetHpPrimary() bool { + return p.HpPrimary != nil +} + +func (p *BulkLoadRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I32 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.STRING { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField10(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *BulkLoadRequest) ReadField1(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *BulkLoadRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *BulkLoadRequest) ReadField3(iprot thrift.TProtocol) error { + p.Primary = &base.RPCAddress{} + if err := p.Primary.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Primary), err) + } + return nil +} + +func (p *BulkLoadRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.RemoteProviderName = v + } + return nil +} + +func (p *BulkLoadRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.ClusterName = v + } + return nil +} + +func (p *BulkLoadRequest) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Ballot = v + } + return nil +} + +func (p *BulkLoadRequest) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + temp := BulkLoadStatus(v) + p.MetaBulkLoadStatus = temp + } + return nil +} + +func (p *BulkLoadRequest) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.QueryBulkLoadMetadata = v + } + return nil +} + +func (p *BulkLoadRequest) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.RemoteRootPath = v + } + return nil +} + +func (p *BulkLoadRequest) ReadField10(iprot thrift.TProtocol) error { + p.HpPrimary = &base.HostPort{} + if err := p.HpPrimary.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpPrimary), err) + } + return nil +} + +func (p *BulkLoadRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("bulk_load_request"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := p.writeField9(oprot); err != nil { + return err + } + if err := p.writeField10(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 *BulkLoadRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err) + } + return err +} + +func (p *BulkLoadRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:app_name: ", p), err) + } + return err +} + +func (p *BulkLoadRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("primary", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:primary: ", p), err) + } + if err := p.Primary.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Primary), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:primary: ", p), err) + } + return err +} + +func (p *BulkLoadRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("remote_provider_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:remote_provider_name: ", p), err) + } + if err := oprot.WriteString(string(p.RemoteProviderName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_provider_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:remote_provider_name: ", p), err) + } + return err +} + +func (p *BulkLoadRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("cluster_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:cluster_name: ", p), err) + } + if err := oprot.WriteString(string(p.ClusterName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_name (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:cluster_name: ", p), err) + } + return err +} + +func (p *BulkLoadRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ballot", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:ballot: ", p), err) + } + if err := oprot.WriteI64(int64(p.Ballot)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ballot (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:ballot: ", p), err) + } + return err +} + +func (p *BulkLoadRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("meta_bulk_load_status", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:meta_bulk_load_status: ", p), err) + } + if err := oprot.WriteI32(int32(p.MetaBulkLoadStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.meta_bulk_load_status (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:meta_bulk_load_status: ", p), err) + } + return err +} + +func (p *BulkLoadRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("query_bulk_load_metadata", thrift.BOOL, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:query_bulk_load_metadata: ", p), err) + } + if err := oprot.WriteBool(bool(p.QueryBulkLoadMetadata)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.query_bulk_load_metadata (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:query_bulk_load_metadata: ", p), err) + } + return err +} + +func (p *BulkLoadRequest) writeField9(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("remote_root_path", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:remote_root_path: ", p), err) + } + if err := oprot.WriteString(string(p.RemoteRootPath)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_root_path (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:remote_root_path: ", p), err) + } + return err +} + +func (p *BulkLoadRequest) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetHpPrimary() { + if err := oprot.WriteFieldBegin("hp_primary", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:hp_primary: ", p), err) + } + if err := p.HpPrimary.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpPrimary), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:hp_primary: ", p), err) + } + } + return err +} + +func (p *BulkLoadRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BulkLoadRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Pid +// - AppName +// - PrimaryBulkLoadStatus +// - GroupBulkLoadState +// - Metadata +// - TotalDownloadProgress +// - IsGroupIngestionFinished +// - IsGroupBulkLoadContextCleanedUp +// - IsGroupBulkLoadPaused +// - HpGroupBulkLoadState +type BulkLoadResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Pid *base.Gpid `thrift:"pid,2" db:"pid" json:"pid"` + AppName string `thrift:"app_name,3" db:"app_name" json:"app_name"` + PrimaryBulkLoadStatus BulkLoadStatus `thrift:"primary_bulk_load_status,4" db:"primary_bulk_load_status" json:"primary_bulk_load_status"` + GroupBulkLoadState map[*base.RPCAddress]*PartitionBulkLoadState `thrift:"group_bulk_load_state,5" db:"group_bulk_load_state" json:"group_bulk_load_state"` + Metadata *BulkLoadMetadata `thrift:"metadata,6" db:"metadata" json:"metadata,omitempty"` + TotalDownloadProgress *int32 `thrift:"total_download_progress,7" db:"total_download_progress" json:"total_download_progress,omitempty"` + IsGroupIngestionFinished *bool `thrift:"is_group_ingestion_finished,8" db:"is_group_ingestion_finished" json:"is_group_ingestion_finished,omitempty"` + IsGroupBulkLoadContextCleanedUp *bool `thrift:"is_group_bulk_load_context_cleaned_up,9" db:"is_group_bulk_load_context_cleaned_up" json:"is_group_bulk_load_context_cleaned_up,omitempty"` + IsGroupBulkLoadPaused *bool `thrift:"is_group_bulk_load_paused,10" db:"is_group_bulk_load_paused" json:"is_group_bulk_load_paused,omitempty"` + HpGroupBulkLoadState map[*base.HostPort]*PartitionBulkLoadState `thrift:"hp_group_bulk_load_state,11" db:"hp_group_bulk_load_state" json:"hp_group_bulk_load_state,omitempty"` +} + +func NewBulkLoadResponse() *BulkLoadResponse { + return &BulkLoadResponse{} +} + +var BulkLoadResponse_Err_DEFAULT *base.ErrorCode + +func (p *BulkLoadResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return BulkLoadResponse_Err_DEFAULT + } + return p.Err +} + +var BulkLoadResponse_Pid_DEFAULT *base.Gpid + +func (p *BulkLoadResponse) GetPid() *base.Gpid { + if !p.IsSetPid() { + return BulkLoadResponse_Pid_DEFAULT + } + return p.Pid +} + +func (p *BulkLoadResponse) GetAppName() string { + return p.AppName +} + +func (p *BulkLoadResponse) GetPrimaryBulkLoadStatus() BulkLoadStatus { + return p.PrimaryBulkLoadStatus +} + +func (p *BulkLoadResponse) GetGroupBulkLoadState() map[*base.RPCAddress]*PartitionBulkLoadState { + return p.GroupBulkLoadState +} + +var BulkLoadResponse_Metadata_DEFAULT *BulkLoadMetadata + +func (p *BulkLoadResponse) GetMetadata() *BulkLoadMetadata { + if !p.IsSetMetadata() { + return BulkLoadResponse_Metadata_DEFAULT + } + return p.Metadata +} + +var BulkLoadResponse_TotalDownloadProgress_DEFAULT int32 + +func (p *BulkLoadResponse) GetTotalDownloadProgress() int32 { + if !p.IsSetTotalDownloadProgress() { + return BulkLoadResponse_TotalDownloadProgress_DEFAULT + } + return *p.TotalDownloadProgress +} + +var BulkLoadResponse_IsGroupIngestionFinished_DEFAULT bool + +func (p *BulkLoadResponse) GetIsGroupIngestionFinished() bool { + if !p.IsSetIsGroupIngestionFinished() { + return BulkLoadResponse_IsGroupIngestionFinished_DEFAULT + } + return *p.IsGroupIngestionFinished +} + +var BulkLoadResponse_IsGroupBulkLoadContextCleanedUp_DEFAULT bool + +func (p *BulkLoadResponse) GetIsGroupBulkLoadContextCleanedUp() bool { + if !p.IsSetIsGroupBulkLoadContextCleanedUp() { + return BulkLoadResponse_IsGroupBulkLoadContextCleanedUp_DEFAULT + } + return *p.IsGroupBulkLoadContextCleanedUp +} + +var BulkLoadResponse_IsGroupBulkLoadPaused_DEFAULT bool + +func (p *BulkLoadResponse) GetIsGroupBulkLoadPaused() bool { + if !p.IsSetIsGroupBulkLoadPaused() { + return BulkLoadResponse_IsGroupBulkLoadPaused_DEFAULT + } + return *p.IsGroupBulkLoadPaused +} + +var BulkLoadResponse_HpGroupBulkLoadState_DEFAULT map[*base.HostPort]*PartitionBulkLoadState + +func (p *BulkLoadResponse) GetHpGroupBulkLoadState() map[*base.HostPort]*PartitionBulkLoadState { + return p.HpGroupBulkLoadState +} +func (p *BulkLoadResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *BulkLoadResponse) IsSetPid() bool { + return p.Pid != nil +} + +func (p *BulkLoadResponse) IsSetMetadata() bool { + return p.Metadata != nil +} + +func (p *BulkLoadResponse) IsSetTotalDownloadProgress() bool { + return p.TotalDownloadProgress != nil +} + +func (p *BulkLoadResponse) IsSetIsGroupIngestionFinished() bool { + return p.IsGroupIngestionFinished != nil +} + +func (p *BulkLoadResponse) IsSetIsGroupBulkLoadContextCleanedUp() bool { + return p.IsGroupBulkLoadContextCleanedUp != nil +} + +func (p *BulkLoadResponse) IsSetIsGroupBulkLoadPaused() bool { + return p.IsGroupBulkLoadPaused != nil +} + +func (p *BulkLoadResponse) IsSetHpGroupBulkLoadState() bool { + return p.HpGroupBulkLoadState != nil +} + +func (p *BulkLoadResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.MAP { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I32 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField10(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.MAP { + if err := p.ReadField11(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *BulkLoadResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *BulkLoadResponse) ReadField2(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *BulkLoadResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *BulkLoadResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := BulkLoadStatus(v) + p.PrimaryBulkLoadStatus = temp + } + return nil +} + +func (p *BulkLoadResponse) ReadField5(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[*base.RPCAddress]*PartitionBulkLoadState, size) + p.GroupBulkLoadState = tMap + for i := 0; i < size; i++ { + _key1 := &base.RPCAddress{} + if err := _key1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _key1), err) + } + _val2 := &PartitionBulkLoadState{ + IngestStatus: 0, + } + if err := _val2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val2), err) + } + p.GroupBulkLoadState[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *BulkLoadResponse) ReadField6(iprot thrift.TProtocol) error { + p.Metadata = &BulkLoadMetadata{} + if err := p.Metadata.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Metadata), err) + } + return nil +} + +func (p *BulkLoadResponse) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.TotalDownloadProgress = &v + } + return nil +} + +func (p *BulkLoadResponse) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.IsGroupIngestionFinished = &v + } + return nil +} + +func (p *BulkLoadResponse) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.IsGroupBulkLoadContextCleanedUp = &v + } + return nil +} + +func (p *BulkLoadResponse) ReadField10(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) + } else { + p.IsGroupBulkLoadPaused = &v + } + return nil +} + +func (p *BulkLoadResponse) ReadField11(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[*base.HostPort]*PartitionBulkLoadState, size) + p.HpGroupBulkLoadState = tMap + for i := 0; i < size; i++ { + _key3 := &base.HostPort{} + if err := _key3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _key3), err) + } + _val4 := &PartitionBulkLoadState{ + IngestStatus: 0, + } + if err := _val4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val4), err) + } + p.HpGroupBulkLoadState[_key3] = _val4 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *BulkLoadResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("bulk_load_response"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := p.writeField9(oprot); err != nil { + return err + } + if err := p.writeField10(oprot); err != nil { + return err + } + if err := p.writeField11(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 *BulkLoadResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *BulkLoadResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:pid: ", p), err) + } + return err +} + +func (p *BulkLoadResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_name: ", p), err) + } + return err +} + +func (p *BulkLoadResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("primary_bulk_load_status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:primary_bulk_load_status: ", p), err) + } + if err := oprot.WriteI32(int32(p.PrimaryBulkLoadStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.primary_bulk_load_status (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:primary_bulk_load_status: ", p), err) + } + return err +} + +func (p *BulkLoadResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("group_bulk_load_state", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:group_bulk_load_state: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRUCT, thrift.STRUCT, len(p.GroupBulkLoadState)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.GroupBulkLoadState { + if err := k.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", k), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:group_bulk_load_state: ", p), err) + } + return err +} + +func (p *BulkLoadResponse) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetMetadata() { + if err := oprot.WriteFieldBegin("metadata", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:metadata: ", p), err) + } + if err := p.Metadata.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Metadata), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:metadata: ", p), err) + } + } + return err +} + +func (p *BulkLoadResponse) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetTotalDownloadProgress() { + if err := oprot.WriteFieldBegin("total_download_progress", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:total_download_progress: ", p), err) + } + if err := oprot.WriteI32(int32(*p.TotalDownloadProgress)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.total_download_progress (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:total_download_progress: ", p), err) + } + } + return err +} + +func (p *BulkLoadResponse) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetIsGroupIngestionFinished() { + if err := oprot.WriteFieldBegin("is_group_ingestion_finished", thrift.BOOL, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:is_group_ingestion_finished: ", p), err) + } + if err := oprot.WriteBool(bool(*p.IsGroupIngestionFinished)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_group_ingestion_finished (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:is_group_ingestion_finished: ", p), err) + } + } + return err +} + +func (p *BulkLoadResponse) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetIsGroupBulkLoadContextCleanedUp() { + if err := oprot.WriteFieldBegin("is_group_bulk_load_context_cleaned_up", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:is_group_bulk_load_context_cleaned_up: ", p), err) + } + if err := oprot.WriteBool(bool(*p.IsGroupBulkLoadContextCleanedUp)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_group_bulk_load_context_cleaned_up (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:is_group_bulk_load_context_cleaned_up: ", p), err) + } + } + return err +} + +func (p *BulkLoadResponse) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetIsGroupBulkLoadPaused() { + if err := oprot.WriteFieldBegin("is_group_bulk_load_paused", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:is_group_bulk_load_paused: ", p), err) + } + if err := oprot.WriteBool(bool(*p.IsGroupBulkLoadPaused)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_group_bulk_load_paused (10) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:is_group_bulk_load_paused: ", p), err) + } + } + return err +} + +func (p *BulkLoadResponse) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetHpGroupBulkLoadState() { + if err := oprot.WriteFieldBegin("hp_group_bulk_load_state", thrift.MAP, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:hp_group_bulk_load_state: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRUCT, thrift.STRUCT, len(p.HpGroupBulkLoadState)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.HpGroupBulkLoadState { + if err := k.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", k), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:hp_group_bulk_load_state: ", p), err) + } + } + return err +} + +func (p *BulkLoadResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BulkLoadResponse(%+v)", *p) +} + +// Attributes: +// - AppName +// - Target +// - Config +// - ProviderName +// - ClusterName +// - MetaBulkLoadStatus +// - RemoteRootPath +// - HpTarget +type GroupBulkLoadRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + Target *base.RPCAddress `thrift:"target,2" db:"target" json:"target"` + Config *ReplicaConfiguration `thrift:"config,3" db:"config" json:"config"` + ProviderName string `thrift:"provider_name,4" db:"provider_name" json:"provider_name"` + ClusterName string `thrift:"cluster_name,5" db:"cluster_name" json:"cluster_name"` + MetaBulkLoadStatus BulkLoadStatus `thrift:"meta_bulk_load_status,6" db:"meta_bulk_load_status" json:"meta_bulk_load_status"` + RemoteRootPath string `thrift:"remote_root_path,7" db:"remote_root_path" json:"remote_root_path"` + HpTarget *base.HostPort `thrift:"hp_target,8" db:"hp_target" json:"hp_target,omitempty"` +} + +func NewGroupBulkLoadRequest() *GroupBulkLoadRequest { + return &GroupBulkLoadRequest{} +} + +func (p *GroupBulkLoadRequest) GetAppName() string { + return p.AppName +} + +var GroupBulkLoadRequest_Target_DEFAULT *base.RPCAddress + +func (p *GroupBulkLoadRequest) GetTarget() *base.RPCAddress { + if !p.IsSetTarget() { + return GroupBulkLoadRequest_Target_DEFAULT + } + return p.Target +} + +var GroupBulkLoadRequest_Config_DEFAULT *ReplicaConfiguration + +func (p *GroupBulkLoadRequest) GetConfig() *ReplicaConfiguration { + if !p.IsSetConfig() { + return GroupBulkLoadRequest_Config_DEFAULT + } + return p.Config +} + +func (p *GroupBulkLoadRequest) GetProviderName() string { + return p.ProviderName +} + +func (p *GroupBulkLoadRequest) GetClusterName() string { + return p.ClusterName +} + +func (p *GroupBulkLoadRequest) GetMetaBulkLoadStatus() BulkLoadStatus { + return p.MetaBulkLoadStatus +} + +func (p *GroupBulkLoadRequest) GetRemoteRootPath() string { + return p.RemoteRootPath +} + +var GroupBulkLoadRequest_HpTarget_DEFAULT *base.HostPort + +func (p *GroupBulkLoadRequest) GetHpTarget() *base.HostPort { + if !p.IsSetHpTarget() { + return GroupBulkLoadRequest_HpTarget_DEFAULT + } + return p.HpTarget +} +func (p *GroupBulkLoadRequest) IsSetTarget() bool { + return p.Target != nil +} + +func (p *GroupBulkLoadRequest) IsSetConfig() bool { + return p.Config != nil +} + +func (p *GroupBulkLoadRequest) IsSetHpTarget() bool { + return p.HpTarget != nil +} + +func (p *GroupBulkLoadRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I32 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *GroupBulkLoadRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *GroupBulkLoadRequest) ReadField2(iprot thrift.TProtocol) error { + p.Target = &base.RPCAddress{} + if err := p.Target.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Target), err) + } + return nil +} + +func (p *GroupBulkLoadRequest) ReadField3(iprot thrift.TProtocol) error { + p.Config = &ReplicaConfiguration{ + Status: 0, + } + if err := p.Config.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Config), err) + } + return nil +} + +func (p *GroupBulkLoadRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.ProviderName = v + } + return nil +} + +func (p *GroupBulkLoadRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.ClusterName = v + } + return nil +} + +func (p *GroupBulkLoadRequest) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + temp := BulkLoadStatus(v) + p.MetaBulkLoadStatus = temp + } + return nil +} + +func (p *GroupBulkLoadRequest) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.RemoteRootPath = v + } + return nil +} + +func (p *GroupBulkLoadRequest) ReadField8(iprot thrift.TProtocol) error { + p.HpTarget = &base.HostPort{} + if err := p.HpTarget.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpTarget), err) + } + return nil +} + +func (p *GroupBulkLoadRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("group_bulk_load_request"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(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 *GroupBulkLoadRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *GroupBulkLoadRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("target", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:target: ", p), err) + } + if err := p.Target.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Target), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:target: ", p), err) + } + return err +} + +func (p *GroupBulkLoadRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("config", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:config: ", p), err) + } + if err := p.Config.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Config), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:config: ", p), err) + } + return err +} + +func (p *GroupBulkLoadRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("provider_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:provider_name: ", p), err) + } + if err := oprot.WriteString(string(p.ProviderName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.provider_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:provider_name: ", p), err) + } + return err +} + +func (p *GroupBulkLoadRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("cluster_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:cluster_name: ", p), err) + } + if err := oprot.WriteString(string(p.ClusterName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_name (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:cluster_name: ", p), err) + } + return err +} + +func (p *GroupBulkLoadRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("meta_bulk_load_status", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:meta_bulk_load_status: ", p), err) + } + if err := oprot.WriteI32(int32(p.MetaBulkLoadStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.meta_bulk_load_status (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:meta_bulk_load_status: ", p), err) + } + return err +} + +func (p *GroupBulkLoadRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("remote_root_path", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:remote_root_path: ", p), err) + } + if err := oprot.WriteString(string(p.RemoteRootPath)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_root_path (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:remote_root_path: ", p), err) + } + return err +} + +func (p *GroupBulkLoadRequest) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetHpTarget() { + if err := oprot.WriteFieldBegin("hp_target", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:hp_target: ", p), err) + } + if err := p.HpTarget.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpTarget), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:hp_target: ", p), err) + } + } + return err +} + +func (p *GroupBulkLoadRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GroupBulkLoadRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Status +// - BulkLoadState +type GroupBulkLoadResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Status BulkLoadStatus `thrift:"status,2" db:"status" json:"status"` + BulkLoadState *PartitionBulkLoadState `thrift:"bulk_load_state,3" db:"bulk_load_state" json:"bulk_load_state"` +} + +func NewGroupBulkLoadResponse() *GroupBulkLoadResponse { + return &GroupBulkLoadResponse{} +} + +var GroupBulkLoadResponse_Err_DEFAULT *base.ErrorCode + +func (p *GroupBulkLoadResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return GroupBulkLoadResponse_Err_DEFAULT + } + return p.Err +} + +func (p *GroupBulkLoadResponse) GetStatus() BulkLoadStatus { + return p.Status +} + +var GroupBulkLoadResponse_BulkLoadState_DEFAULT *PartitionBulkLoadState + +func (p *GroupBulkLoadResponse) GetBulkLoadState() *PartitionBulkLoadState { + if !p.IsSetBulkLoadState() { + return GroupBulkLoadResponse_BulkLoadState_DEFAULT + } + return p.BulkLoadState +} +func (p *GroupBulkLoadResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *GroupBulkLoadResponse) IsSetBulkLoadState() bool { + return p.BulkLoadState != nil +} + +func (p *GroupBulkLoadResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *GroupBulkLoadResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *GroupBulkLoadResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := BulkLoadStatus(v) + p.Status = temp + } + return nil +} + +func (p *GroupBulkLoadResponse) ReadField3(iprot thrift.TProtocol) error { + p.BulkLoadState = &PartitionBulkLoadState{ + IngestStatus: 0, + } + if err := p.BulkLoadState.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BulkLoadState), err) + } + return nil +} + +func (p *GroupBulkLoadResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("group_bulk_load_response"); 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 := 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 *GroupBulkLoadResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *GroupBulkLoadResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) + } + return err +} + +func (p *GroupBulkLoadResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("bulk_load_state", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:bulk_load_state: ", p), err) + } + if err := p.BulkLoadState.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BulkLoadState), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:bulk_load_state: ", p), err) + } + return err +} + +func (p *GroupBulkLoadResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GroupBulkLoadResponse(%+v)", *p) +} + +// Attributes: +// - AppName +// - Metadata +// - IngestBehind +// - Ballot +// - VerifyBeforeIngest +type IngestionRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + Metadata *BulkLoadMetadata `thrift:"metadata,2" db:"metadata" json:"metadata"` + IngestBehind bool `thrift:"ingest_behind,3" db:"ingest_behind" json:"ingest_behind"` + Ballot int64 `thrift:"ballot,4" db:"ballot" json:"ballot"` + VerifyBeforeIngest bool `thrift:"verify_before_ingest,5" db:"verify_before_ingest" json:"verify_before_ingest"` +} + +func NewIngestionRequest() *IngestionRequest { + return &IngestionRequest{} +} + +func (p *IngestionRequest) GetAppName() string { + return p.AppName +} + +var IngestionRequest_Metadata_DEFAULT *BulkLoadMetadata + +func (p *IngestionRequest) GetMetadata() *BulkLoadMetadata { + if !p.IsSetMetadata() { + return IngestionRequest_Metadata_DEFAULT + } + return p.Metadata +} + +func (p *IngestionRequest) GetIngestBehind() bool { + return p.IngestBehind +} + +func (p *IngestionRequest) GetBallot() int64 { + return p.Ballot +} + +func (p *IngestionRequest) GetVerifyBeforeIngest() bool { + return p.VerifyBeforeIngest +} +func (p *IngestionRequest) IsSetMetadata() bool { + return p.Metadata != nil +} + +func (p *IngestionRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *IngestionRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *IngestionRequest) ReadField2(iprot thrift.TProtocol) error { + p.Metadata = &BulkLoadMetadata{} + if err := p.Metadata.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Metadata), err) + } + return nil +} + +func (p *IngestionRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IngestBehind = v + } + return nil +} + +func (p *IngestionRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Ballot = v + } + return nil +} + +func (p *IngestionRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.VerifyBeforeIngest = v + } + return nil +} + +func (p *IngestionRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ingestion_request"); 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 := p.writeField5(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 *IngestionRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *IngestionRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("metadata", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:metadata: ", p), err) + } + if err := p.Metadata.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Metadata), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:metadata: ", p), err) + } + return err +} + +func (p *IngestionRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ingest_behind", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:ingest_behind: ", p), err) + } + if err := oprot.WriteBool(bool(p.IngestBehind)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ingest_behind (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:ingest_behind: ", p), err) + } + return err +} + +func (p *IngestionRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ballot", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:ballot: ", p), err) + } + if err := oprot.WriteI64(int64(p.Ballot)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ballot (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:ballot: ", p), err) + } + return err +} + +func (p *IngestionRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("verify_before_ingest", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:verify_before_ingest: ", p), err) + } + if err := oprot.WriteBool(bool(p.VerifyBeforeIngest)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.verify_before_ingest (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:verify_before_ingest: ", p), err) + } + return err +} + +func (p *IngestionRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IngestionRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - RocksdbError +type IngestionResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + RocksdbError int32 `thrift:"rocksdb_error,2" db:"rocksdb_error" json:"rocksdb_error"` +} + +func NewIngestionResponse() *IngestionResponse { + return &IngestionResponse{} +} + +var IngestionResponse_Err_DEFAULT *base.ErrorCode + +func (p *IngestionResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return IngestionResponse_Err_DEFAULT + } + return p.Err +} + +func (p *IngestionResponse) GetRocksdbError() int32 { + return p.RocksdbError +} +func (p *IngestionResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *IngestionResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *IngestionResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *IngestionResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.RocksdbError = v + } + return nil +} + +func (p *IngestionResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ingestion_response"); 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 *IngestionResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *IngestionResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("rocksdb_error", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rocksdb_error: ", p), err) + } + if err := oprot.WriteI32(int32(p.RocksdbError)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.rocksdb_error (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rocksdb_error: ", p), err) + } + return err +} + +func (p *IngestionResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IngestionResponse(%+v)", *p) +} + +// Attributes: +// - AppName +// - Type +type ControlBulkLoadRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + Type BulkLoadControlType `thrift:"type,2" db:"type" json:"type"` +} + +func NewControlBulkLoadRequest() *ControlBulkLoadRequest { + return &ControlBulkLoadRequest{} +} + +func (p *ControlBulkLoadRequest) GetAppName() string { + return p.AppName +} + +func (p *ControlBulkLoadRequest) GetType() BulkLoadControlType { + return p.Type +} +func (p *ControlBulkLoadRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ControlBulkLoadRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *ControlBulkLoadRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := BulkLoadControlType(v) + p.Type = temp + } + return nil +} + +func (p *ControlBulkLoadRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("control_bulk_load_request"); 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 *ControlBulkLoadRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *ControlBulkLoadRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) + } + return err +} + +func (p *ControlBulkLoadRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ControlBulkLoadRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMsg +type ControlBulkLoadResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMsg *string `thrift:"hint_msg,2" db:"hint_msg" json:"hint_msg,omitempty"` +} + +func NewControlBulkLoadResponse() *ControlBulkLoadResponse { + return &ControlBulkLoadResponse{} +} + +var ControlBulkLoadResponse_Err_DEFAULT *base.ErrorCode + +func (p *ControlBulkLoadResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ControlBulkLoadResponse_Err_DEFAULT + } + return p.Err +} + +var ControlBulkLoadResponse_HintMsg_DEFAULT string + +func (p *ControlBulkLoadResponse) GetHintMsg() string { + if !p.IsSetHintMsg() { + return ControlBulkLoadResponse_HintMsg_DEFAULT + } + return *p.HintMsg +} +func (p *ControlBulkLoadResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ControlBulkLoadResponse) IsSetHintMsg() bool { + return p.HintMsg != nil +} + +func (p *ControlBulkLoadResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ControlBulkLoadResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ControlBulkLoadResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMsg = &v + } + return nil +} + +func (p *ControlBulkLoadResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("control_bulk_load_response"); 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 *ControlBulkLoadResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ControlBulkLoadResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetHintMsg() { + if err := oprot.WriteFieldBegin("hint_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_msg: ", p), err) + } + if err := oprot.WriteString(string(*p.HintMsg)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_msg (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_msg: ", p), err) + } + } + return err +} + +func (p *ControlBulkLoadResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ControlBulkLoadResponse(%+v)", *p) +} + +// Attributes: +// - AppName +type QueryBulkLoadRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` +} + +func NewQueryBulkLoadRequest() *QueryBulkLoadRequest { + return &QueryBulkLoadRequest{} +} + +func (p *QueryBulkLoadRequest) GetAppName() string { + return p.AppName +} +func (p *QueryBulkLoadRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryBulkLoadRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *QueryBulkLoadRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_bulk_load_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *QueryBulkLoadRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *QueryBulkLoadRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryBulkLoadRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - AppName +// - AppStatus +// - PartitionsStatus +// - MaxReplicaCount +// - BulkLoadStates +// - HintMsg +// - IsBulkLoading +// - HpBulkLoadStates +type QueryBulkLoadResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + AppName string `thrift:"app_name,2" db:"app_name" json:"app_name"` + AppStatus BulkLoadStatus `thrift:"app_status,3" db:"app_status" json:"app_status"` + PartitionsStatus []BulkLoadStatus `thrift:"partitions_status,4" db:"partitions_status" json:"partitions_status"` + MaxReplicaCount int32 `thrift:"max_replica_count,5" db:"max_replica_count" json:"max_replica_count"` + BulkLoadStates []map[*base.RPCAddress]*PartitionBulkLoadState `thrift:"bulk_load_states,6" db:"bulk_load_states" json:"bulk_load_states"` + HintMsg *string `thrift:"hint_msg,7" db:"hint_msg" json:"hint_msg,omitempty"` + IsBulkLoading *bool `thrift:"is_bulk_loading,8" db:"is_bulk_loading" json:"is_bulk_loading,omitempty"` + HpBulkLoadStates []map[*base.HostPort]*PartitionBulkLoadState `thrift:"hp_bulk_load_states,9" db:"hp_bulk_load_states" json:"hp_bulk_load_states,omitempty"` +} + +func NewQueryBulkLoadResponse() *QueryBulkLoadResponse { + return &QueryBulkLoadResponse{} +} + +var QueryBulkLoadResponse_Err_DEFAULT *base.ErrorCode + +func (p *QueryBulkLoadResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return QueryBulkLoadResponse_Err_DEFAULT + } + return p.Err +} + +func (p *QueryBulkLoadResponse) GetAppName() string { + return p.AppName +} + +func (p *QueryBulkLoadResponse) GetAppStatus() BulkLoadStatus { + return p.AppStatus +} + +func (p *QueryBulkLoadResponse) GetPartitionsStatus() []BulkLoadStatus { + return p.PartitionsStatus +} + +func (p *QueryBulkLoadResponse) GetMaxReplicaCount() int32 { + return p.MaxReplicaCount +} + +func (p *QueryBulkLoadResponse) GetBulkLoadStates() []map[*base.RPCAddress]*PartitionBulkLoadState { + return p.BulkLoadStates +} + +var QueryBulkLoadResponse_HintMsg_DEFAULT string + +func (p *QueryBulkLoadResponse) GetHintMsg() string { + if !p.IsSetHintMsg() { + return QueryBulkLoadResponse_HintMsg_DEFAULT + } + return *p.HintMsg +} + +var QueryBulkLoadResponse_IsBulkLoading_DEFAULT bool + +func (p *QueryBulkLoadResponse) GetIsBulkLoading() bool { + if !p.IsSetIsBulkLoading() { + return QueryBulkLoadResponse_IsBulkLoading_DEFAULT + } + return *p.IsBulkLoading +} + +var QueryBulkLoadResponse_HpBulkLoadStates_DEFAULT []map[*base.HostPort]*PartitionBulkLoadState + +func (p *QueryBulkLoadResponse) GetHpBulkLoadStates() []map[*base.HostPort]*PartitionBulkLoadState { + return p.HpBulkLoadStates +} +func (p *QueryBulkLoadResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *QueryBulkLoadResponse) IsSetHintMsg() bool { + return p.HintMsg != nil +} + +func (p *QueryBulkLoadResponse) IsSetIsBulkLoading() bool { + return p.IsBulkLoading != nil +} + +func (p *QueryBulkLoadResponse) IsSetHpBulkLoadStates() bool { + return p.HpBulkLoadStates != nil +} + +func (p *QueryBulkLoadResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.LIST { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.LIST { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryBulkLoadResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *QueryBulkLoadResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *QueryBulkLoadResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := BulkLoadStatus(v) + p.AppStatus = temp + } + return nil +} + +func (p *QueryBulkLoadResponse) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]BulkLoadStatus, 0, size) + p.PartitionsStatus = tSlice + for i := 0; i < size; i++ { + var _elem5 BulkLoadStatus + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := BulkLoadStatus(v) + _elem5 = temp + } + p.PartitionsStatus = append(p.PartitionsStatus, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *QueryBulkLoadResponse) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.MaxReplicaCount = v + } + return nil +} + +func (p *QueryBulkLoadResponse) ReadField6(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]map[*base.RPCAddress]*PartitionBulkLoadState, 0, size) + p.BulkLoadStates = tSlice + for i := 0; i < size; i++ { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[*base.RPCAddress]*PartitionBulkLoadState, size) + _elem6 := tMap + for i := 0; i < size; i++ { + _key7 := &base.RPCAddress{} + if err := _key7.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _key7), err) + } + _val8 := &PartitionBulkLoadState{ + IngestStatus: 0, + } + if err := _val8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val8), err) + } + _elem6[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + p.BulkLoadStates = append(p.BulkLoadStates, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *QueryBulkLoadResponse) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.HintMsg = &v + } + return nil +} + +func (p *QueryBulkLoadResponse) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.IsBulkLoading = &v + } + return nil +} + +func (p *QueryBulkLoadResponse) ReadField9(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]map[*base.HostPort]*PartitionBulkLoadState, 0, size) + p.HpBulkLoadStates = tSlice + for i := 0; i < size; i++ { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[*base.HostPort]*PartitionBulkLoadState, size) + _elem9 := tMap + for i := 0; i < size; i++ { + _key10 := &base.HostPort{} + if err := _key10.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _key10), err) + } + _val11 := &PartitionBulkLoadState{ + IngestStatus: 0, + } + if err := _val11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val11), err) + } + _elem9[_key10] = _val11 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + p.HpBulkLoadStates = append(p.HpBulkLoadStates, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *QueryBulkLoadResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_bulk_load_response"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + 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 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 *QueryBulkLoadResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *QueryBulkLoadResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:app_name: ", p), err) + } + return err +} + +func (p *QueryBulkLoadResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_status", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_status: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_status (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_status: ", p), err) + } + return err +} + +func (p *QueryBulkLoadResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partitions_status", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partitions_status: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(p.PartitionsStatus)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PartitionsStatus { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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 4:partitions_status: ", p), err) + } + return err +} + +func (p *QueryBulkLoadResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("max_replica_count", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:max_replica_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxReplicaCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_replica_count (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:max_replica_count: ", p), err) + } + return err +} + +func (p *QueryBulkLoadResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("bulk_load_states", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:bulk_load_states: ", p), err) + } + if err := oprot.WriteListBegin(thrift.MAP, len(p.BulkLoadStates)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.BulkLoadStates { + if err := oprot.WriteMapBegin(thrift.STRUCT, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range v { + if err := k.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", k), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", 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 6:bulk_load_states: ", p), err) + } + return err +} + +func (p *QueryBulkLoadResponse) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetHintMsg() { + if err := oprot.WriteFieldBegin("hint_msg", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:hint_msg: ", p), err) + } + if err := oprot.WriteString(string(*p.HintMsg)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_msg (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:hint_msg: ", p), err) + } + } + return err +} + +func (p *QueryBulkLoadResponse) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetIsBulkLoading() { + if err := oprot.WriteFieldBegin("is_bulk_loading", thrift.BOOL, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:is_bulk_loading: ", p), err) + } + if err := oprot.WriteBool(bool(*p.IsBulkLoading)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_bulk_loading (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:is_bulk_loading: ", p), err) + } + } + return err +} + +func (p *QueryBulkLoadResponse) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetHpBulkLoadStates() { + if err := oprot.WriteFieldBegin("hp_bulk_load_states", thrift.LIST, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:hp_bulk_load_states: ", p), err) + } + if err := oprot.WriteListBegin(thrift.MAP, len(p.HpBulkLoadStates)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HpBulkLoadStates { + if err := oprot.WriteMapBegin(thrift.STRUCT, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range v { + if err := k.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", k), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", 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 9:hp_bulk_load_states: ", p), err) + } + } + return err +} + +func (p *QueryBulkLoadResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryBulkLoadResponse(%+v)", *p) +} + +// Attributes: +// - AppName +type ClearBulkLoadStateRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` +} + +func NewClearBulkLoadStateRequest() *ClearBulkLoadStateRequest { + return &ClearBulkLoadStateRequest{} +} + +func (p *ClearBulkLoadStateRequest) GetAppName() string { + return p.AppName +} +func (p *ClearBulkLoadStateRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ClearBulkLoadStateRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *ClearBulkLoadStateRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("clear_bulk_load_state_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ClearBulkLoadStateRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *ClearBulkLoadStateRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ClearBulkLoadStateRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMsg +type ClearBulkLoadStateResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMsg string `thrift:"hint_msg,2" db:"hint_msg" json:"hint_msg"` +} + +func NewClearBulkLoadStateResponse() *ClearBulkLoadStateResponse { + return &ClearBulkLoadStateResponse{} +} + +var ClearBulkLoadStateResponse_Err_DEFAULT *base.ErrorCode + +func (p *ClearBulkLoadStateResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ClearBulkLoadStateResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ClearBulkLoadStateResponse) GetHintMsg() string { + return p.HintMsg +} +func (p *ClearBulkLoadStateResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ClearBulkLoadStateResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ClearBulkLoadStateResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ClearBulkLoadStateResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMsg = v + } + return nil +} + +func (p *ClearBulkLoadStateResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("clear_bulk_load_state_response"); 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 *ClearBulkLoadStateResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ClearBulkLoadStateResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_msg: ", p), err) + } + if err := oprot.WriteString(string(p.HintMsg)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_msg (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_msg: ", p), err) + } + return err +} + +func (p *ClearBulkLoadStateResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ClearBulkLoadStateResponse(%+v)", *p) +} diff --git a/go-client/idl/admin/duplication-consts.go b/go-client/idl/admin/duplication-consts.go new file mode 100644 index 0000000000..757b943ef3 --- /dev/null +++ b/go-client/idl/admin/duplication-consts.go @@ -0,0 +1,27 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +func init() { +} diff --git a/go-client/idl/admin/duplication.go b/go-client/idl/admin/duplication.go new file mode 100644 index 0000000000..fa55de71f6 --- /dev/null +++ b/go-client/idl/admin/duplication.go @@ -0,0 +1,2606 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +type DuplicationStatus int64 + +const ( + DuplicationStatus_DS_INIT DuplicationStatus = 0 + DuplicationStatus_DS_PREPARE DuplicationStatus = 1 + DuplicationStatus_DS_APP DuplicationStatus = 2 + DuplicationStatus_DS_LOG DuplicationStatus = 3 + DuplicationStatus_DS_PAUSE DuplicationStatus = 4 + DuplicationStatus_DS_REMOVED DuplicationStatus = 5 +) + +func (p DuplicationStatus) String() string { + switch p { + case DuplicationStatus_DS_INIT: + return "DS_INIT" + case DuplicationStatus_DS_PREPARE: + return "DS_PREPARE" + case DuplicationStatus_DS_APP: + return "DS_APP" + case DuplicationStatus_DS_LOG: + return "DS_LOG" + case DuplicationStatus_DS_PAUSE: + return "DS_PAUSE" + case DuplicationStatus_DS_REMOVED: + return "DS_REMOVED" + } + return "" +} + +func DuplicationStatusFromString(s string) (DuplicationStatus, error) { + switch s { + case "DS_INIT": + return DuplicationStatus_DS_INIT, nil + case "DS_PREPARE": + return DuplicationStatus_DS_PREPARE, nil + case "DS_APP": + return DuplicationStatus_DS_APP, nil + case "DS_LOG": + return DuplicationStatus_DS_LOG, nil + case "DS_PAUSE": + return DuplicationStatus_DS_PAUSE, nil + case "DS_REMOVED": + return DuplicationStatus_DS_REMOVED, nil + } + return DuplicationStatus(0), fmt.Errorf("not a valid DuplicationStatus string") +} + +func DuplicationStatusPtr(v DuplicationStatus) *DuplicationStatus { return &v } + +func (p DuplicationStatus) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *DuplicationStatus) UnmarshalText(text []byte) error { + q, err := DuplicationStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *DuplicationStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = DuplicationStatus(v) + return nil +} + +func (p *DuplicationStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type DuplicationFailMode int64 + +const ( + DuplicationFailMode_FAIL_SLOW DuplicationFailMode = 0 + DuplicationFailMode_FAIL_SKIP DuplicationFailMode = 1 + DuplicationFailMode_FAIL_FAST DuplicationFailMode = 2 +) + +func (p DuplicationFailMode) String() string { + switch p { + case DuplicationFailMode_FAIL_SLOW: + return "FAIL_SLOW" + case DuplicationFailMode_FAIL_SKIP: + return "FAIL_SKIP" + case DuplicationFailMode_FAIL_FAST: + return "FAIL_FAST" + } + return "" +} + +func DuplicationFailModeFromString(s string) (DuplicationFailMode, error) { + switch s { + case "FAIL_SLOW": + return DuplicationFailMode_FAIL_SLOW, nil + case "FAIL_SKIP": + return DuplicationFailMode_FAIL_SKIP, nil + case "FAIL_FAST": + return DuplicationFailMode_FAIL_FAST, nil + } + return DuplicationFailMode(0), fmt.Errorf("not a valid DuplicationFailMode string") +} + +func DuplicationFailModePtr(v DuplicationFailMode) *DuplicationFailMode { return &v } + +func (p DuplicationFailMode) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *DuplicationFailMode) UnmarshalText(text []byte) error { + q, err := DuplicationFailModeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *DuplicationFailMode) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = DuplicationFailMode(v) + return nil +} + +func (p *DuplicationFailMode) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +// Attributes: +// - AppName +// - RemoteClusterName +// - IsDuplicatingCheckpoint +// - RemoteAppName +// - RemoteReplicaCount +type DuplicationAddRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + RemoteClusterName string `thrift:"remote_cluster_name,2" db:"remote_cluster_name" json:"remote_cluster_name"` + IsDuplicatingCheckpoint bool `thrift:"is_duplicating_checkpoint,3" db:"is_duplicating_checkpoint" json:"is_duplicating_checkpoint"` + RemoteAppName *string `thrift:"remote_app_name,4" db:"remote_app_name" json:"remote_app_name,omitempty"` + RemoteReplicaCount *int32 `thrift:"remote_replica_count,5" db:"remote_replica_count" json:"remote_replica_count,omitempty"` +} + +func NewDuplicationAddRequest() *DuplicationAddRequest { + return &DuplicationAddRequest{ + IsDuplicatingCheckpoint: true, + } +} + +func (p *DuplicationAddRequest) GetAppName() string { + return p.AppName +} + +func (p *DuplicationAddRequest) GetRemoteClusterName() string { + return p.RemoteClusterName +} + +var DuplicationAddRequest_IsDuplicatingCheckpoint_DEFAULT bool = true + +func (p *DuplicationAddRequest) GetIsDuplicatingCheckpoint() bool { + return p.IsDuplicatingCheckpoint +} + +var DuplicationAddRequest_RemoteAppName_DEFAULT string + +func (p *DuplicationAddRequest) GetRemoteAppName() string { + if !p.IsSetRemoteAppName() { + return DuplicationAddRequest_RemoteAppName_DEFAULT + } + return *p.RemoteAppName +} + +var DuplicationAddRequest_RemoteReplicaCount_DEFAULT int32 + +func (p *DuplicationAddRequest) GetRemoteReplicaCount() int32 { + if !p.IsSetRemoteReplicaCount() { + return DuplicationAddRequest_RemoteReplicaCount_DEFAULT + } + return *p.RemoteReplicaCount +} +func (p *DuplicationAddRequest) IsSetIsDuplicatingCheckpoint() bool { + return p.IsDuplicatingCheckpoint != DuplicationAddRequest_IsDuplicatingCheckpoint_DEFAULT +} + +func (p *DuplicationAddRequest) IsSetRemoteAppName() bool { + return p.RemoteAppName != nil +} + +func (p *DuplicationAddRequest) IsSetRemoteReplicaCount() bool { + return p.RemoteReplicaCount != nil +} + +func (p *DuplicationAddRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DuplicationAddRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *DuplicationAddRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.RemoteClusterName = v + } + return nil +} + +func (p *DuplicationAddRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IsDuplicatingCheckpoint = v + } + return nil +} + +func (p *DuplicationAddRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.RemoteAppName = &v + } + return nil +} + +func (p *DuplicationAddRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.RemoteReplicaCount = &v + } + return nil +} + +func (p *DuplicationAddRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("duplication_add_request"); 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 := p.writeField5(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 *DuplicationAddRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *DuplicationAddRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("remote_cluster_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:remote_cluster_name: ", p), err) + } + if err := oprot.WriteString(string(p.RemoteClusterName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_cluster_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:remote_cluster_name: ", p), err) + } + return err +} + +func (p *DuplicationAddRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetIsDuplicatingCheckpoint() { + if err := oprot.WriteFieldBegin("is_duplicating_checkpoint", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:is_duplicating_checkpoint: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsDuplicatingCheckpoint)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_duplicating_checkpoint (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:is_duplicating_checkpoint: ", p), err) + } + } + return err +} + +func (p *DuplicationAddRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteAppName() { + if err := oprot.WriteFieldBegin("remote_app_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:remote_app_name: ", p), err) + } + if err := oprot.WriteString(string(*p.RemoteAppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_app_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:remote_app_name: ", p), err) + } + } + return err +} + +func (p *DuplicationAddRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteReplicaCount() { + if err := oprot.WriteFieldBegin("remote_replica_count", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:remote_replica_count: ", p), err) + } + if err := oprot.WriteI32(int32(*p.RemoteReplicaCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_replica_count (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:remote_replica_count: ", p), err) + } + } + return err +} + +func (p *DuplicationAddRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DuplicationAddRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Appid +// - Dupid +// - Hint +// - RemoteAppName +// - RemoteReplicaCount +type DuplicationAddResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Appid int32 `thrift:"appid,2" db:"appid" json:"appid"` + Dupid int32 `thrift:"dupid,3" db:"dupid" json:"dupid"` + Hint *string `thrift:"hint,4" db:"hint" json:"hint,omitempty"` + RemoteAppName *string `thrift:"remote_app_name,5" db:"remote_app_name" json:"remote_app_name,omitempty"` + RemoteReplicaCount *int32 `thrift:"remote_replica_count,6" db:"remote_replica_count" json:"remote_replica_count,omitempty"` +} + +func NewDuplicationAddResponse() *DuplicationAddResponse { + return &DuplicationAddResponse{} +} + +var DuplicationAddResponse_Err_DEFAULT *base.ErrorCode + +func (p *DuplicationAddResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return DuplicationAddResponse_Err_DEFAULT + } + return p.Err +} + +func (p *DuplicationAddResponse) GetAppid() int32 { + return p.Appid +} + +func (p *DuplicationAddResponse) GetDupid() int32 { + return p.Dupid +} + +var DuplicationAddResponse_Hint_DEFAULT string + +func (p *DuplicationAddResponse) GetHint() string { + if !p.IsSetHint() { + return DuplicationAddResponse_Hint_DEFAULT + } + return *p.Hint +} + +var DuplicationAddResponse_RemoteAppName_DEFAULT string + +func (p *DuplicationAddResponse) GetRemoteAppName() string { + if !p.IsSetRemoteAppName() { + return DuplicationAddResponse_RemoteAppName_DEFAULT + } + return *p.RemoteAppName +} + +var DuplicationAddResponse_RemoteReplicaCount_DEFAULT int32 + +func (p *DuplicationAddResponse) GetRemoteReplicaCount() int32 { + if !p.IsSetRemoteReplicaCount() { + return DuplicationAddResponse_RemoteReplicaCount_DEFAULT + } + return *p.RemoteReplicaCount +} +func (p *DuplicationAddResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *DuplicationAddResponse) IsSetHint() bool { + return p.Hint != nil +} + +func (p *DuplicationAddResponse) IsSetRemoteAppName() bool { + return p.RemoteAppName != nil +} + +func (p *DuplicationAddResponse) IsSetRemoteReplicaCount() bool { + return p.RemoteReplicaCount != nil +} + +func (p *DuplicationAddResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I32 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DuplicationAddResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *DuplicationAddResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Appid = v + } + return nil +} + +func (p *DuplicationAddResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Dupid = v + } + return nil +} + +func (p *DuplicationAddResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Hint = &v + } + return nil +} + +func (p *DuplicationAddResponse) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.RemoteAppName = &v + } + return nil +} + +func (p *DuplicationAddResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.RemoteReplicaCount = &v + } + return nil +} + +func (p *DuplicationAddResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("duplication_add_response"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(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 *DuplicationAddResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *DuplicationAddResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("appid", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:appid: ", p), err) + } + if err := oprot.WriteI32(int32(p.Appid)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.appid (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:appid: ", p), err) + } + return err +} + +func (p *DuplicationAddResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("dupid", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:dupid: ", p), err) + } + if err := oprot.WriteI32(int32(p.Dupid)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dupid (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:dupid: ", p), err) + } + return err +} + +func (p *DuplicationAddResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetHint() { + if err := oprot.WriteFieldBegin("hint", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hint: ", p), err) + } + if err := oprot.WriteString(string(*p.Hint)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:hint: ", p), err) + } + } + return err +} + +func (p *DuplicationAddResponse) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteAppName() { + if err := oprot.WriteFieldBegin("remote_app_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:remote_app_name: ", p), err) + } + if err := oprot.WriteString(string(*p.RemoteAppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_app_name (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:remote_app_name: ", p), err) + } + } + return err +} + +func (p *DuplicationAddResponse) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteReplicaCount() { + if err := oprot.WriteFieldBegin("remote_replica_count", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:remote_replica_count: ", p), err) + } + if err := oprot.WriteI32(int32(*p.RemoteReplicaCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_replica_count (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:remote_replica_count: ", p), err) + } + } + return err +} + +func (p *DuplicationAddResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DuplicationAddResponse(%+v)", *p) +} + +// Attributes: +// - AppName +// - Dupid +// - Status +// - FailMode +type DuplicationModifyRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + Dupid int32 `thrift:"dupid,2" db:"dupid" json:"dupid"` + Status *DuplicationStatus `thrift:"status,3" db:"status" json:"status,omitempty"` + FailMode *DuplicationFailMode `thrift:"fail_mode,4" db:"fail_mode" json:"fail_mode,omitempty"` +} + +func NewDuplicationModifyRequest() *DuplicationModifyRequest { + return &DuplicationModifyRequest{} +} + +func (p *DuplicationModifyRequest) GetAppName() string { + return p.AppName +} + +func (p *DuplicationModifyRequest) GetDupid() int32 { + return p.Dupid +} + +var DuplicationModifyRequest_Status_DEFAULT DuplicationStatus + +func (p *DuplicationModifyRequest) GetStatus() DuplicationStatus { + if !p.IsSetStatus() { + return DuplicationModifyRequest_Status_DEFAULT + } + return *p.Status +} + +var DuplicationModifyRequest_FailMode_DEFAULT DuplicationFailMode + +func (p *DuplicationModifyRequest) GetFailMode() DuplicationFailMode { + if !p.IsSetFailMode() { + return DuplicationModifyRequest_FailMode_DEFAULT + } + return *p.FailMode +} +func (p *DuplicationModifyRequest) IsSetStatus() bool { + return p.Status != nil +} + +func (p *DuplicationModifyRequest) IsSetFailMode() bool { + return p.FailMode != nil +} + +func (p *DuplicationModifyRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DuplicationModifyRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *DuplicationModifyRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Dupid = v + } + return nil +} + +func (p *DuplicationModifyRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := DuplicationStatus(v) + p.Status = &temp + } + return nil +} + +func (p *DuplicationModifyRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := DuplicationFailMode(v) + p.FailMode = &temp + } + return nil +} + +func (p *DuplicationModifyRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("duplication_modify_request"); 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 *DuplicationModifyRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *DuplicationModifyRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("dupid", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dupid: ", p), err) + } + if err := oprot.WriteI32(int32(p.Dupid)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dupid (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dupid: ", p), err) + } + return err +} + +func (p *DuplicationModifyRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetStatus() { + if err := oprot.WriteFieldBegin("status", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:status: ", p), err) + } + if err := oprot.WriteI32(int32(*p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:status: ", p), err) + } + } + return err +} + +func (p *DuplicationModifyRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetFailMode() { + if err := oprot.WriteFieldBegin("fail_mode", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fail_mode: ", p), err) + } + if err := oprot.WriteI32(int32(*p.FailMode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fail_mode (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fail_mode: ", p), err) + } + } + return err +} + +func (p *DuplicationModifyRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DuplicationModifyRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Appid +type DuplicationModifyResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Appid int32 `thrift:"appid,2" db:"appid" json:"appid"` +} + +func NewDuplicationModifyResponse() *DuplicationModifyResponse { + return &DuplicationModifyResponse{} +} + +var DuplicationModifyResponse_Err_DEFAULT *base.ErrorCode + +func (p *DuplicationModifyResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return DuplicationModifyResponse_Err_DEFAULT + } + return p.Err +} + +func (p *DuplicationModifyResponse) GetAppid() int32 { + return p.Appid +} +func (p *DuplicationModifyResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *DuplicationModifyResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DuplicationModifyResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *DuplicationModifyResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Appid = v + } + return nil +} + +func (p *DuplicationModifyResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("duplication_modify_response"); 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 *DuplicationModifyResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *DuplicationModifyResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("appid", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:appid: ", p), err) + } + if err := oprot.WriteI32(int32(p.Appid)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.appid (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:appid: ", p), err) + } + return err +} + +func (p *DuplicationModifyResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DuplicationModifyResponse(%+v)", *p) +} + +// Attributes: +// - Dupid +// - Status +// - Remote +// - CreateTs +// - Progress +// - FailMode +// - RemoteAppName +// - RemoteReplicaCount +type DuplicationEntry struct { + Dupid int32 `thrift:"dupid,1" db:"dupid" json:"dupid"` + Status DuplicationStatus `thrift:"status,2" db:"status" json:"status"` + Remote string `thrift:"remote,3" db:"remote" json:"remote"` + CreateTs int64 `thrift:"create_ts,4" db:"create_ts" json:"create_ts"` + Progress map[int32]int64 `thrift:"progress,5" db:"progress" json:"progress,omitempty"` + // unused field # 6 + FailMode *DuplicationFailMode `thrift:"fail_mode,7" db:"fail_mode" json:"fail_mode,omitempty"` + RemoteAppName *string `thrift:"remote_app_name,8" db:"remote_app_name" json:"remote_app_name,omitempty"` + RemoteReplicaCount *int32 `thrift:"remote_replica_count,9" db:"remote_replica_count" json:"remote_replica_count,omitempty"` +} + +func NewDuplicationEntry() *DuplicationEntry { + return &DuplicationEntry{} +} + +func (p *DuplicationEntry) GetDupid() int32 { + return p.Dupid +} + +func (p *DuplicationEntry) GetStatus() DuplicationStatus { + return p.Status +} + +func (p *DuplicationEntry) GetRemote() string { + return p.Remote +} + +func (p *DuplicationEntry) GetCreateTs() int64 { + return p.CreateTs +} + +var DuplicationEntry_Progress_DEFAULT map[int32]int64 + +func (p *DuplicationEntry) GetProgress() map[int32]int64 { + return p.Progress +} + +var DuplicationEntry_FailMode_DEFAULT DuplicationFailMode + +func (p *DuplicationEntry) GetFailMode() DuplicationFailMode { + if !p.IsSetFailMode() { + return DuplicationEntry_FailMode_DEFAULT + } + return *p.FailMode +} + +var DuplicationEntry_RemoteAppName_DEFAULT string + +func (p *DuplicationEntry) GetRemoteAppName() string { + if !p.IsSetRemoteAppName() { + return DuplicationEntry_RemoteAppName_DEFAULT + } + return *p.RemoteAppName +} + +var DuplicationEntry_RemoteReplicaCount_DEFAULT int32 + +func (p *DuplicationEntry) GetRemoteReplicaCount() int32 { + if !p.IsSetRemoteReplicaCount() { + return DuplicationEntry_RemoteReplicaCount_DEFAULT + } + return *p.RemoteReplicaCount +} +func (p *DuplicationEntry) IsSetProgress() bool { + return p.Progress != nil +} + +func (p *DuplicationEntry) IsSetFailMode() bool { + return p.FailMode != nil +} + +func (p *DuplicationEntry) IsSetRemoteAppName() bool { + return p.RemoteAppName != nil +} + +func (p *DuplicationEntry) IsSetRemoteReplicaCount() bool { + return p.RemoteReplicaCount != nil +} + +func (p *DuplicationEntry) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.MAP { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I32 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRING { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.I32 { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DuplicationEntry) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Dupid = v + } + return nil +} + +func (p *DuplicationEntry) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := DuplicationStatus(v) + p.Status = temp + } + return nil +} + +func (p *DuplicationEntry) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Remote = v + } + return nil +} + +func (p *DuplicationEntry) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.CreateTs = v + } + return nil +} + +func (p *DuplicationEntry) ReadField5(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[int32]int64, size) + p.Progress = tMap + for i := 0; i < size; i++ { + var _key0 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key0 = v + } + var _val1 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val1 = v + } + p.Progress[_key0] = _val1 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DuplicationEntry) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + temp := DuplicationFailMode(v) + p.FailMode = &temp + } + return nil +} + +func (p *DuplicationEntry) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.RemoteAppName = &v + } + return nil +} + +func (p *DuplicationEntry) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.RemoteReplicaCount = &v + } + return nil +} + +func (p *DuplicationEntry) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("duplication_entry"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + 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 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 *DuplicationEntry) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("dupid", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dupid: ", p), err) + } + if err := oprot.WriteI32(int32(p.Dupid)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dupid (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dupid: ", p), err) + } + return err +} + +func (p *DuplicationEntry) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) + } + return err +} + +func (p *DuplicationEntry) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("remote", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:remote: ", p), err) + } + if err := oprot.WriteString(string(p.Remote)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:remote: ", p), err) + } + return err +} + +func (p *DuplicationEntry) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("create_ts", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:create_ts: ", p), err) + } + if err := oprot.WriteI64(int64(p.CreateTs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_ts (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:create_ts: ", p), err) + } + return err +} + +func (p *DuplicationEntry) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetProgress() { + if err := oprot.WriteFieldBegin("progress", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:progress: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.I64, len(p.Progress)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Progress { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:progress: ", p), err) + } + } + return err +} + +func (p *DuplicationEntry) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetFailMode() { + if err := oprot.WriteFieldBegin("fail_mode", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:fail_mode: ", p), err) + } + if err := oprot.WriteI32(int32(*p.FailMode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fail_mode (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:fail_mode: ", p), err) + } + } + return err +} + +func (p *DuplicationEntry) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteAppName() { + if err := oprot.WriteFieldBegin("remote_app_name", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:remote_app_name: ", p), err) + } + if err := oprot.WriteString(string(*p.RemoteAppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_app_name (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:remote_app_name: ", p), err) + } + } + return err +} + +func (p *DuplicationEntry) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteReplicaCount() { + if err := oprot.WriteFieldBegin("remote_replica_count", thrift.I32, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:remote_replica_count: ", p), err) + } + if err := oprot.WriteI32(int32(*p.RemoteReplicaCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.remote_replica_count (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:remote_replica_count: ", p), err) + } + } + return err +} + +func (p *DuplicationEntry) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DuplicationEntry(%+v)", *p) +} + +// Attributes: +// - AppName +type DuplicationQueryRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` +} + +func NewDuplicationQueryRequest() *DuplicationQueryRequest { + return &DuplicationQueryRequest{} +} + +func (p *DuplicationQueryRequest) GetAppName() string { + return p.AppName +} +func (p *DuplicationQueryRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DuplicationQueryRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *DuplicationQueryRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("duplication_query_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *DuplicationQueryRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *DuplicationQueryRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DuplicationQueryRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Appid +// - EntryList +type DuplicationQueryResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + // unused field # 2 + Appid int32 `thrift:"appid,3" db:"appid" json:"appid"` + EntryList []*DuplicationEntry `thrift:"entry_list,4" db:"entry_list" json:"entry_list"` +} + +func NewDuplicationQueryResponse() *DuplicationQueryResponse { + return &DuplicationQueryResponse{} +} + +var DuplicationQueryResponse_Err_DEFAULT *base.ErrorCode + +func (p *DuplicationQueryResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return DuplicationQueryResponse_Err_DEFAULT + } + return p.Err +} + +func (p *DuplicationQueryResponse) GetAppid() int32 { + return p.Appid +} + +func (p *DuplicationQueryResponse) GetEntryList() []*DuplicationEntry { + return p.EntryList +} +func (p *DuplicationQueryResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *DuplicationQueryResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DuplicationQueryResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *DuplicationQueryResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Appid = v + } + return nil +} + +func (p *DuplicationQueryResponse) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*DuplicationEntry, 0, size) + p.EntryList = tSlice + for i := 0; i < size; i++ { + _elem2 := &DuplicationEntry{} + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.EntryList = append(p.EntryList, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DuplicationQueryResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("duplication_query_response"); 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.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 *DuplicationQueryResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *DuplicationQueryResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("appid", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:appid: ", p), err) + } + if err := oprot.WriteI32(int32(p.Appid)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.appid (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:appid: ", p), err) + } + return err +} + +func (p *DuplicationQueryResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("entry_list", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:entry_list: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EntryList)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EntryList { + 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 4:entry_list: ", p), err) + } + return err +} + +func (p *DuplicationQueryResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DuplicationQueryResponse(%+v)", *p) +} + +// Attributes: +// - Dupid +// - ConfirmedDecree +// - CheckpointPrepared +type DuplicationConfirmEntry struct { + Dupid int32 `thrift:"dupid,1" db:"dupid" json:"dupid"` + ConfirmedDecree int64 `thrift:"confirmed_decree,2" db:"confirmed_decree" json:"confirmed_decree"` + CheckpointPrepared bool `thrift:"checkpoint_prepared,3" db:"checkpoint_prepared" json:"checkpoint_prepared"` +} + +func NewDuplicationConfirmEntry() *DuplicationConfirmEntry { + return &DuplicationConfirmEntry{} +} + +func (p *DuplicationConfirmEntry) GetDupid() int32 { + return p.Dupid +} + +func (p *DuplicationConfirmEntry) GetConfirmedDecree() int64 { + return p.ConfirmedDecree +} + +var DuplicationConfirmEntry_CheckpointPrepared_DEFAULT bool = false + +func (p *DuplicationConfirmEntry) GetCheckpointPrepared() bool { + return p.CheckpointPrepared +} +func (p *DuplicationConfirmEntry) IsSetCheckpointPrepared() bool { + return p.CheckpointPrepared != DuplicationConfirmEntry_CheckpointPrepared_DEFAULT +} + +func (p *DuplicationConfirmEntry) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DuplicationConfirmEntry) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Dupid = v + } + return nil +} + +func (p *DuplicationConfirmEntry) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ConfirmedDecree = v + } + return nil +} + +func (p *DuplicationConfirmEntry) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.CheckpointPrepared = v + } + return nil +} + +func (p *DuplicationConfirmEntry) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("duplication_confirm_entry"); 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 := 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 *DuplicationConfirmEntry) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("dupid", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dupid: ", p), err) + } + if err := oprot.WriteI32(int32(p.Dupid)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dupid (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dupid: ", p), err) + } + return err +} + +func (p *DuplicationConfirmEntry) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("confirmed_decree", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:confirmed_decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.ConfirmedDecree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.confirmed_decree (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:confirmed_decree: ", p), err) + } + return err +} + +func (p *DuplicationConfirmEntry) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetCheckpointPrepared() { + if err := oprot.WriteFieldBegin("checkpoint_prepared", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:checkpoint_prepared: ", p), err) + } + if err := oprot.WriteBool(bool(p.CheckpointPrepared)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.checkpoint_prepared (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:checkpoint_prepared: ", p), err) + } + } + return err +} + +func (p *DuplicationConfirmEntry) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DuplicationConfirmEntry(%+v)", *p) +} + +// Attributes: +// - Node +// - ConfirmList +// - HpNode +type DuplicationSyncRequest struct { + Node *base.RPCAddress `thrift:"node,1" db:"node" json:"node"` + ConfirmList map[*base.Gpid][]*DuplicationConfirmEntry `thrift:"confirm_list,2" db:"confirm_list" json:"confirm_list"` + HpNode *base.HostPort `thrift:"hp_node,3" db:"hp_node" json:"hp_node"` +} + +func NewDuplicationSyncRequest() *DuplicationSyncRequest { + return &DuplicationSyncRequest{} +} + +var DuplicationSyncRequest_Node_DEFAULT *base.RPCAddress + +func (p *DuplicationSyncRequest) GetNode() *base.RPCAddress { + if !p.IsSetNode() { + return DuplicationSyncRequest_Node_DEFAULT + } + return p.Node +} + +func (p *DuplicationSyncRequest) GetConfirmList() map[*base.Gpid][]*DuplicationConfirmEntry { + return p.ConfirmList +} + +var DuplicationSyncRequest_HpNode_DEFAULT *base.HostPort + +func (p *DuplicationSyncRequest) GetHpNode() *base.HostPort { + if !p.IsSetHpNode() { + return DuplicationSyncRequest_HpNode_DEFAULT + } + return p.HpNode +} +func (p *DuplicationSyncRequest) IsSetNode() bool { + return p.Node != nil +} + +func (p *DuplicationSyncRequest) IsSetHpNode() bool { + return p.HpNode != nil +} + +func (p *DuplicationSyncRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DuplicationSyncRequest) ReadField1(iprot thrift.TProtocol) error { + p.Node = &base.RPCAddress{} + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *DuplicationSyncRequest) ReadField2(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[*base.Gpid][]*DuplicationConfirmEntry, size) + p.ConfirmList = tMap + for i := 0; i < size; i++ { + _key3 := &base.Gpid{} + if err := _key3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _key3), err) + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*DuplicationConfirmEntry, 0, size) + _val4 := tSlice + for i := 0; i < size; i++ { + _elem5 := &DuplicationConfirmEntry{} + if err := _elem5.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) + } + _val4 = append(_val4, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.ConfirmList[_key3] = _val4 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DuplicationSyncRequest) ReadField3(iprot thrift.TProtocol) error { + p.HpNode = &base.HostPort{} + if err := p.HpNode.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpNode), err) + } + return nil +} + +func (p *DuplicationSyncRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("duplication_sync_request"); 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 := 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 *DuplicationSyncRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) + } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) + } + return err +} + +func (p *DuplicationSyncRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("confirm_list", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:confirm_list: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRUCT, thrift.LIST, len(p.ConfirmList)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.ConfirmList { + if err := k.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", k), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:confirm_list: ", p), err) + } + return err +} + +func (p *DuplicationSyncRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hp_node", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hp_node: ", p), err) + } + if err := p.HpNode.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpNode), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hp_node: ", p), err) + } + return err +} + +func (p *DuplicationSyncRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DuplicationSyncRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - DupMap +type DuplicationSyncResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + DupMap map[int32]map[int32]*DuplicationEntry `thrift:"dup_map,2" db:"dup_map" json:"dup_map"` +} + +func NewDuplicationSyncResponse() *DuplicationSyncResponse { + return &DuplicationSyncResponse{} +} + +var DuplicationSyncResponse_Err_DEFAULT *base.ErrorCode + +func (p *DuplicationSyncResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return DuplicationSyncResponse_Err_DEFAULT + } + return p.Err +} + +func (p *DuplicationSyncResponse) GetDupMap() map[int32]map[int32]*DuplicationEntry { + return p.DupMap +} +func (p *DuplicationSyncResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *DuplicationSyncResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DuplicationSyncResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *DuplicationSyncResponse) ReadField2(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[int32]map[int32]*DuplicationEntry, size) + p.DupMap = tMap + for i := 0; i < size; i++ { + var _key6 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key6 = v + } + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[int32]*DuplicationEntry, size) + _val7 := tMap + for i := 0; i < size; i++ { + var _key8 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key8 = v + } + _val9 := &DuplicationEntry{} + if err := _val9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val9), err) + } + _val7[_key8] = _val9 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + p.DupMap[_key6] = _val7 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DuplicationSyncResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("duplication_sync_response"); 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 *DuplicationSyncResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *DuplicationSyncResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("dup_map", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dup_map: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.MAP, len(p.DupMap)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.DupMap { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range v { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dup_map: ", p), err) + } + return err +} + +func (p *DuplicationSyncResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DuplicationSyncResponse(%+v)", *p) +} diff --git a/go-client/idl/admin/meta_admin-consts.go b/go-client/idl/admin/meta_admin-consts.go new file mode 100644 index 0000000000..757b943ef3 --- /dev/null +++ b/go-client/idl/admin/meta_admin-consts.go @@ -0,0 +1,27 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +func init() { +} diff --git a/go-client/idl/admin/meta_admin.go b/go-client/idl/admin/meta_admin.go new file mode 100644 index 0000000000..4a335e282d --- /dev/null +++ b/go-client/idl/admin/meta_admin.go @@ -0,0 +1,16081 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +type ConfigType int64 + +const ( + ConfigType_CT_INVALID ConfigType = 0 + ConfigType_CT_ASSIGN_PRIMARY ConfigType = 1 + ConfigType_CT_UPGRADE_TO_PRIMARY ConfigType = 2 + ConfigType_CT_ADD_SECONDARY ConfigType = 3 + ConfigType_CT_UPGRADE_TO_SECONDARY ConfigType = 4 + ConfigType_CT_DOWNGRADE_TO_SECONDARY ConfigType = 5 + ConfigType_CT_DOWNGRADE_TO_INACTIVE ConfigType = 6 + ConfigType_CT_REMOVE ConfigType = 7 + ConfigType_CT_ADD_SECONDARY_FOR_LB ConfigType = 8 + ConfigType_CT_PRIMARY_FORCE_UPDATE_BALLOT ConfigType = 9 + ConfigType_CT_DROP_PARTITION ConfigType = 10 + ConfigType_CT_REGISTER_CHILD ConfigType = 11 +) + +func (p ConfigType) String() string { + switch p { + case ConfigType_CT_INVALID: + return "CT_INVALID" + case ConfigType_CT_ASSIGN_PRIMARY: + return "CT_ASSIGN_PRIMARY" + case ConfigType_CT_UPGRADE_TO_PRIMARY: + return "CT_UPGRADE_TO_PRIMARY" + case ConfigType_CT_ADD_SECONDARY: + return "CT_ADD_SECONDARY" + case ConfigType_CT_UPGRADE_TO_SECONDARY: + return "CT_UPGRADE_TO_SECONDARY" + case ConfigType_CT_DOWNGRADE_TO_SECONDARY: + return "CT_DOWNGRADE_TO_SECONDARY" + case ConfigType_CT_DOWNGRADE_TO_INACTIVE: + return "CT_DOWNGRADE_TO_INACTIVE" + case ConfigType_CT_REMOVE: + return "CT_REMOVE" + case ConfigType_CT_ADD_SECONDARY_FOR_LB: + return "CT_ADD_SECONDARY_FOR_LB" + case ConfigType_CT_PRIMARY_FORCE_UPDATE_BALLOT: + return "CT_PRIMARY_FORCE_UPDATE_BALLOT" + case ConfigType_CT_DROP_PARTITION: + return "CT_DROP_PARTITION" + case ConfigType_CT_REGISTER_CHILD: + return "CT_REGISTER_CHILD" + } + return "" +} + +func ConfigTypeFromString(s string) (ConfigType, error) { + switch s { + case "CT_INVALID": + return ConfigType_CT_INVALID, nil + case "CT_ASSIGN_PRIMARY": + return ConfigType_CT_ASSIGN_PRIMARY, nil + case "CT_UPGRADE_TO_PRIMARY": + return ConfigType_CT_UPGRADE_TO_PRIMARY, nil + case "CT_ADD_SECONDARY": + return ConfigType_CT_ADD_SECONDARY, nil + case "CT_UPGRADE_TO_SECONDARY": + return ConfigType_CT_UPGRADE_TO_SECONDARY, nil + case "CT_DOWNGRADE_TO_SECONDARY": + return ConfigType_CT_DOWNGRADE_TO_SECONDARY, nil + case "CT_DOWNGRADE_TO_INACTIVE": + return ConfigType_CT_DOWNGRADE_TO_INACTIVE, nil + case "CT_REMOVE": + return ConfigType_CT_REMOVE, nil + case "CT_ADD_SECONDARY_FOR_LB": + return ConfigType_CT_ADD_SECONDARY_FOR_LB, nil + case "CT_PRIMARY_FORCE_UPDATE_BALLOT": + return ConfigType_CT_PRIMARY_FORCE_UPDATE_BALLOT, nil + case "CT_DROP_PARTITION": + return ConfigType_CT_DROP_PARTITION, nil + case "CT_REGISTER_CHILD": + return ConfigType_CT_REGISTER_CHILD, nil + } + return ConfigType(0), fmt.Errorf("not a valid ConfigType string") +} + +func ConfigTypePtr(v ConfigType) *ConfigType { return &v } + +func (p ConfigType) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *ConfigType) UnmarshalText(text []byte) error { + q, err := ConfigTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *ConfigType) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = ConfigType(v) + return nil +} + +func (p *ConfigType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type NodeStatus int64 + +const ( + NodeStatus_NS_INVALID NodeStatus = 0 + NodeStatus_NS_ALIVE NodeStatus = 1 + NodeStatus_NS_UNALIVE NodeStatus = 2 +) + +func (p NodeStatus) String() string { + switch p { + case NodeStatus_NS_INVALID: + return "NS_INVALID" + case NodeStatus_NS_ALIVE: + return "NS_ALIVE" + case NodeStatus_NS_UNALIVE: + return "NS_UNALIVE" + } + return "" +} + +func NodeStatusFromString(s string) (NodeStatus, error) { + switch s { + case "NS_INVALID": + return NodeStatus_NS_INVALID, nil + case "NS_ALIVE": + return NodeStatus_NS_ALIVE, nil + case "NS_UNALIVE": + return NodeStatus_NS_UNALIVE, nil + } + return NodeStatus(0), fmt.Errorf("not a valid NodeStatus string") +} + +func NodeStatusPtr(v NodeStatus) *NodeStatus { return &v } + +func (p NodeStatus) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *NodeStatus) UnmarshalText(text []byte) error { + q, err := NodeStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *NodeStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = NodeStatus(v) + return nil +} + +func (p *NodeStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type AppEnvOperation int64 + +const ( + AppEnvOperation_APP_ENV_OP_INVALID AppEnvOperation = 0 + AppEnvOperation_APP_ENV_OP_SET AppEnvOperation = 1 + AppEnvOperation_APP_ENV_OP_DEL AppEnvOperation = 2 + AppEnvOperation_APP_ENV_OP_CLEAR AppEnvOperation = 3 +) + +func (p AppEnvOperation) String() string { + switch p { + case AppEnvOperation_APP_ENV_OP_INVALID: + return "APP_ENV_OP_INVALID" + case AppEnvOperation_APP_ENV_OP_SET: + return "APP_ENV_OP_SET" + case AppEnvOperation_APP_ENV_OP_DEL: + return "APP_ENV_OP_DEL" + case AppEnvOperation_APP_ENV_OP_CLEAR: + return "APP_ENV_OP_CLEAR" + } + return "" +} + +func AppEnvOperationFromString(s string) (AppEnvOperation, error) { + switch s { + case "APP_ENV_OP_INVALID": + return AppEnvOperation_APP_ENV_OP_INVALID, nil + case "APP_ENV_OP_SET": + return AppEnvOperation_APP_ENV_OP_SET, nil + case "APP_ENV_OP_DEL": + return AppEnvOperation_APP_ENV_OP_DEL, nil + case "APP_ENV_OP_CLEAR": + return AppEnvOperation_APP_ENV_OP_CLEAR, nil + } + return AppEnvOperation(0), fmt.Errorf("not a valid AppEnvOperation string") +} + +func AppEnvOperationPtr(v AppEnvOperation) *AppEnvOperation { return &v } + +func (p AppEnvOperation) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *AppEnvOperation) UnmarshalText(text []byte) error { + q, err := AppEnvOperationFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *AppEnvOperation) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = AppEnvOperation(v) + return nil +} + +func (p *AppEnvOperation) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type MetaFunctionLevel int64 + +const ( + MetaFunctionLevel_fl_stopped MetaFunctionLevel = 100 + MetaFunctionLevel_fl_blind MetaFunctionLevel = 200 + MetaFunctionLevel_fl_freezed MetaFunctionLevel = 300 + MetaFunctionLevel_fl_steady MetaFunctionLevel = 400 + MetaFunctionLevel_fl_lively MetaFunctionLevel = 500 + MetaFunctionLevel_fl_invalid MetaFunctionLevel = 10000 +) + +func (p MetaFunctionLevel) String() string { + switch p { + case MetaFunctionLevel_fl_stopped: + return "fl_stopped" + case MetaFunctionLevel_fl_blind: + return "fl_blind" + case MetaFunctionLevel_fl_freezed: + return "fl_freezed" + case MetaFunctionLevel_fl_steady: + return "fl_steady" + case MetaFunctionLevel_fl_lively: + return "fl_lively" + case MetaFunctionLevel_fl_invalid: + return "fl_invalid" + } + return "" +} + +func MetaFunctionLevelFromString(s string) (MetaFunctionLevel, error) { + switch s { + case "fl_stopped": + return MetaFunctionLevel_fl_stopped, nil + case "fl_blind": + return MetaFunctionLevel_fl_blind, nil + case "fl_freezed": + return MetaFunctionLevel_fl_freezed, nil + case "fl_steady": + return MetaFunctionLevel_fl_steady, nil + case "fl_lively": + return MetaFunctionLevel_fl_lively, nil + case "fl_invalid": + return MetaFunctionLevel_fl_invalid, nil + } + return MetaFunctionLevel(0), fmt.Errorf("not a valid MetaFunctionLevel string") +} + +func MetaFunctionLevelPtr(v MetaFunctionLevel) *MetaFunctionLevel { return &v } + +func (p MetaFunctionLevel) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *MetaFunctionLevel) UnmarshalText(text []byte) error { + q, err := MetaFunctionLevelFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *MetaFunctionLevel) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = MetaFunctionLevel(v) + return nil +} + +func (p *MetaFunctionLevel) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type BalancerRequestType int64 + +const ( + BalancerRequestType_move_primary BalancerRequestType = 0 + BalancerRequestType_copy_primary BalancerRequestType = 1 + BalancerRequestType_copy_secondary BalancerRequestType = 2 +) + +func (p BalancerRequestType) String() string { + switch p { + case BalancerRequestType_move_primary: + return "move_primary" + case BalancerRequestType_copy_primary: + return "copy_primary" + case BalancerRequestType_copy_secondary: + return "copy_secondary" + } + return "" +} + +func BalancerRequestTypeFromString(s string) (BalancerRequestType, error) { + switch s { + case "move_primary": + return BalancerRequestType_move_primary, nil + case "copy_primary": + return BalancerRequestType_copy_primary, nil + case "copy_secondary": + return BalancerRequestType_copy_secondary, nil + } + return BalancerRequestType(0), fmt.Errorf("not a valid BalancerRequestType string") +} + +func BalancerRequestTypePtr(v BalancerRequestType) *BalancerRequestType { return &v } + +func (p BalancerRequestType) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *BalancerRequestType) UnmarshalText(text []byte) error { + q, err := BalancerRequestTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *BalancerRequestType) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = BalancerRequestType(v) + return nil +} + +func (p *BalancerRequestType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +// Attributes: +// - Info +// - Config +// - Type +// - Node +// - HostNode +// - MetaSplitStatus +// - HpNode +type ConfigurationUpdateRequest struct { + Info *replication.AppInfo `thrift:"info,1" db:"info" json:"info"` + Config *replication.PartitionConfiguration `thrift:"config,2" db:"config" json:"config"` + Type ConfigType `thrift:"type,3" db:"type" json:"type"` + Node *base.RPCAddress `thrift:"node,4" db:"node" json:"node"` + HostNode *base.RPCAddress `thrift:"host_node,5" db:"host_node" json:"host_node"` + MetaSplitStatus *SplitStatus `thrift:"meta_split_status,6" db:"meta_split_status" json:"meta_split_status,omitempty"` + HpNode *base.HostPort `thrift:"hp_node,7" db:"hp_node" json:"hp_node,omitempty"` +} + +func NewConfigurationUpdateRequest() *ConfigurationUpdateRequest { + return &ConfigurationUpdateRequest{ + Type: 0, + } +} + +var ConfigurationUpdateRequest_Info_DEFAULT *replication.AppInfo + +func (p *ConfigurationUpdateRequest) GetInfo() *replication.AppInfo { + if !p.IsSetInfo() { + return ConfigurationUpdateRequest_Info_DEFAULT + } + return p.Info +} + +var ConfigurationUpdateRequest_Config_DEFAULT *replication.PartitionConfiguration + +func (p *ConfigurationUpdateRequest) GetConfig() *replication.PartitionConfiguration { + if !p.IsSetConfig() { + return ConfigurationUpdateRequest_Config_DEFAULT + } + return p.Config +} + +func (p *ConfigurationUpdateRequest) GetType() ConfigType { + return p.Type +} + +var ConfigurationUpdateRequest_Node_DEFAULT *base.RPCAddress + +func (p *ConfigurationUpdateRequest) GetNode() *base.RPCAddress { + if !p.IsSetNode() { + return ConfigurationUpdateRequest_Node_DEFAULT + } + return p.Node +} + +var ConfigurationUpdateRequest_HostNode_DEFAULT *base.RPCAddress + +func (p *ConfigurationUpdateRequest) GetHostNode() *base.RPCAddress { + if !p.IsSetHostNode() { + return ConfigurationUpdateRequest_HostNode_DEFAULT + } + return p.HostNode +} + +var ConfigurationUpdateRequest_MetaSplitStatus_DEFAULT SplitStatus + +func (p *ConfigurationUpdateRequest) GetMetaSplitStatus() SplitStatus { + if !p.IsSetMetaSplitStatus() { + return ConfigurationUpdateRequest_MetaSplitStatus_DEFAULT + } + return *p.MetaSplitStatus +} + +var ConfigurationUpdateRequest_HpNode_DEFAULT *base.HostPort + +func (p *ConfigurationUpdateRequest) GetHpNode() *base.HostPort { + if !p.IsSetHpNode() { + return ConfigurationUpdateRequest_HpNode_DEFAULT + } + return p.HpNode +} +func (p *ConfigurationUpdateRequest) IsSetInfo() bool { + return p.Info != nil +} + +func (p *ConfigurationUpdateRequest) IsSetConfig() bool { + return p.Config != nil +} + +func (p *ConfigurationUpdateRequest) IsSetNode() bool { + return p.Node != nil +} + +func (p *ConfigurationUpdateRequest) IsSetHostNode() bool { + return p.HostNode != nil +} + +func (p *ConfigurationUpdateRequest) IsSetMetaSplitStatus() bool { + return p.MetaSplitStatus != nil +} + +func (p *ConfigurationUpdateRequest) IsSetHpNode() bool { + return p.HpNode != nil +} + +func (p *ConfigurationUpdateRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I32 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationUpdateRequest) ReadField1(iprot thrift.TProtocol) error { + p.Info = &replication.AppInfo{ + Status: 0, + + InitPartitionCount: -1, + } + if err := p.Info.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Info), err) + } + return nil +} + +func (p *ConfigurationUpdateRequest) ReadField2(iprot thrift.TProtocol) error { + p.Config = &replication.PartitionConfiguration{} + if err := p.Config.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Config), err) + } + return nil +} + +func (p *ConfigurationUpdateRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := ConfigType(v) + p.Type = temp + } + return nil +} + +func (p *ConfigurationUpdateRequest) ReadField4(iprot thrift.TProtocol) error { + p.Node = &base.RPCAddress{} + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *ConfigurationUpdateRequest) ReadField5(iprot thrift.TProtocol) error { + p.HostNode = &base.RPCAddress{} + if err := p.HostNode.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HostNode), err) + } + return nil +} + +func (p *ConfigurationUpdateRequest) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + temp := SplitStatus(v) + p.MetaSplitStatus = &temp + } + return nil +} + +func (p *ConfigurationUpdateRequest) ReadField7(iprot thrift.TProtocol) error { + p.HpNode = &base.HostPort{} + if err := p.HpNode.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpNode), err) + } + return nil +} + +func (p *ConfigurationUpdateRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_update_request"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(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 *ConfigurationUpdateRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:info: ", p), err) + } + if err := p.Info.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Info), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:info: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("config", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:config: ", p), err) + } + if err := p.Config.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Config), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:config: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:node: ", p), err) + } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:node: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("host_node", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:host_node: ", p), err) + } + if err := p.HostNode.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HostNode), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:host_node: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetMetaSplitStatus() { + if err := oprot.WriteFieldBegin("meta_split_status", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:meta_split_status: ", p), err) + } + if err := oprot.WriteI32(int32(*p.MetaSplitStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.meta_split_status (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:meta_split_status: ", p), err) + } + } + return err +} + +func (p *ConfigurationUpdateRequest) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetHpNode() { + if err := oprot.WriteFieldBegin("hp_node", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:hp_node: ", p), err) + } + if err := p.HpNode.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpNode), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:hp_node: ", p), err) + } + } + return err +} + +func (p *ConfigurationUpdateRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationUpdateRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Config +type ConfigurationUpdateResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Config *replication.PartitionConfiguration `thrift:"config,2" db:"config" json:"config"` +} + +func NewConfigurationUpdateResponse() *ConfigurationUpdateResponse { + return &ConfigurationUpdateResponse{} +} + +var ConfigurationUpdateResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationUpdateResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationUpdateResponse_Err_DEFAULT + } + return p.Err +} + +var ConfigurationUpdateResponse_Config_DEFAULT *replication.PartitionConfiguration + +func (p *ConfigurationUpdateResponse) GetConfig() *replication.PartitionConfiguration { + if !p.IsSetConfig() { + return ConfigurationUpdateResponse_Config_DEFAULT + } + return p.Config +} +func (p *ConfigurationUpdateResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationUpdateResponse) IsSetConfig() bool { + return p.Config != nil +} + +func (p *ConfigurationUpdateResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationUpdateResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationUpdateResponse) ReadField2(iprot thrift.TProtocol) error { + p.Config = &replication.PartitionConfiguration{} + if err := p.Config.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Config), err) + } + return nil +} + +func (p *ConfigurationUpdateResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_update_response"); 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 *ConfigurationUpdateResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("config", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:config: ", p), err) + } + if err := p.Config.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Config), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:config: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationUpdateResponse(%+v)", *p) +} + +// Attributes: +// - GeoTags +// - TotalCapacityMb +type ReplicaServerInfo struct { + GeoTags map[string]string `thrift:"geo_tags,1" db:"geo_tags" json:"geo_tags"` + TotalCapacityMb int64 `thrift:"total_capacity_mb,2" db:"total_capacity_mb" json:"total_capacity_mb"` +} + +func NewReplicaServerInfo() *ReplicaServerInfo { + return &ReplicaServerInfo{} +} + +func (p *ReplicaServerInfo) GetGeoTags() map[string]string { + return p.GeoTags +} + +func (p *ReplicaServerInfo) GetTotalCapacityMb() int64 { + return p.TotalCapacityMb +} +func (p *ReplicaServerInfo) 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 fieldTypeId == thrift.MAP { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaServerInfo) ReadField1(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.GeoTags = tMap + for i := 0; i < size; i++ { + var _key0 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key0 = v + } + var _val1 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val1 = v + } + p.GeoTags[_key0] = _val1 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ReplicaServerInfo) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TotalCapacityMb = v + } + return nil +} + +func (p *ReplicaServerInfo) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("replica_server_info"); 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 *ReplicaServerInfo) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("geo_tags", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:geo_tags: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.GeoTags)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.GeoTags { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:geo_tags: ", p), err) + } + return err +} + +func (p *ReplicaServerInfo) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("total_capacity_mb", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:total_capacity_mb: ", p), err) + } + if err := oprot.WriteI64(int64(p.TotalCapacityMb)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.total_capacity_mb (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:total_capacity_mb: ", p), err) + } + return err +} + +func (p *ReplicaServerInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaServerInfo(%+v)", *p) +} + +// Attributes: +// - Node +// - StoredReplicas +// - Info +// - HpNode +type ConfigurationQueryByNodeRequest struct { + Node *base.RPCAddress `thrift:"node,1" db:"node" json:"node"` + StoredReplicas []*ReplicaInfo `thrift:"stored_replicas,2" db:"stored_replicas" json:"stored_replicas,omitempty"` + Info *ReplicaServerInfo `thrift:"info,3" db:"info" json:"info,omitempty"` + HpNode *base.HostPort `thrift:"hp_node,4" db:"hp_node" json:"hp_node,omitempty"` +} + +func NewConfigurationQueryByNodeRequest() *ConfigurationQueryByNodeRequest { + return &ConfigurationQueryByNodeRequest{} +} + +var ConfigurationQueryByNodeRequest_Node_DEFAULT *base.RPCAddress + +func (p *ConfigurationQueryByNodeRequest) GetNode() *base.RPCAddress { + if !p.IsSetNode() { + return ConfigurationQueryByNodeRequest_Node_DEFAULT + } + return p.Node +} + +var ConfigurationQueryByNodeRequest_StoredReplicas_DEFAULT []*ReplicaInfo + +func (p *ConfigurationQueryByNodeRequest) GetStoredReplicas() []*ReplicaInfo { + return p.StoredReplicas +} + +var ConfigurationQueryByNodeRequest_Info_DEFAULT *ReplicaServerInfo + +func (p *ConfigurationQueryByNodeRequest) GetInfo() *ReplicaServerInfo { + if !p.IsSetInfo() { + return ConfigurationQueryByNodeRequest_Info_DEFAULT + } + return p.Info +} + +var ConfigurationQueryByNodeRequest_HpNode_DEFAULT *base.HostPort + +func (p *ConfigurationQueryByNodeRequest) GetHpNode() *base.HostPort { + if !p.IsSetHpNode() { + return ConfigurationQueryByNodeRequest_HpNode_DEFAULT + } + return p.HpNode +} +func (p *ConfigurationQueryByNodeRequest) IsSetNode() bool { + return p.Node != nil +} + +func (p *ConfigurationQueryByNodeRequest) IsSetStoredReplicas() bool { + return p.StoredReplicas != nil +} + +func (p *ConfigurationQueryByNodeRequest) IsSetInfo() bool { + return p.Info != nil +} + +func (p *ConfigurationQueryByNodeRequest) IsSetHpNode() bool { + return p.HpNode != nil +} + +func (p *ConfigurationQueryByNodeRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationQueryByNodeRequest) ReadField1(iprot thrift.TProtocol) error { + p.Node = &base.RPCAddress{} + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *ConfigurationQueryByNodeRequest) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ReplicaInfo, 0, size) + p.StoredReplicas = tSlice + for i := 0; i < size; i++ { + _elem2 := &ReplicaInfo{} + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.StoredReplicas = append(p.StoredReplicas, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationQueryByNodeRequest) ReadField3(iprot thrift.TProtocol) error { + p.Info = &ReplicaServerInfo{} + if err := p.Info.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Info), err) + } + return nil +} + +func (p *ConfigurationQueryByNodeRequest) ReadField4(iprot thrift.TProtocol) error { + p.HpNode = &base.HostPort{} + if err := p.HpNode.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpNode), err) + } + return nil +} + +func (p *ConfigurationQueryByNodeRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_query_by_node_request"); 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 *ConfigurationQueryByNodeRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) + } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) + } + return err +} + +func (p *ConfigurationQueryByNodeRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetStoredReplicas() { + if err := oprot.WriteFieldBegin("stored_replicas", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stored_replicas: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StoredReplicas)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StoredReplicas { + 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:stored_replicas: ", p), err) + } + } + return err +} + +func (p *ConfigurationQueryByNodeRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetInfo() { + if err := oprot.WriteFieldBegin("info", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:info: ", p), err) + } + if err := p.Info.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Info), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:info: ", p), err) + } + } + return err +} + +func (p *ConfigurationQueryByNodeRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetHpNode() { + if err := oprot.WriteFieldBegin("hp_node", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hp_node: ", p), err) + } + if err := p.HpNode.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpNode), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:hp_node: ", p), err) + } + } + return err +} + +func (p *ConfigurationQueryByNodeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationQueryByNodeRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Partitions +// - GcReplicas +type ConfigurationQueryByNodeResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Partitions []*ConfigurationUpdateRequest `thrift:"partitions,2" db:"partitions" json:"partitions"` + GcReplicas []*ReplicaInfo `thrift:"gc_replicas,3" db:"gc_replicas" json:"gc_replicas,omitempty"` +} + +func NewConfigurationQueryByNodeResponse() *ConfigurationQueryByNodeResponse { + return &ConfigurationQueryByNodeResponse{} +} + +var ConfigurationQueryByNodeResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationQueryByNodeResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationQueryByNodeResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationQueryByNodeResponse) GetPartitions() []*ConfigurationUpdateRequest { + return p.Partitions +} + +var ConfigurationQueryByNodeResponse_GcReplicas_DEFAULT []*ReplicaInfo + +func (p *ConfigurationQueryByNodeResponse) GetGcReplicas() []*ReplicaInfo { + return p.GcReplicas +} +func (p *ConfigurationQueryByNodeResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationQueryByNodeResponse) IsSetGcReplicas() bool { + return p.GcReplicas != nil +} + +func (p *ConfigurationQueryByNodeResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationQueryByNodeResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationQueryByNodeResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigurationUpdateRequest, 0, size) + p.Partitions = tSlice + for i := 0; i < size; i++ { + _elem3 := &ConfigurationUpdateRequest{ + Type: 0, + } + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Partitions = append(p.Partitions, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationQueryByNodeResponse) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ReplicaInfo, 0, size) + p.GcReplicas = tSlice + for i := 0; i < size; i++ { + _elem4 := &ReplicaInfo{} + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.GcReplicas = append(p.GcReplicas, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationQueryByNodeResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_query_by_node_response"); 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 := 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 *ConfigurationQueryByNodeResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationQueryByNodeResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partitions", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:partitions: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Partitions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Partitions { + 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:partitions: ", p), err) + } + return err +} + +func (p *ConfigurationQueryByNodeResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetGcReplicas() { + if err := oprot.WriteFieldBegin("gc_replicas", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:gc_replicas: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.GcReplicas)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.GcReplicas { + 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 3:gc_replicas: ", p), err) + } + } + return err +} + +func (p *ConfigurationQueryByNodeResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationQueryByNodeResponse(%+v)", *p) +} + +// Attributes: +// - RecoveryNodes +// - SkipBadNodes +// - SkipLostPartitions +// - HpRecoveryNodes +type ConfigurationRecoveryRequest struct { + RecoveryNodes []*base.RPCAddress `thrift:"recovery_nodes,1" db:"recovery_nodes" json:"recovery_nodes"` + SkipBadNodes bool `thrift:"skip_bad_nodes,2" db:"skip_bad_nodes" json:"skip_bad_nodes"` + SkipLostPartitions bool `thrift:"skip_lost_partitions,3" db:"skip_lost_partitions" json:"skip_lost_partitions"` + HpRecoveryNodes []*base.HostPort `thrift:"hp_recovery_nodes,4" db:"hp_recovery_nodes" json:"hp_recovery_nodes,omitempty"` +} + +func NewConfigurationRecoveryRequest() *ConfigurationRecoveryRequest { + return &ConfigurationRecoveryRequest{} +} + +func (p *ConfigurationRecoveryRequest) GetRecoveryNodes() []*base.RPCAddress { + return p.RecoveryNodes +} + +func (p *ConfigurationRecoveryRequest) GetSkipBadNodes() bool { + return p.SkipBadNodes +} + +func (p *ConfigurationRecoveryRequest) GetSkipLostPartitions() bool { + return p.SkipLostPartitions +} + +var ConfigurationRecoveryRequest_HpRecoveryNodes_DEFAULT []*base.HostPort + +func (p *ConfigurationRecoveryRequest) GetHpRecoveryNodes() []*base.HostPort { + return p.HpRecoveryNodes +} +func (p *ConfigurationRecoveryRequest) IsSetHpRecoveryNodes() bool { + return p.HpRecoveryNodes != nil +} + +func (p *ConfigurationRecoveryRequest) 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 fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationRecoveryRequest) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*base.RPCAddress, 0, size) + p.RecoveryNodes = tSlice + for i := 0; i < size; i++ { + _elem5 := &base.RPCAddress{} + if err := _elem5.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) + } + p.RecoveryNodes = append(p.RecoveryNodes, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationRecoveryRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.SkipBadNodes = v + } + return nil +} + +func (p *ConfigurationRecoveryRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.SkipLostPartitions = v + } + return nil +} + +func (p *ConfigurationRecoveryRequest) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*base.HostPort, 0, size) + p.HpRecoveryNodes = tSlice + for i := 0; i < size; i++ { + _elem6 := &base.HostPort{} + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.HpRecoveryNodes = append(p.HpRecoveryNodes, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationRecoveryRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_recovery_request"); 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 *ConfigurationRecoveryRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("recovery_nodes", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:recovery_nodes: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.RecoveryNodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.RecoveryNodes { + 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:recovery_nodes: ", p), err) + } + return err +} + +func (p *ConfigurationRecoveryRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("skip_bad_nodes", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:skip_bad_nodes: ", p), err) + } + if err := oprot.WriteBool(bool(p.SkipBadNodes)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.skip_bad_nodes (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:skip_bad_nodes: ", p), err) + } + return err +} + +func (p *ConfigurationRecoveryRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("skip_lost_partitions", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:skip_lost_partitions: ", p), err) + } + if err := oprot.WriteBool(bool(p.SkipLostPartitions)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.skip_lost_partitions (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:skip_lost_partitions: ", p), err) + } + return err +} + +func (p *ConfigurationRecoveryRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetHpRecoveryNodes() { + if err := oprot.WriteFieldBegin("hp_recovery_nodes", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hp_recovery_nodes: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.HpRecoveryNodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HpRecoveryNodes { + 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 4:hp_recovery_nodes: ", p), err) + } + } + return err +} + +func (p *ConfigurationRecoveryRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationRecoveryRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMessage +type ConfigurationRecoveryResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMessage string `thrift:"hint_message,2" db:"hint_message" json:"hint_message"` +} + +func NewConfigurationRecoveryResponse() *ConfigurationRecoveryResponse { + return &ConfigurationRecoveryResponse{} +} + +var ConfigurationRecoveryResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationRecoveryResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationRecoveryResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationRecoveryResponse) GetHintMessage() string { + return p.HintMessage +} +func (p *ConfigurationRecoveryResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationRecoveryResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationRecoveryResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationRecoveryResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMessage = v + } + return nil +} + +func (p *ConfigurationRecoveryResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_recovery_response"); 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 *ConfigurationRecoveryResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationRecoveryResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_message", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_message: ", p), err) + } + if err := oprot.WriteString(string(p.HintMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_message (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_message: ", p), err) + } + return err +} + +func (p *ConfigurationRecoveryResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationRecoveryResponse(%+v)", *p) +} + +// Attributes: +// - PartitionCount +// - ReplicaCount +// - SuccessIfExist +// - AppType +// - IsStateful +// - Envs +type CreateAppOptions struct { + PartitionCount int32 `thrift:"partition_count,1" db:"partition_count" json:"partition_count"` + ReplicaCount int32 `thrift:"replica_count,2" db:"replica_count" json:"replica_count"` + SuccessIfExist bool `thrift:"success_if_exist,3" db:"success_if_exist" json:"success_if_exist"` + AppType string `thrift:"app_type,4" db:"app_type" json:"app_type"` + IsStateful bool `thrift:"is_stateful,5" db:"is_stateful" json:"is_stateful"` + Envs map[string]string `thrift:"envs,6" db:"envs" json:"envs"` +} + +func NewCreateAppOptions() *CreateAppOptions { + return &CreateAppOptions{} +} + +func (p *CreateAppOptions) GetPartitionCount() int32 { + return p.PartitionCount +} + +func (p *CreateAppOptions) GetReplicaCount() int32 { + return p.ReplicaCount +} + +func (p *CreateAppOptions) GetSuccessIfExist() bool { + return p.SuccessIfExist +} + +func (p *CreateAppOptions) GetAppType() string { + return p.AppType +} + +func (p *CreateAppOptions) GetIsStateful() bool { + return p.IsStateful +} + +func (p *CreateAppOptions) GetEnvs() map[string]string { + return p.Envs +} +func (p *CreateAppOptions) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.MAP { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *CreateAppOptions) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.PartitionCount = v + } + return nil +} + +func (p *CreateAppOptions) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ReplicaCount = v + } + return nil +} + +func (p *CreateAppOptions) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.SuccessIfExist = v + } + return nil +} + +func (p *CreateAppOptions) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.AppType = v + } + return nil +} + +func (p *CreateAppOptions) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.IsStateful = v + } + return nil +} + +func (p *CreateAppOptions) ReadField6(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Envs = tMap + for i := 0; i < size; i++ { + var _key7 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key7 = v + } + var _val8 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val8 = v + } + p.Envs[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *CreateAppOptions) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("create_app_options"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(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 *CreateAppOptions) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_count", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_count (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:partition_count: ", p), err) + } + return err +} + +func (p *CreateAppOptions) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("replica_count", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:replica_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.ReplicaCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.replica_count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:replica_count: ", p), err) + } + return err +} + +func (p *CreateAppOptions) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("success_if_exist", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:success_if_exist: ", p), err) + } + if err := oprot.WriteBool(bool(p.SuccessIfExist)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.success_if_exist (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:success_if_exist: ", p), err) + } + return err +} + +func (p *CreateAppOptions) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_type", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:app_type: ", p), err) + } + if err := oprot.WriteString(string(p.AppType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_type (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:app_type: ", p), err) + } + return err +} + +func (p *CreateAppOptions) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_stateful", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:is_stateful: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsStateful)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_stateful (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:is_stateful: ", p), err) + } + return err +} + +func (p *CreateAppOptions) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("envs", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:envs: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Envs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Envs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:envs: ", p), err) + } + return err +} + +func (p *CreateAppOptions) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateAppOptions(%+v)", *p) +} + +// Attributes: +// - AppName +// - Options +type ConfigurationCreateAppRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + Options *CreateAppOptions `thrift:"options,2" db:"options" json:"options"` +} + +func NewConfigurationCreateAppRequest() *ConfigurationCreateAppRequest { + return &ConfigurationCreateAppRequest{} +} + +func (p *ConfigurationCreateAppRequest) GetAppName() string { + return p.AppName +} + +var ConfigurationCreateAppRequest_Options_DEFAULT *CreateAppOptions + +func (p *ConfigurationCreateAppRequest) GetOptions() *CreateAppOptions { + if !p.IsSetOptions() { + return ConfigurationCreateAppRequest_Options_DEFAULT + } + return p.Options +} +func (p *ConfigurationCreateAppRequest) IsSetOptions() bool { + return p.Options != nil +} + +func (p *ConfigurationCreateAppRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationCreateAppRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *ConfigurationCreateAppRequest) ReadField2(iprot thrift.TProtocol) error { + p.Options = &CreateAppOptions{} + if err := p.Options.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Options), err) + } + return nil +} + +func (p *ConfigurationCreateAppRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_create_app_request"); 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 *ConfigurationCreateAppRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *ConfigurationCreateAppRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("options", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:options: ", p), err) + } + if err := p.Options.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Options), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:options: ", p), err) + } + return err +} + +func (p *ConfigurationCreateAppRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationCreateAppRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Appid +type ConfigurationCreateAppResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Appid int32 `thrift:"appid,2" db:"appid" json:"appid"` +} + +func NewConfigurationCreateAppResponse() *ConfigurationCreateAppResponse { + return &ConfigurationCreateAppResponse{} +} + +var ConfigurationCreateAppResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationCreateAppResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationCreateAppResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationCreateAppResponse) GetAppid() int32 { + return p.Appid +} +func (p *ConfigurationCreateAppResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationCreateAppResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationCreateAppResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationCreateAppResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Appid = v + } + return nil +} + +func (p *ConfigurationCreateAppResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_create_app_response"); 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 *ConfigurationCreateAppResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationCreateAppResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("appid", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:appid: ", p), err) + } + if err := oprot.WriteI32(int32(p.Appid)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.appid (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:appid: ", p), err) + } + return err +} + +func (p *ConfigurationCreateAppResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationCreateAppResponse(%+v)", *p) +} + +// Attributes: +// - SuccessIfNotExist +// - ReserveSeconds +type DropAppOptions struct { + SuccessIfNotExist bool `thrift:"success_if_not_exist,1" db:"success_if_not_exist" json:"success_if_not_exist"` + ReserveSeconds *int64 `thrift:"reserve_seconds,2" db:"reserve_seconds" json:"reserve_seconds,omitempty"` +} + +func NewDropAppOptions() *DropAppOptions { + return &DropAppOptions{} +} + +func (p *DropAppOptions) GetSuccessIfNotExist() bool { + return p.SuccessIfNotExist +} + +var DropAppOptions_ReserveSeconds_DEFAULT int64 + +func (p *DropAppOptions) GetReserveSeconds() int64 { + if !p.IsSetReserveSeconds() { + return DropAppOptions_ReserveSeconds_DEFAULT + } + return *p.ReserveSeconds +} +func (p *DropAppOptions) IsSetReserveSeconds() bool { + return p.ReserveSeconds != nil +} + +func (p *DropAppOptions) 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 fieldTypeId == thrift.BOOL { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DropAppOptions) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.SuccessIfNotExist = v + } + return nil +} + +func (p *DropAppOptions) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ReserveSeconds = &v + } + return nil +} + +func (p *DropAppOptions) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("drop_app_options"); 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 *DropAppOptions) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("success_if_not_exist", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:success_if_not_exist: ", p), err) + } + if err := oprot.WriteBool(bool(p.SuccessIfNotExist)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.success_if_not_exist (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:success_if_not_exist: ", p), err) + } + return err +} + +func (p *DropAppOptions) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetReserveSeconds() { + if err := oprot.WriteFieldBegin("reserve_seconds", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:reserve_seconds: ", p), err) + } + if err := oprot.WriteI64(int64(*p.ReserveSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.reserve_seconds (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:reserve_seconds: ", p), err) + } + } + return err +} + +func (p *DropAppOptions) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropAppOptions(%+v)", *p) +} + +// Attributes: +// - AppName +// - Options +type ConfigurationDropAppRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + Options *DropAppOptions `thrift:"options,2" db:"options" json:"options"` +} + +func NewConfigurationDropAppRequest() *ConfigurationDropAppRequest { + return &ConfigurationDropAppRequest{} +} + +func (p *ConfigurationDropAppRequest) GetAppName() string { + return p.AppName +} + +var ConfigurationDropAppRequest_Options_DEFAULT *DropAppOptions + +func (p *ConfigurationDropAppRequest) GetOptions() *DropAppOptions { + if !p.IsSetOptions() { + return ConfigurationDropAppRequest_Options_DEFAULT + } + return p.Options +} +func (p *ConfigurationDropAppRequest) IsSetOptions() bool { + return p.Options != nil +} + +func (p *ConfigurationDropAppRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationDropAppRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *ConfigurationDropAppRequest) ReadField2(iprot thrift.TProtocol) error { + p.Options = &DropAppOptions{} + if err := p.Options.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Options), err) + } + return nil +} + +func (p *ConfigurationDropAppRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_drop_app_request"); 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 *ConfigurationDropAppRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *ConfigurationDropAppRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("options", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:options: ", p), err) + } + if err := p.Options.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Options), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:options: ", p), err) + } + return err +} + +func (p *ConfigurationDropAppRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationDropAppRequest(%+v)", *p) +} + +// Attributes: +// - Err +type ConfigurationDropAppResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` +} + +func NewConfigurationDropAppResponse() *ConfigurationDropAppResponse { + return &ConfigurationDropAppResponse{} +} + +var ConfigurationDropAppResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationDropAppResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationDropAppResponse_Err_DEFAULT + } + return p.Err +} +func (p *ConfigurationDropAppResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationDropAppResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationDropAppResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationDropAppResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_drop_app_response"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigurationDropAppResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationDropAppResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationDropAppResponse(%+v)", *p) +} + +// Attributes: +// - OldAppName +// - NewAppName_ +type ConfigurationRenameAppRequest struct { + OldAppName string `thrift:"old_app_name,1" db:"old_app_name" json:"old_app_name"` + NewAppName_ string `thrift:"new_app_name,2" db:"new_app_name" json:"new_app_name"` +} + +func NewConfigurationRenameAppRequest() *ConfigurationRenameAppRequest { + return &ConfigurationRenameAppRequest{} +} + +func (p *ConfigurationRenameAppRequest) GetOldAppName() string { + return p.OldAppName +} + +func (p *ConfigurationRenameAppRequest) GetNewAppName_() string { + return p.NewAppName_ +} +func (p *ConfigurationRenameAppRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationRenameAppRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.OldAppName = v + } + return nil +} + +func (p *ConfigurationRenameAppRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.NewAppName_ = v + } + return nil +} + +func (p *ConfigurationRenameAppRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_rename_app_request"); 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 *ConfigurationRenameAppRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("old_app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:old_app_name: ", p), err) + } + if err := oprot.WriteString(string(p.OldAppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:old_app_name: ", p), err) + } + return err +} + +func (p *ConfigurationRenameAppRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("new_app_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_app_name: ", p), err) + } + if err := oprot.WriteString(string(p.NewAppName_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_app_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_app_name: ", p), err) + } + return err +} + +func (p *ConfigurationRenameAppRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationRenameAppRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMessage +type ConfigurationRenameAppResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMessage string `thrift:"hint_message,2" db:"hint_message" json:"hint_message"` +} + +func NewConfigurationRenameAppResponse() *ConfigurationRenameAppResponse { + return &ConfigurationRenameAppResponse{} +} + +var ConfigurationRenameAppResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationRenameAppResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationRenameAppResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationRenameAppResponse) GetHintMessage() string { + return p.HintMessage +} +func (p *ConfigurationRenameAppResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationRenameAppResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationRenameAppResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationRenameAppResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMessage = v + } + return nil +} + +func (p *ConfigurationRenameAppResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_rename_app_response"); 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 *ConfigurationRenameAppResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationRenameAppResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_message", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_message: ", p), err) + } + if err := oprot.WriteString(string(p.HintMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_message (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_message: ", p), err) + } + return err +} + +func (p *ConfigurationRenameAppResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationRenameAppResponse(%+v)", *p) +} + +// Attributes: +// - AppID +// - NewAppName_ +type ConfigurationRecallAppRequest struct { + AppID int32 `thrift:"app_id,1" db:"app_id" json:"app_id"` + NewAppName_ string `thrift:"new_app_name,2" db:"new_app_name" json:"new_app_name"` +} + +func NewConfigurationRecallAppRequest() *ConfigurationRecallAppRequest { + return &ConfigurationRecallAppRequest{} +} + +func (p *ConfigurationRecallAppRequest) GetAppID() int32 { + return p.AppID +} + +func (p *ConfigurationRecallAppRequest) GetNewAppName_() string { + return p.NewAppName_ +} +func (p *ConfigurationRecallAppRequest) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationRecallAppRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *ConfigurationRecallAppRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.NewAppName_ = v + } + return nil +} + +func (p *ConfigurationRecallAppRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_recall_app_request"); 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 *ConfigurationRecallAppRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_id: ", p), err) + } + return err +} + +func (p *ConfigurationRecallAppRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("new_app_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_app_name: ", p), err) + } + if err := oprot.WriteString(string(p.NewAppName_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_app_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_app_name: ", p), err) + } + return err +} + +func (p *ConfigurationRecallAppRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationRecallAppRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Info +type ConfigurationRecallAppResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Info *replication.AppInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewConfigurationRecallAppResponse() *ConfigurationRecallAppResponse { + return &ConfigurationRecallAppResponse{} +} + +var ConfigurationRecallAppResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationRecallAppResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationRecallAppResponse_Err_DEFAULT + } + return p.Err +} + +var ConfigurationRecallAppResponse_Info_DEFAULT *replication.AppInfo + +func (p *ConfigurationRecallAppResponse) GetInfo() *replication.AppInfo { + if !p.IsSetInfo() { + return ConfigurationRecallAppResponse_Info_DEFAULT + } + return p.Info +} +func (p *ConfigurationRecallAppResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationRecallAppResponse) IsSetInfo() bool { + return p.Info != nil +} + +func (p *ConfigurationRecallAppResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationRecallAppResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationRecallAppResponse) ReadField2(iprot thrift.TProtocol) error { + p.Info = &replication.AppInfo{ + Status: 0, + + InitPartitionCount: -1, + } + if err := p.Info.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Info), err) + } + return nil +} + +func (p *ConfigurationRecallAppResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_recall_app_response"); 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 *ConfigurationRecallAppResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationRecallAppResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) + } + if err := p.Info.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Info), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:info: ", p), err) + } + return err +} + +func (p *ConfigurationRecallAppResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationRecallAppResponse(%+v)", *p) +} + +// Attributes: +// - Status +type ConfigurationListAppsRequest struct { + Status replication.AppStatus `thrift:"status,1" db:"status" json:"status"` +} + +func NewConfigurationListAppsRequest() *ConfigurationListAppsRequest { + return &ConfigurationListAppsRequest{ + Status: 0, + } +} + +func (p *ConfigurationListAppsRequest) GetStatus() replication.AppStatus { + return p.Status +} +func (p *ConfigurationListAppsRequest) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationListAppsRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := replication.AppStatus(v) + p.Status = temp + } + return nil +} + +func (p *ConfigurationListAppsRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_list_apps_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigurationListAppsRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err +} + +func (p *ConfigurationListAppsRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationListAppsRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Infos +type ConfigurationListAppsResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Infos []*replication.AppInfo `thrift:"infos,2" db:"infos" json:"infos"` +} + +func NewConfigurationListAppsResponse() *ConfigurationListAppsResponse { + return &ConfigurationListAppsResponse{} +} + +var ConfigurationListAppsResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationListAppsResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationListAppsResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationListAppsResponse) GetInfos() []*replication.AppInfo { + return p.Infos +} +func (p *ConfigurationListAppsResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationListAppsResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationListAppsResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationListAppsResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*replication.AppInfo, 0, size) + p.Infos = tSlice + for i := 0; i < size; i++ { + _elem9 := &replication.AppInfo{ + Status: 0, + + InitPartitionCount: -1, + } + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.Infos = append(p.Infos, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationListAppsResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_list_apps_response"); 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 *ConfigurationListAppsResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationListAppsResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("infos", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infos: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Infos)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Infos { + 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:infos: ", p), err) + } + return err +} + +func (p *ConfigurationListAppsResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationListAppsResponse(%+v)", *p) +} + +// Attributes: +// - MetaServer +// - HpMetaServer +type QueryAppInfoRequest struct { + MetaServer *base.RPCAddress `thrift:"meta_server,1" db:"meta_server" json:"meta_server"` + HpMetaServer *base.HostPort `thrift:"hp_meta_server,2" db:"hp_meta_server" json:"hp_meta_server,omitempty"` +} + +func NewQueryAppInfoRequest() *QueryAppInfoRequest { + return &QueryAppInfoRequest{} +} + +var QueryAppInfoRequest_MetaServer_DEFAULT *base.RPCAddress + +func (p *QueryAppInfoRequest) GetMetaServer() *base.RPCAddress { + if !p.IsSetMetaServer() { + return QueryAppInfoRequest_MetaServer_DEFAULT + } + return p.MetaServer +} + +var QueryAppInfoRequest_HpMetaServer_DEFAULT *base.HostPort + +func (p *QueryAppInfoRequest) GetHpMetaServer() *base.HostPort { + if !p.IsSetHpMetaServer() { + return QueryAppInfoRequest_HpMetaServer_DEFAULT + } + return p.HpMetaServer +} +func (p *QueryAppInfoRequest) IsSetMetaServer() bool { + return p.MetaServer != nil +} + +func (p *QueryAppInfoRequest) IsSetHpMetaServer() bool { + return p.HpMetaServer != nil +} + +func (p *QueryAppInfoRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryAppInfoRequest) ReadField1(iprot thrift.TProtocol) error { + p.MetaServer = &base.RPCAddress{} + if err := p.MetaServer.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MetaServer), err) + } + return nil +} + +func (p *QueryAppInfoRequest) ReadField2(iprot thrift.TProtocol) error { + p.HpMetaServer = &base.HostPort{} + if err := p.HpMetaServer.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpMetaServer), err) + } + return nil +} + +func (p *QueryAppInfoRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_app_info_request"); 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 *QueryAppInfoRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("meta_server", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:meta_server: ", p), err) + } + if err := p.MetaServer.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MetaServer), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:meta_server: ", p), err) + } + return err +} + +func (p *QueryAppInfoRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetHpMetaServer() { + if err := oprot.WriteFieldBegin("hp_meta_server", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hp_meta_server: ", p), err) + } + if err := p.HpMetaServer.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpMetaServer), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hp_meta_server: ", p), err) + } + } + return err +} + +func (p *QueryAppInfoRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryAppInfoRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Apps +type QueryAppInfoResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Apps []*replication.AppInfo `thrift:"apps,2" db:"apps" json:"apps"` +} + +func NewQueryAppInfoResponse() *QueryAppInfoResponse { + return &QueryAppInfoResponse{} +} + +var QueryAppInfoResponse_Err_DEFAULT *base.ErrorCode + +func (p *QueryAppInfoResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return QueryAppInfoResponse_Err_DEFAULT + } + return p.Err +} + +func (p *QueryAppInfoResponse) GetApps() []*replication.AppInfo { + return p.Apps +} +func (p *QueryAppInfoResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *QueryAppInfoResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryAppInfoResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *QueryAppInfoResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*replication.AppInfo, 0, size) + p.Apps = tSlice + for i := 0; i < size; i++ { + _elem10 := &replication.AppInfo{ + Status: 0, + + InitPartitionCount: -1, + } + if err := _elem10.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + } + p.Apps = append(p.Apps, _elem10) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *QueryAppInfoResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_app_info_response"); 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 *QueryAppInfoResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *QueryAppInfoResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("apps", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:apps: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Apps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Apps { + 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:apps: ", p), err) + } + return err +} + +func (p *QueryAppInfoResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryAppInfoResponse(%+v)", *p) +} + +// Attributes: +// - AppName +// - Op +// - Keys +// - Values +// - ClearPrefix +type ConfigurationUpdateAppEnvRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + Op AppEnvOperation `thrift:"op,2" db:"op" json:"op"` + Keys []string `thrift:"keys,3" db:"keys" json:"keys,omitempty"` + Values []string `thrift:"values,4" db:"values" json:"values,omitempty"` + ClearPrefix *string `thrift:"clear_prefix,5" db:"clear_prefix" json:"clear_prefix,omitempty"` +} + +func NewConfigurationUpdateAppEnvRequest() *ConfigurationUpdateAppEnvRequest { + return &ConfigurationUpdateAppEnvRequest{ + Op: 0, + } +} + +func (p *ConfigurationUpdateAppEnvRequest) GetAppName() string { + return p.AppName +} + +func (p *ConfigurationUpdateAppEnvRequest) GetOp() AppEnvOperation { + return p.Op +} + +var ConfigurationUpdateAppEnvRequest_Keys_DEFAULT []string + +func (p *ConfigurationUpdateAppEnvRequest) GetKeys() []string { + return p.Keys +} + +var ConfigurationUpdateAppEnvRequest_Values_DEFAULT []string + +func (p *ConfigurationUpdateAppEnvRequest) GetValues() []string { + return p.Values +} + +var ConfigurationUpdateAppEnvRequest_ClearPrefix_DEFAULT string + +func (p *ConfigurationUpdateAppEnvRequest) GetClearPrefix() string { + if !p.IsSetClearPrefix() { + return ConfigurationUpdateAppEnvRequest_ClearPrefix_DEFAULT + } + return *p.ClearPrefix +} +func (p *ConfigurationUpdateAppEnvRequest) IsSetKeys() bool { + return p.Keys != nil +} + +func (p *ConfigurationUpdateAppEnvRequest) IsSetValues() bool { + return p.Values != nil +} + +func (p *ConfigurationUpdateAppEnvRequest) IsSetClearPrefix() bool { + return p.ClearPrefix != nil +} + +func (p *ConfigurationUpdateAppEnvRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationUpdateAppEnvRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *ConfigurationUpdateAppEnvRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := AppEnvOperation(v) + p.Op = temp + } + return nil +} + +func (p *ConfigurationUpdateAppEnvRequest) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Keys = tSlice + for i := 0; i < size; i++ { + var _elem11 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem11 = v + } + p.Keys = append(p.Keys, _elem11) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationUpdateAppEnvRequest) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Values = tSlice + for i := 0; i < size; i++ { + var _elem12 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem12 = v + } + p.Values = append(p.Values, _elem12) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationUpdateAppEnvRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.ClearPrefix = &v + } + return nil +} + +func (p *ConfigurationUpdateAppEnvRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_update_app_env_request"); 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 := p.writeField5(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 *ConfigurationUpdateAppEnvRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateAppEnvRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("op", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:op: ", p), err) + } + if err := oprot.WriteI32(int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:op: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateAppEnvRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetKeys() { + if err := oprot.WriteFieldBegin("keys", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:keys: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Keys)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Keys { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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 3:keys: ", p), err) + } + } + return err +} + +func (p *ConfigurationUpdateAppEnvRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetValues() { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:values: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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 4:values: ", p), err) + } + } + return err +} + +func (p *ConfigurationUpdateAppEnvRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetClearPrefix() { + if err := oprot.WriteFieldBegin("clear_prefix", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:clear_prefix: ", p), err) + } + if err := oprot.WriteString(string(*p.ClearPrefix)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.clear_prefix (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:clear_prefix: ", p), err) + } + } + return err +} + +func (p *ConfigurationUpdateAppEnvRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationUpdateAppEnvRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMessage +type ConfigurationUpdateAppEnvResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMessage string `thrift:"hint_message,2" db:"hint_message" json:"hint_message"` +} + +func NewConfigurationUpdateAppEnvResponse() *ConfigurationUpdateAppEnvResponse { + return &ConfigurationUpdateAppEnvResponse{} +} + +var ConfigurationUpdateAppEnvResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationUpdateAppEnvResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationUpdateAppEnvResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationUpdateAppEnvResponse) GetHintMessage() string { + return p.HintMessage +} +func (p *ConfigurationUpdateAppEnvResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationUpdateAppEnvResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationUpdateAppEnvResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationUpdateAppEnvResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMessage = v + } + return nil +} + +func (p *ConfigurationUpdateAppEnvResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_update_app_env_response"); 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 *ConfigurationUpdateAppEnvResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateAppEnvResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_message", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_message: ", p), err) + } + if err := oprot.WriteString(string(p.HintMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_message (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_message: ", p), err) + } + return err +} + +func (p *ConfigurationUpdateAppEnvResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationUpdateAppEnvResponse(%+v)", *p) +} + +// Attributes: +// - AppName +// - TriggerTime +// - TargetLevel +// - Bottommost +// - MaxRunningCount +type StartAppManualCompactRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + TriggerTime *int64 `thrift:"trigger_time,2" db:"trigger_time" json:"trigger_time,omitempty"` + TargetLevel *int32 `thrift:"target_level,3" db:"target_level" json:"target_level,omitempty"` + Bottommost *bool `thrift:"bottommost,4" db:"bottommost" json:"bottommost,omitempty"` + MaxRunningCount *int32 `thrift:"max_running_count,5" db:"max_running_count" json:"max_running_count,omitempty"` +} + +func NewStartAppManualCompactRequest() *StartAppManualCompactRequest { + return &StartAppManualCompactRequest{} +} + +func (p *StartAppManualCompactRequest) GetAppName() string { + return p.AppName +} + +var StartAppManualCompactRequest_TriggerTime_DEFAULT int64 + +func (p *StartAppManualCompactRequest) GetTriggerTime() int64 { + if !p.IsSetTriggerTime() { + return StartAppManualCompactRequest_TriggerTime_DEFAULT + } + return *p.TriggerTime +} + +var StartAppManualCompactRequest_TargetLevel_DEFAULT int32 + +func (p *StartAppManualCompactRequest) GetTargetLevel() int32 { + if !p.IsSetTargetLevel() { + return StartAppManualCompactRequest_TargetLevel_DEFAULT + } + return *p.TargetLevel +} + +var StartAppManualCompactRequest_Bottommost_DEFAULT bool + +func (p *StartAppManualCompactRequest) GetBottommost() bool { + if !p.IsSetBottommost() { + return StartAppManualCompactRequest_Bottommost_DEFAULT + } + return *p.Bottommost +} + +var StartAppManualCompactRequest_MaxRunningCount_DEFAULT int32 + +func (p *StartAppManualCompactRequest) GetMaxRunningCount() int32 { + if !p.IsSetMaxRunningCount() { + return StartAppManualCompactRequest_MaxRunningCount_DEFAULT + } + return *p.MaxRunningCount +} +func (p *StartAppManualCompactRequest) IsSetTriggerTime() bool { + return p.TriggerTime != nil +} + +func (p *StartAppManualCompactRequest) IsSetTargetLevel() bool { + return p.TargetLevel != nil +} + +func (p *StartAppManualCompactRequest) IsSetBottommost() bool { + return p.Bottommost != nil +} + +func (p *StartAppManualCompactRequest) IsSetMaxRunningCount() bool { + return p.MaxRunningCount != nil +} + +func (p *StartAppManualCompactRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *StartAppManualCompactRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *StartAppManualCompactRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TriggerTime = &v + } + return nil +} + +func (p *StartAppManualCompactRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TargetLevel = &v + } + return nil +} + +func (p *StartAppManualCompactRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Bottommost = &v + } + return nil +} + +func (p *StartAppManualCompactRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.MaxRunningCount = &v + } + return nil +} + +func (p *StartAppManualCompactRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_app_manual_compact_request"); 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 := p.writeField5(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 *StartAppManualCompactRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *StartAppManualCompactRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetTriggerTime() { + if err := oprot.WriteFieldBegin("trigger_time", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:trigger_time: ", p), err) + } + if err := oprot.WriteI64(int64(*p.TriggerTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.trigger_time (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:trigger_time: ", p), err) + } + } + return err +} + +func (p *StartAppManualCompactRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetTargetLevel() { + if err := oprot.WriteFieldBegin("target_level", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:target_level: ", p), err) + } + if err := oprot.WriteI32(int32(*p.TargetLevel)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.target_level (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:target_level: ", p), err) + } + } + return err +} + +func (p *StartAppManualCompactRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetBottommost() { + if err := oprot.WriteFieldBegin("bottommost", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:bottommost: ", p), err) + } + if err := oprot.WriteBool(bool(*p.Bottommost)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.bottommost (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:bottommost: ", p), err) + } + } + return err +} + +func (p *StartAppManualCompactRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetMaxRunningCount() { + if err := oprot.WriteFieldBegin("max_running_count", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:max_running_count: ", p), err) + } + if err := oprot.WriteI32(int32(*p.MaxRunningCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_running_count (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:max_running_count: ", p), err) + } + } + return err +} + +func (p *StartAppManualCompactRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StartAppManualCompactRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMsg +type StartAppManualCompactResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMsg string `thrift:"hint_msg,2" db:"hint_msg" json:"hint_msg"` +} + +func NewStartAppManualCompactResponse() *StartAppManualCompactResponse { + return &StartAppManualCompactResponse{} +} + +var StartAppManualCompactResponse_Err_DEFAULT *base.ErrorCode + +func (p *StartAppManualCompactResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return StartAppManualCompactResponse_Err_DEFAULT + } + return p.Err +} + +func (p *StartAppManualCompactResponse) GetHintMsg() string { + return p.HintMsg +} +func (p *StartAppManualCompactResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *StartAppManualCompactResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *StartAppManualCompactResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *StartAppManualCompactResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMsg = v + } + return nil +} + +func (p *StartAppManualCompactResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_app_manual_compact_response"); 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 *StartAppManualCompactResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *StartAppManualCompactResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_msg: ", p), err) + } + if err := oprot.WriteString(string(p.HintMsg)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_msg (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_msg: ", p), err) + } + return err +} + +func (p *StartAppManualCompactResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StartAppManualCompactResponse(%+v)", *p) +} + +// Attributes: +// - AppName +type QueryAppManualCompactRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` +} + +func NewQueryAppManualCompactRequest() *QueryAppManualCompactRequest { + return &QueryAppManualCompactRequest{} +} + +func (p *QueryAppManualCompactRequest) GetAppName() string { + return p.AppName +} +func (p *QueryAppManualCompactRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryAppManualCompactRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *QueryAppManualCompactRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_app_manual_compact_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *QueryAppManualCompactRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *QueryAppManualCompactRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryAppManualCompactRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMsg +// - Progress +type QueryAppManualCompactResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMsg string `thrift:"hint_msg,2" db:"hint_msg" json:"hint_msg"` + Progress *int32 `thrift:"progress,3" db:"progress" json:"progress,omitempty"` +} + +func NewQueryAppManualCompactResponse() *QueryAppManualCompactResponse { + return &QueryAppManualCompactResponse{} +} + +var QueryAppManualCompactResponse_Err_DEFAULT *base.ErrorCode + +func (p *QueryAppManualCompactResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return QueryAppManualCompactResponse_Err_DEFAULT + } + return p.Err +} + +func (p *QueryAppManualCompactResponse) GetHintMsg() string { + return p.HintMsg +} + +var QueryAppManualCompactResponse_Progress_DEFAULT int32 + +func (p *QueryAppManualCompactResponse) GetProgress() int32 { + if !p.IsSetProgress() { + return QueryAppManualCompactResponse_Progress_DEFAULT + } + return *p.Progress +} +func (p *QueryAppManualCompactResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *QueryAppManualCompactResponse) IsSetProgress() bool { + return p.Progress != nil +} + +func (p *QueryAppManualCompactResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryAppManualCompactResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *QueryAppManualCompactResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMsg = v + } + return nil +} + +func (p *QueryAppManualCompactResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Progress = &v + } + return nil +} + +func (p *QueryAppManualCompactResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_app_manual_compact_response"); 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 := 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 *QueryAppManualCompactResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *QueryAppManualCompactResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_msg: ", p), err) + } + if err := oprot.WriteString(string(p.HintMsg)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_msg (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_msg: ", p), err) + } + return err +} + +func (p *QueryAppManualCompactResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetProgress() { + if err := oprot.WriteFieldBegin("progress", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:progress: ", p), err) + } + if err := oprot.WriteI32(int32(*p.Progress)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.progress (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:progress: ", p), err) + } + } + return err +} + +func (p *QueryAppManualCompactResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryAppManualCompactResponse(%+v)", *p) +} + +// Attributes: +// - Status +// - Node +// - HpNode +type NodeInfo struct { + Status NodeStatus `thrift:"status,1" db:"status" json:"status"` + Node *base.RPCAddress `thrift:"node,2" db:"node" json:"node"` + HpNode *base.HostPort `thrift:"hp_node,3" db:"hp_node" json:"hp_node,omitempty"` +} + +func NewNodeInfo() *NodeInfo { + return &NodeInfo{ + Status: 0, + } +} + +func (p *NodeInfo) GetStatus() NodeStatus { + return p.Status +} + +var NodeInfo_Node_DEFAULT *base.RPCAddress + +func (p *NodeInfo) GetNode() *base.RPCAddress { + if !p.IsSetNode() { + return NodeInfo_Node_DEFAULT + } + return p.Node +} + +var NodeInfo_HpNode_DEFAULT *base.HostPort + +func (p *NodeInfo) GetHpNode() *base.HostPort { + if !p.IsSetHpNode() { + return NodeInfo_HpNode_DEFAULT + } + return p.HpNode +} +func (p *NodeInfo) IsSetNode() bool { + return p.Node != nil +} + +func (p *NodeInfo) IsSetHpNode() bool { + return p.HpNode != nil +} + +func (p *NodeInfo) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *NodeInfo) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := NodeStatus(v) + p.Status = temp + } + return nil +} + +func (p *NodeInfo) ReadField2(iprot thrift.TProtocol) error { + p.Node = &base.RPCAddress{} + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *NodeInfo) ReadField3(iprot thrift.TProtocol) error { + p.HpNode = &base.HostPort{} + if err := p.HpNode.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpNode), err) + } + return nil +} + +func (p *NodeInfo) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("node_info"); 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 := 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 *NodeInfo) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err +} + +func (p *NodeInfo) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:node: ", p), err) + } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:node: ", p), err) + } + return err +} + +func (p *NodeInfo) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetHpNode() { + if err := oprot.WriteFieldBegin("hp_node", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hp_node: ", p), err) + } + if err := p.HpNode.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpNode), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hp_node: ", p), err) + } + } + return err +} + +func (p *NodeInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NodeInfo(%+v)", *p) +} + +// Attributes: +// - Status +type ConfigurationListNodesRequest struct { + Status NodeStatus `thrift:"status,1" db:"status" json:"status"` +} + +func NewConfigurationListNodesRequest() *ConfigurationListNodesRequest { + return &ConfigurationListNodesRequest{ + Status: 0, + } +} + +func (p *ConfigurationListNodesRequest) GetStatus() NodeStatus { + return p.Status +} +func (p *ConfigurationListNodesRequest) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationListNodesRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := NodeStatus(v) + p.Status = temp + } + return nil +} + +func (p *ConfigurationListNodesRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_list_nodes_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigurationListNodesRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err +} + +func (p *ConfigurationListNodesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationListNodesRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Infos +type ConfigurationListNodesResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Infos []*NodeInfo `thrift:"infos,2" db:"infos" json:"infos"` +} + +func NewConfigurationListNodesResponse() *ConfigurationListNodesResponse { + return &ConfigurationListNodesResponse{} +} + +var ConfigurationListNodesResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationListNodesResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationListNodesResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationListNodesResponse) GetInfos() []*NodeInfo { + return p.Infos +} +func (p *ConfigurationListNodesResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationListNodesResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationListNodesResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationListNodesResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NodeInfo, 0, size) + p.Infos = tSlice + for i := 0; i < size; i++ { + _elem13 := &NodeInfo{ + Status: 0, + } + if err := _elem13.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) + } + p.Infos = append(p.Infos, _elem13) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationListNodesResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_list_nodes_response"); 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 *ConfigurationListNodesResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationListNodesResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("infos", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infos: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Infos)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Infos { + 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:infos: ", p), err) + } + return err +} + +func (p *ConfigurationListNodesResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationListNodesResponse(%+v)", *p) +} + +type ConfigurationClusterInfoRequest struct { +} + +func NewConfigurationClusterInfoRequest() *ConfigurationClusterInfoRequest { + return &ConfigurationClusterInfoRequest{} +} + +func (p *ConfigurationClusterInfoRequest) 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 *ConfigurationClusterInfoRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_cluster_info_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigurationClusterInfoRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationClusterInfoRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Keys +// - Values +type ConfigurationClusterInfoResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Keys []string `thrift:"keys,2" db:"keys" json:"keys"` + Values []string `thrift:"values,3" db:"values" json:"values"` +} + +func NewConfigurationClusterInfoResponse() *ConfigurationClusterInfoResponse { + return &ConfigurationClusterInfoResponse{} +} + +var ConfigurationClusterInfoResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationClusterInfoResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationClusterInfoResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationClusterInfoResponse) GetKeys() []string { + return p.Keys +} + +func (p *ConfigurationClusterInfoResponse) GetValues() []string { + return p.Values +} +func (p *ConfigurationClusterInfoResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationClusterInfoResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationClusterInfoResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationClusterInfoResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Keys = tSlice + for i := 0; i < size; i++ { + var _elem14 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem14 = v + } + p.Keys = append(p.Keys, _elem14) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationClusterInfoResponse) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Values = tSlice + for i := 0; i < size; i++ { + var _elem15 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem15 = v + } + p.Values = append(p.Values, _elem15) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationClusterInfoResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_cluster_info_response"); 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 := 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 *ConfigurationClusterInfoResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationClusterInfoResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("keys", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:keys: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Keys)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Keys { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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:keys: ", p), err) + } + return err +} + +func (p *ConfigurationClusterInfoResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:values: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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 3:values: ", p), err) + } + return err +} + +func (p *ConfigurationClusterInfoResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationClusterInfoResponse(%+v)", *p) +} + +// Attributes: +// - Level +type ConfigurationMetaControlRequest struct { + Level MetaFunctionLevel `thrift:"level,1" db:"level" json:"level"` +} + +func NewConfigurationMetaControlRequest() *ConfigurationMetaControlRequest { + return &ConfigurationMetaControlRequest{} +} + +func (p *ConfigurationMetaControlRequest) GetLevel() MetaFunctionLevel { + return p.Level +} +func (p *ConfigurationMetaControlRequest) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationMetaControlRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := MetaFunctionLevel(v) + p.Level = temp + } + return nil +} + +func (p *ConfigurationMetaControlRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_meta_control_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigurationMetaControlRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("level", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:level: ", p), err) + } + if err := oprot.WriteI32(int32(p.Level)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.level (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:level: ", p), err) + } + return err +} + +func (p *ConfigurationMetaControlRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationMetaControlRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - OldLevel +type ConfigurationMetaControlResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + OldLevel MetaFunctionLevel `thrift:"old_level,2" db:"old_level" json:"old_level"` +} + +func NewConfigurationMetaControlResponse() *ConfigurationMetaControlResponse { + return &ConfigurationMetaControlResponse{} +} + +var ConfigurationMetaControlResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationMetaControlResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationMetaControlResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationMetaControlResponse) GetOldLevel() MetaFunctionLevel { + return p.OldLevel +} +func (p *ConfigurationMetaControlResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationMetaControlResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationMetaControlResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationMetaControlResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := MetaFunctionLevel(v) + p.OldLevel = temp + } + return nil +} + +func (p *ConfigurationMetaControlResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_meta_control_response"); 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 *ConfigurationMetaControlResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationMetaControlResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("old_level", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:old_level: ", p), err) + } + if err := oprot.WriteI32(int32(p.OldLevel)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_level (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:old_level: ", p), err) + } + return err +} + +func (p *ConfigurationMetaControlResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationMetaControlResponse(%+v)", *p) +} + +// Attributes: +// - Target +// - Node +// - Type +// - HpTarget +// - HpNode +type ConfigurationProposalAction struct { + Target *base.RPCAddress `thrift:"target,1" db:"target" json:"target"` + Node *base.RPCAddress `thrift:"node,2" db:"node" json:"node"` + Type ConfigType `thrift:"type,3" db:"type" json:"type"` + // unused field # 4 + HpTarget *base.HostPort `thrift:"hp_target,5" db:"hp_target" json:"hp_target,omitempty"` + HpNode *base.HostPort `thrift:"hp_node,6" db:"hp_node" json:"hp_node,omitempty"` +} + +func NewConfigurationProposalAction() *ConfigurationProposalAction { + return &ConfigurationProposalAction{} +} + +var ConfigurationProposalAction_Target_DEFAULT *base.RPCAddress + +func (p *ConfigurationProposalAction) GetTarget() *base.RPCAddress { + if !p.IsSetTarget() { + return ConfigurationProposalAction_Target_DEFAULT + } + return p.Target +} + +var ConfigurationProposalAction_Node_DEFAULT *base.RPCAddress + +func (p *ConfigurationProposalAction) GetNode() *base.RPCAddress { + if !p.IsSetNode() { + return ConfigurationProposalAction_Node_DEFAULT + } + return p.Node +} + +func (p *ConfigurationProposalAction) GetType() ConfigType { + return p.Type +} + +var ConfigurationProposalAction_HpTarget_DEFAULT *base.HostPort + +func (p *ConfigurationProposalAction) GetHpTarget() *base.HostPort { + if !p.IsSetHpTarget() { + return ConfigurationProposalAction_HpTarget_DEFAULT + } + return p.HpTarget +} + +var ConfigurationProposalAction_HpNode_DEFAULT *base.HostPort + +func (p *ConfigurationProposalAction) GetHpNode() *base.HostPort { + if !p.IsSetHpNode() { + return ConfigurationProposalAction_HpNode_DEFAULT + } + return p.HpNode +} +func (p *ConfigurationProposalAction) IsSetTarget() bool { + return p.Target != nil +} + +func (p *ConfigurationProposalAction) IsSetNode() bool { + return p.Node != nil +} + +func (p *ConfigurationProposalAction) IsSetHpTarget() bool { + return p.HpTarget != nil +} + +func (p *ConfigurationProposalAction) IsSetHpNode() bool { + return p.HpNode != nil +} + +func (p *ConfigurationProposalAction) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationProposalAction) ReadField1(iprot thrift.TProtocol) error { + p.Target = &base.RPCAddress{} + if err := p.Target.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Target), err) + } + return nil +} + +func (p *ConfigurationProposalAction) ReadField2(iprot thrift.TProtocol) error { + p.Node = &base.RPCAddress{} + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *ConfigurationProposalAction) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := ConfigType(v) + p.Type = temp + } + return nil +} + +func (p *ConfigurationProposalAction) ReadField5(iprot thrift.TProtocol) error { + p.HpTarget = &base.HostPort{} + if err := p.HpTarget.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpTarget), err) + } + return nil +} + +func (p *ConfigurationProposalAction) ReadField6(iprot thrift.TProtocol) error { + p.HpNode = &base.HostPort{} + if err := p.HpNode.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpNode), err) + } + return nil +} + +func (p *ConfigurationProposalAction) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_proposal_action"); 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.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(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 *ConfigurationProposalAction) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("target", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:target: ", p), err) + } + if err := p.Target.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Target), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:target: ", p), err) + } + return err +} + +func (p *ConfigurationProposalAction) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:node: ", p), err) + } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:node: ", p), err) + } + return err +} + +func (p *ConfigurationProposalAction) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) + } + return err +} + +func (p *ConfigurationProposalAction) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetHpTarget() { + if err := oprot.WriteFieldBegin("hp_target", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:hp_target: ", p), err) + } + if err := p.HpTarget.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpTarget), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:hp_target: ", p), err) + } + } + return err +} + +func (p *ConfigurationProposalAction) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetHpNode() { + if err := oprot.WriteFieldBegin("hp_node", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:hp_node: ", p), err) + } + if err := p.HpNode.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpNode), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:hp_node: ", p), err) + } + } + return err +} + +func (p *ConfigurationProposalAction) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationProposalAction(%+v)", *p) +} + +// Attributes: +// - Gpid +// - ActionList +// - Force +// - BalanceType +type ConfigurationBalancerRequest struct { + Gpid *base.Gpid `thrift:"gpid,1" db:"gpid" json:"gpid"` + ActionList []*ConfigurationProposalAction `thrift:"action_list,2" db:"action_list" json:"action_list"` + Force bool `thrift:"force,3" db:"force" json:"force"` + BalanceType *BalancerRequestType `thrift:"balance_type,4" db:"balance_type" json:"balance_type,omitempty"` +} + +func NewConfigurationBalancerRequest() *ConfigurationBalancerRequest { + return &ConfigurationBalancerRequest{} +} + +var ConfigurationBalancerRequest_Gpid_DEFAULT *base.Gpid + +func (p *ConfigurationBalancerRequest) GetGpid() *base.Gpid { + if !p.IsSetGpid() { + return ConfigurationBalancerRequest_Gpid_DEFAULT + } + return p.Gpid +} + +func (p *ConfigurationBalancerRequest) GetActionList() []*ConfigurationProposalAction { + return p.ActionList +} + +var ConfigurationBalancerRequest_Force_DEFAULT bool = false + +func (p *ConfigurationBalancerRequest) GetForce() bool { + return p.Force +} + +var ConfigurationBalancerRequest_BalanceType_DEFAULT BalancerRequestType + +func (p *ConfigurationBalancerRequest) GetBalanceType() BalancerRequestType { + if !p.IsSetBalanceType() { + return ConfigurationBalancerRequest_BalanceType_DEFAULT + } + return *p.BalanceType +} +func (p *ConfigurationBalancerRequest) IsSetGpid() bool { + return p.Gpid != nil +} + +func (p *ConfigurationBalancerRequest) IsSetForce() bool { + return p.Force != ConfigurationBalancerRequest_Force_DEFAULT +} + +func (p *ConfigurationBalancerRequest) IsSetBalanceType() bool { + return p.BalanceType != nil +} + +func (p *ConfigurationBalancerRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationBalancerRequest) ReadField1(iprot thrift.TProtocol) error { + p.Gpid = &base.Gpid{} + if err := p.Gpid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Gpid), err) + } + return nil +} + +func (p *ConfigurationBalancerRequest) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigurationProposalAction, 0, size) + p.ActionList = tSlice + for i := 0; i < size; i++ { + _elem16 := &ConfigurationProposalAction{} + if err := _elem16.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) + } + p.ActionList = append(p.ActionList, _elem16) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ConfigurationBalancerRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Force = v + } + return nil +} + +func (p *ConfigurationBalancerRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := BalancerRequestType(v) + p.BalanceType = &temp + } + return nil +} + +func (p *ConfigurationBalancerRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_balancer_request"); 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 *ConfigurationBalancerRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("gpid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:gpid: ", p), err) + } + if err := p.Gpid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Gpid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:gpid: ", p), err) + } + return err +} + +func (p *ConfigurationBalancerRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("action_list", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:action_list: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ActionList)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ActionList { + 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:action_list: ", p), err) + } + return err +} + +func (p *ConfigurationBalancerRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetForce() { + if err := oprot.WriteFieldBegin("force", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:force: ", p), err) + } + if err := oprot.WriteBool(bool(p.Force)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.force (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:force: ", p), err) + } + } + return err +} + +func (p *ConfigurationBalancerRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetBalanceType() { + if err := oprot.WriteFieldBegin("balance_type", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:balance_type: ", p), err) + } + if err := oprot.WriteI32(int32(*p.BalanceType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.balance_type (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:balance_type: ", p), err) + } + } + return err +} + +func (p *ConfigurationBalancerRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationBalancerRequest(%+v)", *p) +} + +// Attributes: +// - Err +type ConfigurationBalancerResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` +} + +func NewConfigurationBalancerResponse() *ConfigurationBalancerResponse { + return &ConfigurationBalancerResponse{} +} + +var ConfigurationBalancerResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationBalancerResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationBalancerResponse_Err_DEFAULT + } + return p.Err +} +func (p *ConfigurationBalancerResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationBalancerResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationBalancerResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationBalancerResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_balancer_response"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigurationBalancerResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationBalancerResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationBalancerResponse(%+v)", *p) +} + +// Attributes: +// - Pid +type DddDiagnoseRequest struct { + Pid *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"` +} + +func NewDddDiagnoseRequest() *DddDiagnoseRequest { + return &DddDiagnoseRequest{} +} + +var DddDiagnoseRequest_Pid_DEFAULT *base.Gpid + +func (p *DddDiagnoseRequest) GetPid() *base.Gpid { + if !p.IsSetPid() { + return DddDiagnoseRequest_Pid_DEFAULT + } + return p.Pid +} +func (p *DddDiagnoseRequest) IsSetPid() bool { + return p.Pid != nil +} + +func (p *DddDiagnoseRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DddDiagnoseRequest) ReadField1(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *DddDiagnoseRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ddd_diagnose_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *DddDiagnoseRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err) + } + return err +} + +func (p *DddDiagnoseRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DddDiagnoseRequest(%+v)", *p) +} + +// Attributes: +// - Node +// - DropTimeMs +// - IsAlive +// - IsCollected +// - Ballot +// - LastCommittedDecree +// - LastPreparedDecree +// - HpNode +type DddNodeInfo struct { + Node *base.RPCAddress `thrift:"node,1" db:"node" json:"node"` + DropTimeMs int64 `thrift:"drop_time_ms,2" db:"drop_time_ms" json:"drop_time_ms"` + IsAlive bool `thrift:"is_alive,3" db:"is_alive" json:"is_alive"` + IsCollected bool `thrift:"is_collected,4" db:"is_collected" json:"is_collected"` + Ballot int64 `thrift:"ballot,5" db:"ballot" json:"ballot"` + LastCommittedDecree int64 `thrift:"last_committed_decree,6" db:"last_committed_decree" json:"last_committed_decree"` + LastPreparedDecree int64 `thrift:"last_prepared_decree,7" db:"last_prepared_decree" json:"last_prepared_decree"` + HpNode *base.HostPort `thrift:"hp_node,8" db:"hp_node" json:"hp_node,omitempty"` +} + +func NewDddNodeInfo() *DddNodeInfo { + return &DddNodeInfo{} +} + +var DddNodeInfo_Node_DEFAULT *base.RPCAddress + +func (p *DddNodeInfo) GetNode() *base.RPCAddress { + if !p.IsSetNode() { + return DddNodeInfo_Node_DEFAULT + } + return p.Node +} + +func (p *DddNodeInfo) GetDropTimeMs() int64 { + return p.DropTimeMs +} + +func (p *DddNodeInfo) GetIsAlive() bool { + return p.IsAlive +} + +func (p *DddNodeInfo) GetIsCollected() bool { + return p.IsCollected +} + +func (p *DddNodeInfo) GetBallot() int64 { + return p.Ballot +} + +func (p *DddNodeInfo) GetLastCommittedDecree() int64 { + return p.LastCommittedDecree +} + +func (p *DddNodeInfo) GetLastPreparedDecree() int64 { + return p.LastPreparedDecree +} + +var DddNodeInfo_HpNode_DEFAULT *base.HostPort + +func (p *DddNodeInfo) GetHpNode() *base.HostPort { + if !p.IsSetHpNode() { + return DddNodeInfo_HpNode_DEFAULT + } + return p.HpNode +} +func (p *DddNodeInfo) IsSetNode() bool { + return p.Node != nil +} + +func (p *DddNodeInfo) IsSetHpNode() bool { + return p.HpNode != nil +} + +func (p *DddNodeInfo) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I64 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DddNodeInfo) ReadField1(iprot thrift.TProtocol) error { + p.Node = &base.RPCAddress{} + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *DddNodeInfo) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DropTimeMs = v + } + return nil +} + +func (p *DddNodeInfo) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IsAlive = v + } + return nil +} + +func (p *DddNodeInfo) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.IsCollected = v + } + return nil +} + +func (p *DddNodeInfo) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.Ballot = v + } + return nil +} + +func (p *DddNodeInfo) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.LastCommittedDecree = v + } + return nil +} + +func (p *DddNodeInfo) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.LastPreparedDecree = v + } + return nil +} + +func (p *DddNodeInfo) ReadField8(iprot thrift.TProtocol) error { + p.HpNode = &base.HostPort{} + if err := p.HpNode.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpNode), err) + } + return nil +} + +func (p *DddNodeInfo) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ddd_node_info"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(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 *DddNodeInfo) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) + } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) + } + return err +} + +func (p *DddNodeInfo) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("drop_time_ms", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:drop_time_ms: ", p), err) + } + if err := oprot.WriteI64(int64(p.DropTimeMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.drop_time_ms (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:drop_time_ms: ", p), err) + } + return err +} + +func (p *DddNodeInfo) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_alive", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:is_alive: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsAlive)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_alive (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:is_alive: ", p), err) + } + return err +} + +func (p *DddNodeInfo) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_collected", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:is_collected: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsCollected)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_collected (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:is_collected: ", p), err) + } + return err +} + +func (p *DddNodeInfo) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ballot", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ballot: ", p), err) + } + if err := oprot.WriteI64(int64(p.Ballot)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ballot (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ballot: ", p), err) + } + return err +} + +func (p *DddNodeInfo) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("last_committed_decree", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:last_committed_decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.LastCommittedDecree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_committed_decree (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:last_committed_decree: ", p), err) + } + return err +} + +func (p *DddNodeInfo) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("last_prepared_decree", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:last_prepared_decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.LastPreparedDecree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_prepared_decree (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:last_prepared_decree: ", p), err) + } + return err +} + +func (p *DddNodeInfo) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetHpNode() { + if err := oprot.WriteFieldBegin("hp_node", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:hp_node: ", p), err) + } + if err := p.HpNode.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpNode), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:hp_node: ", p), err) + } + } + return err +} + +func (p *DddNodeInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DddNodeInfo(%+v)", *p) +} + +// Attributes: +// - Config +// - Dropped +// - Reason +type DddPartitionInfo struct { + Config *replication.PartitionConfiguration `thrift:"config,1" db:"config" json:"config"` + Dropped []*DddNodeInfo `thrift:"dropped,2" db:"dropped" json:"dropped"` + Reason string `thrift:"reason,3" db:"reason" json:"reason"` +} + +func NewDddPartitionInfo() *DddPartitionInfo { + return &DddPartitionInfo{} +} + +var DddPartitionInfo_Config_DEFAULT *replication.PartitionConfiguration + +func (p *DddPartitionInfo) GetConfig() *replication.PartitionConfiguration { + if !p.IsSetConfig() { + return DddPartitionInfo_Config_DEFAULT + } + return p.Config +} + +func (p *DddPartitionInfo) GetDropped() []*DddNodeInfo { + return p.Dropped +} + +func (p *DddPartitionInfo) GetReason() string { + return p.Reason +} +func (p *DddPartitionInfo) IsSetConfig() bool { + return p.Config != nil +} + +func (p *DddPartitionInfo) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DddPartitionInfo) ReadField1(iprot thrift.TProtocol) error { + p.Config = &replication.PartitionConfiguration{} + if err := p.Config.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Config), err) + } + return nil +} + +func (p *DddPartitionInfo) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*DddNodeInfo, 0, size) + p.Dropped = tSlice + for i := 0; i < size; i++ { + _elem17 := &DddNodeInfo{} + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + } + p.Dropped = append(p.Dropped, _elem17) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DddPartitionInfo) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Reason = v + } + return nil +} + +func (p *DddPartitionInfo) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ddd_partition_info"); 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 := 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 *DddPartitionInfo) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("config", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:config: ", p), err) + } + if err := p.Config.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Config), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:config: ", p), err) + } + return err +} + +func (p *DddPartitionInfo) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("dropped", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dropped: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Dropped)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Dropped { + 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:dropped: ", p), err) + } + return err +} + +func (p *DddPartitionInfo) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("reason", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:reason: ", p), err) + } + if err := oprot.WriteString(string(p.Reason)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.reason (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:reason: ", p), err) + } + return err +} + +func (p *DddPartitionInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DddPartitionInfo(%+v)", *p) +} + +// Attributes: +// - Err +// - Partitions +type DddDiagnoseResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Partitions []*DddPartitionInfo `thrift:"partitions,2" db:"partitions" json:"partitions"` +} + +func NewDddDiagnoseResponse() *DddDiagnoseResponse { + return &DddDiagnoseResponse{} +} + +var DddDiagnoseResponse_Err_DEFAULT *base.ErrorCode + +func (p *DddDiagnoseResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return DddDiagnoseResponse_Err_DEFAULT + } + return p.Err +} + +func (p *DddDiagnoseResponse) GetPartitions() []*DddPartitionInfo { + return p.Partitions +} +func (p *DddDiagnoseResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *DddDiagnoseResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DddDiagnoseResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *DddDiagnoseResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*DddPartitionInfo, 0, size) + p.Partitions = tSlice + for i := 0; i < size; i++ { + _elem18 := &DddPartitionInfo{} + if err := _elem18.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) + } + p.Partitions = append(p.Partitions, _elem18) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DddDiagnoseResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ddd_diagnose_response"); 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 *DddDiagnoseResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *DddDiagnoseResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partitions", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:partitions: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Partitions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Partitions { + 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:partitions: ", p), err) + } + return err +} + +func (p *DddDiagnoseResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DddDiagnoseResponse(%+v)", *p) +} + +// Attributes: +// - AppName +type ConfigurationGetMaxReplicaCountRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` +} + +func NewConfigurationGetMaxReplicaCountRequest() *ConfigurationGetMaxReplicaCountRequest { + return &ConfigurationGetMaxReplicaCountRequest{} +} + +func (p *ConfigurationGetMaxReplicaCountRequest) GetAppName() string { + return p.AppName +} +func (p *ConfigurationGetMaxReplicaCountRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationGetMaxReplicaCountRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *ConfigurationGetMaxReplicaCountRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_get_max_replica_count_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigurationGetMaxReplicaCountRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *ConfigurationGetMaxReplicaCountRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationGetMaxReplicaCountRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - MaxReplicaCount +// - HintMessage +type ConfigurationGetMaxReplicaCountResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + MaxReplicaCount int32 `thrift:"max_replica_count,2" db:"max_replica_count" json:"max_replica_count"` + HintMessage string `thrift:"hint_message,3" db:"hint_message" json:"hint_message"` +} + +func NewConfigurationGetMaxReplicaCountResponse() *ConfigurationGetMaxReplicaCountResponse { + return &ConfigurationGetMaxReplicaCountResponse{} +} + +var ConfigurationGetMaxReplicaCountResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationGetMaxReplicaCountResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationGetMaxReplicaCountResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationGetMaxReplicaCountResponse) GetMaxReplicaCount() int32 { + return p.MaxReplicaCount +} + +func (p *ConfigurationGetMaxReplicaCountResponse) GetHintMessage() string { + return p.HintMessage +} +func (p *ConfigurationGetMaxReplicaCountResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationGetMaxReplicaCountResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationGetMaxReplicaCountResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationGetMaxReplicaCountResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.MaxReplicaCount = v + } + return nil +} + +func (p *ConfigurationGetMaxReplicaCountResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.HintMessage = v + } + return nil +} + +func (p *ConfigurationGetMaxReplicaCountResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_get_max_replica_count_response"); 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 := 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 *ConfigurationGetMaxReplicaCountResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationGetMaxReplicaCountResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("max_replica_count", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:max_replica_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxReplicaCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_replica_count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:max_replica_count: ", p), err) + } + return err +} + +func (p *ConfigurationGetMaxReplicaCountResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_message", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hint_message: ", p), err) + } + if err := oprot.WriteString(string(p.HintMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_message (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hint_message: ", p), err) + } + return err +} + +func (p *ConfigurationGetMaxReplicaCountResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationGetMaxReplicaCountResponse(%+v)", *p) +} + +// Attributes: +// - AppName +// - MaxReplicaCount +type ConfigurationSetMaxReplicaCountRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + MaxReplicaCount int32 `thrift:"max_replica_count,2" db:"max_replica_count" json:"max_replica_count"` +} + +func NewConfigurationSetMaxReplicaCountRequest() *ConfigurationSetMaxReplicaCountRequest { + return &ConfigurationSetMaxReplicaCountRequest{} +} + +func (p *ConfigurationSetMaxReplicaCountRequest) GetAppName() string { + return p.AppName +} + +func (p *ConfigurationSetMaxReplicaCountRequest) GetMaxReplicaCount() int32 { + return p.MaxReplicaCount +} +func (p *ConfigurationSetMaxReplicaCountRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationSetMaxReplicaCountRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *ConfigurationSetMaxReplicaCountRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.MaxReplicaCount = v + } + return nil +} + +func (p *ConfigurationSetMaxReplicaCountRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_set_max_replica_count_request"); 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 *ConfigurationSetMaxReplicaCountRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *ConfigurationSetMaxReplicaCountRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("max_replica_count", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:max_replica_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxReplicaCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_replica_count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:max_replica_count: ", p), err) + } + return err +} + +func (p *ConfigurationSetMaxReplicaCountRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationSetMaxReplicaCountRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - OldMaxReplicaCount +// - HintMessage +type ConfigurationSetMaxReplicaCountResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + OldMaxReplicaCount int32 `thrift:"old_max_replica_count,2" db:"old_max_replica_count" json:"old_max_replica_count"` + HintMessage string `thrift:"hint_message,3" db:"hint_message" json:"hint_message"` +} + +func NewConfigurationSetMaxReplicaCountResponse() *ConfigurationSetMaxReplicaCountResponse { + return &ConfigurationSetMaxReplicaCountResponse{} +} + +var ConfigurationSetMaxReplicaCountResponse_Err_DEFAULT *base.ErrorCode + +func (p *ConfigurationSetMaxReplicaCountResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ConfigurationSetMaxReplicaCountResponse_Err_DEFAULT + } + return p.Err +} + +func (p *ConfigurationSetMaxReplicaCountResponse) GetOldMaxReplicaCount() int32 { + return p.OldMaxReplicaCount +} + +func (p *ConfigurationSetMaxReplicaCountResponse) GetHintMessage() string { + return p.HintMessage +} +func (p *ConfigurationSetMaxReplicaCountResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ConfigurationSetMaxReplicaCountResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ConfigurationSetMaxReplicaCountResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ConfigurationSetMaxReplicaCountResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.OldMaxReplicaCount = v + } + return nil +} + +func (p *ConfigurationSetMaxReplicaCountResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.HintMessage = v + } + return nil +} + +func (p *ConfigurationSetMaxReplicaCountResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("configuration_set_max_replica_count_response"); 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 := 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 *ConfigurationSetMaxReplicaCountResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ConfigurationSetMaxReplicaCountResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("old_max_replica_count", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:old_max_replica_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.OldMaxReplicaCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_max_replica_count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:old_max_replica_count: ", p), err) + } + return err +} + +func (p *ConfigurationSetMaxReplicaCountResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_message", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hint_message: ", p), err) + } + if err := oprot.WriteString(string(p.HintMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_message (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hint_message: ", p), err) + } + return err +} + +func (p *ConfigurationSetMaxReplicaCountResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigurationSetMaxReplicaCountResponse(%+v)", *p) +} + +type AdminClient interface { + // Parameters: + // - Req + CreateApp(ctx context.Context, req *ConfigurationCreateAppRequest) (r *ConfigurationCreateAppResponse, err error) + // Parameters: + // - Req + DropApp(ctx context.Context, req *ConfigurationDropAppRequest) (r *ConfigurationDropAppResponse, err error) + // Parameters: + // - Req + RecallApp(ctx context.Context, req *ConfigurationRecallAppRequest) (r *ConfigurationRecallAppResponse, err error) + // Parameters: + // - Req + ListApps(ctx context.Context, req *ConfigurationListAppsRequest) (r *ConfigurationListAppsResponse, err error) + // Parameters: + // - Req + AddDuplication(ctx context.Context, req *DuplicationAddRequest) (r *DuplicationAddResponse, err error) + // Parameters: + // - Req + QueryDuplication(ctx context.Context, req *DuplicationQueryRequest) (r *DuplicationQueryResponse, err error) + // Parameters: + // - Req + ModifyDuplication(ctx context.Context, req *DuplicationModifyRequest) (r *DuplicationModifyResponse, err error) + // Parameters: + // - Req + QueryAppInfo(ctx context.Context, req *QueryAppInfoRequest) (r *QueryAppInfoResponse, err error) + // Parameters: + // - Req + UpdateAppEnv(ctx context.Context, req *ConfigurationUpdateAppEnvRequest) (r *ConfigurationUpdateAppEnvResponse, err error) + // Parameters: + // - Req + ListNodes(ctx context.Context, req *ConfigurationListNodesRequest) (r *ConfigurationListNodesResponse, err error) + // Parameters: + // - Req + QueryClusterInfo(ctx context.Context, req *ConfigurationClusterInfoRequest) (r *ConfigurationClusterInfoResponse, err error) + // Parameters: + // - Req + MetaControl(ctx context.Context, req *ConfigurationMetaControlRequest) (r *ConfigurationMetaControlResponse, err error) + // Parameters: + // - Req + QueryBackupPolicy(ctx context.Context, req *ConfigurationQueryBackupPolicyRequest) (r *ConfigurationQueryBackupPolicyResponse, err error) + // Parameters: + // - Req + Balance(ctx context.Context, req *ConfigurationBalancerRequest) (r *ConfigurationBalancerResponse, err error) + // Parameters: + // - Req + StartBackupApp(ctx context.Context, req *StartBackupAppRequest) (r *StartBackupAppResponse, err error) + // Parameters: + // - Req + QueryBackupStatus(ctx context.Context, req *QueryBackupStatusRequest) (r *QueryBackupStatusResponse, err error) + // Parameters: + // - Req + RestoreApp(ctx context.Context, req *ConfigurationRestoreRequest) (r *ConfigurationCreateAppResponse, err error) + // Parameters: + // - Req + StartPartitionSplit(ctx context.Context, req *StartPartitionSplitRequest) (r *StartPartitionSplitResponse, err error) + // Parameters: + // - Req + QuerySplitStatus(ctx context.Context, req *QuerySplitRequest) (r *QuerySplitResponse, err error) + // Parameters: + // - Req + ControlPartitionSplit(ctx context.Context, req *ControlSplitRequest) (r *ControlSplitResponse, err error) + // Parameters: + // - Req + StartBulkLoad(ctx context.Context, req *StartBulkLoadRequest) (r *StartBulkLoadResponse, err error) + // Parameters: + // - Req + QueryBulkLoadStatus(ctx context.Context, req *QueryBulkLoadRequest) (r *QueryBulkLoadResponse, err error) + // Parameters: + // - Req + ControlBulkLoad(ctx context.Context, req *ControlBulkLoadRequest) (r *ControlBulkLoadResponse, err error) + // Parameters: + // - Req + ClearBulkLoad(ctx context.Context, req *ClearBulkLoadStateRequest) (r *ClearBulkLoadStateResponse, err error) + // Parameters: + // - Req + StartManualCompact(ctx context.Context, req *StartAppManualCompactRequest) (r *StartAppManualCompactResponse, err error) + // Parameters: + // - Req + QueryManualCompact(ctx context.Context, req *QueryAppManualCompactRequest) (r *QueryAppManualCompactResponse, err error) +} + +type AdminClientClient struct { + c thrift.TClient +} + +func NewAdminClientClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AdminClientClient { + return &AdminClientClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewAdminClientClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AdminClientClient { + return &AdminClientClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewAdminClientClient(c thrift.TClient) *AdminClientClient { + return &AdminClientClient{ + c: c, + } +} + +func (p *AdminClientClient) Client_() thrift.TClient { + return p.c +} + +// Parameters: +// - Req +func (p *AdminClientClient) CreateApp(ctx context.Context, req *ConfigurationCreateAppRequest) (r *ConfigurationCreateAppResponse, err error) { + var _args19 AdminClientCreateAppArgs + _args19.Req = req + var _result20 AdminClientCreateAppResult + if err = p.Client_().Call(ctx, "create_app", &_args19, &_result20); err != nil { + return + } + return _result20.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) DropApp(ctx context.Context, req *ConfigurationDropAppRequest) (r *ConfigurationDropAppResponse, err error) { + var _args21 AdminClientDropAppArgs + _args21.Req = req + var _result22 AdminClientDropAppResult + if err = p.Client_().Call(ctx, "drop_app", &_args21, &_result22); err != nil { + return + } + return _result22.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) RecallApp(ctx context.Context, req *ConfigurationRecallAppRequest) (r *ConfigurationRecallAppResponse, err error) { + var _args23 AdminClientRecallAppArgs + _args23.Req = req + var _result24 AdminClientRecallAppResult + if err = p.Client_().Call(ctx, "recall_app", &_args23, &_result24); err != nil { + return + } + return _result24.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) ListApps(ctx context.Context, req *ConfigurationListAppsRequest) (r *ConfigurationListAppsResponse, err error) { + var _args25 AdminClientListAppsArgs + _args25.Req = req + var _result26 AdminClientListAppsResult + if err = p.Client_().Call(ctx, "list_apps", &_args25, &_result26); err != nil { + return + } + return _result26.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) AddDuplication(ctx context.Context, req *DuplicationAddRequest) (r *DuplicationAddResponse, err error) { + var _args27 AdminClientAddDuplicationArgs + _args27.Req = req + var _result28 AdminClientAddDuplicationResult + if err = p.Client_().Call(ctx, "add_duplication", &_args27, &_result28); err != nil { + return + } + return _result28.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) QueryDuplication(ctx context.Context, req *DuplicationQueryRequest) (r *DuplicationQueryResponse, err error) { + var _args29 AdminClientQueryDuplicationArgs + _args29.Req = req + var _result30 AdminClientQueryDuplicationResult + if err = p.Client_().Call(ctx, "query_duplication", &_args29, &_result30); err != nil { + return + } + return _result30.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) ModifyDuplication(ctx context.Context, req *DuplicationModifyRequest) (r *DuplicationModifyResponse, err error) { + var _args31 AdminClientModifyDuplicationArgs + _args31.Req = req + var _result32 AdminClientModifyDuplicationResult + if err = p.Client_().Call(ctx, "modify_duplication", &_args31, &_result32); err != nil { + return + } + return _result32.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) QueryAppInfo(ctx context.Context, req *QueryAppInfoRequest) (r *QueryAppInfoResponse, err error) { + var _args33 AdminClientQueryAppInfoArgs + _args33.Req = req + var _result34 AdminClientQueryAppInfoResult + if err = p.Client_().Call(ctx, "query_app_info", &_args33, &_result34); err != nil { + return + } + return _result34.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) UpdateAppEnv(ctx context.Context, req *ConfigurationUpdateAppEnvRequest) (r *ConfigurationUpdateAppEnvResponse, err error) { + var _args35 AdminClientUpdateAppEnvArgs + _args35.Req = req + var _result36 AdminClientUpdateAppEnvResult + if err = p.Client_().Call(ctx, "update_app_env", &_args35, &_result36); err != nil { + return + } + return _result36.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) ListNodes(ctx context.Context, req *ConfigurationListNodesRequest) (r *ConfigurationListNodesResponse, err error) { + var _args37 AdminClientListNodesArgs + _args37.Req = req + var _result38 AdminClientListNodesResult + if err = p.Client_().Call(ctx, "list_nodes", &_args37, &_result38); err != nil { + return + } + return _result38.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) QueryClusterInfo(ctx context.Context, req *ConfigurationClusterInfoRequest) (r *ConfigurationClusterInfoResponse, err error) { + var _args39 AdminClientQueryClusterInfoArgs + _args39.Req = req + var _result40 AdminClientQueryClusterInfoResult + if err = p.Client_().Call(ctx, "query_cluster_info", &_args39, &_result40); err != nil { + return + } + return _result40.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) MetaControl(ctx context.Context, req *ConfigurationMetaControlRequest) (r *ConfigurationMetaControlResponse, err error) { + var _args41 AdminClientMetaControlArgs + _args41.Req = req + var _result42 AdminClientMetaControlResult + if err = p.Client_().Call(ctx, "meta_control", &_args41, &_result42); err != nil { + return + } + return _result42.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) QueryBackupPolicy(ctx context.Context, req *ConfigurationQueryBackupPolicyRequest) (r *ConfigurationQueryBackupPolicyResponse, err error) { + var _args43 AdminClientQueryBackupPolicyArgs + _args43.Req = req + var _result44 AdminClientQueryBackupPolicyResult + if err = p.Client_().Call(ctx, "query_backup_policy", &_args43, &_result44); err != nil { + return + } + return _result44.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) Balance(ctx context.Context, req *ConfigurationBalancerRequest) (r *ConfigurationBalancerResponse, err error) { + var _args45 AdminClientBalanceArgs + _args45.Req = req + var _result46 AdminClientBalanceResult + if err = p.Client_().Call(ctx, "balance", &_args45, &_result46); err != nil { + return + } + return _result46.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) StartBackupApp(ctx context.Context, req *StartBackupAppRequest) (r *StartBackupAppResponse, err error) { + var _args47 AdminClientStartBackupAppArgs + _args47.Req = req + var _result48 AdminClientStartBackupAppResult + if err = p.Client_().Call(ctx, "start_backup_app", &_args47, &_result48); err != nil { + return + } + return _result48.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) QueryBackupStatus(ctx context.Context, req *QueryBackupStatusRequest) (r *QueryBackupStatusResponse, err error) { + var _args49 AdminClientQueryBackupStatusArgs + _args49.Req = req + var _result50 AdminClientQueryBackupStatusResult + if err = p.Client_().Call(ctx, "query_backup_status", &_args49, &_result50); err != nil { + return + } + return _result50.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) RestoreApp(ctx context.Context, req *ConfigurationRestoreRequest) (r *ConfigurationCreateAppResponse, err error) { + var _args51 AdminClientRestoreAppArgs + _args51.Req = req + var _result52 AdminClientRestoreAppResult + if err = p.Client_().Call(ctx, "restore_app", &_args51, &_result52); err != nil { + return + } + return _result52.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) StartPartitionSplit(ctx context.Context, req *StartPartitionSplitRequest) (r *StartPartitionSplitResponse, err error) { + var _args53 AdminClientStartPartitionSplitArgs + _args53.Req = req + var _result54 AdminClientStartPartitionSplitResult + if err = p.Client_().Call(ctx, "start_partition_split", &_args53, &_result54); err != nil { + return + } + return _result54.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) QuerySplitStatus(ctx context.Context, req *QuerySplitRequest) (r *QuerySplitResponse, err error) { + var _args55 AdminClientQuerySplitStatusArgs + _args55.Req = req + var _result56 AdminClientQuerySplitStatusResult + if err = p.Client_().Call(ctx, "query_split_status", &_args55, &_result56); err != nil { + return + } + return _result56.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) ControlPartitionSplit(ctx context.Context, req *ControlSplitRequest) (r *ControlSplitResponse, err error) { + var _args57 AdminClientControlPartitionSplitArgs + _args57.Req = req + var _result58 AdminClientControlPartitionSplitResult + if err = p.Client_().Call(ctx, "control_partition_split", &_args57, &_result58); err != nil { + return + } + return _result58.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) StartBulkLoad(ctx context.Context, req *StartBulkLoadRequest) (r *StartBulkLoadResponse, err error) { + var _args59 AdminClientStartBulkLoadArgs + _args59.Req = req + var _result60 AdminClientStartBulkLoadResult + if err = p.Client_().Call(ctx, "start_bulk_load", &_args59, &_result60); err != nil { + return + } + return _result60.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) QueryBulkLoadStatus(ctx context.Context, req *QueryBulkLoadRequest) (r *QueryBulkLoadResponse, err error) { + var _args61 AdminClientQueryBulkLoadStatusArgs + _args61.Req = req + var _result62 AdminClientQueryBulkLoadStatusResult + if err = p.Client_().Call(ctx, "query_bulk_load_status", &_args61, &_result62); err != nil { + return + } + return _result62.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) ControlBulkLoad(ctx context.Context, req *ControlBulkLoadRequest) (r *ControlBulkLoadResponse, err error) { + var _args63 AdminClientControlBulkLoadArgs + _args63.Req = req + var _result64 AdminClientControlBulkLoadResult + if err = p.Client_().Call(ctx, "control_bulk_load", &_args63, &_result64); err != nil { + return + } + return _result64.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) ClearBulkLoad(ctx context.Context, req *ClearBulkLoadStateRequest) (r *ClearBulkLoadStateResponse, err error) { + var _args65 AdminClientClearBulkLoadArgs + _args65.Req = req + var _result66 AdminClientClearBulkLoadResult + if err = p.Client_().Call(ctx, "clear_bulk_load", &_args65, &_result66); err != nil { + return + } + return _result66.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) StartManualCompact(ctx context.Context, req *StartAppManualCompactRequest) (r *StartAppManualCompactResponse, err error) { + var _args67 AdminClientStartManualCompactArgs + _args67.Req = req + var _result68 AdminClientStartManualCompactResult + if err = p.Client_().Call(ctx, "start_manual_compact", &_args67, &_result68); err != nil { + return + } + return _result68.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *AdminClientClient) QueryManualCompact(ctx context.Context, req *QueryAppManualCompactRequest) (r *QueryAppManualCompactResponse, err error) { + var _args69 AdminClientQueryManualCompactArgs + _args69.Req = req + var _result70 AdminClientQueryManualCompactResult + if err = p.Client_().Call(ctx, "query_manual_compact", &_args69, &_result70); err != nil { + return + } + return _result70.GetSuccess(), nil +} + +type AdminClientProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler AdminClient +} + +func (p *AdminClientProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *AdminClientProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *AdminClientProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewAdminClientProcessor(handler AdminClient) *AdminClientProcessor { + + self71 := &AdminClientProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self71.processorMap["create_app"] = &adminClientProcessorCreateApp{handler: handler} + self71.processorMap["drop_app"] = &adminClientProcessorDropApp{handler: handler} + self71.processorMap["recall_app"] = &adminClientProcessorRecallApp{handler: handler} + self71.processorMap["list_apps"] = &adminClientProcessorListApps{handler: handler} + self71.processorMap["add_duplication"] = &adminClientProcessorAddDuplication{handler: handler} + self71.processorMap["query_duplication"] = &adminClientProcessorQueryDuplication{handler: handler} + self71.processorMap["modify_duplication"] = &adminClientProcessorModifyDuplication{handler: handler} + self71.processorMap["query_app_info"] = &adminClientProcessorQueryAppInfo{handler: handler} + self71.processorMap["update_app_env"] = &adminClientProcessorUpdateAppEnv{handler: handler} + self71.processorMap["list_nodes"] = &adminClientProcessorListNodes{handler: handler} + self71.processorMap["query_cluster_info"] = &adminClientProcessorQueryClusterInfo{handler: handler} + self71.processorMap["meta_control"] = &adminClientProcessorMetaControl{handler: handler} + self71.processorMap["query_backup_policy"] = &adminClientProcessorQueryBackupPolicy{handler: handler} + self71.processorMap["balance"] = &adminClientProcessorBalance{handler: handler} + self71.processorMap["start_backup_app"] = &adminClientProcessorStartBackupApp{handler: handler} + self71.processorMap["query_backup_status"] = &adminClientProcessorQueryBackupStatus{handler: handler} + self71.processorMap["restore_app"] = &adminClientProcessorRestoreApp{handler: handler} + self71.processorMap["start_partition_split"] = &adminClientProcessorStartPartitionSplit{handler: handler} + self71.processorMap["query_split_status"] = &adminClientProcessorQuerySplitStatus{handler: handler} + self71.processorMap["control_partition_split"] = &adminClientProcessorControlPartitionSplit{handler: handler} + self71.processorMap["start_bulk_load"] = &adminClientProcessorStartBulkLoad{handler: handler} + self71.processorMap["query_bulk_load_status"] = &adminClientProcessorQueryBulkLoadStatus{handler: handler} + self71.processorMap["control_bulk_load"] = &adminClientProcessorControlBulkLoad{handler: handler} + self71.processorMap["clear_bulk_load"] = &adminClientProcessorClearBulkLoad{handler: handler} + self71.processorMap["start_manual_compact"] = &adminClientProcessorStartManualCompact{handler: handler} + self71.processorMap["query_manual_compact"] = &adminClientProcessorQueryManualCompact{handler: handler} + return self71 +} + +func (p *AdminClientProcessor) Process(ctx context.Context, 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(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x72 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x72.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x72 + +} + +type adminClientProcessorCreateApp struct { + handler AdminClient +} + +func (p *adminClientProcessorCreateApp) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientCreateAppArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("create_app", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientCreateAppResult{} + var retval *ConfigurationCreateAppResponse + var err2 error + if retval, err2 = p.handler.CreateApp(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing create_app: "+err2.Error()) + oprot.WriteMessageBegin("create_app", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("create_app", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorDropApp struct { + handler AdminClient +} + +func (p *adminClientProcessorDropApp) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientDropAppArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("drop_app", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientDropAppResult{} + var retval *ConfigurationDropAppResponse + var err2 error + if retval, err2 = p.handler.DropApp(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing drop_app: "+err2.Error()) + oprot.WriteMessageBegin("drop_app", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("drop_app", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorRecallApp struct { + handler AdminClient +} + +func (p *adminClientProcessorRecallApp) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientRecallAppArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("recall_app", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientRecallAppResult{} + var retval *ConfigurationRecallAppResponse + var err2 error + if retval, err2 = p.handler.RecallApp(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing recall_app: "+err2.Error()) + oprot.WriteMessageBegin("recall_app", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("recall_app", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorListApps struct { + handler AdminClient +} + +func (p *adminClientProcessorListApps) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientListAppsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("list_apps", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientListAppsResult{} + var retval *ConfigurationListAppsResponse + var err2 error + if retval, err2 = p.handler.ListApps(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing list_apps: "+err2.Error()) + oprot.WriteMessageBegin("list_apps", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("list_apps", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorAddDuplication struct { + handler AdminClient +} + +func (p *adminClientProcessorAddDuplication) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientAddDuplicationArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("add_duplication", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientAddDuplicationResult{} + var retval *DuplicationAddResponse + var err2 error + if retval, err2 = p.handler.AddDuplication(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing add_duplication: "+err2.Error()) + oprot.WriteMessageBegin("add_duplication", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("add_duplication", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorQueryDuplication struct { + handler AdminClient +} + +func (p *adminClientProcessorQueryDuplication) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientQueryDuplicationArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("query_duplication", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientQueryDuplicationResult{} + var retval *DuplicationQueryResponse + var err2 error + if retval, err2 = p.handler.QueryDuplication(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_duplication: "+err2.Error()) + oprot.WriteMessageBegin("query_duplication", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("query_duplication", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorModifyDuplication struct { + handler AdminClient +} + +func (p *adminClientProcessorModifyDuplication) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientModifyDuplicationArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("modify_duplication", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientModifyDuplicationResult{} + var retval *DuplicationModifyResponse + var err2 error + if retval, err2 = p.handler.ModifyDuplication(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing modify_duplication: "+err2.Error()) + oprot.WriteMessageBegin("modify_duplication", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("modify_duplication", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorQueryAppInfo struct { + handler AdminClient +} + +func (p *adminClientProcessorQueryAppInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientQueryAppInfoArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("query_app_info", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientQueryAppInfoResult{} + var retval *QueryAppInfoResponse + var err2 error + if retval, err2 = p.handler.QueryAppInfo(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_app_info: "+err2.Error()) + oprot.WriteMessageBegin("query_app_info", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("query_app_info", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorUpdateAppEnv struct { + handler AdminClient +} + +func (p *adminClientProcessorUpdateAppEnv) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientUpdateAppEnvArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("update_app_env", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientUpdateAppEnvResult{} + var retval *ConfigurationUpdateAppEnvResponse + var err2 error + if retval, err2 = p.handler.UpdateAppEnv(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing update_app_env: "+err2.Error()) + oprot.WriteMessageBegin("update_app_env", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("update_app_env", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorListNodes struct { + handler AdminClient +} + +func (p *adminClientProcessorListNodes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientListNodesArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("list_nodes", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientListNodesResult{} + var retval *ConfigurationListNodesResponse + var err2 error + if retval, err2 = p.handler.ListNodes(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing list_nodes: "+err2.Error()) + oprot.WriteMessageBegin("list_nodes", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("list_nodes", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorQueryClusterInfo struct { + handler AdminClient +} + +func (p *adminClientProcessorQueryClusterInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientQueryClusterInfoArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("query_cluster_info", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientQueryClusterInfoResult{} + var retval *ConfigurationClusterInfoResponse + var err2 error + if retval, err2 = p.handler.QueryClusterInfo(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_cluster_info: "+err2.Error()) + oprot.WriteMessageBegin("query_cluster_info", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("query_cluster_info", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorMetaControl struct { + handler AdminClient +} + +func (p *adminClientProcessorMetaControl) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientMetaControlArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("meta_control", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientMetaControlResult{} + var retval *ConfigurationMetaControlResponse + var err2 error + if retval, err2 = p.handler.MetaControl(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing meta_control: "+err2.Error()) + oprot.WriteMessageBegin("meta_control", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("meta_control", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorQueryBackupPolicy struct { + handler AdminClient +} + +func (p *adminClientProcessorQueryBackupPolicy) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientQueryBackupPolicyArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("query_backup_policy", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientQueryBackupPolicyResult{} + var retval *ConfigurationQueryBackupPolicyResponse + var err2 error + if retval, err2 = p.handler.QueryBackupPolicy(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_backup_policy: "+err2.Error()) + oprot.WriteMessageBegin("query_backup_policy", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("query_backup_policy", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorBalance struct { + handler AdminClient +} + +func (p *adminClientProcessorBalance) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientBalanceArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("balance", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientBalanceResult{} + var retval *ConfigurationBalancerResponse + var err2 error + if retval, err2 = p.handler.Balance(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing balance: "+err2.Error()) + oprot.WriteMessageBegin("balance", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("balance", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorStartBackupApp struct { + handler AdminClient +} + +func (p *adminClientProcessorStartBackupApp) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientStartBackupAppArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("start_backup_app", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientStartBackupAppResult{} + var retval *StartBackupAppResponse + var err2 error + if retval, err2 = p.handler.StartBackupApp(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing start_backup_app: "+err2.Error()) + oprot.WriteMessageBegin("start_backup_app", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("start_backup_app", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorQueryBackupStatus struct { + handler AdminClient +} + +func (p *adminClientProcessorQueryBackupStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientQueryBackupStatusArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("query_backup_status", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientQueryBackupStatusResult{} + var retval *QueryBackupStatusResponse + var err2 error + if retval, err2 = p.handler.QueryBackupStatus(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_backup_status: "+err2.Error()) + oprot.WriteMessageBegin("query_backup_status", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("query_backup_status", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorRestoreApp struct { + handler AdminClient +} + +func (p *adminClientProcessorRestoreApp) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientRestoreAppArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("restore_app", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientRestoreAppResult{} + var retval *ConfigurationCreateAppResponse + var err2 error + if retval, err2 = p.handler.RestoreApp(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing restore_app: "+err2.Error()) + oprot.WriteMessageBegin("restore_app", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("restore_app", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorStartPartitionSplit struct { + handler AdminClient +} + +func (p *adminClientProcessorStartPartitionSplit) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientStartPartitionSplitArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("start_partition_split", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientStartPartitionSplitResult{} + var retval *StartPartitionSplitResponse + var err2 error + if retval, err2 = p.handler.StartPartitionSplit(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing start_partition_split: "+err2.Error()) + oprot.WriteMessageBegin("start_partition_split", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("start_partition_split", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorQuerySplitStatus struct { + handler AdminClient +} + +func (p *adminClientProcessorQuerySplitStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientQuerySplitStatusArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("query_split_status", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientQuerySplitStatusResult{} + var retval *QuerySplitResponse + var err2 error + if retval, err2 = p.handler.QuerySplitStatus(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_split_status: "+err2.Error()) + oprot.WriteMessageBegin("query_split_status", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("query_split_status", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorControlPartitionSplit struct { + handler AdminClient +} + +func (p *adminClientProcessorControlPartitionSplit) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientControlPartitionSplitArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("control_partition_split", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientControlPartitionSplitResult{} + var retval *ControlSplitResponse + var err2 error + if retval, err2 = p.handler.ControlPartitionSplit(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing control_partition_split: "+err2.Error()) + oprot.WriteMessageBegin("control_partition_split", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("control_partition_split", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorStartBulkLoad struct { + handler AdminClient +} + +func (p *adminClientProcessorStartBulkLoad) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientStartBulkLoadArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("start_bulk_load", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientStartBulkLoadResult{} + var retval *StartBulkLoadResponse + var err2 error + if retval, err2 = p.handler.StartBulkLoad(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing start_bulk_load: "+err2.Error()) + oprot.WriteMessageBegin("start_bulk_load", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("start_bulk_load", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorQueryBulkLoadStatus struct { + handler AdminClient +} + +func (p *adminClientProcessorQueryBulkLoadStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientQueryBulkLoadStatusArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("query_bulk_load_status", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientQueryBulkLoadStatusResult{} + var retval *QueryBulkLoadResponse + var err2 error + if retval, err2 = p.handler.QueryBulkLoadStatus(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_bulk_load_status: "+err2.Error()) + oprot.WriteMessageBegin("query_bulk_load_status", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("query_bulk_load_status", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorControlBulkLoad struct { + handler AdminClient +} + +func (p *adminClientProcessorControlBulkLoad) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientControlBulkLoadArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("control_bulk_load", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientControlBulkLoadResult{} + var retval *ControlBulkLoadResponse + var err2 error + if retval, err2 = p.handler.ControlBulkLoad(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing control_bulk_load: "+err2.Error()) + oprot.WriteMessageBegin("control_bulk_load", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("control_bulk_load", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorClearBulkLoad struct { + handler AdminClient +} + +func (p *adminClientProcessorClearBulkLoad) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientClearBulkLoadArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("clear_bulk_load", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientClearBulkLoadResult{} + var retval *ClearBulkLoadStateResponse + var err2 error + if retval, err2 = p.handler.ClearBulkLoad(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing clear_bulk_load: "+err2.Error()) + oprot.WriteMessageBegin("clear_bulk_load", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("clear_bulk_load", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorStartManualCompact struct { + handler AdminClient +} + +func (p *adminClientProcessorStartManualCompact) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientStartManualCompactArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("start_manual_compact", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientStartManualCompactResult{} + var retval *StartAppManualCompactResponse + var err2 error + if retval, err2 = p.handler.StartManualCompact(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing start_manual_compact: "+err2.Error()) + oprot.WriteMessageBegin("start_manual_compact", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("start_manual_compact", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type adminClientProcessorQueryManualCompact struct { + handler AdminClient +} + +func (p *adminClientProcessorQueryManualCompact) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AdminClientQueryManualCompactArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("query_manual_compact", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AdminClientQueryManualCompactResult{} + var retval *QueryAppManualCompactResponse + var err2 error + if retval, err2 = p.handler.QueryManualCompact(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_manual_compact: "+err2.Error()) + oprot.WriteMessageBegin("query_manual_compact", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("query_manual_compact", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type AdminClientCreateAppArgs struct { + Req *ConfigurationCreateAppRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientCreateAppArgs() *AdminClientCreateAppArgs { + return &AdminClientCreateAppArgs{} +} + +var AdminClientCreateAppArgs_Req_DEFAULT *ConfigurationCreateAppRequest + +func (p *AdminClientCreateAppArgs) GetReq() *ConfigurationCreateAppRequest { + if !p.IsSetReq() { + return AdminClientCreateAppArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientCreateAppArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientCreateAppArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientCreateAppArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationCreateAppRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientCreateAppArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("create_app_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientCreateAppArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientCreateAppArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientCreateAppArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientCreateAppResult struct { + Success *ConfigurationCreateAppResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientCreateAppResult() *AdminClientCreateAppResult { + return &AdminClientCreateAppResult{} +} + +var AdminClientCreateAppResult_Success_DEFAULT *ConfigurationCreateAppResponse + +func (p *AdminClientCreateAppResult) GetSuccess() *ConfigurationCreateAppResponse { + if !p.IsSetSuccess() { + return AdminClientCreateAppResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientCreateAppResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientCreateAppResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientCreateAppResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationCreateAppResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientCreateAppResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("create_app_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 *AdminClientCreateAppResult) 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 *AdminClientCreateAppResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientCreateAppResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientDropAppArgs struct { + Req *ConfigurationDropAppRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientDropAppArgs() *AdminClientDropAppArgs { + return &AdminClientDropAppArgs{} +} + +var AdminClientDropAppArgs_Req_DEFAULT *ConfigurationDropAppRequest + +func (p *AdminClientDropAppArgs) GetReq() *ConfigurationDropAppRequest { + if !p.IsSetReq() { + return AdminClientDropAppArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientDropAppArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientDropAppArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientDropAppArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationDropAppRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientDropAppArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("drop_app_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientDropAppArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientDropAppArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientDropAppArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientDropAppResult struct { + Success *ConfigurationDropAppResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientDropAppResult() *AdminClientDropAppResult { + return &AdminClientDropAppResult{} +} + +var AdminClientDropAppResult_Success_DEFAULT *ConfigurationDropAppResponse + +func (p *AdminClientDropAppResult) GetSuccess() *ConfigurationDropAppResponse { + if !p.IsSetSuccess() { + return AdminClientDropAppResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientDropAppResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientDropAppResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientDropAppResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationDropAppResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientDropAppResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("drop_app_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 *AdminClientDropAppResult) 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 *AdminClientDropAppResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientDropAppResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientRecallAppArgs struct { + Req *ConfigurationRecallAppRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientRecallAppArgs() *AdminClientRecallAppArgs { + return &AdminClientRecallAppArgs{} +} + +var AdminClientRecallAppArgs_Req_DEFAULT *ConfigurationRecallAppRequest + +func (p *AdminClientRecallAppArgs) GetReq() *ConfigurationRecallAppRequest { + if !p.IsSetReq() { + return AdminClientRecallAppArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientRecallAppArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientRecallAppArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientRecallAppArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationRecallAppRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientRecallAppArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("recall_app_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientRecallAppArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientRecallAppArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientRecallAppArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientRecallAppResult struct { + Success *ConfigurationRecallAppResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientRecallAppResult() *AdminClientRecallAppResult { + return &AdminClientRecallAppResult{} +} + +var AdminClientRecallAppResult_Success_DEFAULT *ConfigurationRecallAppResponse + +func (p *AdminClientRecallAppResult) GetSuccess() *ConfigurationRecallAppResponse { + if !p.IsSetSuccess() { + return AdminClientRecallAppResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientRecallAppResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientRecallAppResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientRecallAppResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationRecallAppResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientRecallAppResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("recall_app_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 *AdminClientRecallAppResult) 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 *AdminClientRecallAppResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientRecallAppResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientListAppsArgs struct { + Req *ConfigurationListAppsRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientListAppsArgs() *AdminClientListAppsArgs { + return &AdminClientListAppsArgs{} +} + +var AdminClientListAppsArgs_Req_DEFAULT *ConfigurationListAppsRequest + +func (p *AdminClientListAppsArgs) GetReq() *ConfigurationListAppsRequest { + if !p.IsSetReq() { + return AdminClientListAppsArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientListAppsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientListAppsArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientListAppsArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationListAppsRequest{ + Status: 0, + } + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientListAppsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("list_apps_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientListAppsArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientListAppsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientListAppsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientListAppsResult struct { + Success *ConfigurationListAppsResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientListAppsResult() *AdminClientListAppsResult { + return &AdminClientListAppsResult{} +} + +var AdminClientListAppsResult_Success_DEFAULT *ConfigurationListAppsResponse + +func (p *AdminClientListAppsResult) GetSuccess() *ConfigurationListAppsResponse { + if !p.IsSetSuccess() { + return AdminClientListAppsResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientListAppsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientListAppsResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientListAppsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationListAppsResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientListAppsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("list_apps_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 *AdminClientListAppsResult) 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 *AdminClientListAppsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientListAppsResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientAddDuplicationArgs struct { + Req *DuplicationAddRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientAddDuplicationArgs() *AdminClientAddDuplicationArgs { + return &AdminClientAddDuplicationArgs{} +} + +var AdminClientAddDuplicationArgs_Req_DEFAULT *DuplicationAddRequest + +func (p *AdminClientAddDuplicationArgs) GetReq() *DuplicationAddRequest { + if !p.IsSetReq() { + return AdminClientAddDuplicationArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientAddDuplicationArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientAddDuplicationArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientAddDuplicationArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &DuplicationAddRequest{ + IsDuplicatingCheckpoint: true, + } + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientAddDuplicationArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("add_duplication_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientAddDuplicationArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientAddDuplicationArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientAddDuplicationArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientAddDuplicationResult struct { + Success *DuplicationAddResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientAddDuplicationResult() *AdminClientAddDuplicationResult { + return &AdminClientAddDuplicationResult{} +} + +var AdminClientAddDuplicationResult_Success_DEFAULT *DuplicationAddResponse + +func (p *AdminClientAddDuplicationResult) GetSuccess() *DuplicationAddResponse { + if !p.IsSetSuccess() { + return AdminClientAddDuplicationResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientAddDuplicationResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientAddDuplicationResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientAddDuplicationResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &DuplicationAddResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientAddDuplicationResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("add_duplication_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 *AdminClientAddDuplicationResult) 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 *AdminClientAddDuplicationResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientAddDuplicationResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientQueryDuplicationArgs struct { + Req *DuplicationQueryRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientQueryDuplicationArgs() *AdminClientQueryDuplicationArgs { + return &AdminClientQueryDuplicationArgs{} +} + +var AdminClientQueryDuplicationArgs_Req_DEFAULT *DuplicationQueryRequest + +func (p *AdminClientQueryDuplicationArgs) GetReq() *DuplicationQueryRequest { + if !p.IsSetReq() { + return AdminClientQueryDuplicationArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientQueryDuplicationArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientQueryDuplicationArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryDuplicationArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &DuplicationQueryRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientQueryDuplicationArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_duplication_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientQueryDuplicationArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientQueryDuplicationArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryDuplicationArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientQueryDuplicationResult struct { + Success *DuplicationQueryResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientQueryDuplicationResult() *AdminClientQueryDuplicationResult { + return &AdminClientQueryDuplicationResult{} +} + +var AdminClientQueryDuplicationResult_Success_DEFAULT *DuplicationQueryResponse + +func (p *AdminClientQueryDuplicationResult) GetSuccess() *DuplicationQueryResponse { + if !p.IsSetSuccess() { + return AdminClientQueryDuplicationResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientQueryDuplicationResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientQueryDuplicationResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryDuplicationResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &DuplicationQueryResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientQueryDuplicationResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_duplication_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 *AdminClientQueryDuplicationResult) 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 *AdminClientQueryDuplicationResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryDuplicationResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientModifyDuplicationArgs struct { + Req *DuplicationModifyRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientModifyDuplicationArgs() *AdminClientModifyDuplicationArgs { + return &AdminClientModifyDuplicationArgs{} +} + +var AdminClientModifyDuplicationArgs_Req_DEFAULT *DuplicationModifyRequest + +func (p *AdminClientModifyDuplicationArgs) GetReq() *DuplicationModifyRequest { + if !p.IsSetReq() { + return AdminClientModifyDuplicationArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientModifyDuplicationArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientModifyDuplicationArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientModifyDuplicationArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &DuplicationModifyRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientModifyDuplicationArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("modify_duplication_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientModifyDuplicationArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientModifyDuplicationArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientModifyDuplicationArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientModifyDuplicationResult struct { + Success *DuplicationModifyResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientModifyDuplicationResult() *AdminClientModifyDuplicationResult { + return &AdminClientModifyDuplicationResult{} +} + +var AdminClientModifyDuplicationResult_Success_DEFAULT *DuplicationModifyResponse + +func (p *AdminClientModifyDuplicationResult) GetSuccess() *DuplicationModifyResponse { + if !p.IsSetSuccess() { + return AdminClientModifyDuplicationResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientModifyDuplicationResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientModifyDuplicationResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientModifyDuplicationResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &DuplicationModifyResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientModifyDuplicationResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("modify_duplication_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 *AdminClientModifyDuplicationResult) 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 *AdminClientModifyDuplicationResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientModifyDuplicationResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientQueryAppInfoArgs struct { + Req *QueryAppInfoRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientQueryAppInfoArgs() *AdminClientQueryAppInfoArgs { + return &AdminClientQueryAppInfoArgs{} +} + +var AdminClientQueryAppInfoArgs_Req_DEFAULT *QueryAppInfoRequest + +func (p *AdminClientQueryAppInfoArgs) GetReq() *QueryAppInfoRequest { + if !p.IsSetReq() { + return AdminClientQueryAppInfoArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientQueryAppInfoArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientQueryAppInfoArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryAppInfoArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &QueryAppInfoRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientQueryAppInfoArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_app_info_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientQueryAppInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientQueryAppInfoArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryAppInfoArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientQueryAppInfoResult struct { + Success *QueryAppInfoResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientQueryAppInfoResult() *AdminClientQueryAppInfoResult { + return &AdminClientQueryAppInfoResult{} +} + +var AdminClientQueryAppInfoResult_Success_DEFAULT *QueryAppInfoResponse + +func (p *AdminClientQueryAppInfoResult) GetSuccess() *QueryAppInfoResponse { + if !p.IsSetSuccess() { + return AdminClientQueryAppInfoResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientQueryAppInfoResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientQueryAppInfoResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryAppInfoResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &QueryAppInfoResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientQueryAppInfoResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_app_info_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 *AdminClientQueryAppInfoResult) 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 *AdminClientQueryAppInfoResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryAppInfoResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientUpdateAppEnvArgs struct { + Req *ConfigurationUpdateAppEnvRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientUpdateAppEnvArgs() *AdminClientUpdateAppEnvArgs { + return &AdminClientUpdateAppEnvArgs{} +} + +var AdminClientUpdateAppEnvArgs_Req_DEFAULT *ConfigurationUpdateAppEnvRequest + +func (p *AdminClientUpdateAppEnvArgs) GetReq() *ConfigurationUpdateAppEnvRequest { + if !p.IsSetReq() { + return AdminClientUpdateAppEnvArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientUpdateAppEnvArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientUpdateAppEnvArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientUpdateAppEnvArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationUpdateAppEnvRequest{ + Op: 0, + } + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientUpdateAppEnvArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("update_app_env_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientUpdateAppEnvArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientUpdateAppEnvArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientUpdateAppEnvArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientUpdateAppEnvResult struct { + Success *ConfigurationUpdateAppEnvResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientUpdateAppEnvResult() *AdminClientUpdateAppEnvResult { + return &AdminClientUpdateAppEnvResult{} +} + +var AdminClientUpdateAppEnvResult_Success_DEFAULT *ConfigurationUpdateAppEnvResponse + +func (p *AdminClientUpdateAppEnvResult) GetSuccess() *ConfigurationUpdateAppEnvResponse { + if !p.IsSetSuccess() { + return AdminClientUpdateAppEnvResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientUpdateAppEnvResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientUpdateAppEnvResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientUpdateAppEnvResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationUpdateAppEnvResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientUpdateAppEnvResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("update_app_env_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 *AdminClientUpdateAppEnvResult) 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 *AdminClientUpdateAppEnvResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientUpdateAppEnvResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientListNodesArgs struct { + Req *ConfigurationListNodesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientListNodesArgs() *AdminClientListNodesArgs { + return &AdminClientListNodesArgs{} +} + +var AdminClientListNodesArgs_Req_DEFAULT *ConfigurationListNodesRequest + +func (p *AdminClientListNodesArgs) GetReq() *ConfigurationListNodesRequest { + if !p.IsSetReq() { + return AdminClientListNodesArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientListNodesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientListNodesArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientListNodesArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationListNodesRequest{ + Status: 0, + } + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientListNodesArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("list_nodes_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientListNodesArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientListNodesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientListNodesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientListNodesResult struct { + Success *ConfigurationListNodesResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientListNodesResult() *AdminClientListNodesResult { + return &AdminClientListNodesResult{} +} + +var AdminClientListNodesResult_Success_DEFAULT *ConfigurationListNodesResponse + +func (p *AdminClientListNodesResult) GetSuccess() *ConfigurationListNodesResponse { + if !p.IsSetSuccess() { + return AdminClientListNodesResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientListNodesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientListNodesResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientListNodesResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationListNodesResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientListNodesResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("list_nodes_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 *AdminClientListNodesResult) 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 *AdminClientListNodesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientListNodesResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientQueryClusterInfoArgs struct { + Req *ConfigurationClusterInfoRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientQueryClusterInfoArgs() *AdminClientQueryClusterInfoArgs { + return &AdminClientQueryClusterInfoArgs{} +} + +var AdminClientQueryClusterInfoArgs_Req_DEFAULT *ConfigurationClusterInfoRequest + +func (p *AdminClientQueryClusterInfoArgs) GetReq() *ConfigurationClusterInfoRequest { + if !p.IsSetReq() { + return AdminClientQueryClusterInfoArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientQueryClusterInfoArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientQueryClusterInfoArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryClusterInfoArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationClusterInfoRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientQueryClusterInfoArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_cluster_info_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientQueryClusterInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientQueryClusterInfoArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryClusterInfoArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientQueryClusterInfoResult struct { + Success *ConfigurationClusterInfoResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientQueryClusterInfoResult() *AdminClientQueryClusterInfoResult { + return &AdminClientQueryClusterInfoResult{} +} + +var AdminClientQueryClusterInfoResult_Success_DEFAULT *ConfigurationClusterInfoResponse + +func (p *AdminClientQueryClusterInfoResult) GetSuccess() *ConfigurationClusterInfoResponse { + if !p.IsSetSuccess() { + return AdminClientQueryClusterInfoResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientQueryClusterInfoResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientQueryClusterInfoResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryClusterInfoResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationClusterInfoResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientQueryClusterInfoResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_cluster_info_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 *AdminClientQueryClusterInfoResult) 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 *AdminClientQueryClusterInfoResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryClusterInfoResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientMetaControlArgs struct { + Req *ConfigurationMetaControlRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientMetaControlArgs() *AdminClientMetaControlArgs { + return &AdminClientMetaControlArgs{} +} + +var AdminClientMetaControlArgs_Req_DEFAULT *ConfigurationMetaControlRequest + +func (p *AdminClientMetaControlArgs) GetReq() *ConfigurationMetaControlRequest { + if !p.IsSetReq() { + return AdminClientMetaControlArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientMetaControlArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientMetaControlArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientMetaControlArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationMetaControlRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientMetaControlArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("meta_control_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientMetaControlArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientMetaControlArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientMetaControlArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientMetaControlResult struct { + Success *ConfigurationMetaControlResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientMetaControlResult() *AdminClientMetaControlResult { + return &AdminClientMetaControlResult{} +} + +var AdminClientMetaControlResult_Success_DEFAULT *ConfigurationMetaControlResponse + +func (p *AdminClientMetaControlResult) GetSuccess() *ConfigurationMetaControlResponse { + if !p.IsSetSuccess() { + return AdminClientMetaControlResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientMetaControlResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientMetaControlResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientMetaControlResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationMetaControlResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientMetaControlResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("meta_control_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 *AdminClientMetaControlResult) 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 *AdminClientMetaControlResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientMetaControlResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientQueryBackupPolicyArgs struct { + Req *ConfigurationQueryBackupPolicyRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientQueryBackupPolicyArgs() *AdminClientQueryBackupPolicyArgs { + return &AdminClientQueryBackupPolicyArgs{} +} + +var AdminClientQueryBackupPolicyArgs_Req_DEFAULT *ConfigurationQueryBackupPolicyRequest + +func (p *AdminClientQueryBackupPolicyArgs) GetReq() *ConfigurationQueryBackupPolicyRequest { + if !p.IsSetReq() { + return AdminClientQueryBackupPolicyArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientQueryBackupPolicyArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientQueryBackupPolicyArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryBackupPolicyArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationQueryBackupPolicyRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientQueryBackupPolicyArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_backup_policy_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientQueryBackupPolicyArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientQueryBackupPolicyArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryBackupPolicyArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientQueryBackupPolicyResult struct { + Success *ConfigurationQueryBackupPolicyResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientQueryBackupPolicyResult() *AdminClientQueryBackupPolicyResult { + return &AdminClientQueryBackupPolicyResult{} +} + +var AdminClientQueryBackupPolicyResult_Success_DEFAULT *ConfigurationQueryBackupPolicyResponse + +func (p *AdminClientQueryBackupPolicyResult) GetSuccess() *ConfigurationQueryBackupPolicyResponse { + if !p.IsSetSuccess() { + return AdminClientQueryBackupPolicyResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientQueryBackupPolicyResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientQueryBackupPolicyResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryBackupPolicyResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationQueryBackupPolicyResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientQueryBackupPolicyResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_backup_policy_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 *AdminClientQueryBackupPolicyResult) 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 *AdminClientQueryBackupPolicyResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryBackupPolicyResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientBalanceArgs struct { + Req *ConfigurationBalancerRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientBalanceArgs() *AdminClientBalanceArgs { + return &AdminClientBalanceArgs{} +} + +var AdminClientBalanceArgs_Req_DEFAULT *ConfigurationBalancerRequest + +func (p *AdminClientBalanceArgs) GetReq() *ConfigurationBalancerRequest { + if !p.IsSetReq() { + return AdminClientBalanceArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientBalanceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientBalanceArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientBalanceArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationBalancerRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientBalanceArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("balance_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientBalanceArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientBalanceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientBalanceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientBalanceResult struct { + Success *ConfigurationBalancerResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientBalanceResult() *AdminClientBalanceResult { + return &AdminClientBalanceResult{} +} + +var AdminClientBalanceResult_Success_DEFAULT *ConfigurationBalancerResponse + +func (p *AdminClientBalanceResult) GetSuccess() *ConfigurationBalancerResponse { + if !p.IsSetSuccess() { + return AdminClientBalanceResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientBalanceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientBalanceResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientBalanceResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationBalancerResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientBalanceResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("balance_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 *AdminClientBalanceResult) 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 *AdminClientBalanceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientBalanceResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientStartBackupAppArgs struct { + Req *StartBackupAppRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientStartBackupAppArgs() *AdminClientStartBackupAppArgs { + return &AdminClientStartBackupAppArgs{} +} + +var AdminClientStartBackupAppArgs_Req_DEFAULT *StartBackupAppRequest + +func (p *AdminClientStartBackupAppArgs) GetReq() *StartBackupAppRequest { + if !p.IsSetReq() { + return AdminClientStartBackupAppArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientStartBackupAppArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientStartBackupAppArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientStartBackupAppArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &StartBackupAppRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientStartBackupAppArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_backup_app_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientStartBackupAppArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientStartBackupAppArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientStartBackupAppArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientStartBackupAppResult struct { + Success *StartBackupAppResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientStartBackupAppResult() *AdminClientStartBackupAppResult { + return &AdminClientStartBackupAppResult{} +} + +var AdminClientStartBackupAppResult_Success_DEFAULT *StartBackupAppResponse + +func (p *AdminClientStartBackupAppResult) GetSuccess() *StartBackupAppResponse { + if !p.IsSetSuccess() { + return AdminClientStartBackupAppResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientStartBackupAppResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientStartBackupAppResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientStartBackupAppResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &StartBackupAppResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientStartBackupAppResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_backup_app_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 *AdminClientStartBackupAppResult) 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 *AdminClientStartBackupAppResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientStartBackupAppResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientQueryBackupStatusArgs struct { + Req *QueryBackupStatusRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientQueryBackupStatusArgs() *AdminClientQueryBackupStatusArgs { + return &AdminClientQueryBackupStatusArgs{} +} + +var AdminClientQueryBackupStatusArgs_Req_DEFAULT *QueryBackupStatusRequest + +func (p *AdminClientQueryBackupStatusArgs) GetReq() *QueryBackupStatusRequest { + if !p.IsSetReq() { + return AdminClientQueryBackupStatusArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientQueryBackupStatusArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientQueryBackupStatusArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryBackupStatusArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &QueryBackupStatusRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientQueryBackupStatusArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_backup_status_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientQueryBackupStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientQueryBackupStatusArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryBackupStatusArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientQueryBackupStatusResult struct { + Success *QueryBackupStatusResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientQueryBackupStatusResult() *AdminClientQueryBackupStatusResult { + return &AdminClientQueryBackupStatusResult{} +} + +var AdminClientQueryBackupStatusResult_Success_DEFAULT *QueryBackupStatusResponse + +func (p *AdminClientQueryBackupStatusResult) GetSuccess() *QueryBackupStatusResponse { + if !p.IsSetSuccess() { + return AdminClientQueryBackupStatusResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientQueryBackupStatusResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientQueryBackupStatusResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryBackupStatusResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &QueryBackupStatusResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientQueryBackupStatusResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_backup_status_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 *AdminClientQueryBackupStatusResult) 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 *AdminClientQueryBackupStatusResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryBackupStatusResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientRestoreAppArgs struct { + Req *ConfigurationRestoreRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientRestoreAppArgs() *AdminClientRestoreAppArgs { + return &AdminClientRestoreAppArgs{} +} + +var AdminClientRestoreAppArgs_Req_DEFAULT *ConfigurationRestoreRequest + +func (p *AdminClientRestoreAppArgs) GetReq() *ConfigurationRestoreRequest { + if !p.IsSetReq() { + return AdminClientRestoreAppArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientRestoreAppArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientRestoreAppArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientRestoreAppArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ConfigurationRestoreRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientRestoreAppArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("restore_app_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientRestoreAppArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientRestoreAppArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientRestoreAppArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientRestoreAppResult struct { + Success *ConfigurationCreateAppResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientRestoreAppResult() *AdminClientRestoreAppResult { + return &AdminClientRestoreAppResult{} +} + +var AdminClientRestoreAppResult_Success_DEFAULT *ConfigurationCreateAppResponse + +func (p *AdminClientRestoreAppResult) GetSuccess() *ConfigurationCreateAppResponse { + if !p.IsSetSuccess() { + return AdminClientRestoreAppResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientRestoreAppResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientRestoreAppResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientRestoreAppResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ConfigurationCreateAppResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientRestoreAppResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("restore_app_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 *AdminClientRestoreAppResult) 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 *AdminClientRestoreAppResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientRestoreAppResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientStartPartitionSplitArgs struct { + Req *StartPartitionSplitRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientStartPartitionSplitArgs() *AdminClientStartPartitionSplitArgs { + return &AdminClientStartPartitionSplitArgs{} +} + +var AdminClientStartPartitionSplitArgs_Req_DEFAULT *StartPartitionSplitRequest + +func (p *AdminClientStartPartitionSplitArgs) GetReq() *StartPartitionSplitRequest { + if !p.IsSetReq() { + return AdminClientStartPartitionSplitArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientStartPartitionSplitArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientStartPartitionSplitArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientStartPartitionSplitArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &StartPartitionSplitRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientStartPartitionSplitArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_partition_split_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientStartPartitionSplitArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientStartPartitionSplitArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientStartPartitionSplitArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientStartPartitionSplitResult struct { + Success *StartPartitionSplitResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientStartPartitionSplitResult() *AdminClientStartPartitionSplitResult { + return &AdminClientStartPartitionSplitResult{} +} + +var AdminClientStartPartitionSplitResult_Success_DEFAULT *StartPartitionSplitResponse + +func (p *AdminClientStartPartitionSplitResult) GetSuccess() *StartPartitionSplitResponse { + if !p.IsSetSuccess() { + return AdminClientStartPartitionSplitResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientStartPartitionSplitResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientStartPartitionSplitResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientStartPartitionSplitResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &StartPartitionSplitResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientStartPartitionSplitResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_partition_split_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 *AdminClientStartPartitionSplitResult) 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 *AdminClientStartPartitionSplitResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientStartPartitionSplitResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientQuerySplitStatusArgs struct { + Req *QuerySplitRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientQuerySplitStatusArgs() *AdminClientQuerySplitStatusArgs { + return &AdminClientQuerySplitStatusArgs{} +} + +var AdminClientQuerySplitStatusArgs_Req_DEFAULT *QuerySplitRequest + +func (p *AdminClientQuerySplitStatusArgs) GetReq() *QuerySplitRequest { + if !p.IsSetReq() { + return AdminClientQuerySplitStatusArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientQuerySplitStatusArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientQuerySplitStatusArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQuerySplitStatusArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &QuerySplitRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientQuerySplitStatusArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_split_status_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientQuerySplitStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientQuerySplitStatusArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQuerySplitStatusArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientQuerySplitStatusResult struct { + Success *QuerySplitResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientQuerySplitStatusResult() *AdminClientQuerySplitStatusResult { + return &AdminClientQuerySplitStatusResult{} +} + +var AdminClientQuerySplitStatusResult_Success_DEFAULT *QuerySplitResponse + +func (p *AdminClientQuerySplitStatusResult) GetSuccess() *QuerySplitResponse { + if !p.IsSetSuccess() { + return AdminClientQuerySplitStatusResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientQuerySplitStatusResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientQuerySplitStatusResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQuerySplitStatusResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &QuerySplitResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientQuerySplitStatusResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_split_status_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 *AdminClientQuerySplitStatusResult) 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 *AdminClientQuerySplitStatusResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQuerySplitStatusResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientControlPartitionSplitArgs struct { + Req *ControlSplitRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientControlPartitionSplitArgs() *AdminClientControlPartitionSplitArgs { + return &AdminClientControlPartitionSplitArgs{} +} + +var AdminClientControlPartitionSplitArgs_Req_DEFAULT *ControlSplitRequest + +func (p *AdminClientControlPartitionSplitArgs) GetReq() *ControlSplitRequest { + if !p.IsSetReq() { + return AdminClientControlPartitionSplitArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientControlPartitionSplitArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientControlPartitionSplitArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientControlPartitionSplitArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ControlSplitRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientControlPartitionSplitArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("control_partition_split_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientControlPartitionSplitArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientControlPartitionSplitArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientControlPartitionSplitArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientControlPartitionSplitResult struct { + Success *ControlSplitResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientControlPartitionSplitResult() *AdminClientControlPartitionSplitResult { + return &AdminClientControlPartitionSplitResult{} +} + +var AdminClientControlPartitionSplitResult_Success_DEFAULT *ControlSplitResponse + +func (p *AdminClientControlPartitionSplitResult) GetSuccess() *ControlSplitResponse { + if !p.IsSetSuccess() { + return AdminClientControlPartitionSplitResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientControlPartitionSplitResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientControlPartitionSplitResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientControlPartitionSplitResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ControlSplitResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientControlPartitionSplitResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("control_partition_split_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 *AdminClientControlPartitionSplitResult) 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 *AdminClientControlPartitionSplitResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientControlPartitionSplitResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientStartBulkLoadArgs struct { + Req *StartBulkLoadRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientStartBulkLoadArgs() *AdminClientStartBulkLoadArgs { + return &AdminClientStartBulkLoadArgs{} +} + +var AdminClientStartBulkLoadArgs_Req_DEFAULT *StartBulkLoadRequest + +func (p *AdminClientStartBulkLoadArgs) GetReq() *StartBulkLoadRequest { + if !p.IsSetReq() { + return AdminClientStartBulkLoadArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientStartBulkLoadArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientStartBulkLoadArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientStartBulkLoadArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &StartBulkLoadRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientStartBulkLoadArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_bulk_load_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientStartBulkLoadArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientStartBulkLoadArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientStartBulkLoadArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientStartBulkLoadResult struct { + Success *StartBulkLoadResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientStartBulkLoadResult() *AdminClientStartBulkLoadResult { + return &AdminClientStartBulkLoadResult{} +} + +var AdminClientStartBulkLoadResult_Success_DEFAULT *StartBulkLoadResponse + +func (p *AdminClientStartBulkLoadResult) GetSuccess() *StartBulkLoadResponse { + if !p.IsSetSuccess() { + return AdminClientStartBulkLoadResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientStartBulkLoadResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientStartBulkLoadResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientStartBulkLoadResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &StartBulkLoadResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientStartBulkLoadResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_bulk_load_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 *AdminClientStartBulkLoadResult) 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 *AdminClientStartBulkLoadResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientStartBulkLoadResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientQueryBulkLoadStatusArgs struct { + Req *QueryBulkLoadRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientQueryBulkLoadStatusArgs() *AdminClientQueryBulkLoadStatusArgs { + return &AdminClientQueryBulkLoadStatusArgs{} +} + +var AdminClientQueryBulkLoadStatusArgs_Req_DEFAULT *QueryBulkLoadRequest + +func (p *AdminClientQueryBulkLoadStatusArgs) GetReq() *QueryBulkLoadRequest { + if !p.IsSetReq() { + return AdminClientQueryBulkLoadStatusArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientQueryBulkLoadStatusArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientQueryBulkLoadStatusArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryBulkLoadStatusArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &QueryBulkLoadRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientQueryBulkLoadStatusArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_bulk_load_status_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientQueryBulkLoadStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientQueryBulkLoadStatusArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryBulkLoadStatusArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientQueryBulkLoadStatusResult struct { + Success *QueryBulkLoadResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientQueryBulkLoadStatusResult() *AdminClientQueryBulkLoadStatusResult { + return &AdminClientQueryBulkLoadStatusResult{} +} + +var AdminClientQueryBulkLoadStatusResult_Success_DEFAULT *QueryBulkLoadResponse + +func (p *AdminClientQueryBulkLoadStatusResult) GetSuccess() *QueryBulkLoadResponse { + if !p.IsSetSuccess() { + return AdminClientQueryBulkLoadStatusResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientQueryBulkLoadStatusResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientQueryBulkLoadStatusResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryBulkLoadStatusResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &QueryBulkLoadResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientQueryBulkLoadStatusResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_bulk_load_status_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 *AdminClientQueryBulkLoadStatusResult) 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 *AdminClientQueryBulkLoadStatusResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryBulkLoadStatusResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientControlBulkLoadArgs struct { + Req *ControlBulkLoadRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientControlBulkLoadArgs() *AdminClientControlBulkLoadArgs { + return &AdminClientControlBulkLoadArgs{} +} + +var AdminClientControlBulkLoadArgs_Req_DEFAULT *ControlBulkLoadRequest + +func (p *AdminClientControlBulkLoadArgs) GetReq() *ControlBulkLoadRequest { + if !p.IsSetReq() { + return AdminClientControlBulkLoadArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientControlBulkLoadArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientControlBulkLoadArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientControlBulkLoadArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ControlBulkLoadRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientControlBulkLoadArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("control_bulk_load_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientControlBulkLoadArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientControlBulkLoadArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientControlBulkLoadArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientControlBulkLoadResult struct { + Success *ControlBulkLoadResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientControlBulkLoadResult() *AdminClientControlBulkLoadResult { + return &AdminClientControlBulkLoadResult{} +} + +var AdminClientControlBulkLoadResult_Success_DEFAULT *ControlBulkLoadResponse + +func (p *AdminClientControlBulkLoadResult) GetSuccess() *ControlBulkLoadResponse { + if !p.IsSetSuccess() { + return AdminClientControlBulkLoadResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientControlBulkLoadResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientControlBulkLoadResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientControlBulkLoadResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ControlBulkLoadResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientControlBulkLoadResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("control_bulk_load_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 *AdminClientControlBulkLoadResult) 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 *AdminClientControlBulkLoadResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientControlBulkLoadResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientClearBulkLoadArgs struct { + Req *ClearBulkLoadStateRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientClearBulkLoadArgs() *AdminClientClearBulkLoadArgs { + return &AdminClientClearBulkLoadArgs{} +} + +var AdminClientClearBulkLoadArgs_Req_DEFAULT *ClearBulkLoadStateRequest + +func (p *AdminClientClearBulkLoadArgs) GetReq() *ClearBulkLoadStateRequest { + if !p.IsSetReq() { + return AdminClientClearBulkLoadArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientClearBulkLoadArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientClearBulkLoadArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientClearBulkLoadArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ClearBulkLoadStateRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientClearBulkLoadArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("clear_bulk_load_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientClearBulkLoadArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientClearBulkLoadArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientClearBulkLoadArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientClearBulkLoadResult struct { + Success *ClearBulkLoadStateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientClearBulkLoadResult() *AdminClientClearBulkLoadResult { + return &AdminClientClearBulkLoadResult{} +} + +var AdminClientClearBulkLoadResult_Success_DEFAULT *ClearBulkLoadStateResponse + +func (p *AdminClientClearBulkLoadResult) GetSuccess() *ClearBulkLoadStateResponse { + if !p.IsSetSuccess() { + return AdminClientClearBulkLoadResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientClearBulkLoadResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientClearBulkLoadResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientClearBulkLoadResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ClearBulkLoadStateResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientClearBulkLoadResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("clear_bulk_load_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 *AdminClientClearBulkLoadResult) 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 *AdminClientClearBulkLoadResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientClearBulkLoadResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientStartManualCompactArgs struct { + Req *StartAppManualCompactRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientStartManualCompactArgs() *AdminClientStartManualCompactArgs { + return &AdminClientStartManualCompactArgs{} +} + +var AdminClientStartManualCompactArgs_Req_DEFAULT *StartAppManualCompactRequest + +func (p *AdminClientStartManualCompactArgs) GetReq() *StartAppManualCompactRequest { + if !p.IsSetReq() { + return AdminClientStartManualCompactArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientStartManualCompactArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientStartManualCompactArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientStartManualCompactArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &StartAppManualCompactRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientStartManualCompactArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_manual_compact_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientStartManualCompactArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientStartManualCompactArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientStartManualCompactArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientStartManualCompactResult struct { + Success *StartAppManualCompactResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientStartManualCompactResult() *AdminClientStartManualCompactResult { + return &AdminClientStartManualCompactResult{} +} + +var AdminClientStartManualCompactResult_Success_DEFAULT *StartAppManualCompactResponse + +func (p *AdminClientStartManualCompactResult) GetSuccess() *StartAppManualCompactResponse { + if !p.IsSetSuccess() { + return AdminClientStartManualCompactResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientStartManualCompactResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientStartManualCompactResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientStartManualCompactResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &StartAppManualCompactResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientStartManualCompactResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_manual_compact_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 *AdminClientStartManualCompactResult) 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 *AdminClientStartManualCompactResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientStartManualCompactResult(%+v)", *p) +} + +// Attributes: +// - Req +type AdminClientQueryManualCompactArgs struct { + Req *QueryAppManualCompactRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewAdminClientQueryManualCompactArgs() *AdminClientQueryManualCompactArgs { + return &AdminClientQueryManualCompactArgs{} +} + +var AdminClientQueryManualCompactArgs_Req_DEFAULT *QueryAppManualCompactRequest + +func (p *AdminClientQueryManualCompactArgs) GetReq() *QueryAppManualCompactRequest { + if !p.IsSetReq() { + return AdminClientQueryManualCompactArgs_Req_DEFAULT + } + return p.Req +} +func (p *AdminClientQueryManualCompactArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AdminClientQueryManualCompactArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryManualCompactArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &QueryAppManualCompactRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *AdminClientQueryManualCompactArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_manual_compact_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminClientQueryManualCompactArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *AdminClientQueryManualCompactArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryManualCompactArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AdminClientQueryManualCompactResult struct { + Success *QueryAppManualCompactResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAdminClientQueryManualCompactResult() *AdminClientQueryManualCompactResult { + return &AdminClientQueryManualCompactResult{} +} + +var AdminClientQueryManualCompactResult_Success_DEFAULT *QueryAppManualCompactResponse + +func (p *AdminClientQueryManualCompactResult) GetSuccess() *QueryAppManualCompactResponse { + if !p.IsSetSuccess() { + return AdminClientQueryManualCompactResult_Success_DEFAULT + } + return p.Success +} +func (p *AdminClientQueryManualCompactResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AdminClientQueryManualCompactResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AdminClientQueryManualCompactResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &QueryAppManualCompactResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AdminClientQueryManualCompactResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_manual_compact_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 *AdminClientQueryManualCompactResult) 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 *AdminClientQueryManualCompactResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminClientQueryManualCompactResult(%+v)", *p) +} diff --git a/go-client/idl/admin/metadata-consts.go b/go-client/idl/admin/metadata-consts.go new file mode 100644 index 0000000000..757b943ef3 --- /dev/null +++ b/go-client/idl/admin/metadata-consts.go @@ -0,0 +1,27 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +func init() { +} diff --git a/go-client/idl/admin/metadata.go b/go-client/idl/admin/metadata.go new file mode 100644 index 0000000000..4a3c5592c5 --- /dev/null +++ b/go-client/idl/admin/metadata.go @@ -0,0 +1,1373 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +type PartitionStatus int64 + +const ( + PartitionStatus_PS_INVALID PartitionStatus = 0 + PartitionStatus_PS_INACTIVE PartitionStatus = 1 + PartitionStatus_PS_ERROR PartitionStatus = 2 + PartitionStatus_PS_PRIMARY PartitionStatus = 3 + PartitionStatus_PS_SECONDARY PartitionStatus = 4 + PartitionStatus_PS_POTENTIAL_SECONDARY PartitionStatus = 5 + PartitionStatus_PS_PARTITION_SPLIT PartitionStatus = 6 +) + +func (p PartitionStatus) String() string { + switch p { + case PartitionStatus_PS_INVALID: + return "PS_INVALID" + case PartitionStatus_PS_INACTIVE: + return "PS_INACTIVE" + case PartitionStatus_PS_ERROR: + return "PS_ERROR" + case PartitionStatus_PS_PRIMARY: + return "PS_PRIMARY" + case PartitionStatus_PS_SECONDARY: + return "PS_SECONDARY" + case PartitionStatus_PS_POTENTIAL_SECONDARY: + return "PS_POTENTIAL_SECONDARY" + case PartitionStatus_PS_PARTITION_SPLIT: + return "PS_PARTITION_SPLIT" + } + return "" +} + +func PartitionStatusFromString(s string) (PartitionStatus, error) { + switch s { + case "PS_INVALID": + return PartitionStatus_PS_INVALID, nil + case "PS_INACTIVE": + return PartitionStatus_PS_INACTIVE, nil + case "PS_ERROR": + return PartitionStatus_PS_ERROR, nil + case "PS_PRIMARY": + return PartitionStatus_PS_PRIMARY, nil + case "PS_SECONDARY": + return PartitionStatus_PS_SECONDARY, nil + case "PS_POTENTIAL_SECONDARY": + return PartitionStatus_PS_POTENTIAL_SECONDARY, nil + case "PS_PARTITION_SPLIT": + return PartitionStatus_PS_PARTITION_SPLIT, nil + } + return PartitionStatus(0), fmt.Errorf("not a valid PartitionStatus string") +} + +func PartitionStatusPtr(v PartitionStatus) *PartitionStatus { return &v } + +func (p PartitionStatus) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *PartitionStatus) UnmarshalText(text []byte) error { + q, err := PartitionStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *PartitionStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = PartitionStatus(v) + return nil +} + +func (p *PartitionStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type SplitStatus int64 + +const ( + SplitStatus_NOT_SPLIT SplitStatus = 0 + SplitStatus_SPLITTING SplitStatus = 1 + SplitStatus_PAUSING SplitStatus = 2 + SplitStatus_PAUSED SplitStatus = 3 + SplitStatus_CANCELING SplitStatus = 4 +) + +func (p SplitStatus) String() string { + switch p { + case SplitStatus_NOT_SPLIT: + return "NOT_SPLIT" + case SplitStatus_SPLITTING: + return "SPLITTING" + case SplitStatus_PAUSING: + return "PAUSING" + case SplitStatus_PAUSED: + return "PAUSED" + case SplitStatus_CANCELING: + return "CANCELING" + } + return "" +} + +func SplitStatusFromString(s string) (SplitStatus, error) { + switch s { + case "NOT_SPLIT": + return SplitStatus_NOT_SPLIT, nil + case "SPLITTING": + return SplitStatus_SPLITTING, nil + case "PAUSING": + return SplitStatus_PAUSING, nil + case "PAUSED": + return SplitStatus_PAUSED, nil + case "CANCELING": + return SplitStatus_CANCELING, nil + } + return SplitStatus(0), fmt.Errorf("not a valid SplitStatus string") +} + +func SplitStatusPtr(v SplitStatus) *SplitStatus { return &v } + +func (p SplitStatus) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *SplitStatus) UnmarshalText(text []byte) error { + q, err := SplitStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *SplitStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = SplitStatus(v) + return nil +} + +func (p *SplitStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type DiskStatus int64 + +const ( + DiskStatus_NORMAL DiskStatus = 0 + DiskStatus_SPACE_INSUFFICIENT DiskStatus = 1 + DiskStatus_IO_ERROR DiskStatus = 2 +) + +func (p DiskStatus) String() string { + switch p { + case DiskStatus_NORMAL: + return "NORMAL" + case DiskStatus_SPACE_INSUFFICIENT: + return "SPACE_INSUFFICIENT" + case DiskStatus_IO_ERROR: + return "IO_ERROR" + } + return "" +} + +func DiskStatusFromString(s string) (DiskStatus, error) { + switch s { + case "NORMAL": + return DiskStatus_NORMAL, nil + case "SPACE_INSUFFICIENT": + return DiskStatus_SPACE_INSUFFICIENT, nil + case "IO_ERROR": + return DiskStatus_IO_ERROR, nil + } + return DiskStatus(0), fmt.Errorf("not a valid DiskStatus string") +} + +func DiskStatusPtr(v DiskStatus) *DiskStatus { return &v } + +func (p DiskStatus) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *DiskStatus) UnmarshalText(text []byte) error { + q, err := DiskStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *DiskStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = DiskStatus(v) + return nil +} + +func (p *DiskStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type ManualCompactionStatus int64 + +const ( + ManualCompactionStatus_IDLE ManualCompactionStatus = 0 + ManualCompactionStatus_QUEUING ManualCompactionStatus = 1 + ManualCompactionStatus_RUNNING ManualCompactionStatus = 2 + ManualCompactionStatus_FINISHED ManualCompactionStatus = 3 +) + +func (p ManualCompactionStatus) String() string { + switch p { + case ManualCompactionStatus_IDLE: + return "IDLE" + case ManualCompactionStatus_QUEUING: + return "QUEUING" + case ManualCompactionStatus_RUNNING: + return "RUNNING" + case ManualCompactionStatus_FINISHED: + return "FINISHED" + } + return "" +} + +func ManualCompactionStatusFromString(s string) (ManualCompactionStatus, error) { + switch s { + case "IDLE": + return ManualCompactionStatus_IDLE, nil + case "QUEUING": + return ManualCompactionStatus_QUEUING, nil + case "RUNNING": + return ManualCompactionStatus_RUNNING, nil + case "FINISHED": + return ManualCompactionStatus_FINISHED, nil + } + return ManualCompactionStatus(0), fmt.Errorf("not a valid ManualCompactionStatus string") +} + +func ManualCompactionStatusPtr(v ManualCompactionStatus) *ManualCompactionStatus { return &v } + +func (p ManualCompactionStatus) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *ManualCompactionStatus) UnmarshalText(text []byte) error { + q, err := ManualCompactionStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *ManualCompactionStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = ManualCompactionStatus(v) + return nil +} + +func (p *ManualCompactionStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +// Attributes: +// - Name +// - Size +// - Md5 +type FileMeta struct { + Name string `thrift:"name,1" db:"name" json:"name"` + Size int64 `thrift:"size,2" db:"size" json:"size"` + Md5 string `thrift:"md5,3" db:"md5" json:"md5"` +} + +func NewFileMeta() *FileMeta { + return &FileMeta{} +} + +func (p *FileMeta) GetName() string { + return p.Name +} + +func (p *FileMeta) GetSize() int64 { + return p.Size +} + +func (p *FileMeta) GetMd5() string { + return p.Md5 +} +func (p *FileMeta) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *FileMeta) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *FileMeta) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Size = v + } + return nil +} + +func (p *FileMeta) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Md5 = v + } + return nil +} + +func (p *FileMeta) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("file_meta"); 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 := 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 *FileMeta) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) + } + if err := oprot.WriteString(string(p.Name)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *FileMeta) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("size", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:size: ", p), err) + } + if err := oprot.WriteI64(int64(p.Size)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.size (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:size: ", p), err) + } + return err +} + +func (p *FileMeta) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("md5", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:md5: ", p), err) + } + if err := oprot.WriteString(string(p.Md5)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.md5 (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:md5: ", p), err) + } + return err +} + +func (p *FileMeta) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("FileMeta(%+v)", *p) +} + +// Attributes: +// - Pid +// - Ballot +// - Primary +// - Status +// - LearnerSignature +// - PopAll +// - SplitSyncToChild +// - HpPrimary +type ReplicaConfiguration struct { + Pid *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"` + Ballot int64 `thrift:"ballot,2" db:"ballot" json:"ballot"` + Primary *base.RPCAddress `thrift:"primary,3" db:"primary" json:"primary"` + Status PartitionStatus `thrift:"status,4" db:"status" json:"status"` + LearnerSignature int64 `thrift:"learner_signature,5" db:"learner_signature" json:"learner_signature"` + PopAll bool `thrift:"pop_all,6" db:"pop_all" json:"pop_all"` + SplitSyncToChild bool `thrift:"split_sync_to_child,7" db:"split_sync_to_child" json:"split_sync_to_child"` + HpPrimary *base.HostPort `thrift:"hp_primary,8" db:"hp_primary" json:"hp_primary,omitempty"` +} + +func NewReplicaConfiguration() *ReplicaConfiguration { + return &ReplicaConfiguration{ + Status: 0, + } +} + +var ReplicaConfiguration_Pid_DEFAULT *base.Gpid + +func (p *ReplicaConfiguration) GetPid() *base.Gpid { + if !p.IsSetPid() { + return ReplicaConfiguration_Pid_DEFAULT + } + return p.Pid +} + +func (p *ReplicaConfiguration) GetBallot() int64 { + return p.Ballot +} + +var ReplicaConfiguration_Primary_DEFAULT *base.RPCAddress + +func (p *ReplicaConfiguration) GetPrimary() *base.RPCAddress { + if !p.IsSetPrimary() { + return ReplicaConfiguration_Primary_DEFAULT + } + return p.Primary +} + +func (p *ReplicaConfiguration) GetStatus() PartitionStatus { + return p.Status +} + +func (p *ReplicaConfiguration) GetLearnerSignature() int64 { + return p.LearnerSignature +} + +var ReplicaConfiguration_PopAll_DEFAULT bool = false + +func (p *ReplicaConfiguration) GetPopAll() bool { + return p.PopAll +} + +var ReplicaConfiguration_SplitSyncToChild_DEFAULT bool = false + +func (p *ReplicaConfiguration) GetSplitSyncToChild() bool { + return p.SplitSyncToChild +} + +var ReplicaConfiguration_HpPrimary_DEFAULT *base.HostPort + +func (p *ReplicaConfiguration) GetHpPrimary() *base.HostPort { + if !p.IsSetHpPrimary() { + return ReplicaConfiguration_HpPrimary_DEFAULT + } + return p.HpPrimary +} +func (p *ReplicaConfiguration) IsSetPid() bool { + return p.Pid != nil +} + +func (p *ReplicaConfiguration) IsSetPrimary() bool { + return p.Primary != nil +} + +func (p *ReplicaConfiguration) IsSetPopAll() bool { + return p.PopAll != ReplicaConfiguration_PopAll_DEFAULT +} + +func (p *ReplicaConfiguration) IsSetSplitSyncToChild() bool { + return p.SplitSyncToChild != ReplicaConfiguration_SplitSyncToChild_DEFAULT +} + +func (p *ReplicaConfiguration) IsSetHpPrimary() bool { + return p.HpPrimary != nil +} + +func (p *ReplicaConfiguration) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaConfiguration) ReadField1(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *ReplicaConfiguration) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Ballot = v + } + return nil +} + +func (p *ReplicaConfiguration) ReadField3(iprot thrift.TProtocol) error { + p.Primary = &base.RPCAddress{} + if err := p.Primary.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Primary), err) + } + return nil +} + +func (p *ReplicaConfiguration) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := PartitionStatus(v) + p.Status = temp + } + return nil +} + +func (p *ReplicaConfiguration) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.LearnerSignature = v + } + return nil +} + +func (p *ReplicaConfiguration) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.PopAll = v + } + return nil +} + +func (p *ReplicaConfiguration) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.SplitSyncToChild = v + } + return nil +} + +func (p *ReplicaConfiguration) ReadField8(iprot thrift.TProtocol) error { + p.HpPrimary = &base.HostPort{} + if err := p.HpPrimary.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpPrimary), err) + } + return nil +} + +func (p *ReplicaConfiguration) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("replica_configuration"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(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 *ReplicaConfiguration) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err) + } + return err +} + +func (p *ReplicaConfiguration) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ballot", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ballot: ", p), err) + } + if err := oprot.WriteI64(int64(p.Ballot)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ballot (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ballot: ", p), err) + } + return err +} + +func (p *ReplicaConfiguration) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("primary", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:primary: ", p), err) + } + if err := p.Primary.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Primary), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:primary: ", p), err) + } + return err +} + +func (p *ReplicaConfiguration) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) + } + return err +} + +func (p *ReplicaConfiguration) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("learner_signature", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:learner_signature: ", p), err) + } + if err := oprot.WriteI64(int64(p.LearnerSignature)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.learner_signature (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:learner_signature: ", p), err) + } + return err +} + +func (p *ReplicaConfiguration) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetPopAll() { + if err := oprot.WriteFieldBegin("pop_all", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:pop_all: ", p), err) + } + if err := oprot.WriteBool(bool(p.PopAll)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.pop_all (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:pop_all: ", p), err) + } + } + return err +} + +func (p *ReplicaConfiguration) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetSplitSyncToChild() { + if err := oprot.WriteFieldBegin("split_sync_to_child", thrift.BOOL, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:split_sync_to_child: ", p), err) + } + if err := oprot.WriteBool(bool(p.SplitSyncToChild)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.split_sync_to_child (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:split_sync_to_child: ", p), err) + } + } + return err +} + +func (p *ReplicaConfiguration) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetHpPrimary() { + if err := oprot.WriteFieldBegin("hp_primary", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:hp_primary: ", p), err) + } + if err := p.HpPrimary.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpPrimary), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:hp_primary: ", p), err) + } + } + return err +} + +func (p *ReplicaConfiguration) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaConfiguration(%+v)", *p) +} + +// Attributes: +// - Pid +// - Ballot +// - Status +// - LastCommittedDecree +// - LastPreparedDecree +// - LastDurableDecree +// - AppType +// - DiskTag +// - ManualCompactStatus +type ReplicaInfo struct { + Pid *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"` + Ballot int64 `thrift:"ballot,2" db:"ballot" json:"ballot"` + Status PartitionStatus `thrift:"status,3" db:"status" json:"status"` + LastCommittedDecree int64 `thrift:"last_committed_decree,4" db:"last_committed_decree" json:"last_committed_decree"` + LastPreparedDecree int64 `thrift:"last_prepared_decree,5" db:"last_prepared_decree" json:"last_prepared_decree"` + LastDurableDecree int64 `thrift:"last_durable_decree,6" db:"last_durable_decree" json:"last_durable_decree"` + AppType string `thrift:"app_type,7" db:"app_type" json:"app_type"` + DiskTag string `thrift:"disk_tag,8" db:"disk_tag" json:"disk_tag"` + ManualCompactStatus *ManualCompactionStatus `thrift:"manual_compact_status,9" db:"manual_compact_status" json:"manual_compact_status,omitempty"` +} + +func NewReplicaInfo() *ReplicaInfo { + return &ReplicaInfo{} +} + +var ReplicaInfo_Pid_DEFAULT *base.Gpid + +func (p *ReplicaInfo) GetPid() *base.Gpid { + if !p.IsSetPid() { + return ReplicaInfo_Pid_DEFAULT + } + return p.Pid +} + +func (p *ReplicaInfo) GetBallot() int64 { + return p.Ballot +} + +func (p *ReplicaInfo) GetStatus() PartitionStatus { + return p.Status +} + +func (p *ReplicaInfo) GetLastCommittedDecree() int64 { + return p.LastCommittedDecree +} + +func (p *ReplicaInfo) GetLastPreparedDecree() int64 { + return p.LastPreparedDecree +} + +func (p *ReplicaInfo) GetLastDurableDecree() int64 { + return p.LastDurableDecree +} + +func (p *ReplicaInfo) GetAppType() string { + return p.AppType +} + +func (p *ReplicaInfo) GetDiskTag() string { + return p.DiskTag +} + +var ReplicaInfo_ManualCompactStatus_DEFAULT ManualCompactionStatus + +func (p *ReplicaInfo) GetManualCompactStatus() ManualCompactionStatus { + if !p.IsSetManualCompactStatus() { + return ReplicaInfo_ManualCompactStatus_DEFAULT + } + return *p.ManualCompactStatus +} +func (p *ReplicaInfo) IsSetPid() bool { + return p.Pid != nil +} + +func (p *ReplicaInfo) IsSetManualCompactStatus() bool { + return p.ManualCompactStatus != nil +} + +func (p *ReplicaInfo) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRING { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.I32 { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaInfo) ReadField1(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *ReplicaInfo) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Ballot = v + } + return nil +} + +func (p *ReplicaInfo) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := PartitionStatus(v) + p.Status = temp + } + return nil +} + +func (p *ReplicaInfo) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.LastCommittedDecree = v + } + return nil +} + +func (p *ReplicaInfo) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.LastPreparedDecree = v + } + return nil +} + +func (p *ReplicaInfo) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.LastDurableDecree = v + } + return nil +} + +func (p *ReplicaInfo) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.AppType = v + } + return nil +} + +func (p *ReplicaInfo) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.DiskTag = v + } + return nil +} + +func (p *ReplicaInfo) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + temp := ManualCompactionStatus(v) + p.ManualCompactStatus = &temp + } + return nil +} + +func (p *ReplicaInfo) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("replica_info"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + 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 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 *ReplicaInfo) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err) + } + return err +} + +func (p *ReplicaInfo) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ballot", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ballot: ", p), err) + } + if err := oprot.WriteI64(int64(p.Ballot)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ballot (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ballot: ", p), err) + } + return err +} + +func (p *ReplicaInfo) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:status: ", p), err) + } + return err +} + +func (p *ReplicaInfo) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("last_committed_decree", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:last_committed_decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.LastCommittedDecree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_committed_decree (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:last_committed_decree: ", p), err) + } + return err +} + +func (p *ReplicaInfo) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("last_prepared_decree", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:last_prepared_decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.LastPreparedDecree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_prepared_decree (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:last_prepared_decree: ", p), err) + } + return err +} + +func (p *ReplicaInfo) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("last_durable_decree", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:last_durable_decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.LastDurableDecree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_durable_decree (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:last_durable_decree: ", p), err) + } + return err +} + +func (p *ReplicaInfo) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_type", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:app_type: ", p), err) + } + if err := oprot.WriteString(string(p.AppType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_type (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:app_type: ", p), err) + } + return err +} + +func (p *ReplicaInfo) writeField8(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("disk_tag", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:disk_tag: ", p), err) + } + if err := oprot.WriteString(string(p.DiskTag)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.disk_tag (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:disk_tag: ", p), err) + } + return err +} + +func (p *ReplicaInfo) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetManualCompactStatus() { + if err := oprot.WriteFieldBegin("manual_compact_status", thrift.I32, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:manual_compact_status: ", p), err) + } + if err := oprot.WriteI32(int32(*p.ManualCompactStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.manual_compact_status (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:manual_compact_status: ", p), err) + } + } + return err +} + +func (p *ReplicaInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaInfo(%+v)", *p) +} diff --git a/go-client/idl/admin/partition_split-consts.go b/go-client/idl/admin/partition_split-consts.go new file mode 100644 index 0000000000..757b943ef3 --- /dev/null +++ b/go-client/idl/admin/partition_split-consts.go @@ -0,0 +1,27 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +func init() { +} diff --git a/go-client/idl/admin/partition_split.go b/go-client/idl/admin/partition_split.go new file mode 100644 index 0000000000..45cc544d62 --- /dev/null +++ b/go-client/idl/admin/partition_split.go @@ -0,0 +1,3245 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package admin + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ + +type SplitControlType int64 + +const ( + SplitControlType_PAUSE SplitControlType = 0 + SplitControlType_RESTART SplitControlType = 1 + SplitControlType_CANCEL SplitControlType = 2 +) + +func (p SplitControlType) String() string { + switch p { + case SplitControlType_PAUSE: + return "PAUSE" + case SplitControlType_RESTART: + return "RESTART" + case SplitControlType_CANCEL: + return "CANCEL" + } + return "" +} + +func SplitControlTypeFromString(s string) (SplitControlType, error) { + switch s { + case "PAUSE": + return SplitControlType_PAUSE, nil + case "RESTART": + return SplitControlType_RESTART, nil + case "CANCEL": + return SplitControlType_CANCEL, nil + } + return SplitControlType(0), fmt.Errorf("not a valid SplitControlType string") +} + +func SplitControlTypePtr(v SplitControlType) *SplitControlType { return &v } + +func (p SplitControlType) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *SplitControlType) UnmarshalText(text []byte) error { + q, err := SplitControlTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *SplitControlType) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = SplitControlType(v) + return nil +} + +func (p *SplitControlType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +// Attributes: +// - AppName +// - NewPartitionCount_ +type StartPartitionSplitRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + NewPartitionCount_ int32 `thrift:"new_partition_count,2" db:"new_partition_count" json:"new_partition_count"` +} + +func NewStartPartitionSplitRequest() *StartPartitionSplitRequest { + return &StartPartitionSplitRequest{} +} + +func (p *StartPartitionSplitRequest) GetAppName() string { + return p.AppName +} + +func (p *StartPartitionSplitRequest) GetNewPartitionCount_() int32 { + return p.NewPartitionCount_ +} +func (p *StartPartitionSplitRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *StartPartitionSplitRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *StartPartitionSplitRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.NewPartitionCount_ = v + } + return nil +} + +func (p *StartPartitionSplitRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_partition_split_request"); 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 *StartPartitionSplitRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *StartPartitionSplitRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("new_partition_count", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.NewPartitionCount_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_partition_count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_partition_count: ", p), err) + } + return err +} + +func (p *StartPartitionSplitRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StartPartitionSplitRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMsg +type StartPartitionSplitResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMsg string `thrift:"hint_msg,2" db:"hint_msg" json:"hint_msg"` +} + +func NewStartPartitionSplitResponse() *StartPartitionSplitResponse { + return &StartPartitionSplitResponse{} +} + +var StartPartitionSplitResponse_Err_DEFAULT *base.ErrorCode + +func (p *StartPartitionSplitResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return StartPartitionSplitResponse_Err_DEFAULT + } + return p.Err +} + +func (p *StartPartitionSplitResponse) GetHintMsg() string { + return p.HintMsg +} +func (p *StartPartitionSplitResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *StartPartitionSplitResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *StartPartitionSplitResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *StartPartitionSplitResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMsg = v + } + return nil +} + +func (p *StartPartitionSplitResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("start_partition_split_response"); 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 *StartPartitionSplitResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *StartPartitionSplitResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hint_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_msg: ", p), err) + } + if err := oprot.WriteString(string(p.HintMsg)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_msg (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_msg: ", p), err) + } + return err +} + +func (p *StartPartitionSplitResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StartPartitionSplitResponse(%+v)", *p) +} + +// Attributes: +// - AppName +// - ControlType +// - ParentPidx +// - OldPartitionCount +type ControlSplitRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + ControlType SplitControlType `thrift:"control_type,2" db:"control_type" json:"control_type"` + ParentPidx int32 `thrift:"parent_pidx,3" db:"parent_pidx" json:"parent_pidx"` + OldPartitionCount *int32 `thrift:"old_partition_count,4" db:"old_partition_count" json:"old_partition_count,omitempty"` +} + +func NewControlSplitRequest() *ControlSplitRequest { + return &ControlSplitRequest{} +} + +func (p *ControlSplitRequest) GetAppName() string { + return p.AppName +} + +func (p *ControlSplitRequest) GetControlType() SplitControlType { + return p.ControlType +} + +func (p *ControlSplitRequest) GetParentPidx() int32 { + return p.ParentPidx +} + +var ControlSplitRequest_OldPartitionCount_DEFAULT int32 + +func (p *ControlSplitRequest) GetOldPartitionCount() int32 { + if !p.IsSetOldPartitionCount() { + return ControlSplitRequest_OldPartitionCount_DEFAULT + } + return *p.OldPartitionCount +} +func (p *ControlSplitRequest) IsSetOldPartitionCount() bool { + return p.OldPartitionCount != nil +} + +func (p *ControlSplitRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ControlSplitRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *ControlSplitRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := SplitControlType(v) + p.ControlType = temp + } + return nil +} + +func (p *ControlSplitRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ParentPidx = v + } + return nil +} + +func (p *ControlSplitRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.OldPartitionCount = &v + } + return nil +} + +func (p *ControlSplitRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("control_split_request"); 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 *ControlSplitRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *ControlSplitRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("control_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:control_type: ", p), err) + } + if err := oprot.WriteI32(int32(p.ControlType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.control_type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:control_type: ", p), err) + } + return err +} + +func (p *ControlSplitRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("parent_pidx", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parent_pidx: ", p), err) + } + if err := oprot.WriteI32(int32(p.ParentPidx)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parent_pidx (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parent_pidx: ", p), err) + } + return err +} + +func (p *ControlSplitRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetOldPartitionCount() { + if err := oprot.WriteFieldBegin("old_partition_count", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:old_partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(*p.OldPartitionCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_partition_count (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:old_partition_count: ", p), err) + } + } + return err +} + +func (p *ControlSplitRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ControlSplitRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - HintMsg +type ControlSplitResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + HintMsg *string `thrift:"hint_msg,2" db:"hint_msg" json:"hint_msg,omitempty"` +} + +func NewControlSplitResponse() *ControlSplitResponse { + return &ControlSplitResponse{} +} + +var ControlSplitResponse_Err_DEFAULT *base.ErrorCode + +func (p *ControlSplitResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ControlSplitResponse_Err_DEFAULT + } + return p.Err +} + +var ControlSplitResponse_HintMsg_DEFAULT string + +func (p *ControlSplitResponse) GetHintMsg() string { + if !p.IsSetHintMsg() { + return ControlSplitResponse_HintMsg_DEFAULT + } + return *p.HintMsg +} +func (p *ControlSplitResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ControlSplitResponse) IsSetHintMsg() bool { + return p.HintMsg != nil +} + +func (p *ControlSplitResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ControlSplitResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ControlSplitResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HintMsg = &v + } + return nil +} + +func (p *ControlSplitResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("control_split_response"); 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 *ControlSplitResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ControlSplitResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetHintMsg() { + if err := oprot.WriteFieldBegin("hint_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint_msg: ", p), err) + } + if err := oprot.WriteString(string(*p.HintMsg)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_msg (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint_msg: ", p), err) + } + } + return err +} + +func (p *ControlSplitResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ControlSplitResponse(%+v)", *p) +} + +// Attributes: +// - AppName +type QuerySplitRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` +} + +func NewQuerySplitRequest() *QuerySplitRequest { + return &QuerySplitRequest{} +} + +func (p *QuerySplitRequest) GetAppName() string { + return p.AppName +} +func (p *QuerySplitRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QuerySplitRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *QuerySplitRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_split_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *QuerySplitRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *QuerySplitRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QuerySplitRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - NewPartitionCount_ +// - Status +// - HintMsg +type QuerySplitResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + NewPartitionCount_ int32 `thrift:"new_partition_count,2" db:"new_partition_count" json:"new_partition_count"` + Status map[int32]SplitStatus `thrift:"status,3" db:"status" json:"status"` + HintMsg *string `thrift:"hint_msg,4" db:"hint_msg" json:"hint_msg,omitempty"` +} + +func NewQuerySplitResponse() *QuerySplitResponse { + return &QuerySplitResponse{} +} + +var QuerySplitResponse_Err_DEFAULT *base.ErrorCode + +func (p *QuerySplitResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return QuerySplitResponse_Err_DEFAULT + } + return p.Err +} + +func (p *QuerySplitResponse) GetNewPartitionCount_() int32 { + return p.NewPartitionCount_ +} + +func (p *QuerySplitResponse) GetStatus() map[int32]SplitStatus { + return p.Status +} + +var QuerySplitResponse_HintMsg_DEFAULT string + +func (p *QuerySplitResponse) GetHintMsg() string { + if !p.IsSetHintMsg() { + return QuerySplitResponse_HintMsg_DEFAULT + } + return *p.HintMsg +} +func (p *QuerySplitResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *QuerySplitResponse) IsSetHintMsg() bool { + return p.HintMsg != nil +} + +func (p *QuerySplitResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QuerySplitResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *QuerySplitResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.NewPartitionCount_ = v + } + return nil +} + +func (p *QuerySplitResponse) ReadField3(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[int32]SplitStatus, size) + p.Status = tMap + for i := 0; i < size; i++ { + var _key0 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key0 = v + } + var _val1 SplitStatus + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := SplitStatus(v) + _val1 = temp + } + p.Status[_key0] = _val1 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *QuerySplitResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.HintMsg = &v + } + return nil +} + +func (p *QuerySplitResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_split_response"); 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 *QuerySplitResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *QuerySplitResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("new_partition_count", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.NewPartitionCount_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_partition_count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_partition_count: ", p), err) + } + return err +} + +func (p *QuerySplitResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:status: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.I32, len(p.Status)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Status { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:status: ", p), err) + } + return err +} + +func (p *QuerySplitResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetHintMsg() { + if err := oprot.WriteFieldBegin("hint_msg", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hint_msg: ", p), err) + } + if err := oprot.WriteString(string(*p.HintMsg)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint_msg (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:hint_msg: ", p), err) + } + } + return err +} + +func (p *QuerySplitResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QuerySplitResponse(%+v)", *p) +} + +// Attributes: +// - ParentGpid +// - ChildGpid +// - ChildBallot +// - Child +// - HpChild +type NotifyCatchUpRequest struct { + ParentGpid *base.Gpid `thrift:"parent_gpid,1" db:"parent_gpid" json:"parent_gpid"` + ChildGpid *base.Gpid `thrift:"child_gpid,2" db:"child_gpid" json:"child_gpid"` + ChildBallot int64 `thrift:"child_ballot,3" db:"child_ballot" json:"child_ballot"` + Child *base.RPCAddress `thrift:"child,4" db:"child" json:"child"` + HpChild *base.HostPort `thrift:"hp_child,5" db:"hp_child" json:"hp_child,omitempty"` +} + +func NewNotifyCatchUpRequest() *NotifyCatchUpRequest { + return &NotifyCatchUpRequest{} +} + +var NotifyCatchUpRequest_ParentGpid_DEFAULT *base.Gpid + +func (p *NotifyCatchUpRequest) GetParentGpid() *base.Gpid { + if !p.IsSetParentGpid() { + return NotifyCatchUpRequest_ParentGpid_DEFAULT + } + return p.ParentGpid +} + +var NotifyCatchUpRequest_ChildGpid_DEFAULT *base.Gpid + +func (p *NotifyCatchUpRequest) GetChildGpid() *base.Gpid { + if !p.IsSetChildGpid() { + return NotifyCatchUpRequest_ChildGpid_DEFAULT + } + return p.ChildGpid +} + +func (p *NotifyCatchUpRequest) GetChildBallot() int64 { + return p.ChildBallot +} + +var NotifyCatchUpRequest_Child_DEFAULT *base.RPCAddress + +func (p *NotifyCatchUpRequest) GetChild() *base.RPCAddress { + if !p.IsSetChild() { + return NotifyCatchUpRequest_Child_DEFAULT + } + return p.Child +} + +var NotifyCatchUpRequest_HpChild_DEFAULT *base.HostPort + +func (p *NotifyCatchUpRequest) GetHpChild() *base.HostPort { + if !p.IsSetHpChild() { + return NotifyCatchUpRequest_HpChild_DEFAULT + } + return p.HpChild +} +func (p *NotifyCatchUpRequest) IsSetParentGpid() bool { + return p.ParentGpid != nil +} + +func (p *NotifyCatchUpRequest) IsSetChildGpid() bool { + return p.ChildGpid != nil +} + +func (p *NotifyCatchUpRequest) IsSetChild() bool { + return p.Child != nil +} + +func (p *NotifyCatchUpRequest) IsSetHpChild() bool { + return p.HpChild != nil +} + +func (p *NotifyCatchUpRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *NotifyCatchUpRequest) ReadField1(iprot thrift.TProtocol) error { + p.ParentGpid = &base.Gpid{} + if err := p.ParentGpid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ParentGpid), err) + } + return nil +} + +func (p *NotifyCatchUpRequest) ReadField2(iprot thrift.TProtocol) error { + p.ChildGpid = &base.Gpid{} + if err := p.ChildGpid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ChildGpid), err) + } + return nil +} + +func (p *NotifyCatchUpRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ChildBallot = v + } + return nil +} + +func (p *NotifyCatchUpRequest) ReadField4(iprot thrift.TProtocol) error { + p.Child = &base.RPCAddress{} + if err := p.Child.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Child), err) + } + return nil +} + +func (p *NotifyCatchUpRequest) ReadField5(iprot thrift.TProtocol) error { + p.HpChild = &base.HostPort{} + if err := p.HpChild.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpChild), err) + } + return nil +} + +func (p *NotifyCatchUpRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("notify_catch_up_request"); 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 := p.writeField5(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 *NotifyCatchUpRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("parent_gpid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:parent_gpid: ", p), err) + } + if err := p.ParentGpid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ParentGpid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:parent_gpid: ", p), err) + } + return err +} + +func (p *NotifyCatchUpRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("child_gpid", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:child_gpid: ", p), err) + } + if err := p.ChildGpid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ChildGpid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:child_gpid: ", p), err) + } + return err +} + +func (p *NotifyCatchUpRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("child_ballot", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:child_ballot: ", p), err) + } + if err := oprot.WriteI64(int64(p.ChildBallot)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.child_ballot (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:child_ballot: ", p), err) + } + return err +} + +func (p *NotifyCatchUpRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("child", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:child: ", p), err) + } + if err := p.Child.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Child), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:child: ", p), err) + } + return err +} + +func (p *NotifyCatchUpRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetHpChild() { + if err := oprot.WriteFieldBegin("hp_child", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:hp_child: ", p), err) + } + if err := p.HpChild.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpChild), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:hp_child: ", p), err) + } + } + return err +} + +func (p *NotifyCatchUpRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NotifyCatchUpRequest(%+v)", *p) +} + +// Attributes: +// - Err +type NotifyCacthUpResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` +} + +func NewNotifyCacthUpResponse() *NotifyCacthUpResponse { + return &NotifyCacthUpResponse{} +} + +var NotifyCacthUpResponse_Err_DEFAULT *base.ErrorCode + +func (p *NotifyCacthUpResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return NotifyCacthUpResponse_Err_DEFAULT + } + return p.Err +} +func (p *NotifyCacthUpResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *NotifyCacthUpResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *NotifyCacthUpResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *NotifyCacthUpResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("notify_cacth_up_response"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *NotifyCacthUpResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *NotifyCacthUpResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NotifyCacthUpResponse(%+v)", *p) +} + +// Attributes: +// - Target +// - NewPartitionCount_ +// - ChildPid +// - Ballot +// - HpTarget +type UpdateChildGroupPartitionCountRequest struct { + Target *base.RPCAddress `thrift:"target,1" db:"target" json:"target"` + NewPartitionCount_ int32 `thrift:"new_partition_count,2" db:"new_partition_count" json:"new_partition_count"` + ChildPid *base.Gpid `thrift:"child_pid,3" db:"child_pid" json:"child_pid"` + Ballot int64 `thrift:"ballot,4" db:"ballot" json:"ballot"` + HpTarget *base.HostPort `thrift:"hp_target,5" db:"hp_target" json:"hp_target,omitempty"` +} + +func NewUpdateChildGroupPartitionCountRequest() *UpdateChildGroupPartitionCountRequest { + return &UpdateChildGroupPartitionCountRequest{} +} + +var UpdateChildGroupPartitionCountRequest_Target_DEFAULT *base.RPCAddress + +func (p *UpdateChildGroupPartitionCountRequest) GetTarget() *base.RPCAddress { + if !p.IsSetTarget() { + return UpdateChildGroupPartitionCountRequest_Target_DEFAULT + } + return p.Target +} + +func (p *UpdateChildGroupPartitionCountRequest) GetNewPartitionCount_() int32 { + return p.NewPartitionCount_ +} + +var UpdateChildGroupPartitionCountRequest_ChildPid_DEFAULT *base.Gpid + +func (p *UpdateChildGroupPartitionCountRequest) GetChildPid() *base.Gpid { + if !p.IsSetChildPid() { + return UpdateChildGroupPartitionCountRequest_ChildPid_DEFAULT + } + return p.ChildPid +} + +func (p *UpdateChildGroupPartitionCountRequest) GetBallot() int64 { + return p.Ballot +} + +var UpdateChildGroupPartitionCountRequest_HpTarget_DEFAULT *base.HostPort + +func (p *UpdateChildGroupPartitionCountRequest) GetHpTarget() *base.HostPort { + if !p.IsSetHpTarget() { + return UpdateChildGroupPartitionCountRequest_HpTarget_DEFAULT + } + return p.HpTarget +} +func (p *UpdateChildGroupPartitionCountRequest) IsSetTarget() bool { + return p.Target != nil +} + +func (p *UpdateChildGroupPartitionCountRequest) IsSetChildPid() bool { + return p.ChildPid != nil +} + +func (p *UpdateChildGroupPartitionCountRequest) IsSetHpTarget() bool { + return p.HpTarget != nil +} + +func (p *UpdateChildGroupPartitionCountRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *UpdateChildGroupPartitionCountRequest) ReadField1(iprot thrift.TProtocol) error { + p.Target = &base.RPCAddress{} + if err := p.Target.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Target), err) + } + return nil +} + +func (p *UpdateChildGroupPartitionCountRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.NewPartitionCount_ = v + } + return nil +} + +func (p *UpdateChildGroupPartitionCountRequest) ReadField3(iprot thrift.TProtocol) error { + p.ChildPid = &base.Gpid{} + if err := p.ChildPid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ChildPid), err) + } + return nil +} + +func (p *UpdateChildGroupPartitionCountRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Ballot = v + } + return nil +} + +func (p *UpdateChildGroupPartitionCountRequest) ReadField5(iprot thrift.TProtocol) error { + p.HpTarget = &base.HostPort{} + if err := p.HpTarget.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpTarget), err) + } + return nil +} + +func (p *UpdateChildGroupPartitionCountRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("update_child_group_partition_count_request"); 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 := p.writeField5(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 *UpdateChildGroupPartitionCountRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("target", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:target: ", p), err) + } + if err := p.Target.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Target), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:target: ", p), err) + } + return err +} + +func (p *UpdateChildGroupPartitionCountRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("new_partition_count", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.NewPartitionCount_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_partition_count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_partition_count: ", p), err) + } + return err +} + +func (p *UpdateChildGroupPartitionCountRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("child_pid", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:child_pid: ", p), err) + } + if err := p.ChildPid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ChildPid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:child_pid: ", p), err) + } + return err +} + +func (p *UpdateChildGroupPartitionCountRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ballot", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:ballot: ", p), err) + } + if err := oprot.WriteI64(int64(p.Ballot)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ballot (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:ballot: ", p), err) + } + return err +} + +func (p *UpdateChildGroupPartitionCountRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetHpTarget() { + if err := oprot.WriteFieldBegin("hp_target", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:hp_target: ", p), err) + } + if err := p.HpTarget.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpTarget), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:hp_target: ", p), err) + } + } + return err +} + +func (p *UpdateChildGroupPartitionCountRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateChildGroupPartitionCountRequest(%+v)", *p) +} + +// Attributes: +// - Err +type UpdateChildGroupPartitionCountResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` +} + +func NewUpdateChildGroupPartitionCountResponse() *UpdateChildGroupPartitionCountResponse { + return &UpdateChildGroupPartitionCountResponse{} +} + +var UpdateChildGroupPartitionCountResponse_Err_DEFAULT *base.ErrorCode + +func (p *UpdateChildGroupPartitionCountResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return UpdateChildGroupPartitionCountResponse_Err_DEFAULT + } + return p.Err +} +func (p *UpdateChildGroupPartitionCountResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *UpdateChildGroupPartitionCountResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *UpdateChildGroupPartitionCountResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *UpdateChildGroupPartitionCountResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("update_child_group_partition_count_response"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *UpdateChildGroupPartitionCountResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *UpdateChildGroupPartitionCountResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateChildGroupPartitionCountResponse(%+v)", *p) +} + +// Attributes: +// - App +// - ParentConfig +// - ChildConfig +// - Primary +// - HpPrimary +type RegisterChildRequest struct { + App *replication.AppInfo `thrift:"app,1" db:"app" json:"app"` + ParentConfig *replication.PartitionConfiguration `thrift:"parent_config,2" db:"parent_config" json:"parent_config"` + ChildConfig *replication.PartitionConfiguration `thrift:"child_config,3" db:"child_config" json:"child_config"` + Primary *base.RPCAddress `thrift:"primary,4" db:"primary" json:"primary"` + HpPrimary *base.HostPort `thrift:"hp_primary,5" db:"hp_primary" json:"hp_primary,omitempty"` +} + +func NewRegisterChildRequest() *RegisterChildRequest { + return &RegisterChildRequest{} +} + +var RegisterChildRequest_App_DEFAULT *replication.AppInfo + +func (p *RegisterChildRequest) GetApp() *replication.AppInfo { + if !p.IsSetApp() { + return RegisterChildRequest_App_DEFAULT + } + return p.App +} + +var RegisterChildRequest_ParentConfig_DEFAULT *replication.PartitionConfiguration + +func (p *RegisterChildRequest) GetParentConfig() *replication.PartitionConfiguration { + if !p.IsSetParentConfig() { + return RegisterChildRequest_ParentConfig_DEFAULT + } + return p.ParentConfig +} + +var RegisterChildRequest_ChildConfig_DEFAULT *replication.PartitionConfiguration + +func (p *RegisterChildRequest) GetChildConfig() *replication.PartitionConfiguration { + if !p.IsSetChildConfig() { + return RegisterChildRequest_ChildConfig_DEFAULT + } + return p.ChildConfig +} + +var RegisterChildRequest_Primary_DEFAULT *base.RPCAddress + +func (p *RegisterChildRequest) GetPrimary() *base.RPCAddress { + if !p.IsSetPrimary() { + return RegisterChildRequest_Primary_DEFAULT + } + return p.Primary +} + +var RegisterChildRequest_HpPrimary_DEFAULT *base.HostPort + +func (p *RegisterChildRequest) GetHpPrimary() *base.HostPort { + if !p.IsSetHpPrimary() { + return RegisterChildRequest_HpPrimary_DEFAULT + } + return p.HpPrimary +} +func (p *RegisterChildRequest) IsSetApp() bool { + return p.App != nil +} + +func (p *RegisterChildRequest) IsSetParentConfig() bool { + return p.ParentConfig != nil +} + +func (p *RegisterChildRequest) IsSetChildConfig() bool { + return p.ChildConfig != nil +} + +func (p *RegisterChildRequest) IsSetPrimary() bool { + return p.Primary != nil +} + +func (p *RegisterChildRequest) IsSetHpPrimary() bool { + return p.HpPrimary != nil +} + +func (p *RegisterChildRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RegisterChildRequest) ReadField1(iprot thrift.TProtocol) error { + p.App = &replication.AppInfo{ + Status: 0, + + InitPartitionCount: -1, + } + if err := p.App.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.App), err) + } + return nil +} + +func (p *RegisterChildRequest) ReadField2(iprot thrift.TProtocol) error { + p.ParentConfig = &replication.PartitionConfiguration{} + if err := p.ParentConfig.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ParentConfig), err) + } + return nil +} + +func (p *RegisterChildRequest) ReadField3(iprot thrift.TProtocol) error { + p.ChildConfig = &replication.PartitionConfiguration{} + if err := p.ChildConfig.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ChildConfig), err) + } + return nil +} + +func (p *RegisterChildRequest) ReadField4(iprot thrift.TProtocol) error { + p.Primary = &base.RPCAddress{} + if err := p.Primary.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Primary), err) + } + return nil +} + +func (p *RegisterChildRequest) ReadField5(iprot thrift.TProtocol) error { + p.HpPrimary = &base.HostPort{} + if err := p.HpPrimary.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpPrimary), err) + } + return nil +} + +func (p *RegisterChildRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("register_child_request"); 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 := p.writeField5(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 *RegisterChildRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app: ", p), err) + } + if err := p.App.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.App), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app: ", p), err) + } + return err +} + +func (p *RegisterChildRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("parent_config", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parent_config: ", p), err) + } + if err := p.ParentConfig.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ParentConfig), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parent_config: ", p), err) + } + return err +} + +func (p *RegisterChildRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("child_config", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:child_config: ", p), err) + } + if err := p.ChildConfig.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ChildConfig), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:child_config: ", p), err) + } + return err +} + +func (p *RegisterChildRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("primary", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:primary: ", p), err) + } + if err := p.Primary.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Primary), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:primary: ", p), err) + } + return err +} + +func (p *RegisterChildRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetHpPrimary() { + if err := oprot.WriteFieldBegin("hp_primary", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:hp_primary: ", p), err) + } + if err := p.HpPrimary.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpPrimary), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:hp_primary: ", p), err) + } + } + return err +} + +func (p *RegisterChildRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RegisterChildRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - App +// - ParentConfig +// - ChildConfig +type RegisterChildResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + App *replication.AppInfo `thrift:"app,2" db:"app" json:"app"` + ParentConfig *replication.PartitionConfiguration `thrift:"parent_config,3" db:"parent_config" json:"parent_config"` + ChildConfig *replication.PartitionConfiguration `thrift:"child_config,4" db:"child_config" json:"child_config"` +} + +func NewRegisterChildResponse() *RegisterChildResponse { + return &RegisterChildResponse{} +} + +var RegisterChildResponse_Err_DEFAULT *base.ErrorCode + +func (p *RegisterChildResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return RegisterChildResponse_Err_DEFAULT + } + return p.Err +} + +var RegisterChildResponse_App_DEFAULT *replication.AppInfo + +func (p *RegisterChildResponse) GetApp() *replication.AppInfo { + if !p.IsSetApp() { + return RegisterChildResponse_App_DEFAULT + } + return p.App +} + +var RegisterChildResponse_ParentConfig_DEFAULT *replication.PartitionConfiguration + +func (p *RegisterChildResponse) GetParentConfig() *replication.PartitionConfiguration { + if !p.IsSetParentConfig() { + return RegisterChildResponse_ParentConfig_DEFAULT + } + return p.ParentConfig +} + +var RegisterChildResponse_ChildConfig_DEFAULT *replication.PartitionConfiguration + +func (p *RegisterChildResponse) GetChildConfig() *replication.PartitionConfiguration { + if !p.IsSetChildConfig() { + return RegisterChildResponse_ChildConfig_DEFAULT + } + return p.ChildConfig +} +func (p *RegisterChildResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *RegisterChildResponse) IsSetApp() bool { + return p.App != nil +} + +func (p *RegisterChildResponse) IsSetParentConfig() bool { + return p.ParentConfig != nil +} + +func (p *RegisterChildResponse) IsSetChildConfig() bool { + return p.ChildConfig != nil +} + +func (p *RegisterChildResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RegisterChildResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *RegisterChildResponse) ReadField2(iprot thrift.TProtocol) error { + p.App = &replication.AppInfo{ + Status: 0, + + InitPartitionCount: -1, + } + if err := p.App.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.App), err) + } + return nil +} + +func (p *RegisterChildResponse) ReadField3(iprot thrift.TProtocol) error { + p.ParentConfig = &replication.PartitionConfiguration{} + if err := p.ParentConfig.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ParentConfig), err) + } + return nil +} + +func (p *RegisterChildResponse) ReadField4(iprot thrift.TProtocol) error { + p.ChildConfig = &replication.PartitionConfiguration{} + if err := p.ChildConfig.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ChildConfig), err) + } + return nil +} + +func (p *RegisterChildResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("register_child_response"); 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 *RegisterChildResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *RegisterChildResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:app: ", p), err) + } + if err := p.App.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.App), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:app: ", p), err) + } + return err +} + +func (p *RegisterChildResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("parent_config", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parent_config: ", p), err) + } + if err := p.ParentConfig.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ParentConfig), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parent_config: ", p), err) + } + return err +} + +func (p *RegisterChildResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("child_config", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:child_config: ", p), err) + } + if err := p.ChildConfig.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ChildConfig), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:child_config: ", p), err) + } + return err +} + +func (p *RegisterChildResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RegisterChildResponse(%+v)", *p) +} + +// Attributes: +// - AppName +// - ParentGpid +// - MetaSplitStatus +// - PartitionCount +type NotifyStopSplitRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + ParentGpid *base.Gpid `thrift:"parent_gpid,2" db:"parent_gpid" json:"parent_gpid"` + MetaSplitStatus SplitStatus `thrift:"meta_split_status,3" db:"meta_split_status" json:"meta_split_status"` + PartitionCount int32 `thrift:"partition_count,4" db:"partition_count" json:"partition_count"` +} + +func NewNotifyStopSplitRequest() *NotifyStopSplitRequest { + return &NotifyStopSplitRequest{} +} + +func (p *NotifyStopSplitRequest) GetAppName() string { + return p.AppName +} + +var NotifyStopSplitRequest_ParentGpid_DEFAULT *base.Gpid + +func (p *NotifyStopSplitRequest) GetParentGpid() *base.Gpid { + if !p.IsSetParentGpid() { + return NotifyStopSplitRequest_ParentGpid_DEFAULT + } + return p.ParentGpid +} + +func (p *NotifyStopSplitRequest) GetMetaSplitStatus() SplitStatus { + return p.MetaSplitStatus +} + +func (p *NotifyStopSplitRequest) GetPartitionCount() int32 { + return p.PartitionCount +} +func (p *NotifyStopSplitRequest) IsSetParentGpid() bool { + return p.ParentGpid != nil +} + +func (p *NotifyStopSplitRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *NotifyStopSplitRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *NotifyStopSplitRequest) ReadField2(iprot thrift.TProtocol) error { + p.ParentGpid = &base.Gpid{} + if err := p.ParentGpid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ParentGpid), err) + } + return nil +} + +func (p *NotifyStopSplitRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := SplitStatus(v) + p.MetaSplitStatus = temp + } + return nil +} + +func (p *NotifyStopSplitRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.PartitionCount = v + } + return nil +} + +func (p *NotifyStopSplitRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("notify_stop_split_request"); 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 *NotifyStopSplitRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *NotifyStopSplitRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("parent_gpid", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parent_gpid: ", p), err) + } + if err := p.ParentGpid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ParentGpid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parent_gpid: ", p), err) + } + return err +} + +func (p *NotifyStopSplitRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("meta_split_status", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:meta_split_status: ", p), err) + } + if err := oprot.WriteI32(int32(p.MetaSplitStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.meta_split_status (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:meta_split_status: ", p), err) + } + return err +} + +func (p *NotifyStopSplitRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_count", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_count (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_count: ", p), err) + } + return err +} + +func (p *NotifyStopSplitRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NotifyStopSplitRequest(%+v)", *p) +} + +// Attributes: +// - Err +type NotifyStopSplitResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` +} + +func NewNotifyStopSplitResponse() *NotifyStopSplitResponse { + return &NotifyStopSplitResponse{} +} + +var NotifyStopSplitResponse_Err_DEFAULT *base.ErrorCode + +func (p *NotifyStopSplitResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return NotifyStopSplitResponse_Err_DEFAULT + } + return p.Err +} +func (p *NotifyStopSplitResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *NotifyStopSplitResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *NotifyStopSplitResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *NotifyStopSplitResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("notify_stop_split_response"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *NotifyStopSplitResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *NotifyStopSplitResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NotifyStopSplitResponse(%+v)", *p) +} + +// Attributes: +// - AppName +// - Pid +// - PartitionCount +type QueryChildStateRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + Pid *base.Gpid `thrift:"pid,2" db:"pid" json:"pid"` + PartitionCount int32 `thrift:"partition_count,3" db:"partition_count" json:"partition_count"` +} + +func NewQueryChildStateRequest() *QueryChildStateRequest { + return &QueryChildStateRequest{} +} + +func (p *QueryChildStateRequest) GetAppName() string { + return p.AppName +} + +var QueryChildStateRequest_Pid_DEFAULT *base.Gpid + +func (p *QueryChildStateRequest) GetPid() *base.Gpid { + if !p.IsSetPid() { + return QueryChildStateRequest_Pid_DEFAULT + } + return p.Pid +} + +func (p *QueryChildStateRequest) GetPartitionCount() int32 { + return p.PartitionCount +} +func (p *QueryChildStateRequest) IsSetPid() bool { + return p.Pid != nil +} + +func (p *QueryChildStateRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryChildStateRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *QueryChildStateRequest) ReadField2(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *QueryChildStateRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.PartitionCount = v + } + return nil +} + +func (p *QueryChildStateRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_child_state_request"); 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 := 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 *QueryChildStateRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *QueryChildStateRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:pid: ", p), err) + } + return err +} + +func (p *QueryChildStateRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_count", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_count (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:partition_count: ", p), err) + } + return err +} + +func (p *QueryChildStateRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryChildStateRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - PartitionCount +// - ChildConfig +type QueryChildStateResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + PartitionCount *int32 `thrift:"partition_count,2" db:"partition_count" json:"partition_count,omitempty"` + ChildConfig *replication.PartitionConfiguration `thrift:"child_config,3" db:"child_config" json:"child_config,omitempty"` +} + +func NewQueryChildStateResponse() *QueryChildStateResponse { + return &QueryChildStateResponse{} +} + +var QueryChildStateResponse_Err_DEFAULT *base.ErrorCode + +func (p *QueryChildStateResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return QueryChildStateResponse_Err_DEFAULT + } + return p.Err +} + +var QueryChildStateResponse_PartitionCount_DEFAULT int32 + +func (p *QueryChildStateResponse) GetPartitionCount() int32 { + if !p.IsSetPartitionCount() { + return QueryChildStateResponse_PartitionCount_DEFAULT + } + return *p.PartitionCount +} + +var QueryChildStateResponse_ChildConfig_DEFAULT *replication.PartitionConfiguration + +func (p *QueryChildStateResponse) GetChildConfig() *replication.PartitionConfiguration { + if !p.IsSetChildConfig() { + return QueryChildStateResponse_ChildConfig_DEFAULT + } + return p.ChildConfig +} +func (p *QueryChildStateResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *QueryChildStateResponse) IsSetPartitionCount() bool { + return p.PartitionCount != nil +} + +func (p *QueryChildStateResponse) IsSetChildConfig() bool { + return p.ChildConfig != nil +} + +func (p *QueryChildStateResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryChildStateResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *QueryChildStateResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.PartitionCount = &v + } + return nil +} + +func (p *QueryChildStateResponse) ReadField3(iprot thrift.TProtocol) error { + p.ChildConfig = &replication.PartitionConfiguration{} + if err := p.ChildConfig.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ChildConfig), err) + } + return nil +} + +func (p *QueryChildStateResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_child_state_response"); 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 := 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 *QueryChildStateResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *QueryChildStateResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPartitionCount() { + if err := oprot.WriteFieldBegin("partition_count", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(*p.PartitionCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:partition_count: ", p), err) + } + } + return err +} + +func (p *QueryChildStateResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetChildConfig() { + if err := oprot.WriteFieldBegin("child_config", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:child_config: ", p), err) + } + if err := p.ChildConfig.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ChildConfig), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:child_config: ", p), err) + } + } + return err +} + +func (p *QueryChildStateResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryChildStateResponse(%+v)", *p) +} diff --git a/go-client/idl/cmd/GoUnusedProtection__.go b/go-client/idl/cmd/GoUnusedProtection__.go new file mode 100644 index 0000000000..b15aabc4ad --- /dev/null +++ b/go-client/idl/cmd/GoUnusedProtection__.go @@ -0,0 +1,6 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package cmd + +var GoUnusedProtection__ int diff --git a/go-client/idl/cmd/command-consts.go b/go-client/idl/cmd/command-consts.go new file mode 100644 index 0000000000..7dba9de517 --- /dev/null +++ b/go-client/idl/cmd/command-consts.go @@ -0,0 +1,22 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package cmd + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +func init() { +} diff --git a/go-client/idl/cmd/command.go b/go-client/idl/cmd/command.go new file mode 100644 index 0000000000..edeb8b1da4 --- /dev/null +++ b/go-client/idl/cmd/command.go @@ -0,0 +1,535 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package cmd + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +// Attributes: +// - Cmd +// - Arguments +type Command struct { + Cmd string `thrift:"cmd,1" db:"cmd" json:"cmd"` + Arguments []string `thrift:"arguments,2" db:"arguments" json:"arguments"` +} + +func NewCommand() *Command { + return &Command{} +} + +func (p *Command) GetCmd() string { + return p.Cmd +} + +func (p *Command) GetArguments() []string { + return p.Arguments +} +func (p *Command) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *Command) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Cmd = v + } + return nil +} + +func (p *Command) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Arguments = tSlice + for i := 0; i < size; i++ { + var _elem0 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem0 = v + } + p.Arguments = append(p.Arguments, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Command) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("command"); 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 *Command) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cmd: ", p), err) + } + if err := oprot.WriteString(string(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cmd: ", p), err) + } + return err +} + +func (p *Command) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("arguments", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:arguments: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Arguments)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Arguments { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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:arguments: ", p), err) + } + return err +} + +func (p *Command) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Command(%+v)", *p) +} + +type RemoteCmdService interface { + // Parameters: + // - Cmd + CallCommand(ctx context.Context, cmd *Command) (r string, err error) +} + +type RemoteCmdServiceClient struct { + c thrift.TClient +} + +func NewRemoteCmdServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *RemoteCmdServiceClient { + return &RemoteCmdServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewRemoteCmdServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *RemoteCmdServiceClient { + return &RemoteCmdServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewRemoteCmdServiceClient(c thrift.TClient) *RemoteCmdServiceClient { + return &RemoteCmdServiceClient{ + c: c, + } +} + +func (p *RemoteCmdServiceClient) Client_() thrift.TClient { + return p.c +} + +// Parameters: +// - Cmd +func (p *RemoteCmdServiceClient) CallCommand(ctx context.Context, cmd *Command) (r string, err error) { + var _args1 RemoteCmdServiceCallCommandArgs + _args1.Cmd = cmd + var _result2 RemoteCmdServiceCallCommandResult + if err = p.Client_().Call(ctx, "callCommand", &_args1, &_result2); err != nil { + return + } + return _result2.GetSuccess(), nil +} + +type RemoteCmdServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler RemoteCmdService +} + +func (p *RemoteCmdServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *RemoteCmdServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *RemoteCmdServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewRemoteCmdServiceProcessor(handler RemoteCmdService) *RemoteCmdServiceProcessor { + + self3 := &RemoteCmdServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self3.processorMap["callCommand"] = &remoteCmdServiceProcessorCallCommand{handler: handler} + return self3 +} + +func (p *RemoteCmdServiceProcessor) Process(ctx context.Context, 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(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x4 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x4.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x4 + +} + +type remoteCmdServiceProcessorCallCommand struct { + handler RemoteCmdService +} + +func (p *remoteCmdServiceProcessorCallCommand) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RemoteCmdServiceCallCommandArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("callCommand", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RemoteCmdServiceCallCommandResult{} + var retval string + var err2 error + if retval, err2 = p.handler.CallCommand(ctx, args.Cmd); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing callCommand: "+err2.Error()) + oprot.WriteMessageBegin("callCommand", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = &retval + } + if err2 = oprot.WriteMessageBegin("callCommand", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Cmd +type RemoteCmdServiceCallCommandArgs struct { + Cmd *Command `thrift:"cmd,1" db:"cmd" json:"cmd"` +} + +func NewRemoteCmdServiceCallCommandArgs() *RemoteCmdServiceCallCommandArgs { + return &RemoteCmdServiceCallCommandArgs{} +} + +var RemoteCmdServiceCallCommandArgs_Cmd_DEFAULT *Command + +func (p *RemoteCmdServiceCallCommandArgs) GetCmd() *Command { + if !p.IsSetCmd() { + return RemoteCmdServiceCallCommandArgs_Cmd_DEFAULT + } + return p.Cmd +} +func (p *RemoteCmdServiceCallCommandArgs) IsSetCmd() bool { + return p.Cmd != nil +} + +func (p *RemoteCmdServiceCallCommandArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RemoteCmdServiceCallCommandArgs) ReadField1(iprot thrift.TProtocol) error { + p.Cmd = &Command{} + if err := p.Cmd.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Cmd), err) + } + return nil +} + +func (p *RemoteCmdServiceCallCommandArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("callCommand_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RemoteCmdServiceCallCommandArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cmd: ", p), err) + } + if err := p.Cmd.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Cmd), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cmd: ", p), err) + } + return err +} + +func (p *RemoteCmdServiceCallCommandArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemoteCmdServiceCallCommandArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RemoteCmdServiceCallCommandResult struct { + Success *string `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRemoteCmdServiceCallCommandResult() *RemoteCmdServiceCallCommandResult { + return &RemoteCmdServiceCallCommandResult{} +} + +var RemoteCmdServiceCallCommandResult_Success_DEFAULT string + +func (p *RemoteCmdServiceCallCommandResult) GetSuccess() string { + if !p.IsSetSuccess() { + return RemoteCmdServiceCallCommandResult_Success_DEFAULT + } + return *p.Success +} +func (p *RemoteCmdServiceCallCommandResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RemoteCmdServiceCallCommandResult) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RemoteCmdServiceCallCommandResult) ReadField0(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + p.Success = &v + } + return nil +} + +func (p *RemoteCmdServiceCallCommandResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("callCommand_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 *RemoteCmdServiceCallCommandResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := oprot.WriteString(string(*p.Success)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), 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 *RemoteCmdServiceCallCommandResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemoteCmdServiceCallCommandResult(%+v)", *p) +} diff --git a/go-client/idl/radmin/GoUnusedProtection__.go b/go-client/idl/radmin/GoUnusedProtection__.go new file mode 100644 index 0000000000..c460900104 --- /dev/null +++ b/go-client/idl/radmin/GoUnusedProtection__.go @@ -0,0 +1,6 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package radmin + +var GoUnusedProtection__ int diff --git a/go-client/idl/radmin/replica_admin-consts.go b/go-client/idl/radmin/replica_admin-consts.go new file mode 100644 index 0000000000..6e0cdbb21d --- /dev/null +++ b/go-client/idl/radmin/replica_admin-consts.go @@ -0,0 +1,29 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package radmin + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/admin" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ +var _ = admin.GoUnusedProtection__ + +func init() { +} diff --git a/go-client/idl/radmin/replica_admin.go b/go-client/idl/radmin/replica_admin.go new file mode 100644 index 0000000000..0ad97a8977 --- /dev/null +++ b/go-client/idl/radmin/replica_admin.go @@ -0,0 +1,3681 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package radmin + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/admin" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ +var _ = replication.GoUnusedProtection__ +var _ = admin.GoUnusedProtection__ + +type DiskMigrationStatus int64 + +const ( + DiskMigrationStatus_IDLE DiskMigrationStatus = 0 + DiskMigrationStatus_MOVING DiskMigrationStatus = 1 + DiskMigrationStatus_MOVED DiskMigrationStatus = 2 + DiskMigrationStatus_CLOSED DiskMigrationStatus = 3 +) + +func (p DiskMigrationStatus) String() string { + switch p { + case DiskMigrationStatus_IDLE: + return "IDLE" + case DiskMigrationStatus_MOVING: + return "MOVING" + case DiskMigrationStatus_MOVED: + return "MOVED" + case DiskMigrationStatus_CLOSED: + return "CLOSED" + } + return "" +} + +func DiskMigrationStatusFromString(s string) (DiskMigrationStatus, error) { + switch s { + case "IDLE": + return DiskMigrationStatus_IDLE, nil + case "MOVING": + return DiskMigrationStatus_MOVING, nil + case "MOVED": + return DiskMigrationStatus_MOVED, nil + case "CLOSED": + return DiskMigrationStatus_CLOSED, nil + } + return DiskMigrationStatus(0), fmt.Errorf("not a valid DiskMigrationStatus string") +} + +func DiskMigrationStatusPtr(v DiskMigrationStatus) *DiskMigrationStatus { return &v } + +func (p DiskMigrationStatus) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *DiskMigrationStatus) UnmarshalText(text []byte) error { + q, err := DiskMigrationStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *DiskMigrationStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = DiskMigrationStatus(v) + return nil +} + +func (p *DiskMigrationStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type HotkeyType int64 + +const ( + HotkeyType_READ HotkeyType = 0 + HotkeyType_WRITE HotkeyType = 1 +) + +func (p HotkeyType) String() string { + switch p { + case HotkeyType_READ: + return "READ" + case HotkeyType_WRITE: + return "WRITE" + } + return "" +} + +func HotkeyTypeFromString(s string) (HotkeyType, error) { + switch s { + case "READ": + return HotkeyType_READ, nil + case "WRITE": + return HotkeyType_WRITE, nil + } + return HotkeyType(0), fmt.Errorf("not a valid HotkeyType string") +} + +func HotkeyTypePtr(v HotkeyType) *HotkeyType { return &v } + +func (p HotkeyType) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *HotkeyType) UnmarshalText(text []byte) error { + q, err := HotkeyTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *HotkeyType) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = HotkeyType(v) + return nil +} + +func (p *HotkeyType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type DetectAction int64 + +const ( + DetectAction_START DetectAction = 0 + DetectAction_STOP DetectAction = 1 + DetectAction_QUERY DetectAction = 2 +) + +func (p DetectAction) String() string { + switch p { + case DetectAction_START: + return "START" + case DetectAction_STOP: + return "STOP" + case DetectAction_QUERY: + return "QUERY" + } + return "" +} + +func DetectActionFromString(s string) (DetectAction, error) { + switch s { + case "START": + return DetectAction_START, nil + case "STOP": + return DetectAction_STOP, nil + case "QUERY": + return DetectAction_QUERY, nil + } + return DetectAction(0), fmt.Errorf("not a valid DetectAction string") +} + +func DetectActionPtr(v DetectAction) *DetectAction { return &v } + +func (p DetectAction) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *DetectAction) UnmarshalText(text []byte) error { + q, err := DetectActionFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *DetectAction) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = DetectAction(v) + return nil +} + +func (p *DetectAction) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +// Attributes: +// - Pid +// - Node1 +// - HpNode1 +type QueryReplicaDecreeRequest struct { + Pid *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"` + Node1 *base.RPCAddress `thrift:"node1,2" db:"node1" json:"node1"` + HpNode1 *base.HostPort `thrift:"hp_node1,3" db:"hp_node1" json:"hp_node1,omitempty"` +} + +func NewQueryReplicaDecreeRequest() *QueryReplicaDecreeRequest { + return &QueryReplicaDecreeRequest{} +} + +var QueryReplicaDecreeRequest_Pid_DEFAULT *base.Gpid + +func (p *QueryReplicaDecreeRequest) GetPid() *base.Gpid { + if !p.IsSetPid() { + return QueryReplicaDecreeRequest_Pid_DEFAULT + } + return p.Pid +} + +var QueryReplicaDecreeRequest_Node1_DEFAULT *base.RPCAddress + +func (p *QueryReplicaDecreeRequest) GetNode1() *base.RPCAddress { + if !p.IsSetNode1() { + return QueryReplicaDecreeRequest_Node1_DEFAULT + } + return p.Node1 +} + +var QueryReplicaDecreeRequest_HpNode1_DEFAULT *base.HostPort + +func (p *QueryReplicaDecreeRequest) GetHpNode1() *base.HostPort { + if !p.IsSetHpNode1() { + return QueryReplicaDecreeRequest_HpNode1_DEFAULT + } + return p.HpNode1 +} +func (p *QueryReplicaDecreeRequest) IsSetPid() bool { + return p.Pid != nil +} + +func (p *QueryReplicaDecreeRequest) IsSetNode1() bool { + return p.Node1 != nil +} + +func (p *QueryReplicaDecreeRequest) IsSetHpNode1() bool { + return p.HpNode1 != nil +} + +func (p *QueryReplicaDecreeRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryReplicaDecreeRequest) ReadField1(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *QueryReplicaDecreeRequest) ReadField2(iprot thrift.TProtocol) error { + p.Node1 = &base.RPCAddress{} + if err := p.Node1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node1), err) + } + return nil +} + +func (p *QueryReplicaDecreeRequest) ReadField3(iprot thrift.TProtocol) error { + p.HpNode1 = &base.HostPort{} + if err := p.HpNode1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpNode1), err) + } + return nil +} + +func (p *QueryReplicaDecreeRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_replica_decree_request"); 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 := 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 *QueryReplicaDecreeRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err) + } + return err +} + +func (p *QueryReplicaDecreeRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("node1", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:node1: ", p), err) + } + if err := p.Node1.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node1), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:node1: ", p), err) + } + return err +} + +func (p *QueryReplicaDecreeRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetHpNode1() { + if err := oprot.WriteFieldBegin("hp_node1", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hp_node1: ", p), err) + } + if err := p.HpNode1.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpNode1), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hp_node1: ", p), err) + } + } + return err +} + +func (p *QueryReplicaDecreeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryReplicaDecreeRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - LastDecree +type QueryReplicaDecreeResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + LastDecree int64 `thrift:"last_decree,2" db:"last_decree" json:"last_decree"` +} + +func NewQueryReplicaDecreeResponse() *QueryReplicaDecreeResponse { + return &QueryReplicaDecreeResponse{} +} + +var QueryReplicaDecreeResponse_Err_DEFAULT *base.ErrorCode + +func (p *QueryReplicaDecreeResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return QueryReplicaDecreeResponse_Err_DEFAULT + } + return p.Err +} + +func (p *QueryReplicaDecreeResponse) GetLastDecree() int64 { + return p.LastDecree +} +func (p *QueryReplicaDecreeResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *QueryReplicaDecreeResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryReplicaDecreeResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *QueryReplicaDecreeResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.LastDecree = v + } + return nil +} + +func (p *QueryReplicaDecreeResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_replica_decree_response"); 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 *QueryReplicaDecreeResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *QueryReplicaDecreeResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("last_decree", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:last_decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.LastDecree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_decree (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:last_decree: ", p), err) + } + return err +} + +func (p *QueryReplicaDecreeResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryReplicaDecreeResponse(%+v)", *p) +} + +// Attributes: +// - Node1 +// - HpNode1 +type QueryReplicaInfoRequest struct { + Node1 *base.RPCAddress `thrift:"node1,1" db:"node1" json:"node1"` + HpNode1 *base.HostPort `thrift:"hp_node1,2" db:"hp_node1" json:"hp_node1,omitempty"` +} + +func NewQueryReplicaInfoRequest() *QueryReplicaInfoRequest { + return &QueryReplicaInfoRequest{} +} + +var QueryReplicaInfoRequest_Node1_DEFAULT *base.RPCAddress + +func (p *QueryReplicaInfoRequest) GetNode1() *base.RPCAddress { + if !p.IsSetNode1() { + return QueryReplicaInfoRequest_Node1_DEFAULT + } + return p.Node1 +} + +var QueryReplicaInfoRequest_HpNode1_DEFAULT *base.HostPort + +func (p *QueryReplicaInfoRequest) GetHpNode1() *base.HostPort { + if !p.IsSetHpNode1() { + return QueryReplicaInfoRequest_HpNode1_DEFAULT + } + return p.HpNode1 +} +func (p *QueryReplicaInfoRequest) IsSetNode1() bool { + return p.Node1 != nil +} + +func (p *QueryReplicaInfoRequest) IsSetHpNode1() bool { + return p.HpNode1 != nil +} + +func (p *QueryReplicaInfoRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryReplicaInfoRequest) ReadField1(iprot thrift.TProtocol) error { + p.Node1 = &base.RPCAddress{} + if err := p.Node1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node1), err) + } + return nil +} + +func (p *QueryReplicaInfoRequest) ReadField2(iprot thrift.TProtocol) error { + p.HpNode1 = &base.HostPort{} + if err := p.HpNode1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpNode1), err) + } + return nil +} + +func (p *QueryReplicaInfoRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_replica_info_request"); 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 *QueryReplicaInfoRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("node1", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node1: ", p), err) + } + if err := p.Node1.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node1), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node1: ", p), err) + } + return err +} + +func (p *QueryReplicaInfoRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetHpNode1() { + if err := oprot.WriteFieldBegin("hp_node1", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hp_node1: ", p), err) + } + if err := p.HpNode1.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpNode1), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hp_node1: ", p), err) + } + } + return err +} + +func (p *QueryReplicaInfoRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryReplicaInfoRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Replicas +type QueryReplicaInfoResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Replicas []*admin.ReplicaInfo `thrift:"replicas,2" db:"replicas" json:"replicas"` +} + +func NewQueryReplicaInfoResponse() *QueryReplicaInfoResponse { + return &QueryReplicaInfoResponse{} +} + +var QueryReplicaInfoResponse_Err_DEFAULT *base.ErrorCode + +func (p *QueryReplicaInfoResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return QueryReplicaInfoResponse_Err_DEFAULT + } + return p.Err +} + +func (p *QueryReplicaInfoResponse) GetReplicas() []*admin.ReplicaInfo { + return p.Replicas +} +func (p *QueryReplicaInfoResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *QueryReplicaInfoResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryReplicaInfoResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *QueryReplicaInfoResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*admin.ReplicaInfo, 0, size) + p.Replicas = tSlice + for i := 0; i < size; i++ { + _elem0 := &admin.ReplicaInfo{} + if err := _elem0.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Replicas = append(p.Replicas, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *QueryReplicaInfoResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_replica_info_response"); 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 *QueryReplicaInfoResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *QueryReplicaInfoResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("replicas", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:replicas: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Replicas)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Replicas { + 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:replicas: ", p), err) + } + return err +} + +func (p *QueryReplicaInfoResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryReplicaInfoResponse(%+v)", *p) +} + +// Attributes: +// - Tag +// - FullDir +// - DiskCapacityMb +// - DiskAvailableMb +// - HoldingPrimaryReplicas +// - HoldingSecondaryReplicas +type DiskInfo struct { + Tag string `thrift:"tag,1" db:"tag" json:"tag"` + FullDir string `thrift:"full_dir,2" db:"full_dir" json:"full_dir"` + DiskCapacityMb int64 `thrift:"disk_capacity_mb,3" db:"disk_capacity_mb" json:"disk_capacity_mb"` + DiskAvailableMb int64 `thrift:"disk_available_mb,4" db:"disk_available_mb" json:"disk_available_mb"` + HoldingPrimaryReplicas map[int32][]*base.Gpid `thrift:"holding_primary_replicas,5" db:"holding_primary_replicas" json:"holding_primary_replicas"` + HoldingSecondaryReplicas map[int32][]*base.Gpid `thrift:"holding_secondary_replicas,6" db:"holding_secondary_replicas" json:"holding_secondary_replicas"` +} + +func NewDiskInfo() *DiskInfo { + return &DiskInfo{} +} + +func (p *DiskInfo) GetTag() string { + return p.Tag +} + +func (p *DiskInfo) GetFullDir() string { + return p.FullDir +} + +func (p *DiskInfo) GetDiskCapacityMb() int64 { + return p.DiskCapacityMb +} + +func (p *DiskInfo) GetDiskAvailableMb() int64 { + return p.DiskAvailableMb +} + +func (p *DiskInfo) GetHoldingPrimaryReplicas() map[int32][]*base.Gpid { + return p.HoldingPrimaryReplicas +} + +func (p *DiskInfo) GetHoldingSecondaryReplicas() map[int32][]*base.Gpid { + return p.HoldingSecondaryReplicas +} +func (p *DiskInfo) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.MAP { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.MAP { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DiskInfo) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Tag = v + } + return nil +} + +func (p *DiskInfo) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.FullDir = v + } + return nil +} + +func (p *DiskInfo) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.DiskCapacityMb = v + } + return nil +} + +func (p *DiskInfo) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.DiskAvailableMb = v + } + return nil +} + +func (p *DiskInfo) ReadField5(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[int32][]*base.Gpid, size) + p.HoldingPrimaryReplicas = tMap + for i := 0; i < size; i++ { + var _key1 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key1 = v + } + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]*base.Gpid, 0, size) + _val2 := tSet + for i := 0; i < size; i++ { + _elem3 := &base.Gpid{} + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + _val2 = append(_val2, _elem3) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + p.HoldingPrimaryReplicas[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DiskInfo) ReadField6(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[int32][]*base.Gpid, size) + p.HoldingSecondaryReplicas = tMap + for i := 0; i < size; i++ { + var _key4 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key4 = v + } + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]*base.Gpid, 0, size) + _val5 := tSet + for i := 0; i < size; i++ { + _elem6 := &base.Gpid{} + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + _val5 = append(_val5, _elem6) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + p.HoldingSecondaryReplicas[_key4] = _val5 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DiskInfo) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("disk_info"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(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 *DiskInfo) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("tag", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag: ", p), err) + } + if err := oprot.WriteString(string(p.Tag)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag: ", p), err) + } + return err +} + +func (p *DiskInfo) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("full_dir", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:full_dir: ", p), err) + } + if err := oprot.WriteString(string(p.FullDir)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.full_dir (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:full_dir: ", p), err) + } + return err +} + +func (p *DiskInfo) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("disk_capacity_mb", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:disk_capacity_mb: ", p), err) + } + if err := oprot.WriteI64(int64(p.DiskCapacityMb)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.disk_capacity_mb (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:disk_capacity_mb: ", p), err) + } + return err +} + +func (p *DiskInfo) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("disk_available_mb", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:disk_available_mb: ", p), err) + } + if err := oprot.WriteI64(int64(p.DiskAvailableMb)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.disk_available_mb (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:disk_available_mb: ", p), err) + } + return err +} + +func (p *DiskInfo) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("holding_primary_replicas", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:holding_primary_replicas: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.SET, len(p.HoldingPrimaryReplicas)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.HoldingPrimaryReplicas { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteSetBegin(thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + for i := 0; i < len(v); i++ { + for j := i + 1; j < len(v); j++ { + if reflect.DeepEqual(v[i], v[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", v[i])) + } + } + } + for _, v := range v { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:holding_primary_replicas: ", p), err) + } + return err +} + +func (p *DiskInfo) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("holding_secondary_replicas", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:holding_secondary_replicas: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.SET, len(p.HoldingSecondaryReplicas)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.HoldingSecondaryReplicas { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteSetBegin(thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + for i := 0; i < len(v); i++ { + for j := i + 1; j < len(v); j++ { + if reflect.DeepEqual(v[i], v[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", v[i])) + } + } + } + for _, v := range v { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:holding_secondary_replicas: ", p), err) + } + return err +} + +func (p *DiskInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DiskInfo(%+v)", *p) +} + +// Attributes: +// - Node1 +// - AppName +// - HpNode1 +type QueryDiskInfoRequest struct { + Node1 *base.RPCAddress `thrift:"node1,1" db:"node1" json:"node1"` + AppName string `thrift:"app_name,2" db:"app_name" json:"app_name"` + HpNode1 *base.HostPort `thrift:"hp_node1,3" db:"hp_node1" json:"hp_node1,omitempty"` +} + +func NewQueryDiskInfoRequest() *QueryDiskInfoRequest { + return &QueryDiskInfoRequest{} +} + +var QueryDiskInfoRequest_Node1_DEFAULT *base.RPCAddress + +func (p *QueryDiskInfoRequest) GetNode1() *base.RPCAddress { + if !p.IsSetNode1() { + return QueryDiskInfoRequest_Node1_DEFAULT + } + return p.Node1 +} + +func (p *QueryDiskInfoRequest) GetAppName() string { + return p.AppName +} + +var QueryDiskInfoRequest_HpNode1_DEFAULT *base.HostPort + +func (p *QueryDiskInfoRequest) GetHpNode1() *base.HostPort { + if !p.IsSetHpNode1() { + return QueryDiskInfoRequest_HpNode1_DEFAULT + } + return p.HpNode1 +} +func (p *QueryDiskInfoRequest) IsSetNode1() bool { + return p.Node1 != nil +} + +func (p *QueryDiskInfoRequest) IsSetHpNode1() bool { + return p.HpNode1 != nil +} + +func (p *QueryDiskInfoRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryDiskInfoRequest) ReadField1(iprot thrift.TProtocol) error { + p.Node1 = &base.RPCAddress{} + if err := p.Node1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node1), err) + } + return nil +} + +func (p *QueryDiskInfoRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *QueryDiskInfoRequest) ReadField3(iprot thrift.TProtocol) error { + p.HpNode1 = &base.HostPort{} + if err := p.HpNode1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpNode1), err) + } + return nil +} + +func (p *QueryDiskInfoRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_disk_info_request"); 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 := 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 *QueryDiskInfoRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("node1", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node1: ", p), err) + } + if err := p.Node1.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node1), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node1: ", p), err) + } + return err +} + +func (p *QueryDiskInfoRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:app_name: ", p), err) + } + return err +} + +func (p *QueryDiskInfoRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetHpNode1() { + if err := oprot.WriteFieldBegin("hp_node1", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hp_node1: ", p), err) + } + if err := p.HpNode1.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpNode1), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hp_node1: ", p), err) + } + } + return err +} + +func (p *QueryDiskInfoRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryDiskInfoRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - TotalCapacityMb +// - TotalAvailableMb +// - DiskInfos +type QueryDiskInfoResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + TotalCapacityMb int64 `thrift:"total_capacity_mb,2" db:"total_capacity_mb" json:"total_capacity_mb"` + TotalAvailableMb int64 `thrift:"total_available_mb,3" db:"total_available_mb" json:"total_available_mb"` + DiskInfos []*DiskInfo `thrift:"disk_infos,4" db:"disk_infos" json:"disk_infos"` +} + +func NewQueryDiskInfoResponse() *QueryDiskInfoResponse { + return &QueryDiskInfoResponse{} +} + +var QueryDiskInfoResponse_Err_DEFAULT *base.ErrorCode + +func (p *QueryDiskInfoResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return QueryDiskInfoResponse_Err_DEFAULT + } + return p.Err +} + +func (p *QueryDiskInfoResponse) GetTotalCapacityMb() int64 { + return p.TotalCapacityMb +} + +func (p *QueryDiskInfoResponse) GetTotalAvailableMb() int64 { + return p.TotalAvailableMb +} + +func (p *QueryDiskInfoResponse) GetDiskInfos() []*DiskInfo { + return p.DiskInfos +} +func (p *QueryDiskInfoResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *QueryDiskInfoResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryDiskInfoResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *QueryDiskInfoResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TotalCapacityMb = v + } + return nil +} + +func (p *QueryDiskInfoResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TotalAvailableMb = v + } + return nil +} + +func (p *QueryDiskInfoResponse) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*DiskInfo, 0, size) + p.DiskInfos = tSlice + for i := 0; i < size; i++ { + _elem7 := &DiskInfo{} + if err := _elem7.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + } + p.DiskInfos = append(p.DiskInfos, _elem7) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *QueryDiskInfoResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_disk_info_response"); 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 *QueryDiskInfoResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *QueryDiskInfoResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("total_capacity_mb", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:total_capacity_mb: ", p), err) + } + if err := oprot.WriteI64(int64(p.TotalCapacityMb)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.total_capacity_mb (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:total_capacity_mb: ", p), err) + } + return err +} + +func (p *QueryDiskInfoResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("total_available_mb", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:total_available_mb: ", p), err) + } + if err := oprot.WriteI64(int64(p.TotalAvailableMb)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.total_available_mb (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:total_available_mb: ", p), err) + } + return err +} + +func (p *QueryDiskInfoResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("disk_infos", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:disk_infos: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.DiskInfos)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.DiskInfos { + 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 4:disk_infos: ", p), err) + } + return err +} + +func (p *QueryDiskInfoResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryDiskInfoResponse(%+v)", *p) +} + +// Attributes: +// - Pid +// - OriginDisk +// - TargetDisk +type ReplicaDiskMigrateRequest struct { + Pid *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"` + OriginDisk string `thrift:"origin_disk,2" db:"origin_disk" json:"origin_disk"` + TargetDisk string `thrift:"target_disk,3" db:"target_disk" json:"target_disk"` +} + +func NewReplicaDiskMigrateRequest() *ReplicaDiskMigrateRequest { + return &ReplicaDiskMigrateRequest{} +} + +var ReplicaDiskMigrateRequest_Pid_DEFAULT *base.Gpid + +func (p *ReplicaDiskMigrateRequest) GetPid() *base.Gpid { + if !p.IsSetPid() { + return ReplicaDiskMigrateRequest_Pid_DEFAULT + } + return p.Pid +} + +func (p *ReplicaDiskMigrateRequest) GetOriginDisk() string { + return p.OriginDisk +} + +func (p *ReplicaDiskMigrateRequest) GetTargetDisk() string { + return p.TargetDisk +} +func (p *ReplicaDiskMigrateRequest) IsSetPid() bool { + return p.Pid != nil +} + +func (p *ReplicaDiskMigrateRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaDiskMigrateRequest) ReadField1(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *ReplicaDiskMigrateRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.OriginDisk = v + } + return nil +} + +func (p *ReplicaDiskMigrateRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TargetDisk = v + } + return nil +} + +func (p *ReplicaDiskMigrateRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("replica_disk_migrate_request"); 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 := 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 *ReplicaDiskMigrateRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err) + } + return err +} + +func (p *ReplicaDiskMigrateRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("origin_disk", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:origin_disk: ", p), err) + } + if err := oprot.WriteString(string(p.OriginDisk)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.origin_disk (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:origin_disk: ", p), err) + } + return err +} + +func (p *ReplicaDiskMigrateRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("target_disk", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:target_disk: ", p), err) + } + if err := oprot.WriteString(string(p.TargetDisk)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.target_disk (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:target_disk: ", p), err) + } + return err +} + +func (p *ReplicaDiskMigrateRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaDiskMigrateRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - Hint +type ReplicaDiskMigrateResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + Hint *string `thrift:"hint,2" db:"hint" json:"hint,omitempty"` +} + +func NewReplicaDiskMigrateResponse() *ReplicaDiskMigrateResponse { + return &ReplicaDiskMigrateResponse{} +} + +var ReplicaDiskMigrateResponse_Err_DEFAULT *base.ErrorCode + +func (p *ReplicaDiskMigrateResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return ReplicaDiskMigrateResponse_Err_DEFAULT + } + return p.Err +} + +var ReplicaDiskMigrateResponse_Hint_DEFAULT string + +func (p *ReplicaDiskMigrateResponse) GetHint() string { + if !p.IsSetHint() { + return ReplicaDiskMigrateResponse_Hint_DEFAULT + } + return *p.Hint +} +func (p *ReplicaDiskMigrateResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *ReplicaDiskMigrateResponse) IsSetHint() bool { + return p.Hint != nil +} + +func (p *ReplicaDiskMigrateResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaDiskMigrateResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *ReplicaDiskMigrateResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Hint = &v + } + return nil +} + +func (p *ReplicaDiskMigrateResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("replica_disk_migrate_response"); 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 *ReplicaDiskMigrateResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *ReplicaDiskMigrateResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetHint() { + if err := oprot.WriteFieldBegin("hint", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hint: ", p), err) + } + if err := oprot.WriteString(string(*p.Hint)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hint (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hint: ", p), err) + } + } + return err +} + +func (p *ReplicaDiskMigrateResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaDiskMigrateResponse(%+v)", *p) +} + +// Attributes: +// - Type +// - Action +// - Pid +type DetectHotkeyRequest struct { + Type HotkeyType `thrift:"type,1" db:"type" json:"type"` + Action DetectAction `thrift:"action,2" db:"action" json:"action"` + Pid *base.Gpid `thrift:"pid,3" db:"pid" json:"pid"` +} + +func NewDetectHotkeyRequest() *DetectHotkeyRequest { + return &DetectHotkeyRequest{} +} + +func (p *DetectHotkeyRequest) GetType() HotkeyType { + return p.Type +} + +func (p *DetectHotkeyRequest) GetAction() DetectAction { + return p.Action +} + +var DetectHotkeyRequest_Pid_DEFAULT *base.Gpid + +func (p *DetectHotkeyRequest) GetPid() *base.Gpid { + if !p.IsSetPid() { + return DetectHotkeyRequest_Pid_DEFAULT + } + return p.Pid +} +func (p *DetectHotkeyRequest) IsSetPid() bool { + return p.Pid != nil +} + +func (p *DetectHotkeyRequest) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DetectHotkeyRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := HotkeyType(v) + p.Type = temp + } + return nil +} + +func (p *DetectHotkeyRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := DetectAction(v) + p.Action = temp + } + return nil +} + +func (p *DetectHotkeyRequest) ReadField3(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *DetectHotkeyRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("detect_hotkey_request"); 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 := 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 *DetectHotkeyRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + return err +} + +func (p *DetectHotkeyRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("action", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:action: ", p), err) + } + if err := oprot.WriteI32(int32(p.Action)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.action (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:action: ", p), err) + } + return err +} + +func (p *DetectHotkeyRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:pid: ", p), err) + } + return err +} + +func (p *DetectHotkeyRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DetectHotkeyRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - ErrHint +// - HotkeyResult_ +type DetectHotkeyResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + ErrHint *string `thrift:"err_hint,2" db:"err_hint" json:"err_hint,omitempty"` + HotkeyResult_ *string `thrift:"hotkey_result,3" db:"hotkey_result" json:"hotkey_result,omitempty"` +} + +func NewDetectHotkeyResponse() *DetectHotkeyResponse { + return &DetectHotkeyResponse{} +} + +var DetectHotkeyResponse_Err_DEFAULT *base.ErrorCode + +func (p *DetectHotkeyResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return DetectHotkeyResponse_Err_DEFAULT + } + return p.Err +} + +var DetectHotkeyResponse_ErrHint_DEFAULT string + +func (p *DetectHotkeyResponse) GetErrHint() string { + if !p.IsSetErrHint() { + return DetectHotkeyResponse_ErrHint_DEFAULT + } + return *p.ErrHint +} + +var DetectHotkeyResponse_HotkeyResult__DEFAULT string + +func (p *DetectHotkeyResponse) GetHotkeyResult_() string { + if !p.IsSetHotkeyResult_() { + return DetectHotkeyResponse_HotkeyResult__DEFAULT + } + return *p.HotkeyResult_ +} +func (p *DetectHotkeyResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *DetectHotkeyResponse) IsSetErrHint() bool { + return p.ErrHint != nil +} + +func (p *DetectHotkeyResponse) IsSetHotkeyResult_() bool { + return p.HotkeyResult_ != nil +} + +func (p *DetectHotkeyResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *DetectHotkeyResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *DetectHotkeyResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ErrHint = &v + } + return nil +} + +func (p *DetectHotkeyResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.HotkeyResult_ = &v + } + return nil +} + +func (p *DetectHotkeyResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("detect_hotkey_response"); 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 := 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 *DetectHotkeyResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *DetectHotkeyResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetErrHint() { + if err := oprot.WriteFieldBegin("err_hint", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:err_hint: ", p), err) + } + if err := oprot.WriteString(string(*p.ErrHint)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.err_hint (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:err_hint: ", p), err) + } + } + return err +} + +func (p *DetectHotkeyResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetHotkeyResult_() { + if err := oprot.WriteFieldBegin("hotkey_result", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hotkey_result: ", p), err) + } + if err := oprot.WriteString(string(*p.HotkeyResult_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hotkey_result (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hotkey_result: ", p), err) + } + } + return err +} + +func (p *DetectHotkeyResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DetectHotkeyResponse(%+v)", *p) +} + +// Attributes: +// - DiskStr +type AddNewDiskRequest struct { + DiskStr string `thrift:"disk_str,1" db:"disk_str" json:"disk_str"` +} + +func NewAddNewDiskRequest() *AddNewDiskRequest { + return &AddNewDiskRequest{} +} + +func (p *AddNewDiskRequest) GetDiskStr() string { + return p.DiskStr +} +func (p *AddNewDiskRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AddNewDiskRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.DiskStr = v + } + return nil +} + +func (p *AddNewDiskRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("add_new_disk_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AddNewDiskRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("disk_str", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:disk_str: ", p), err) + } + if err := oprot.WriteString(string(p.DiskStr)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.disk_str (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:disk_str: ", p), err) + } + return err +} + +func (p *AddNewDiskRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddNewDiskRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - ErrHint +type AddNewDiskResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + ErrHint *string `thrift:"err_hint,2" db:"err_hint" json:"err_hint,omitempty"` +} + +func NewAddNewDiskResponse() *AddNewDiskResponse { + return &AddNewDiskResponse{} +} + +var AddNewDiskResponse_Err_DEFAULT *base.ErrorCode + +func (p *AddNewDiskResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return AddNewDiskResponse_Err_DEFAULT + } + return p.Err +} + +var AddNewDiskResponse_ErrHint_DEFAULT string + +func (p *AddNewDiskResponse) GetErrHint() string { + if !p.IsSetErrHint() { + return AddNewDiskResponse_ErrHint_DEFAULT + } + return *p.ErrHint +} +func (p *AddNewDiskResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *AddNewDiskResponse) IsSetErrHint() bool { + return p.ErrHint != nil +} + +func (p *AddNewDiskResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AddNewDiskResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *AddNewDiskResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ErrHint = &v + } + return nil +} + +func (p *AddNewDiskResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("add_new_disk_response"); 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 *AddNewDiskResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *AddNewDiskResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetErrHint() { + if err := oprot.WriteFieldBegin("err_hint", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:err_hint: ", p), err) + } + if err := oprot.WriteString(string(*p.ErrHint)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.err_hint (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:err_hint: ", p), err) + } + } + return err +} + +func (p *AddNewDiskResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddNewDiskResponse(%+v)", *p) +} + +type ReplicaClient interface { + // Parameters: + // - Req + QueryDiskInfo(ctx context.Context, req *QueryDiskInfoRequest) (r *QueryDiskInfoResponse, err error) + // Parameters: + // - Req + DiskMigrate(ctx context.Context, req *ReplicaDiskMigrateRequest) (r *ReplicaDiskMigrateResponse, err error) + // Parameters: + // - Req + AddDisk(ctx context.Context, req *AddNewDiskRequest) (r *AddNewDiskResponse, err error) +} + +type ReplicaClientClient struct { + c thrift.TClient +} + +func NewReplicaClientClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ReplicaClientClient { + return &ReplicaClientClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewReplicaClientClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ReplicaClientClient { + return &ReplicaClientClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewReplicaClientClient(c thrift.TClient) *ReplicaClientClient { + return &ReplicaClientClient{ + c: c, + } +} + +func (p *ReplicaClientClient) Client_() thrift.TClient { + return p.c +} + +// Parameters: +// - Req +func (p *ReplicaClientClient) QueryDiskInfo(ctx context.Context, req *QueryDiskInfoRequest) (r *QueryDiskInfoResponse, err error) { + var _args8 ReplicaClientQueryDiskInfoArgs + _args8.Req = req + var _result9 ReplicaClientQueryDiskInfoResult + if err = p.Client_().Call(ctx, "query_disk_info", &_args8, &_result9); err != nil { + return + } + return _result9.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *ReplicaClientClient) DiskMigrate(ctx context.Context, req *ReplicaDiskMigrateRequest) (r *ReplicaDiskMigrateResponse, err error) { + var _args10 ReplicaClientDiskMigrateArgs + _args10.Req = req + var _result11 ReplicaClientDiskMigrateResult + if err = p.Client_().Call(ctx, "disk_migrate", &_args10, &_result11); err != nil { + return + } + return _result11.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *ReplicaClientClient) AddDisk(ctx context.Context, req *AddNewDiskRequest) (r *AddNewDiskResponse, err error) { + var _args12 ReplicaClientAddDiskArgs + _args12.Req = req + var _result13 ReplicaClientAddDiskResult + if err = p.Client_().Call(ctx, "add_disk", &_args12, &_result13); err != nil { + return + } + return _result13.GetSuccess(), nil +} + +type ReplicaClientProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler ReplicaClient +} + +func (p *ReplicaClientProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *ReplicaClientProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *ReplicaClientProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewReplicaClientProcessor(handler ReplicaClient) *ReplicaClientProcessor { + + self14 := &ReplicaClientProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self14.processorMap["query_disk_info"] = &replicaClientProcessorQueryDiskInfo{handler: handler} + self14.processorMap["disk_migrate"] = &replicaClientProcessorDiskMigrate{handler: handler} + self14.processorMap["add_disk"] = &replicaClientProcessorAddDisk{handler: handler} + return self14 +} + +func (p *ReplicaClientProcessor) Process(ctx context.Context, 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(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x15 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x15.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x15 + +} + +type replicaClientProcessorQueryDiskInfo struct { + handler ReplicaClient +} + +func (p *replicaClientProcessorQueryDiskInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReplicaClientQueryDiskInfoArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("query_disk_info", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReplicaClientQueryDiskInfoResult{} + var retval *QueryDiskInfoResponse + var err2 error + if retval, err2 = p.handler.QueryDiskInfo(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_disk_info: "+err2.Error()) + oprot.WriteMessageBegin("query_disk_info", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("query_disk_info", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type replicaClientProcessorDiskMigrate struct { + handler ReplicaClient +} + +func (p *replicaClientProcessorDiskMigrate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReplicaClientDiskMigrateArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("disk_migrate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReplicaClientDiskMigrateResult{} + var retval *ReplicaDiskMigrateResponse + var err2 error + if retval, err2 = p.handler.DiskMigrate(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing disk_migrate: "+err2.Error()) + oprot.WriteMessageBegin("disk_migrate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("disk_migrate", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type replicaClientProcessorAddDisk struct { + handler ReplicaClient +} + +func (p *replicaClientProcessorAddDisk) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReplicaClientAddDiskArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("add_disk", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReplicaClientAddDiskResult{} + var retval *AddNewDiskResponse + var err2 error + if retval, err2 = p.handler.AddDisk(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing add_disk: "+err2.Error()) + oprot.WriteMessageBegin("add_disk", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("add_disk", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type ReplicaClientQueryDiskInfoArgs struct { + Req *QueryDiskInfoRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewReplicaClientQueryDiskInfoArgs() *ReplicaClientQueryDiskInfoArgs { + return &ReplicaClientQueryDiskInfoArgs{} +} + +var ReplicaClientQueryDiskInfoArgs_Req_DEFAULT *QueryDiskInfoRequest + +func (p *ReplicaClientQueryDiskInfoArgs) GetReq() *QueryDiskInfoRequest { + if !p.IsSetReq() { + return ReplicaClientQueryDiskInfoArgs_Req_DEFAULT + } + return p.Req +} +func (p *ReplicaClientQueryDiskInfoArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *ReplicaClientQueryDiskInfoArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaClientQueryDiskInfoArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &QueryDiskInfoRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *ReplicaClientQueryDiskInfoArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_disk_info_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ReplicaClientQueryDiskInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *ReplicaClientQueryDiskInfoArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaClientQueryDiskInfoArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReplicaClientQueryDiskInfoResult struct { + Success *QueryDiskInfoResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReplicaClientQueryDiskInfoResult() *ReplicaClientQueryDiskInfoResult { + return &ReplicaClientQueryDiskInfoResult{} +} + +var ReplicaClientQueryDiskInfoResult_Success_DEFAULT *QueryDiskInfoResponse + +func (p *ReplicaClientQueryDiskInfoResult) GetSuccess() *QueryDiskInfoResponse { + if !p.IsSetSuccess() { + return ReplicaClientQueryDiskInfoResult_Success_DEFAULT + } + return p.Success +} +func (p *ReplicaClientQueryDiskInfoResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReplicaClientQueryDiskInfoResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaClientQueryDiskInfoResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &QueryDiskInfoResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReplicaClientQueryDiskInfoResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_disk_info_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 *ReplicaClientQueryDiskInfoResult) 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 *ReplicaClientQueryDiskInfoResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaClientQueryDiskInfoResult(%+v)", *p) +} + +// Attributes: +// - Req +type ReplicaClientDiskMigrateArgs struct { + Req *ReplicaDiskMigrateRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewReplicaClientDiskMigrateArgs() *ReplicaClientDiskMigrateArgs { + return &ReplicaClientDiskMigrateArgs{} +} + +var ReplicaClientDiskMigrateArgs_Req_DEFAULT *ReplicaDiskMigrateRequest + +func (p *ReplicaClientDiskMigrateArgs) GetReq() *ReplicaDiskMigrateRequest { + if !p.IsSetReq() { + return ReplicaClientDiskMigrateArgs_Req_DEFAULT + } + return p.Req +} +func (p *ReplicaClientDiskMigrateArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *ReplicaClientDiskMigrateArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaClientDiskMigrateArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &ReplicaDiskMigrateRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *ReplicaClientDiskMigrateArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("disk_migrate_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ReplicaClientDiskMigrateArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *ReplicaClientDiskMigrateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaClientDiskMigrateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReplicaClientDiskMigrateResult struct { + Success *ReplicaDiskMigrateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReplicaClientDiskMigrateResult() *ReplicaClientDiskMigrateResult { + return &ReplicaClientDiskMigrateResult{} +} + +var ReplicaClientDiskMigrateResult_Success_DEFAULT *ReplicaDiskMigrateResponse + +func (p *ReplicaClientDiskMigrateResult) GetSuccess() *ReplicaDiskMigrateResponse { + if !p.IsSetSuccess() { + return ReplicaClientDiskMigrateResult_Success_DEFAULT + } + return p.Success +} +func (p *ReplicaClientDiskMigrateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReplicaClientDiskMigrateResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaClientDiskMigrateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ReplicaDiskMigrateResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReplicaClientDiskMigrateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("disk_migrate_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 *ReplicaClientDiskMigrateResult) 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 *ReplicaClientDiskMigrateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaClientDiskMigrateResult(%+v)", *p) +} + +// Attributes: +// - Req +type ReplicaClientAddDiskArgs struct { + Req *AddNewDiskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewReplicaClientAddDiskArgs() *ReplicaClientAddDiskArgs { + return &ReplicaClientAddDiskArgs{} +} + +var ReplicaClientAddDiskArgs_Req_DEFAULT *AddNewDiskRequest + +func (p *ReplicaClientAddDiskArgs) GetReq() *AddNewDiskRequest { + if !p.IsSetReq() { + return ReplicaClientAddDiskArgs_Req_DEFAULT + } + return p.Req +} +func (p *ReplicaClientAddDiskArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *ReplicaClientAddDiskArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaClientAddDiskArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &AddNewDiskRequest{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *ReplicaClientAddDiskArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("add_disk_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ReplicaClientAddDiskArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err +} + +func (p *ReplicaClientAddDiskArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaClientAddDiskArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReplicaClientAddDiskResult struct { + Success *AddNewDiskResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReplicaClientAddDiskResult() *ReplicaClientAddDiskResult { + return &ReplicaClientAddDiskResult{} +} + +var ReplicaClientAddDiskResult_Success_DEFAULT *AddNewDiskResponse + +func (p *ReplicaClientAddDiskResult) GetSuccess() *AddNewDiskResponse { + if !p.IsSetSuccess() { + return ReplicaClientAddDiskResult_Success_DEFAULT + } + return p.Success +} +func (p *ReplicaClientAddDiskResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReplicaClientAddDiskResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReplicaClientAddDiskResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &AddNewDiskResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReplicaClientAddDiskResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("add_disk_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 *ReplicaClientAddDiskResult) 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 *ReplicaClientAddDiskResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReplicaClientAddDiskResult(%+v)", *p) +} diff --git a/go-client/idl/replication/GoUnusedProtection__.go b/go-client/idl/replication/GoUnusedProtection__.go new file mode 100644 index 0000000000..20c1f2d56a --- /dev/null +++ b/go-client/idl/replication/GoUnusedProtection__.go @@ -0,0 +1,6 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package replication + +var GoUnusedProtection__ int diff --git a/go-client/idl/replication/dsn.layer2-consts.go b/go-client/idl/replication/dsn.layer2-consts.go new file mode 100644 index 0000000000..da6f576153 --- /dev/null +++ b/go-client/idl/replication/dsn.layer2-consts.go @@ -0,0 +1,25 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package replication + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ + +func init() { +} diff --git a/go-client/idl/replication/dsn.layer2.go b/go-client/idl/replication/dsn.layer2.go new file mode 100644 index 0000000000..0ee6ec2e90 --- /dev/null +++ b/go-client/idl/replication/dsn.layer2.go @@ -0,0 +1,2136 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package replication + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = base.GoUnusedProtection__ + +type AppStatus int64 + +const ( + AppStatus_AS_INVALID AppStatus = 0 + AppStatus_AS_AVAILABLE AppStatus = 1 + AppStatus_AS_CREATING AppStatus = 2 + AppStatus_AS_CREATE_FAILED AppStatus = 3 + AppStatus_AS_DROPPING AppStatus = 4 + AppStatus_AS_DROP_FAILED AppStatus = 5 + AppStatus_AS_DROPPED AppStatus = 6 + AppStatus_AS_RECALLING AppStatus = 7 +) + +func (p AppStatus) String() string { + switch p { + case AppStatus_AS_INVALID: + return "AS_INVALID" + case AppStatus_AS_AVAILABLE: + return "AS_AVAILABLE" + case AppStatus_AS_CREATING: + return "AS_CREATING" + case AppStatus_AS_CREATE_FAILED: + return "AS_CREATE_FAILED" + case AppStatus_AS_DROPPING: + return "AS_DROPPING" + case AppStatus_AS_DROP_FAILED: + return "AS_DROP_FAILED" + case AppStatus_AS_DROPPED: + return "AS_DROPPED" + case AppStatus_AS_RECALLING: + return "AS_RECALLING" + } + return "" +} + +func AppStatusFromString(s string) (AppStatus, error) { + switch s { + case "AS_INVALID": + return AppStatus_AS_INVALID, nil + case "AS_AVAILABLE": + return AppStatus_AS_AVAILABLE, nil + case "AS_CREATING": + return AppStatus_AS_CREATING, nil + case "AS_CREATE_FAILED": + return AppStatus_AS_CREATE_FAILED, nil + case "AS_DROPPING": + return AppStatus_AS_DROPPING, nil + case "AS_DROP_FAILED": + return AppStatus_AS_DROP_FAILED, nil + case "AS_DROPPED": + return AppStatus_AS_DROPPED, nil + case "AS_RECALLING": + return AppStatus_AS_RECALLING, nil + } + return AppStatus(0), fmt.Errorf("not a valid AppStatus string") +} + +func AppStatusPtr(v AppStatus) *AppStatus { return &v } + +func (p AppStatus) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *AppStatus) UnmarshalText(text []byte) error { + q, err := AppStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *AppStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = AppStatus(v) + return nil +} + +func (p *AppStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +// Attributes: +// - Pid +// - Ballot +// - MaxReplicaCount +// - Primary +// - Secondaries +// - LastDrops +// - LastCommittedDecree +// - PartitionFlags +// - HpPrimary +// - HpSecondaries +// - HpLastDrops +type PartitionConfiguration struct { + Pid *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"` + Ballot int64 `thrift:"ballot,2" db:"ballot" json:"ballot"` + MaxReplicaCount int32 `thrift:"max_replica_count,3" db:"max_replica_count" json:"max_replica_count"` + Primary *base.RPCAddress `thrift:"primary,4" db:"primary" json:"primary"` + Secondaries []*base.RPCAddress `thrift:"secondaries,5" db:"secondaries" json:"secondaries"` + LastDrops []*base.RPCAddress `thrift:"last_drops,6" db:"last_drops" json:"last_drops"` + LastCommittedDecree int64 `thrift:"last_committed_decree,7" db:"last_committed_decree" json:"last_committed_decree"` + PartitionFlags int32 `thrift:"partition_flags,8" db:"partition_flags" json:"partition_flags"` + HpPrimary *base.HostPort `thrift:"hp_primary,9" db:"hp_primary" json:"hp_primary,omitempty"` + HpSecondaries []*base.HostPort `thrift:"hp_secondaries,10" db:"hp_secondaries" json:"hp_secondaries,omitempty"` + HpLastDrops []*base.HostPort `thrift:"hp_last_drops,11" db:"hp_last_drops" json:"hp_last_drops,omitempty"` +} + +func NewPartitionConfiguration() *PartitionConfiguration { + return &PartitionConfiguration{} +} + +var PartitionConfiguration_Pid_DEFAULT *base.Gpid + +func (p *PartitionConfiguration) GetPid() *base.Gpid { + if !p.IsSetPid() { + return PartitionConfiguration_Pid_DEFAULT + } + return p.Pid +} + +func (p *PartitionConfiguration) GetBallot() int64 { + return p.Ballot +} + +func (p *PartitionConfiguration) GetMaxReplicaCount() int32 { + return p.MaxReplicaCount +} + +var PartitionConfiguration_Primary_DEFAULT *base.RPCAddress + +func (p *PartitionConfiguration) GetPrimary() *base.RPCAddress { + if !p.IsSetPrimary() { + return PartitionConfiguration_Primary_DEFAULT + } + return p.Primary +} + +func (p *PartitionConfiguration) GetSecondaries() []*base.RPCAddress { + return p.Secondaries +} + +func (p *PartitionConfiguration) GetLastDrops() []*base.RPCAddress { + return p.LastDrops +} + +func (p *PartitionConfiguration) GetLastCommittedDecree() int64 { + return p.LastCommittedDecree +} + +func (p *PartitionConfiguration) GetPartitionFlags() int32 { + return p.PartitionFlags +} + +var PartitionConfiguration_HpPrimary_DEFAULT *base.HostPort + +func (p *PartitionConfiguration) GetHpPrimary() *base.HostPort { + if !p.IsSetHpPrimary() { + return PartitionConfiguration_HpPrimary_DEFAULT + } + return p.HpPrimary +} + +var PartitionConfiguration_HpSecondaries_DEFAULT []*base.HostPort + +func (p *PartitionConfiguration) GetHpSecondaries() []*base.HostPort { + return p.HpSecondaries +} + +var PartitionConfiguration_HpLastDrops_DEFAULT []*base.HostPort + +func (p *PartitionConfiguration) GetHpLastDrops() []*base.HostPort { + return p.HpLastDrops +} +func (p *PartitionConfiguration) IsSetPid() bool { + return p.Pid != nil +} + +func (p *PartitionConfiguration) IsSetPrimary() bool { + return p.Primary != nil +} + +func (p *PartitionConfiguration) IsSetHpPrimary() bool { + return p.HpPrimary != nil +} + +func (p *PartitionConfiguration) IsSetHpSecondaries() bool { + return p.HpSecondaries != nil +} + +func (p *PartitionConfiguration) IsSetHpLastDrops() bool { + return p.HpLastDrops != nil +} + +func (p *PartitionConfiguration) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.LIST { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I64 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I32 { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.LIST { + if err := p.ReadField10(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.LIST { + if err := p.ReadField11(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *PartitionConfiguration) ReadField1(iprot thrift.TProtocol) error { + p.Pid = &base.Gpid{} + if err := p.Pid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err) + } + return nil +} + +func (p *PartitionConfiguration) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Ballot = v + } + return nil +} + +func (p *PartitionConfiguration) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.MaxReplicaCount = v + } + return nil +} + +func (p *PartitionConfiguration) ReadField4(iprot thrift.TProtocol) error { + p.Primary = &base.RPCAddress{} + if err := p.Primary.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Primary), err) + } + return nil +} + +func (p *PartitionConfiguration) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*base.RPCAddress, 0, size) + p.Secondaries = tSlice + for i := 0; i < size; i++ { + _elem0 := &base.RPCAddress{} + if err := _elem0.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Secondaries = append(p.Secondaries, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartitionConfiguration) ReadField6(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*base.RPCAddress, 0, size) + p.LastDrops = tSlice + for i := 0; i < size; i++ { + _elem1 := &base.RPCAddress{} + if err := _elem1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + } + p.LastDrops = append(p.LastDrops, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartitionConfiguration) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.LastCommittedDecree = v + } + return nil +} + +func (p *PartitionConfiguration) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.PartitionFlags = v + } + return nil +} + +func (p *PartitionConfiguration) ReadField9(iprot thrift.TProtocol) error { + p.HpPrimary = &base.HostPort{} + if err := p.HpPrimary.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HpPrimary), err) + } + return nil +} + +func (p *PartitionConfiguration) ReadField10(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*base.HostPort, 0, size) + p.HpSecondaries = tSlice + for i := 0; i < size; i++ { + _elem2 := &base.HostPort{} + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.HpSecondaries = append(p.HpSecondaries, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartitionConfiguration) ReadField11(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*base.HostPort, 0, size) + p.HpLastDrops = tSlice + for i := 0; i < size; i++ { + _elem3 := &base.HostPort{} + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.HpLastDrops = append(p.HpLastDrops, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartitionConfiguration) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("partition_configuration"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := p.writeField9(oprot); err != nil { + return err + } + if err := p.writeField10(oprot); err != nil { + return err + } + if err := p.writeField11(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 *PartitionConfiguration) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err) + } + if err := p.Pid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err) + } + return err +} + +func (p *PartitionConfiguration) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ballot", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ballot: ", p), err) + } + if err := oprot.WriteI64(int64(p.Ballot)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ballot (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ballot: ", p), err) + } + return err +} + +func (p *PartitionConfiguration) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("max_replica_count", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_replica_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxReplicaCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_replica_count (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_replica_count: ", p), err) + } + return err +} + +func (p *PartitionConfiguration) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("primary", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:primary: ", p), err) + } + if err := p.Primary.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Primary), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:primary: ", p), err) + } + return err +} + +func (p *PartitionConfiguration) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("secondaries", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:secondaries: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Secondaries)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Secondaries { + 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 5:secondaries: ", p), err) + } + return err +} + +func (p *PartitionConfiguration) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("last_drops", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:last_drops: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.LastDrops)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.LastDrops { + 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 6:last_drops: ", p), err) + } + return err +} + +func (p *PartitionConfiguration) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("last_committed_decree", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:last_committed_decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.LastCommittedDecree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_committed_decree (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:last_committed_decree: ", p), err) + } + return err +} + +func (p *PartitionConfiguration) writeField8(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_flags", thrift.I32, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:partition_flags: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionFlags)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_flags (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:partition_flags: ", p), err) + } + return err +} + +func (p *PartitionConfiguration) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetHpPrimary() { + if err := oprot.WriteFieldBegin("hp_primary", thrift.STRUCT, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:hp_primary: ", p), err) + } + if err := p.HpPrimary.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HpPrimary), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:hp_primary: ", p), err) + } + } + return err +} + +func (p *PartitionConfiguration) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetHpSecondaries() { + if err := oprot.WriteFieldBegin("hp_secondaries", thrift.LIST, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:hp_secondaries: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.HpSecondaries)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HpSecondaries { + 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 10:hp_secondaries: ", p), err) + } + } + return err +} + +func (p *PartitionConfiguration) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetHpLastDrops() { + if err := oprot.WriteFieldBegin("hp_last_drops", thrift.LIST, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:hp_last_drops: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.HpLastDrops)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HpLastDrops { + 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 11:hp_last_drops: ", p), err) + } + } + return err +} + +func (p *PartitionConfiguration) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartitionConfiguration(%+v)", *p) +} + +// Attributes: +// - AppName +// - PartitionIndices +type QueryCfgRequest struct { + AppName string `thrift:"app_name,1" db:"app_name" json:"app_name"` + PartitionIndices []int32 `thrift:"partition_indices,2" db:"partition_indices" json:"partition_indices"` +} + +func NewQueryCfgRequest() *QueryCfgRequest { + return &QueryCfgRequest{} +} + +func (p *QueryCfgRequest) GetAppName() string { + return p.AppName +} + +func (p *QueryCfgRequest) GetPartitionIndices() []int32 { + return p.PartitionIndices +} +func (p *QueryCfgRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryCfgRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *QueryCfgRequest) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int32, 0, size) + p.PartitionIndices = tSlice + for i := 0; i < size; i++ { + var _elem4 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem4 = v + } + p.PartitionIndices = append(p.PartitionIndices, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *QueryCfgRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_cfg_request"); 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 *QueryCfgRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_name: ", p), err) + } + return err +} + +func (p *QueryCfgRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_indices", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:partition_indices: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(p.PartitionIndices)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PartitionIndices { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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:partition_indices: ", p), err) + } + return err +} + +func (p *QueryCfgRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryCfgRequest(%+v)", *p) +} + +// Attributes: +// - Err +// - AppID +// - PartitionCount +// - IsStateful +// - Partitions +type QueryCfgResponse struct { + Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"` + AppID int32 `thrift:"app_id,2" db:"app_id" json:"app_id"` + PartitionCount int32 `thrift:"partition_count,3" db:"partition_count" json:"partition_count"` + IsStateful bool `thrift:"is_stateful,4" db:"is_stateful" json:"is_stateful"` + Partitions []*PartitionConfiguration `thrift:"partitions,5" db:"partitions" json:"partitions"` +} + +func NewQueryCfgResponse() *QueryCfgResponse { + return &QueryCfgResponse{} +} + +var QueryCfgResponse_Err_DEFAULT *base.ErrorCode + +func (p *QueryCfgResponse) GetErr() *base.ErrorCode { + if !p.IsSetErr() { + return QueryCfgResponse_Err_DEFAULT + } + return p.Err +} + +func (p *QueryCfgResponse) GetAppID() int32 { + return p.AppID +} + +func (p *QueryCfgResponse) GetPartitionCount() int32 { + return p.PartitionCount +} + +func (p *QueryCfgResponse) GetIsStateful() bool { + return p.IsStateful +} + +func (p *QueryCfgResponse) GetPartitions() []*PartitionConfiguration { + return p.Partitions +} +func (p *QueryCfgResponse) IsSetErr() bool { + return p.Err != nil +} + +func (p *QueryCfgResponse) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *QueryCfgResponse) ReadField1(iprot thrift.TProtocol) error { + p.Err = &base.ErrorCode{} + if err := p.Err.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) + } + return nil +} + +func (p *QueryCfgResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *QueryCfgResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.PartitionCount = v + } + return nil +} + +func (p *QueryCfgResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.IsStateful = v + } + return nil +} + +func (p *QueryCfgResponse) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartitionConfiguration, 0, size) + p.Partitions = tSlice + for i := 0; i < size; i++ { + _elem5 := &PartitionConfiguration{} + if err := _elem5.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) + } + p.Partitions = append(p.Partitions, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *QueryCfgResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_cfg_response"); 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 := p.writeField5(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 *QueryCfgResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) + } + if err := p.Err.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) + } + return err +} + +func (p *QueryCfgResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:app_id: ", p), err) + } + return err +} + +func (p *QueryCfgResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_count", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_count (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:partition_count: ", p), err) + } + return err +} + +func (p *QueryCfgResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_stateful", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:is_stateful: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsStateful)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_stateful (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:is_stateful: ", p), err) + } + return err +} + +func (p *QueryCfgResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partitions", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:partitions: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Partitions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Partitions { + 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 5:partitions: ", p), err) + } + return err +} + +func (p *QueryCfgResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryCfgResponse(%+v)", *p) +} + +// Attributes: +// - AppID +// - PartitionIndex +// - ClientTimeout +// - PartitionHash +// - IsBackupRequest +type RequestMeta struct { + AppID int32 `thrift:"app_id,1" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,2" db:"partition_index" json:"partition_index"` + ClientTimeout int32 `thrift:"client_timeout,3" db:"client_timeout" json:"client_timeout"` + PartitionHash int64 `thrift:"partition_hash,4" db:"partition_hash" json:"partition_hash"` + IsBackupRequest bool `thrift:"is_backup_request,5" db:"is_backup_request" json:"is_backup_request"` +} + +func NewRequestMeta() *RequestMeta { + return &RequestMeta{} +} + +func (p *RequestMeta) GetAppID() int32 { + return p.AppID +} + +func (p *RequestMeta) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *RequestMeta) GetClientTimeout() int32 { + return p.ClientTimeout +} + +func (p *RequestMeta) GetPartitionHash() int64 { + return p.PartitionHash +} + +func (p *RequestMeta) GetIsBackupRequest() bool { + return p.IsBackupRequest +} +func (p *RequestMeta) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RequestMeta) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *RequestMeta) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *RequestMeta) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ClientTimeout = v + } + return nil +} + +func (p *RequestMeta) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.PartitionHash = v + } + return nil +} + +func (p *RequestMeta) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.IsBackupRequest = v + } + return nil +} + +func (p *RequestMeta) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("request_meta"); 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 := p.writeField5(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 *RequestMeta) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_id: ", p), err) + } + return err +} + +func (p *RequestMeta) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:partition_index: ", p), err) + } + return err +} + +func (p *RequestMeta) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("client_timeout", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:client_timeout: ", p), err) + } + if err := oprot.WriteI32(int32(p.ClientTimeout)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_timeout (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:client_timeout: ", p), err) + } + return err +} + +func (p *RequestMeta) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_hash", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_hash: ", p), err) + } + if err := oprot.WriteI64(int64(p.PartitionHash)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_hash (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_hash: ", p), err) + } + return err +} + +func (p *RequestMeta) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_backup_request", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:is_backup_request: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsBackupRequest)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_backup_request (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:is_backup_request: ", p), err) + } + return err +} + +func (p *RequestMeta) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RequestMeta(%+v)", *p) +} + +// Attributes: +// - Status +// - AppType +// - AppName +// - AppID +// - PartitionCount +// - Envs +// - IsStateful +// - MaxReplicaCount +// - ExpireSecond +// - CreateSecond +// - DropSecond +// - Duplicating +// - InitPartitionCount +// - IsBulkLoading +type AppInfo struct { + Status AppStatus `thrift:"status,1" db:"status" json:"status"` + AppType string `thrift:"app_type,2" db:"app_type" json:"app_type"` + AppName string `thrift:"app_name,3" db:"app_name" json:"app_name"` + AppID int32 `thrift:"app_id,4" db:"app_id" json:"app_id"` + PartitionCount int32 `thrift:"partition_count,5" db:"partition_count" json:"partition_count"` + Envs map[string]string `thrift:"envs,6" db:"envs" json:"envs"` + IsStateful bool `thrift:"is_stateful,7" db:"is_stateful" json:"is_stateful"` + MaxReplicaCount int32 `thrift:"max_replica_count,8" db:"max_replica_count" json:"max_replica_count"` + ExpireSecond int64 `thrift:"expire_second,9" db:"expire_second" json:"expire_second"` + CreateSecond int64 `thrift:"create_second,10" db:"create_second" json:"create_second"` + DropSecond int64 `thrift:"drop_second,11" db:"drop_second" json:"drop_second"` + Duplicating bool `thrift:"duplicating,12" db:"duplicating" json:"duplicating"` + InitPartitionCount int32 `thrift:"init_partition_count,13" db:"init_partition_count" json:"init_partition_count"` + IsBulkLoading bool `thrift:"is_bulk_loading,14" db:"is_bulk_loading" json:"is_bulk_loading"` +} + +func NewAppInfo() *AppInfo { + return &AppInfo{ + Status: 0, + + InitPartitionCount: -1, + } +} + +func (p *AppInfo) GetStatus() AppStatus { + return p.Status +} + +func (p *AppInfo) GetAppType() string { + return p.AppType +} + +func (p *AppInfo) GetAppName() string { + return p.AppName +} + +func (p *AppInfo) GetAppID() int32 { + return p.AppID +} + +func (p *AppInfo) GetPartitionCount() int32 { + return p.PartitionCount +} + +func (p *AppInfo) GetEnvs() map[string]string { + return p.Envs +} + +func (p *AppInfo) GetIsStateful() bool { + return p.IsStateful +} + +func (p *AppInfo) GetMaxReplicaCount() int32 { + return p.MaxReplicaCount +} + +func (p *AppInfo) GetExpireSecond() int64 { + return p.ExpireSecond +} + +func (p *AppInfo) GetCreateSecond() int64 { + return p.CreateSecond +} + +func (p *AppInfo) GetDropSecond() int64 { + return p.DropSecond +} + +var AppInfo_Duplicating_DEFAULT bool = false + +func (p *AppInfo) GetDuplicating() bool { + return p.Duplicating +} + +func (p *AppInfo) GetInitPartitionCount() int32 { + return p.InitPartitionCount +} + +var AppInfo_IsBulkLoading_DEFAULT bool = false + +func (p *AppInfo) GetIsBulkLoading() bool { + return p.IsBulkLoading +} +func (p *AppInfo) IsSetDuplicating() bool { + return p.Duplicating != AppInfo_Duplicating_DEFAULT +} + +func (p *AppInfo) IsSetIsBulkLoading() bool { + return p.IsBulkLoading != AppInfo_IsBulkLoading_DEFAULT +} + +func (p *AppInfo) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.MAP { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I32 { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.I64 { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.I64 { + if err := p.ReadField10(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.I64 { + if err := p.ReadField11(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 12: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField12(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 13: + if fieldTypeId == thrift.I32 { + if err := p.ReadField13(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 14: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField14(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AppInfo) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := AppStatus(v) + p.Status = temp + } + return nil +} + +func (p *AppInfo) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.AppType = v + } + return nil +} + +func (p *AppInfo) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.AppName = v + } + return nil +} + +func (p *AppInfo) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *AppInfo) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.PartitionCount = v + } + return nil +} + +func (p *AppInfo) ReadField6(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Envs = tMap + for i := 0; i < size; i++ { + var _key6 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key6 = v + } + var _val7 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val7 = v + } + p.Envs[_key6] = _val7 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AppInfo) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.IsStateful = v + } + return nil +} + +func (p *AppInfo) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.MaxReplicaCount = v + } + return nil +} + +func (p *AppInfo) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.ExpireSecond = v + } + return nil +} + +func (p *AppInfo) ReadField10(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 10: ", err) + } else { + p.CreateSecond = v + } + return nil +} + +func (p *AppInfo) ReadField11(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 11: ", err) + } else { + p.DropSecond = v + } + return nil +} + +func (p *AppInfo) ReadField12(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 12: ", err) + } else { + p.Duplicating = v + } + return nil +} + +func (p *AppInfo) ReadField13(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 13: ", err) + } else { + p.InitPartitionCount = v + } + return nil +} + +func (p *AppInfo) ReadField14(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 14: ", err) + } else { + p.IsBulkLoading = v + } + return nil +} + +func (p *AppInfo) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("app_info"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := p.writeField9(oprot); err != nil { + return err + } + if err := p.writeField10(oprot); err != nil { + return err + } + if err := p.writeField11(oprot); err != nil { + return err + } + if err := p.writeField12(oprot); err != nil { + return err + } + if err := p.writeField13(oprot); err != nil { + return err + } + if err := p.writeField14(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 *AppInfo) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err +} + +func (p *AppInfo) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_type", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:app_type: ", p), err) + } + if err := oprot.WriteString(string(p.AppType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:app_type: ", p), err) + } + return err +} + +func (p *AppInfo) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_name: ", p), err) + } + if err := oprot.WriteString(string(p.AppName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_name: ", p), err) + } + return err +} + +func (p *AppInfo) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:app_id: ", p), err) + } + return err +} + +func (p *AppInfo) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_count", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_count (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:partition_count: ", p), err) + } + return err +} + +func (p *AppInfo) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("envs", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:envs: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Envs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Envs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:envs: ", p), err) + } + return err +} + +func (p *AppInfo) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_stateful", thrift.BOOL, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:is_stateful: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsStateful)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_stateful (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:is_stateful: ", p), err) + } + return err +} + +func (p *AppInfo) writeField8(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("max_replica_count", thrift.I32, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:max_replica_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxReplicaCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_replica_count (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:max_replica_count: ", p), err) + } + return err +} + +func (p *AppInfo) writeField9(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("expire_second", thrift.I64, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:expire_second: ", p), err) + } + if err := oprot.WriteI64(int64(p.ExpireSecond)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expire_second (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:expire_second: ", p), err) + } + return err +} + +func (p *AppInfo) writeField10(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("create_second", thrift.I64, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:create_second: ", p), err) + } + if err := oprot.WriteI64(int64(p.CreateSecond)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_second (10) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:create_second: ", p), err) + } + return err +} + +func (p *AppInfo) writeField11(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("drop_second", thrift.I64, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:drop_second: ", p), err) + } + if err := oprot.WriteI64(int64(p.DropSecond)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.drop_second (11) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:drop_second: ", p), err) + } + return err +} + +func (p *AppInfo) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetDuplicating() { + if err := oprot.WriteFieldBegin("duplicating", thrift.BOOL, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:duplicating: ", p), err) + } + if err := oprot.WriteBool(bool(p.Duplicating)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.duplicating (12) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:duplicating: ", p), err) + } + } + return err +} + +func (p *AppInfo) writeField13(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("init_partition_count", thrift.I32, 13); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:init_partition_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.InitPartitionCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.init_partition_count (13) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 13:init_partition_count: ", p), err) + } + return err +} + +func (p *AppInfo) writeField14(oprot thrift.TProtocol) (err error) { + if p.IsSetIsBulkLoading() { + if err := oprot.WriteFieldBegin("is_bulk_loading", thrift.BOOL, 14); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 14:is_bulk_loading: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsBulkLoading)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_bulk_loading (14) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 14:is_bulk_loading: ", p), err) + } + } + return err +} + +func (p *AppInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AppInfo(%+v)", *p) +} diff --git a/go-client/idl/rrdb/GoUnusedProtection__.go b/go-client/idl/rrdb/GoUnusedProtection__.go new file mode 100644 index 0000000000..ba179697d3 --- /dev/null +++ b/go-client/idl/rrdb/GoUnusedProtection__.go @@ -0,0 +1,6 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package rrdb + +var GoUnusedProtection__ int diff --git a/go-client/idl/rrdb/meta-remote/meta-remote.go b/go-client/idl/rrdb/meta-remote/meta-remote.go new file mode 100755 index 0000000000..af4fe0b133 --- /dev/null +++ b/go-client/idl/rrdb/meta-remote/meta-remote.go @@ -0,0 +1,183 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package main + +import ( + "context" + "flag" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/incubator-pegasus/go-client/idl/rrdb" + "github.com/apache/thrift/lib/go/thrift" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" +) + +var _ = replication.GoUnusedProtection__ +var _ = base.GoUnusedProtection__ +var _ = rrdb.GoUnusedProtection__ + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " query_cfg_response query_cfg(query_cfg_request query)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + headers := make(httpHeaders) + var parsedUrl *url.URL + var trans thrift.TTransport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host and port") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") + flag.Parse() + + if len(urlString) > 0 { + var err error + parsedUrl, err = url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr)) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewTFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.TProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewTCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewTSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewTJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewTBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := rrdb.NewMetaClient(thrift.NewTStandardClient(iprot, oprot)) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "query_cfg": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "QueryCfg requires 1 args") + flag.Usage() + } + arg128 := flag.Arg(1) + mbTrans129 := thrift.NewTMemoryBufferLen(len(arg128)) + defer mbTrans129.Close() + _, err130 := mbTrans129.WriteString(arg128) + if err130 != nil { + Usage() + return + } + factory131 := thrift.NewTJSONProtocolFactory() + jsProt132 := factory131.GetProtocol(mbTrans129) + argvalue0 := replication.NewQueryCfgRequest() + err133 := argvalue0.Read(jsProt132) + if err133 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.QueryCfg(context.Background(), value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/go-client/idl/rrdb/rrdb-consts.go b/go-client/idl/rrdb/rrdb-consts.go new file mode 100644 index 0000000000..a888b636ff --- /dev/null +++ b/go-client/idl/rrdb/rrdb-consts.go @@ -0,0 +1,27 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package rrdb + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = replication.GoUnusedProtection__ +var _ = base.GoUnusedProtection__ + +func init() { +} diff --git a/go-client/idl/rrdb/rrdb-remote/rrdb-remote.go b/go-client/idl/rrdb/rrdb-remote/rrdb-remote.go new file mode 100755 index 0000000000..a74084a45a --- /dev/null +++ b/go-client/idl/rrdb/rrdb-remote/rrdb-remote.go @@ -0,0 +1,536 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package main + +import ( + "context" + "flag" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/incubator-pegasus/go-client/idl/rrdb" + "github.com/apache/thrift/lib/go/thrift" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" +) + +var _ = replication.GoUnusedProtection__ +var _ = base.GoUnusedProtection__ +var _ = rrdb.GoUnusedProtection__ + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " update_response put(update_request update)") + fmt.Fprintln(os.Stderr, " update_response multi_put(multi_put_request request)") + fmt.Fprintln(os.Stderr, " update_response remove(blob key)") + fmt.Fprintln(os.Stderr, " multi_remove_response multi_remove(multi_remove_request request)") + fmt.Fprintln(os.Stderr, " incr_response incr(incr_request request)") + fmt.Fprintln(os.Stderr, " check_and_set_response check_and_set(check_and_set_request request)") + fmt.Fprintln(os.Stderr, " check_and_mutate_response check_and_mutate(check_and_mutate_request request)") + fmt.Fprintln(os.Stderr, " read_response get(blob key)") + fmt.Fprintln(os.Stderr, " multi_get_response multi_get(multi_get_request request)") + fmt.Fprintln(os.Stderr, " batch_get_response batch_get(batch_get_request request)") + fmt.Fprintln(os.Stderr, " count_response sortkey_count(blob hash_key)") + fmt.Fprintln(os.Stderr, " ttl_response ttl(blob key)") + fmt.Fprintln(os.Stderr, " scan_response get_scanner(get_scanner_request request)") + fmt.Fprintln(os.Stderr, " scan_response scan(scan_request request)") + fmt.Fprintln(os.Stderr, " void clear_scanner(i64 context_id)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + headers := make(httpHeaders) + var parsedUrl *url.URL + var trans thrift.TTransport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host and port") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") + flag.Parse() + + if len(urlString) > 0 { + var err error + parsedUrl, err = url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr)) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewTFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.TProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewTCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewTSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewTJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewTBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := rrdb.NewRrdbClient(thrift.NewTStandardClient(iprot, oprot)) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "put": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "Put requires 1 args") + flag.Usage() + } + arg39 := flag.Arg(1) + mbTrans40 := thrift.NewTMemoryBufferLen(len(arg39)) + defer mbTrans40.Close() + _, err41 := mbTrans40.WriteString(arg39) + if err41 != nil { + Usage() + return + } + factory42 := thrift.NewTJSONProtocolFactory() + jsProt43 := factory42.GetProtocol(mbTrans40) + argvalue0 := rrdb.NewUpdateRequest() + err44 := argvalue0.Read(jsProt43) + if err44 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Put(context.Background(), value0)) + fmt.Print("\n") + break + case "multi_put": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "MultiPut requires 1 args") + flag.Usage() + } + arg45 := flag.Arg(1) + mbTrans46 := thrift.NewTMemoryBufferLen(len(arg45)) + defer mbTrans46.Close() + _, err47 := mbTrans46.WriteString(arg45) + if err47 != nil { + Usage() + return + } + factory48 := thrift.NewTJSONProtocolFactory() + jsProt49 := factory48.GetProtocol(mbTrans46) + argvalue0 := rrdb.NewMultiPutRequest() + err50 := argvalue0.Read(jsProt49) + if err50 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiPut(context.Background(), value0)) + fmt.Print("\n") + break + case "remove": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "Remove requires 1 args") + flag.Usage() + } + arg51 := flag.Arg(1) + mbTrans52 := thrift.NewTMemoryBufferLen(len(arg51)) + defer mbTrans52.Close() + _, err53 := mbTrans52.WriteString(arg51) + if err53 != nil { + Usage() + return + } + factory54 := thrift.NewTJSONProtocolFactory() + jsProt55 := factory54.GetProtocol(mbTrans52) + argvalue0 := base.NewBlob() + err56 := argvalue0.Read(jsProt55) + if err56 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Remove(context.Background(), value0)) + fmt.Print("\n") + break + case "multi_remove": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "MultiRemove requires 1 args") + flag.Usage() + } + arg57 := flag.Arg(1) + mbTrans58 := thrift.NewTMemoryBufferLen(len(arg57)) + defer mbTrans58.Close() + _, err59 := mbTrans58.WriteString(arg57) + if err59 != nil { + Usage() + return + } + factory60 := thrift.NewTJSONProtocolFactory() + jsProt61 := factory60.GetProtocol(mbTrans58) + argvalue0 := rrdb.NewMultiRemoveRequest() + err62 := argvalue0.Read(jsProt61) + if err62 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiRemove(context.Background(), value0)) + fmt.Print("\n") + break + case "incr": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "Incr requires 1 args") + flag.Usage() + } + arg63 := flag.Arg(1) + mbTrans64 := thrift.NewTMemoryBufferLen(len(arg63)) + defer mbTrans64.Close() + _, err65 := mbTrans64.WriteString(arg63) + if err65 != nil { + Usage() + return + } + factory66 := thrift.NewTJSONProtocolFactory() + jsProt67 := factory66.GetProtocol(mbTrans64) + argvalue0 := rrdb.NewIncrRequest() + err68 := argvalue0.Read(jsProt67) + if err68 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Incr(context.Background(), value0)) + fmt.Print("\n") + break + case "check_and_set": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "CheckAndSet requires 1 args") + flag.Usage() + } + arg69 := flag.Arg(1) + mbTrans70 := thrift.NewTMemoryBufferLen(len(arg69)) + defer mbTrans70.Close() + _, err71 := mbTrans70.WriteString(arg69) + if err71 != nil { + Usage() + return + } + factory72 := thrift.NewTJSONProtocolFactory() + jsProt73 := factory72.GetProtocol(mbTrans70) + argvalue0 := rrdb.NewCheckAndSetRequest() + err74 := argvalue0.Read(jsProt73) + if err74 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CheckAndSet(context.Background(), value0)) + fmt.Print("\n") + break + case "check_and_mutate": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "CheckAndMutate requires 1 args") + flag.Usage() + } + arg75 := flag.Arg(1) + mbTrans76 := thrift.NewTMemoryBufferLen(len(arg75)) + defer mbTrans76.Close() + _, err77 := mbTrans76.WriteString(arg75) + if err77 != nil { + Usage() + return + } + factory78 := thrift.NewTJSONProtocolFactory() + jsProt79 := factory78.GetProtocol(mbTrans76) + argvalue0 := rrdb.NewCheckAndMutateRequest() + err80 := argvalue0.Read(jsProt79) + if err80 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CheckAndMutate(context.Background(), value0)) + fmt.Print("\n") + break + case "get": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "Get requires 1 args") + flag.Usage() + } + arg81 := flag.Arg(1) + mbTrans82 := thrift.NewTMemoryBufferLen(len(arg81)) + defer mbTrans82.Close() + _, err83 := mbTrans82.WriteString(arg81) + if err83 != nil { + Usage() + return + } + factory84 := thrift.NewTJSONProtocolFactory() + jsProt85 := factory84.GetProtocol(mbTrans82) + argvalue0 := base.NewBlob() + err86 := argvalue0.Read(jsProt85) + if err86 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Get(context.Background(), value0)) + fmt.Print("\n") + break + case "multi_get": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "MultiGet requires 1 args") + flag.Usage() + } + arg87 := flag.Arg(1) + mbTrans88 := thrift.NewTMemoryBufferLen(len(arg87)) + defer mbTrans88.Close() + _, err89 := mbTrans88.WriteString(arg87) + if err89 != nil { + Usage() + return + } + factory90 := thrift.NewTJSONProtocolFactory() + jsProt91 := factory90.GetProtocol(mbTrans88) + argvalue0 := rrdb.NewMultiGetRequest() + err92 := argvalue0.Read(jsProt91) + if err92 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiGet(context.Background(), value0)) + fmt.Print("\n") + break + case "batch_get": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "BatchGet requires 1 args") + flag.Usage() + } + arg93 := flag.Arg(1) + mbTrans94 := thrift.NewTMemoryBufferLen(len(arg93)) + defer mbTrans94.Close() + _, err95 := mbTrans94.WriteString(arg93) + if err95 != nil { + Usage() + return + } + factory96 := thrift.NewTJSONProtocolFactory() + jsProt97 := factory96.GetProtocol(mbTrans94) + argvalue0 := rrdb.NewBatchGetRequest() + err98 := argvalue0.Read(jsProt97) + if err98 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.BatchGet(context.Background(), value0)) + fmt.Print("\n") + break + case "sortkey_count": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "SortkeyCount requires 1 args") + flag.Usage() + } + arg99 := flag.Arg(1) + mbTrans100 := thrift.NewTMemoryBufferLen(len(arg99)) + defer mbTrans100.Close() + _, err101 := mbTrans100.WriteString(arg99) + if err101 != nil { + Usage() + return + } + factory102 := thrift.NewTJSONProtocolFactory() + jsProt103 := factory102.GetProtocol(mbTrans100) + argvalue0 := base.NewBlob() + err104 := argvalue0.Read(jsProt103) + if err104 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SortkeyCount(context.Background(), value0)) + fmt.Print("\n") + break + case "ttl": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "TTL requires 1 args") + flag.Usage() + } + arg105 := flag.Arg(1) + mbTrans106 := thrift.NewTMemoryBufferLen(len(arg105)) + defer mbTrans106.Close() + _, err107 := mbTrans106.WriteString(arg105) + if err107 != nil { + Usage() + return + } + factory108 := thrift.NewTJSONProtocolFactory() + jsProt109 := factory108.GetProtocol(mbTrans106) + argvalue0 := base.NewBlob() + err110 := argvalue0.Read(jsProt109) + if err110 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.TTL(context.Background(), value0)) + fmt.Print("\n") + break + case "get_scanner": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "GetScanner requires 1 args") + flag.Usage() + } + arg111 := flag.Arg(1) + mbTrans112 := thrift.NewTMemoryBufferLen(len(arg111)) + defer mbTrans112.Close() + _, err113 := mbTrans112.WriteString(arg111) + if err113 != nil { + Usage() + return + } + factory114 := thrift.NewTJSONProtocolFactory() + jsProt115 := factory114.GetProtocol(mbTrans112) + argvalue0 := rrdb.NewGetScannerRequest() + err116 := argvalue0.Read(jsProt115) + if err116 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetScanner(context.Background(), value0)) + fmt.Print("\n") + break + case "scan": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "Scan requires 1 args") + flag.Usage() + } + arg117 := flag.Arg(1) + mbTrans118 := thrift.NewTMemoryBufferLen(len(arg117)) + defer mbTrans118.Close() + _, err119 := mbTrans118.WriteString(arg117) + if err119 != nil { + Usage() + return + } + factory120 := thrift.NewTJSONProtocolFactory() + jsProt121 := factory120.GetProtocol(mbTrans118) + argvalue0 := rrdb.NewScanRequest() + err122 := argvalue0.Read(jsProt121) + if err122 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Scan(context.Background(), value0)) + fmt.Print("\n") + break + case "clear_scanner": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "ClearScanner requires 1 args") + flag.Usage() + } + argvalue0, err123 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err123 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ClearScanner(context.Background(), value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/go-client/idl/rrdb/rrdb.go b/go-client/idl/rrdb/rrdb.go new file mode 100644 index 0000000000..31782bc3be --- /dev/null +++ b/go-client/idl/rrdb/rrdb.go @@ -0,0 +1,12123 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package rrdb + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "github.com/apache/incubator-pegasus/go-client/idl/base" + "github.com/apache/incubator-pegasus/go-client/idl/replication" + "github.com/apache/thrift/lib/go/thrift" + "reflect" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = replication.GoUnusedProtection__ +var _ = base.GoUnusedProtection__ + +type FilterType int64 + +const ( + FilterType_FT_NO_FILTER FilterType = 0 + FilterType_FT_MATCH_ANYWHERE FilterType = 1 + FilterType_FT_MATCH_PREFIX FilterType = 2 + FilterType_FT_MATCH_POSTFIX FilterType = 3 +) + +func (p FilterType) String() string { + switch p { + case FilterType_FT_NO_FILTER: + return "FT_NO_FILTER" + case FilterType_FT_MATCH_ANYWHERE: + return "FT_MATCH_ANYWHERE" + case FilterType_FT_MATCH_PREFIX: + return "FT_MATCH_PREFIX" + case FilterType_FT_MATCH_POSTFIX: + return "FT_MATCH_POSTFIX" + } + return "" +} + +func FilterTypeFromString(s string) (FilterType, error) { + switch s { + case "FT_NO_FILTER": + return FilterType_FT_NO_FILTER, nil + case "FT_MATCH_ANYWHERE": + return FilterType_FT_MATCH_ANYWHERE, nil + case "FT_MATCH_PREFIX": + return FilterType_FT_MATCH_PREFIX, nil + case "FT_MATCH_POSTFIX": + return FilterType_FT_MATCH_POSTFIX, nil + } + return FilterType(0), fmt.Errorf("not a valid FilterType string") +} + +func FilterTypePtr(v FilterType) *FilterType { return &v } + +func (p FilterType) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *FilterType) UnmarshalText(text []byte) error { + q, err := FilterTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *FilterType) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = FilterType(v) + return nil +} + +func (p *FilterType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type CasCheckType int64 + +const ( + CasCheckType_CT_NO_CHECK CasCheckType = 0 + CasCheckType_CT_VALUE_NOT_EXIST CasCheckType = 1 + CasCheckType_CT_VALUE_NOT_EXIST_OR_EMPTY CasCheckType = 2 + CasCheckType_CT_VALUE_EXIST CasCheckType = 3 + CasCheckType_CT_VALUE_NOT_EMPTY CasCheckType = 4 + CasCheckType_CT_VALUE_MATCH_ANYWHERE CasCheckType = 5 + CasCheckType_CT_VALUE_MATCH_PREFIX CasCheckType = 6 + CasCheckType_CT_VALUE_MATCH_POSTFIX CasCheckType = 7 + CasCheckType_CT_VALUE_BYTES_LESS CasCheckType = 8 + CasCheckType_CT_VALUE_BYTES_LESS_OR_EQUAL CasCheckType = 9 + CasCheckType_CT_VALUE_BYTES_EQUAL CasCheckType = 10 + CasCheckType_CT_VALUE_BYTES_GREATER_OR_EQUAL CasCheckType = 11 + CasCheckType_CT_VALUE_BYTES_GREATER CasCheckType = 12 + CasCheckType_CT_VALUE_INT_LESS CasCheckType = 13 + CasCheckType_CT_VALUE_INT_LESS_OR_EQUAL CasCheckType = 14 + CasCheckType_CT_VALUE_INT_EQUAL CasCheckType = 15 + CasCheckType_CT_VALUE_INT_GREATER_OR_EQUAL CasCheckType = 16 + CasCheckType_CT_VALUE_INT_GREATER CasCheckType = 17 +) + +func (p CasCheckType) String() string { + switch p { + case CasCheckType_CT_NO_CHECK: + return "CT_NO_CHECK" + case CasCheckType_CT_VALUE_NOT_EXIST: + return "CT_VALUE_NOT_EXIST" + case CasCheckType_CT_VALUE_NOT_EXIST_OR_EMPTY: + return "CT_VALUE_NOT_EXIST_OR_EMPTY" + case CasCheckType_CT_VALUE_EXIST: + return "CT_VALUE_EXIST" + case CasCheckType_CT_VALUE_NOT_EMPTY: + return "CT_VALUE_NOT_EMPTY" + case CasCheckType_CT_VALUE_MATCH_ANYWHERE: + return "CT_VALUE_MATCH_ANYWHERE" + case CasCheckType_CT_VALUE_MATCH_PREFIX: + return "CT_VALUE_MATCH_PREFIX" + case CasCheckType_CT_VALUE_MATCH_POSTFIX: + return "CT_VALUE_MATCH_POSTFIX" + case CasCheckType_CT_VALUE_BYTES_LESS: + return "CT_VALUE_BYTES_LESS" + case CasCheckType_CT_VALUE_BYTES_LESS_OR_EQUAL: + return "CT_VALUE_BYTES_LESS_OR_EQUAL" + case CasCheckType_CT_VALUE_BYTES_EQUAL: + return "CT_VALUE_BYTES_EQUAL" + case CasCheckType_CT_VALUE_BYTES_GREATER_OR_EQUAL: + return "CT_VALUE_BYTES_GREATER_OR_EQUAL" + case CasCheckType_CT_VALUE_BYTES_GREATER: + return "CT_VALUE_BYTES_GREATER" + case CasCheckType_CT_VALUE_INT_LESS: + return "CT_VALUE_INT_LESS" + case CasCheckType_CT_VALUE_INT_LESS_OR_EQUAL: + return "CT_VALUE_INT_LESS_OR_EQUAL" + case CasCheckType_CT_VALUE_INT_EQUAL: + return "CT_VALUE_INT_EQUAL" + case CasCheckType_CT_VALUE_INT_GREATER_OR_EQUAL: + return "CT_VALUE_INT_GREATER_OR_EQUAL" + case CasCheckType_CT_VALUE_INT_GREATER: + return "CT_VALUE_INT_GREATER" + } + return "" +} + +func CasCheckTypeFromString(s string) (CasCheckType, error) { + switch s { + case "CT_NO_CHECK": + return CasCheckType_CT_NO_CHECK, nil + case "CT_VALUE_NOT_EXIST": + return CasCheckType_CT_VALUE_NOT_EXIST, nil + case "CT_VALUE_NOT_EXIST_OR_EMPTY": + return CasCheckType_CT_VALUE_NOT_EXIST_OR_EMPTY, nil + case "CT_VALUE_EXIST": + return CasCheckType_CT_VALUE_EXIST, nil + case "CT_VALUE_NOT_EMPTY": + return CasCheckType_CT_VALUE_NOT_EMPTY, nil + case "CT_VALUE_MATCH_ANYWHERE": + return CasCheckType_CT_VALUE_MATCH_ANYWHERE, nil + case "CT_VALUE_MATCH_PREFIX": + return CasCheckType_CT_VALUE_MATCH_PREFIX, nil + case "CT_VALUE_MATCH_POSTFIX": + return CasCheckType_CT_VALUE_MATCH_POSTFIX, nil + case "CT_VALUE_BYTES_LESS": + return CasCheckType_CT_VALUE_BYTES_LESS, nil + case "CT_VALUE_BYTES_LESS_OR_EQUAL": + return CasCheckType_CT_VALUE_BYTES_LESS_OR_EQUAL, nil + case "CT_VALUE_BYTES_EQUAL": + return CasCheckType_CT_VALUE_BYTES_EQUAL, nil + case "CT_VALUE_BYTES_GREATER_OR_EQUAL": + return CasCheckType_CT_VALUE_BYTES_GREATER_OR_EQUAL, nil + case "CT_VALUE_BYTES_GREATER": + return CasCheckType_CT_VALUE_BYTES_GREATER, nil + case "CT_VALUE_INT_LESS": + return CasCheckType_CT_VALUE_INT_LESS, nil + case "CT_VALUE_INT_LESS_OR_EQUAL": + return CasCheckType_CT_VALUE_INT_LESS_OR_EQUAL, nil + case "CT_VALUE_INT_EQUAL": + return CasCheckType_CT_VALUE_INT_EQUAL, nil + case "CT_VALUE_INT_GREATER_OR_EQUAL": + return CasCheckType_CT_VALUE_INT_GREATER_OR_EQUAL, nil + case "CT_VALUE_INT_GREATER": + return CasCheckType_CT_VALUE_INT_GREATER, nil + } + return CasCheckType(0), fmt.Errorf("not a valid CasCheckType string") +} + +func CasCheckTypePtr(v CasCheckType) *CasCheckType { return &v } + +func (p CasCheckType) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *CasCheckType) UnmarshalText(text []byte) error { + q, err := CasCheckTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *CasCheckType) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = CasCheckType(v) + return nil +} + +func (p *CasCheckType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type MutateOperation int64 + +const ( + MutateOperation_MO_PUT MutateOperation = 0 + MutateOperation_MO_DELETE MutateOperation = 1 +) + +func (p MutateOperation) String() string { + switch p { + case MutateOperation_MO_PUT: + return "MO_PUT" + case MutateOperation_MO_DELETE: + return "MO_DELETE" + } + return "" +} + +func MutateOperationFromString(s string) (MutateOperation, error) { + switch s { + case "MO_PUT": + return MutateOperation_MO_PUT, nil + case "MO_DELETE": + return MutateOperation_MO_DELETE, nil + } + return MutateOperation(0), fmt.Errorf("not a valid MutateOperation string") +} + +func MutateOperationPtr(v MutateOperation) *MutateOperation { return &v } + +func (p MutateOperation) MarshalText() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *MutateOperation) UnmarshalText(text []byte) error { + q, err := MutateOperationFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil +} + +func (p *MutateOperation) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = MutateOperation(v) + return nil +} + +func (p *MutateOperation) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +// Attributes: +// - Key +// - Value +// - ExpireTsSeconds +type UpdateRequest struct { + Key *base.Blob `thrift:"key,1" db:"key" json:"key"` + Value *base.Blob `thrift:"value,2" db:"value" json:"value"` + ExpireTsSeconds int32 `thrift:"expire_ts_seconds,3" db:"expire_ts_seconds" json:"expire_ts_seconds"` +} + +func NewUpdateRequest() *UpdateRequest { + return &UpdateRequest{} +} + +var UpdateRequest_Key_DEFAULT *base.Blob + +func (p *UpdateRequest) GetKey() *base.Blob { + if !p.IsSetKey() { + return UpdateRequest_Key_DEFAULT + } + return p.Key +} + +var UpdateRequest_Value_DEFAULT *base.Blob + +func (p *UpdateRequest) GetValue() *base.Blob { + if !p.IsSetValue() { + return UpdateRequest_Value_DEFAULT + } + return p.Value +} + +func (p *UpdateRequest) GetExpireTsSeconds() int32 { + return p.ExpireTsSeconds +} +func (p *UpdateRequest) IsSetKey() bool { + return p.Key != nil +} + +func (p *UpdateRequest) IsSetValue() bool { + return p.Value != nil +} + +func (p *UpdateRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *UpdateRequest) ReadField1(iprot thrift.TProtocol) error { + p.Key = &base.Blob{} + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *UpdateRequest) ReadField2(iprot thrift.TProtocol) error { + p.Value = &base.Blob{} + if err := p.Value.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *UpdateRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ExpireTsSeconds = v + } + return nil +} + +func (p *UpdateRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("update_request"); 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 := 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 *UpdateRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) + } + if err := p.Key.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) + } + return err +} + +func (p *UpdateRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) + } + if err := p.Value.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) + } + return err +} + +func (p *UpdateRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("expire_ts_seconds", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:expire_ts_seconds: ", p), err) + } + if err := oprot.WriteI32(int32(p.ExpireTsSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expire_ts_seconds (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:expire_ts_seconds: ", p), err) + } + return err +} + +func (p *UpdateRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateRequest(%+v)", *p) +} + +// Attributes: +// - Error +// - AppID +// - PartitionIndex +// - Decree +// - Server +type UpdateResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + AppID int32 `thrift:"app_id,2" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,3" db:"partition_index" json:"partition_index"` + Decree int64 `thrift:"decree,4" db:"decree" json:"decree"` + Server string `thrift:"server,5" db:"server" json:"server"` +} + +func NewUpdateResponse() *UpdateResponse { + return &UpdateResponse{} +} + +func (p *UpdateResponse) GetError() int32 { + return p.Error +} + +func (p *UpdateResponse) GetAppID() int32 { + return p.AppID +} + +func (p *UpdateResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *UpdateResponse) GetDecree() int64 { + return p.Decree +} + +func (p *UpdateResponse) GetServer() string { + return p.Server +} +func (p *UpdateResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *UpdateResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *UpdateResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *UpdateResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *UpdateResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Decree = v + } + return nil +} + +func (p *UpdateResponse) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *UpdateResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("update_response"); 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 := p.writeField5(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 *UpdateResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *UpdateResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:app_id: ", p), err) + } + return err +} + +func (p *UpdateResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:partition_index: ", p), err) + } + return err +} + +func (p *UpdateResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("decree", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.Decree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.decree (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:decree: ", p), err) + } + return err +} + +func (p *UpdateResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:server: ", p), err) + } + return err +} + +func (p *UpdateResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateResponse(%+v)", *p) +} + +// Attributes: +// - Error +// - Value +// - AppID +// - PartitionIndex +// - Server +type ReadResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + Value *base.Blob `thrift:"value,2" db:"value" json:"value"` + AppID int32 `thrift:"app_id,3" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,4" db:"partition_index" json:"partition_index"` + // unused field # 5 + Server string `thrift:"server,6" db:"server" json:"server"` +} + +func NewReadResponse() *ReadResponse { + return &ReadResponse{} +} + +func (p *ReadResponse) GetError() int32 { + return p.Error +} + +var ReadResponse_Value_DEFAULT *base.Blob + +func (p *ReadResponse) GetValue() *base.Blob { + if !p.IsSetValue() { + return ReadResponse_Value_DEFAULT + } + return p.Value +} + +func (p *ReadResponse) GetAppID() int32 { + return p.AppID +} + +func (p *ReadResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *ReadResponse) GetServer() string { + return p.Server +} +func (p *ReadResponse) IsSetValue() bool { + return p.Value != nil +} + +func (p *ReadResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *ReadResponse) ReadField2(iprot thrift.TProtocol) error { + p.Value = &base.Blob{} + if err := p.Value.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *ReadResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *ReadResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *ReadResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *ReadResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("read_response"); 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 := p.writeField6(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 *ReadResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *ReadResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) + } + if err := p.Value.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) + } + return err +} + +func (p *ReadResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err) + } + return err +} + +func (p *ReadResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err) + } + return err +} + +func (p *ReadResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err) + } + return err +} + +func (p *ReadResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadResponse(%+v)", *p) +} + +// Attributes: +// - Error +// - TTLSeconds +// - AppID +// - PartitionIndex +// - Server +type TTLResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + TTLSeconds int32 `thrift:"ttl_seconds,2" db:"ttl_seconds" json:"ttl_seconds"` + AppID int32 `thrift:"app_id,3" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,4" db:"partition_index" json:"partition_index"` + // unused field # 5 + Server string `thrift:"server,6" db:"server" json:"server"` +} + +func NewTTLResponse() *TTLResponse { + return &TTLResponse{} +} + +func (p *TTLResponse) GetError() int32 { + return p.Error +} + +func (p *TTLResponse) GetTTLSeconds() int32 { + return p.TTLSeconds +} + +func (p *TTLResponse) GetAppID() int32 { + return p.AppID +} + +func (p *TTLResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *TTLResponse) GetServer() string { + return p.Server +} +func (p *TTLResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *TTLResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *TTLResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TTLSeconds = v + } + return nil +} + +func (p *TTLResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *TTLResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *TTLResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *TTLResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ttl_response"); 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 := p.writeField6(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 *TTLResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *TTLResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ttl_seconds", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ttl_seconds: ", p), err) + } + if err := oprot.WriteI32(int32(p.TTLSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_seconds (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ttl_seconds: ", p), err) + } + return err +} + +func (p *TTLResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err) + } + return err +} + +func (p *TTLResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err) + } + return err +} + +func (p *TTLResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err) + } + return err +} + +func (p *TTLResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TTLResponse(%+v)", *p) +} + +// Attributes: +// - Error +// - Count +// - AppID +// - PartitionIndex +// - Server +type CountResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + Count int64 `thrift:"count,2" db:"count" json:"count"` + AppID int32 `thrift:"app_id,3" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,4" db:"partition_index" json:"partition_index"` + // unused field # 5 + Server string `thrift:"server,6" db:"server" json:"server"` +} + +func NewCountResponse() *CountResponse { + return &CountResponse{} +} + +func (p *CountResponse) GetError() int32 { + return p.Error +} + +func (p *CountResponse) GetCount() int64 { + return p.Count +} + +func (p *CountResponse) GetAppID() int32 { + return p.AppID +} + +func (p *CountResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *CountResponse) GetServer() string { + return p.Server +} +func (p *CountResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *CountResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *CountResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Count = v + } + return nil +} + +func (p *CountResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *CountResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *CountResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *CountResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("count_response"); 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 := p.writeField6(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 *CountResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *CountResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("count", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:count: ", p), err) + } + if err := oprot.WriteI64(int64(p.Count)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:count: ", p), err) + } + return err +} + +func (p *CountResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err) + } + return err +} + +func (p *CountResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err) + } + return err +} + +func (p *CountResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err) + } + return err +} + +func (p *CountResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CountResponse(%+v)", *p) +} + +// Attributes: +// - Key +// - Value +// - ExpireTsSeconds +type KeyValue struct { + Key *base.Blob `thrift:"key,1" db:"key" json:"key"` + Value *base.Blob `thrift:"value,2" db:"value" json:"value"` + ExpireTsSeconds *int32 `thrift:"expire_ts_seconds,3" db:"expire_ts_seconds" json:"expire_ts_seconds,omitempty"` +} + +func NewKeyValue() *KeyValue { + return &KeyValue{} +} + +var KeyValue_Key_DEFAULT *base.Blob + +func (p *KeyValue) GetKey() *base.Blob { + if !p.IsSetKey() { + return KeyValue_Key_DEFAULT + } + return p.Key +} + +var KeyValue_Value_DEFAULT *base.Blob + +func (p *KeyValue) GetValue() *base.Blob { + if !p.IsSetValue() { + return KeyValue_Value_DEFAULT + } + return p.Value +} + +var KeyValue_ExpireTsSeconds_DEFAULT int32 + +func (p *KeyValue) GetExpireTsSeconds() int32 { + if !p.IsSetExpireTsSeconds() { + return KeyValue_ExpireTsSeconds_DEFAULT + } + return *p.ExpireTsSeconds +} +func (p *KeyValue) IsSetKey() bool { + return p.Key != nil +} + +func (p *KeyValue) IsSetValue() bool { + return p.Value != nil +} + +func (p *KeyValue) IsSetExpireTsSeconds() bool { + return p.ExpireTsSeconds != nil +} + +func (p *KeyValue) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *KeyValue) ReadField1(iprot thrift.TProtocol) error { + p.Key = &base.Blob{} + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *KeyValue) ReadField2(iprot thrift.TProtocol) error { + p.Value = &base.Blob{} + if err := p.Value.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *KeyValue) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ExpireTsSeconds = &v + } + return nil +} + +func (p *KeyValue) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("key_value"); 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 := 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 *KeyValue) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) + } + if err := p.Key.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) + } + return err +} + +func (p *KeyValue) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) + } + if err := p.Value.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) + } + return err +} + +func (p *KeyValue) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetExpireTsSeconds() { + if err := oprot.WriteFieldBegin("expire_ts_seconds", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:expire_ts_seconds: ", p), err) + } + if err := oprot.WriteI32(int32(*p.ExpireTsSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expire_ts_seconds (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:expire_ts_seconds: ", p), err) + } + } + return err +} + +func (p *KeyValue) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KeyValue(%+v)", *p) +} + +// Attributes: +// - HashKey +// - Kvs +// - ExpireTsSeconds +type MultiPutRequest struct { + HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"` + Kvs []*KeyValue `thrift:"kvs,2" db:"kvs" json:"kvs"` + ExpireTsSeconds int32 `thrift:"expire_ts_seconds,3" db:"expire_ts_seconds" json:"expire_ts_seconds"` +} + +func NewMultiPutRequest() *MultiPutRequest { + return &MultiPutRequest{} +} + +var MultiPutRequest_HashKey_DEFAULT *base.Blob + +func (p *MultiPutRequest) GetHashKey() *base.Blob { + if !p.IsSetHashKey() { + return MultiPutRequest_HashKey_DEFAULT + } + return p.HashKey +} + +func (p *MultiPutRequest) GetKvs() []*KeyValue { + return p.Kvs +} + +func (p *MultiPutRequest) GetExpireTsSeconds() int32 { + return p.ExpireTsSeconds +} +func (p *MultiPutRequest) IsSetHashKey() bool { + return p.HashKey != nil +} + +func (p *MultiPutRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *MultiPutRequest) ReadField1(iprot thrift.TProtocol) error { + p.HashKey = &base.Blob{} + if err := p.HashKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err) + } + return nil +} + +func (p *MultiPutRequest) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*KeyValue, 0, size) + p.Kvs = tSlice + for i := 0; i < size; i++ { + _elem0 := &KeyValue{} + if err := _elem0.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Kvs = append(p.Kvs, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiPutRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ExpireTsSeconds = v + } + return nil +} + +func (p *MultiPutRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_put_request"); 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 := 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 *MultiPutRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err) + } + if err := p.HashKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err) + } + return err +} + +func (p *MultiPutRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("kvs", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:kvs: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Kvs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Kvs { + 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:kvs: ", p), err) + } + return err +} + +func (p *MultiPutRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("expire_ts_seconds", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:expire_ts_seconds: ", p), err) + } + if err := oprot.WriteI32(int32(p.ExpireTsSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expire_ts_seconds (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:expire_ts_seconds: ", p), err) + } + return err +} + +func (p *MultiPutRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiPutRequest(%+v)", *p) +} + +// Attributes: +// - HashKey +// - SortKeys +// - MaxCount +type MultiRemoveRequest struct { + HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"` + SortKeys []*base.Blob `thrift:"sort_keys,2" db:"sort_keys" json:"sort_keys"` + MaxCount int64 `thrift:"max_count,3" db:"max_count" json:"max_count"` +} + +func NewMultiRemoveRequest() *MultiRemoveRequest { + return &MultiRemoveRequest{} +} + +var MultiRemoveRequest_HashKey_DEFAULT *base.Blob + +func (p *MultiRemoveRequest) GetHashKey() *base.Blob { + if !p.IsSetHashKey() { + return MultiRemoveRequest_HashKey_DEFAULT + } + return p.HashKey +} + +func (p *MultiRemoveRequest) GetSortKeys() []*base.Blob { + return p.SortKeys +} + +func (p *MultiRemoveRequest) GetMaxCount() int64 { + return p.MaxCount +} +func (p *MultiRemoveRequest) IsSetHashKey() bool { + return p.HashKey != nil +} + +func (p *MultiRemoveRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *MultiRemoveRequest) ReadField1(iprot thrift.TProtocol) error { + p.HashKey = &base.Blob{} + if err := p.HashKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err) + } + return nil +} + +func (p *MultiRemoveRequest) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*base.Blob, 0, size) + p.SortKeys = tSlice + for i := 0; i < size; i++ { + _elem1 := &base.Blob{} + if err := _elem1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + } + p.SortKeys = append(p.SortKeys, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiRemoveRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.MaxCount = v + } + return nil +} + +func (p *MultiRemoveRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_remove_request"); 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 := 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 *MultiRemoveRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err) + } + if err := p.HashKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err) + } + return err +} + +func (p *MultiRemoveRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sort_keys", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sort_keys: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SortKeys)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.SortKeys { + 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:sort_keys: ", p), err) + } + return err +} + +func (p *MultiRemoveRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("max_count", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_count: ", p), err) + } + if err := oprot.WriteI64(int64(p.MaxCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_count (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_count: ", p), err) + } + return err +} + +func (p *MultiRemoveRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiRemoveRequest(%+v)", *p) +} + +// Attributes: +// - Error +// - Count +// - AppID +// - PartitionIndex +// - Decree +// - Server +type MultiRemoveResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + Count int64 `thrift:"count,2" db:"count" json:"count"` + AppID int32 `thrift:"app_id,3" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,4" db:"partition_index" json:"partition_index"` + Decree int64 `thrift:"decree,5" db:"decree" json:"decree"` + Server string `thrift:"server,6" db:"server" json:"server"` +} + +func NewMultiRemoveResponse() *MultiRemoveResponse { + return &MultiRemoveResponse{} +} + +func (p *MultiRemoveResponse) GetError() int32 { + return p.Error +} + +func (p *MultiRemoveResponse) GetCount() int64 { + return p.Count +} + +func (p *MultiRemoveResponse) GetAppID() int32 { + return p.AppID +} + +func (p *MultiRemoveResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *MultiRemoveResponse) GetDecree() int64 { + return p.Decree +} + +func (p *MultiRemoveResponse) GetServer() string { + return p.Server +} +func (p *MultiRemoveResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *MultiRemoveResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *MultiRemoveResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Count = v + } + return nil +} + +func (p *MultiRemoveResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *MultiRemoveResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *MultiRemoveResponse) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.Decree = v + } + return nil +} + +func (p *MultiRemoveResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *MultiRemoveResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_remove_response"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(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 *MultiRemoveResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *MultiRemoveResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("count", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:count: ", p), err) + } + if err := oprot.WriteI64(int64(p.Count)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.count (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:count: ", p), err) + } + return err +} + +func (p *MultiRemoveResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err) + } + return err +} + +func (p *MultiRemoveResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err) + } + return err +} + +func (p *MultiRemoveResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("decree", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.Decree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.decree (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:decree: ", p), err) + } + return err +} + +func (p *MultiRemoveResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err) + } + return err +} + +func (p *MultiRemoveResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiRemoveResponse(%+v)", *p) +} + +// Attributes: +// - HashKey +// - SortKeys +// - MaxKvCount +// - MaxKvSize +// - NoValue +// - StartSortkey +// - StopSortkey +// - StartInclusive +// - StopInclusive +// - SortKeyFilterType +// - SortKeyFilterPattern +// - Reverse +type MultiGetRequest struct { + HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"` + SortKeys []*base.Blob `thrift:"sort_keys,2" db:"sort_keys" json:"sort_keys"` + MaxKvCount int32 `thrift:"max_kv_count,3" db:"max_kv_count" json:"max_kv_count"` + MaxKvSize int32 `thrift:"max_kv_size,4" db:"max_kv_size" json:"max_kv_size"` + NoValue bool `thrift:"no_value,5" db:"no_value" json:"no_value"` + StartSortkey *base.Blob `thrift:"start_sortkey,6" db:"start_sortkey" json:"start_sortkey"` + StopSortkey *base.Blob `thrift:"stop_sortkey,7" db:"stop_sortkey" json:"stop_sortkey"` + StartInclusive bool `thrift:"start_inclusive,8" db:"start_inclusive" json:"start_inclusive"` + StopInclusive bool `thrift:"stop_inclusive,9" db:"stop_inclusive" json:"stop_inclusive"` + SortKeyFilterType FilterType `thrift:"sort_key_filter_type,10" db:"sort_key_filter_type" json:"sort_key_filter_type"` + SortKeyFilterPattern *base.Blob `thrift:"sort_key_filter_pattern,11" db:"sort_key_filter_pattern" json:"sort_key_filter_pattern"` + Reverse bool `thrift:"reverse,12" db:"reverse" json:"reverse"` +} + +func NewMultiGetRequest() *MultiGetRequest { + return &MultiGetRequest{} +} + +var MultiGetRequest_HashKey_DEFAULT *base.Blob + +func (p *MultiGetRequest) GetHashKey() *base.Blob { + if !p.IsSetHashKey() { + return MultiGetRequest_HashKey_DEFAULT + } + return p.HashKey +} + +func (p *MultiGetRequest) GetSortKeys() []*base.Blob { + return p.SortKeys +} + +func (p *MultiGetRequest) GetMaxKvCount() int32 { + return p.MaxKvCount +} + +func (p *MultiGetRequest) GetMaxKvSize() int32 { + return p.MaxKvSize +} + +func (p *MultiGetRequest) GetNoValue() bool { + return p.NoValue +} + +var MultiGetRequest_StartSortkey_DEFAULT *base.Blob + +func (p *MultiGetRequest) GetStartSortkey() *base.Blob { + if !p.IsSetStartSortkey() { + return MultiGetRequest_StartSortkey_DEFAULT + } + return p.StartSortkey +} + +var MultiGetRequest_StopSortkey_DEFAULT *base.Blob + +func (p *MultiGetRequest) GetStopSortkey() *base.Blob { + if !p.IsSetStopSortkey() { + return MultiGetRequest_StopSortkey_DEFAULT + } + return p.StopSortkey +} + +func (p *MultiGetRequest) GetStartInclusive() bool { + return p.StartInclusive +} + +func (p *MultiGetRequest) GetStopInclusive() bool { + return p.StopInclusive +} + +func (p *MultiGetRequest) GetSortKeyFilterType() FilterType { + return p.SortKeyFilterType +} + +var MultiGetRequest_SortKeyFilterPattern_DEFAULT *base.Blob + +func (p *MultiGetRequest) GetSortKeyFilterPattern() *base.Blob { + if !p.IsSetSortKeyFilterPattern() { + return MultiGetRequest_SortKeyFilterPattern_DEFAULT + } + return p.SortKeyFilterPattern +} + +func (p *MultiGetRequest) GetReverse() bool { + return p.Reverse +} +func (p *MultiGetRequest) IsSetHashKey() bool { + return p.HashKey != nil +} + +func (p *MultiGetRequest) IsSetStartSortkey() bool { + return p.StartSortkey != nil +} + +func (p *MultiGetRequest) IsSetStopSortkey() bool { + return p.StopSortkey != nil +} + +func (p *MultiGetRequest) IsSetSortKeyFilterPattern() bool { + return p.SortKeyFilterPattern != nil +} + +func (p *MultiGetRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.I32 { + if err := p.ReadField10(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField11(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 12: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField12(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *MultiGetRequest) ReadField1(iprot thrift.TProtocol) error { + p.HashKey = &base.Blob{} + if err := p.HashKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err) + } + return nil +} + +func (p *MultiGetRequest) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*base.Blob, 0, size) + p.SortKeys = tSlice + for i := 0; i < size; i++ { + _elem2 := &base.Blob{} + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.SortKeys = append(p.SortKeys, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiGetRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.MaxKvCount = v + } + return nil +} + +func (p *MultiGetRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.MaxKvSize = v + } + return nil +} + +func (p *MultiGetRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.NoValue = v + } + return nil +} + +func (p *MultiGetRequest) ReadField6(iprot thrift.TProtocol) error { + p.StartSortkey = &base.Blob{} + if err := p.StartSortkey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StartSortkey), err) + } + return nil +} + +func (p *MultiGetRequest) ReadField7(iprot thrift.TProtocol) error { + p.StopSortkey = &base.Blob{} + if err := p.StopSortkey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StopSortkey), err) + } + return nil +} + +func (p *MultiGetRequest) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.StartInclusive = v + } + return nil +} + +func (p *MultiGetRequest) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.StopInclusive = v + } + return nil +} + +func (p *MultiGetRequest) ReadField10(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 10: ", err) + } else { + temp := FilterType(v) + p.SortKeyFilterType = temp + } + return nil +} + +func (p *MultiGetRequest) ReadField11(iprot thrift.TProtocol) error { + p.SortKeyFilterPattern = &base.Blob{} + if err := p.SortKeyFilterPattern.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SortKeyFilterPattern), err) + } + return nil +} + +func (p *MultiGetRequest) ReadField12(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 12: ", err) + } else { + p.Reverse = v + } + return nil +} + +func (p *MultiGetRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_get_request"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := p.writeField9(oprot); err != nil { + return err + } + if err := p.writeField10(oprot); err != nil { + return err + } + if err := p.writeField11(oprot); err != nil { + return err + } + if err := p.writeField12(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 *MultiGetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err) + } + if err := p.HashKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sort_keys", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sort_keys: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SortKeys)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.SortKeys { + 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:sort_keys: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("max_kv_count", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_kv_count: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxKvCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_kv_count (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_kv_count: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("max_kv_size", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:max_kv_size: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxKvSize)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_kv_size (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:max_kv_size: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("no_value", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:no_value: ", p), err) + } + if err := oprot.WriteBool(bool(p.NoValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.no_value (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:no_value: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("start_sortkey", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_sortkey: ", p), err) + } + if err := p.StartSortkey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StartSortkey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_sortkey: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("stop_sortkey", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stop_sortkey: ", p), err) + } + if err := p.StopSortkey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StopSortkey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stop_sortkey: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("start_inclusive", thrift.BOOL, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:start_inclusive: ", p), err) + } + if err := oprot.WriteBool(bool(p.StartInclusive)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_inclusive (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:start_inclusive: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField9(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("stop_inclusive", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:stop_inclusive: ", p), err) + } + if err := oprot.WriteBool(bool(p.StopInclusive)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_inclusive (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:stop_inclusive: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField10(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sort_key_filter_type", thrift.I32, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:sort_key_filter_type: ", p), err) + } + if err := oprot.WriteI32(int32(p.SortKeyFilterType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sort_key_filter_type (10) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:sort_key_filter_type: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField11(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sort_key_filter_pattern", thrift.STRUCT, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:sort_key_filter_pattern: ", p), err) + } + if err := p.SortKeyFilterPattern.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SortKeyFilterPattern), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:sort_key_filter_pattern: ", p), err) + } + return err +} + +func (p *MultiGetRequest) writeField12(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("reverse", thrift.BOOL, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:reverse: ", p), err) + } + if err := oprot.WriteBool(bool(p.Reverse)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.reverse (12) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:reverse: ", p), err) + } + return err +} + +func (p *MultiGetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiGetRequest(%+v)", *p) +} + +// Attributes: +// - Error +// - Kvs +// - AppID +// - PartitionIndex +// - Server +type MultiGetResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + Kvs []*KeyValue `thrift:"kvs,2" db:"kvs" json:"kvs"` + AppID int32 `thrift:"app_id,3" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,4" db:"partition_index" json:"partition_index"` + // unused field # 5 + Server string `thrift:"server,6" db:"server" json:"server"` +} + +func NewMultiGetResponse() *MultiGetResponse { + return &MultiGetResponse{} +} + +func (p *MultiGetResponse) GetError() int32 { + return p.Error +} + +func (p *MultiGetResponse) GetKvs() []*KeyValue { + return p.Kvs +} + +func (p *MultiGetResponse) GetAppID() int32 { + return p.AppID +} + +func (p *MultiGetResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *MultiGetResponse) GetServer() string { + return p.Server +} +func (p *MultiGetResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *MultiGetResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *MultiGetResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*KeyValue, 0, size) + p.Kvs = tSlice + for i := 0; i < size; i++ { + _elem3 := &KeyValue{} + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Kvs = append(p.Kvs, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiGetResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *MultiGetResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *MultiGetResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *MultiGetResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_get_response"); 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 := p.writeField6(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 *MultiGetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *MultiGetResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("kvs", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:kvs: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Kvs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Kvs { + 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:kvs: ", p), err) + } + return err +} + +func (p *MultiGetResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err) + } + return err +} + +func (p *MultiGetResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err) + } + return err +} + +func (p *MultiGetResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err) + } + return err +} + +func (p *MultiGetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiGetResponse(%+v)", *p) +} + +// Attributes: +// - HashKey +// - SortKey +type FullKey struct { + HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"` + SortKey *base.Blob `thrift:"sort_key,2" db:"sort_key" json:"sort_key"` +} + +func NewFullKey() *FullKey { + return &FullKey{} +} + +var FullKey_HashKey_DEFAULT *base.Blob + +func (p *FullKey) GetHashKey() *base.Blob { + if !p.IsSetHashKey() { + return FullKey_HashKey_DEFAULT + } + return p.HashKey +} + +var FullKey_SortKey_DEFAULT *base.Blob + +func (p *FullKey) GetSortKey() *base.Blob { + if !p.IsSetSortKey() { + return FullKey_SortKey_DEFAULT + } + return p.SortKey +} +func (p *FullKey) IsSetHashKey() bool { + return p.HashKey != nil +} + +func (p *FullKey) IsSetSortKey() bool { + return p.SortKey != nil +} + +func (p *FullKey) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *FullKey) ReadField1(iprot thrift.TProtocol) error { + p.HashKey = &base.Blob{} + if err := p.HashKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err) + } + return nil +} + +func (p *FullKey) ReadField2(iprot thrift.TProtocol) error { + p.SortKey = &base.Blob{} + if err := p.SortKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SortKey), err) + } + return nil +} + +func (p *FullKey) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("full_key"); 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 *FullKey) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err) + } + if err := p.HashKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err) + } + return err +} + +func (p *FullKey) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sort_key", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sort_key: ", p), err) + } + if err := p.SortKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SortKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sort_key: ", p), err) + } + return err +} + +func (p *FullKey) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("FullKey(%+v)", *p) +} + +// Attributes: +// - Keys +type BatchGetRequest struct { + Keys []*FullKey `thrift:"keys,1" db:"keys" json:"keys"` +} + +func NewBatchGetRequest() *BatchGetRequest { + return &BatchGetRequest{} +} + +func (p *BatchGetRequest) GetKeys() []*FullKey { + return p.Keys +} +func (p *BatchGetRequest) 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 fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *BatchGetRequest) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FullKey, 0, size) + p.Keys = tSlice + for i := 0; i < size; i++ { + _elem4 := &FullKey{} + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Keys = append(p.Keys, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BatchGetRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("batch_get_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *BatchGetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("keys", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:keys: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Keys)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Keys { + 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:keys: ", p), err) + } + return err +} + +func (p *BatchGetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BatchGetRequest(%+v)", *p) +} + +// Attributes: +// - HashKey +// - SortKey +// - Value +type FullData struct { + HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"` + SortKey *base.Blob `thrift:"sort_key,2" db:"sort_key" json:"sort_key"` + Value *base.Blob `thrift:"value,3" db:"value" json:"value"` +} + +func NewFullData() *FullData { + return &FullData{} +} + +var FullData_HashKey_DEFAULT *base.Blob + +func (p *FullData) GetHashKey() *base.Blob { + if !p.IsSetHashKey() { + return FullData_HashKey_DEFAULT + } + return p.HashKey +} + +var FullData_SortKey_DEFAULT *base.Blob + +func (p *FullData) GetSortKey() *base.Blob { + if !p.IsSetSortKey() { + return FullData_SortKey_DEFAULT + } + return p.SortKey +} + +var FullData_Value_DEFAULT *base.Blob + +func (p *FullData) GetValue() *base.Blob { + if !p.IsSetValue() { + return FullData_Value_DEFAULT + } + return p.Value +} +func (p *FullData) IsSetHashKey() bool { + return p.HashKey != nil +} + +func (p *FullData) IsSetSortKey() bool { + return p.SortKey != nil +} + +func (p *FullData) IsSetValue() bool { + return p.Value != nil +} + +func (p *FullData) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *FullData) ReadField1(iprot thrift.TProtocol) error { + p.HashKey = &base.Blob{} + if err := p.HashKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err) + } + return nil +} + +func (p *FullData) ReadField2(iprot thrift.TProtocol) error { + p.SortKey = &base.Blob{} + if err := p.SortKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SortKey), err) + } + return nil +} + +func (p *FullData) ReadField3(iprot thrift.TProtocol) error { + p.Value = &base.Blob{} + if err := p.Value.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *FullData) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("full_data"); 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 := 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 *FullData) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err) + } + if err := p.HashKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err) + } + return err +} + +func (p *FullData) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sort_key", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sort_key: ", p), err) + } + if err := p.SortKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SortKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sort_key: ", p), err) + } + return err +} + +func (p *FullData) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:value: ", p), err) + } + if err := p.Value.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:value: ", p), err) + } + return err +} + +func (p *FullData) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("FullData(%+v)", *p) +} + +// Attributes: +// - Error +// - Data +// - AppID +// - PartitionIndex +// - Server +type BatchGetResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + Data []*FullData `thrift:"data,2" db:"data" json:"data"` + AppID int32 `thrift:"app_id,3" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,4" db:"partition_index" json:"partition_index"` + // unused field # 5 + Server string `thrift:"server,6" db:"server" json:"server"` +} + +func NewBatchGetResponse() *BatchGetResponse { + return &BatchGetResponse{} +} + +func (p *BatchGetResponse) GetError() int32 { + return p.Error +} + +func (p *BatchGetResponse) GetData() []*FullData { + return p.Data +} + +func (p *BatchGetResponse) GetAppID() int32 { + return p.AppID +} + +func (p *BatchGetResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *BatchGetResponse) GetServer() string { + return p.Server +} +func (p *BatchGetResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *BatchGetResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *BatchGetResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FullData, 0, size) + p.Data = tSlice + for i := 0; i < size; i++ { + _elem5 := &FullData{} + if err := _elem5.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) + } + p.Data = append(p.Data, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BatchGetResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *BatchGetResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *BatchGetResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *BatchGetResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("batch_get_response"); 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 := p.writeField6(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 *BatchGetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *BatchGetResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("data", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Data)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Data { + 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:data: ", p), err) + } + return err +} + +func (p *BatchGetResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err) + } + return err +} + +func (p *BatchGetResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err) + } + return err +} + +func (p *BatchGetResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err) + } + return err +} + +func (p *BatchGetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BatchGetResponse(%+v)", *p) +} + +// Attributes: +// - Key +// - Increment +// - ExpireTsSeconds +type IncrRequest struct { + Key *base.Blob `thrift:"key,1" db:"key" json:"key"` + Increment int64 `thrift:"increment,2" db:"increment" json:"increment"` + ExpireTsSeconds int32 `thrift:"expire_ts_seconds,3" db:"expire_ts_seconds" json:"expire_ts_seconds"` +} + +func NewIncrRequest() *IncrRequest { + return &IncrRequest{} +} + +var IncrRequest_Key_DEFAULT *base.Blob + +func (p *IncrRequest) GetKey() *base.Blob { + if !p.IsSetKey() { + return IncrRequest_Key_DEFAULT + } + return p.Key +} + +func (p *IncrRequest) GetIncrement() int64 { + return p.Increment +} + +func (p *IncrRequest) GetExpireTsSeconds() int32 { + return p.ExpireTsSeconds +} +func (p *IncrRequest) IsSetKey() bool { + return p.Key != nil +} + +func (p *IncrRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *IncrRequest) ReadField1(iprot thrift.TProtocol) error { + p.Key = &base.Blob{} + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *IncrRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Increment = v + } + return nil +} + +func (p *IncrRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ExpireTsSeconds = v + } + return nil +} + +func (p *IncrRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("incr_request"); 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 := 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 *IncrRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) + } + if err := p.Key.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) + } + return err +} + +func (p *IncrRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("increment", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:increment: ", p), err) + } + if err := oprot.WriteI64(int64(p.Increment)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.increment (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:increment: ", p), err) + } + return err +} + +func (p *IncrRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("expire_ts_seconds", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:expire_ts_seconds: ", p), err) + } + if err := oprot.WriteI32(int32(p.ExpireTsSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expire_ts_seconds (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:expire_ts_seconds: ", p), err) + } + return err +} + +func (p *IncrRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IncrRequest(%+v)", *p) +} + +// Attributes: +// - Error +// - NewValue_ +// - AppID +// - PartitionIndex +// - Decree +// - Server +type IncrResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + NewValue_ int64 `thrift:"new_value,2" db:"new_value" json:"new_value"` + AppID int32 `thrift:"app_id,3" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,4" db:"partition_index" json:"partition_index"` + Decree int64 `thrift:"decree,5" db:"decree" json:"decree"` + Server string `thrift:"server,6" db:"server" json:"server"` +} + +func NewIncrResponse() *IncrResponse { + return &IncrResponse{} +} + +func (p *IncrResponse) GetError() int32 { + return p.Error +} + +func (p *IncrResponse) GetNewValue_() int64 { + return p.NewValue_ +} + +func (p *IncrResponse) GetAppID() int32 { + return p.AppID +} + +func (p *IncrResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *IncrResponse) GetDecree() int64 { + return p.Decree +} + +func (p *IncrResponse) GetServer() string { + return p.Server +} +func (p *IncrResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *IncrResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *IncrResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.NewValue_ = v + } + return nil +} + +func (p *IncrResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *IncrResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *IncrResponse) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.Decree = v + } + return nil +} + +func (p *IncrResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *IncrResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("incr_response"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(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 *IncrResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *IncrResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("new_value", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_value: ", p), err) + } + if err := oprot.WriteI64(int64(p.NewValue_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_value (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_value: ", p), err) + } + return err +} + +func (p *IncrResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err) + } + return err +} + +func (p *IncrResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err) + } + return err +} + +func (p *IncrResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("decree", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.Decree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.decree (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:decree: ", p), err) + } + return err +} + +func (p *IncrResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err) + } + return err +} + +func (p *IncrResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IncrResponse(%+v)", *p) +} + +// Attributes: +// - HashKey +// - CheckSortKey +// - CheckType +// - CheckOperand +// - SetDiffSortKey +// - SetSortKey +// - SetValue +// - SetExpireTsSeconds +// - ReturnCheckValue +type CheckAndSetRequest struct { + HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"` + CheckSortKey *base.Blob `thrift:"check_sort_key,2" db:"check_sort_key" json:"check_sort_key"` + CheckType CasCheckType `thrift:"check_type,3" db:"check_type" json:"check_type"` + CheckOperand *base.Blob `thrift:"check_operand,4" db:"check_operand" json:"check_operand"` + SetDiffSortKey bool `thrift:"set_diff_sort_key,5" db:"set_diff_sort_key" json:"set_diff_sort_key"` + SetSortKey *base.Blob `thrift:"set_sort_key,6" db:"set_sort_key" json:"set_sort_key"` + SetValue *base.Blob `thrift:"set_value,7" db:"set_value" json:"set_value"` + SetExpireTsSeconds int32 `thrift:"set_expire_ts_seconds,8" db:"set_expire_ts_seconds" json:"set_expire_ts_seconds"` + ReturnCheckValue bool `thrift:"return_check_value,9" db:"return_check_value" json:"return_check_value"` +} + +func NewCheckAndSetRequest() *CheckAndSetRequest { + return &CheckAndSetRequest{} +} + +var CheckAndSetRequest_HashKey_DEFAULT *base.Blob + +func (p *CheckAndSetRequest) GetHashKey() *base.Blob { + if !p.IsSetHashKey() { + return CheckAndSetRequest_HashKey_DEFAULT + } + return p.HashKey +} + +var CheckAndSetRequest_CheckSortKey_DEFAULT *base.Blob + +func (p *CheckAndSetRequest) GetCheckSortKey() *base.Blob { + if !p.IsSetCheckSortKey() { + return CheckAndSetRequest_CheckSortKey_DEFAULT + } + return p.CheckSortKey +} + +func (p *CheckAndSetRequest) GetCheckType() CasCheckType { + return p.CheckType +} + +var CheckAndSetRequest_CheckOperand_DEFAULT *base.Blob + +func (p *CheckAndSetRequest) GetCheckOperand() *base.Blob { + if !p.IsSetCheckOperand() { + return CheckAndSetRequest_CheckOperand_DEFAULT + } + return p.CheckOperand +} + +func (p *CheckAndSetRequest) GetSetDiffSortKey() bool { + return p.SetDiffSortKey +} + +var CheckAndSetRequest_SetSortKey_DEFAULT *base.Blob + +func (p *CheckAndSetRequest) GetSetSortKey() *base.Blob { + if !p.IsSetSetSortKey() { + return CheckAndSetRequest_SetSortKey_DEFAULT + } + return p.SetSortKey +} + +var CheckAndSetRequest_SetValue_DEFAULT *base.Blob + +func (p *CheckAndSetRequest) GetSetValue() *base.Blob { + if !p.IsSetSetValue() { + return CheckAndSetRequest_SetValue_DEFAULT + } + return p.SetValue +} + +func (p *CheckAndSetRequest) GetSetExpireTsSeconds() int32 { + return p.SetExpireTsSeconds +} + +func (p *CheckAndSetRequest) GetReturnCheckValue() bool { + return p.ReturnCheckValue +} +func (p *CheckAndSetRequest) IsSetHashKey() bool { + return p.HashKey != nil +} + +func (p *CheckAndSetRequest) IsSetCheckSortKey() bool { + return p.CheckSortKey != nil +} + +func (p *CheckAndSetRequest) IsSetCheckOperand() bool { + return p.CheckOperand != nil +} + +func (p *CheckAndSetRequest) IsSetSetSortKey() bool { + return p.SetSortKey != nil +} + +func (p *CheckAndSetRequest) IsSetSetValue() bool { + return p.SetValue != nil +} + +func (p *CheckAndSetRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I32 { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *CheckAndSetRequest) ReadField1(iprot thrift.TProtocol) error { + p.HashKey = &base.Blob{} + if err := p.HashKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err) + } + return nil +} + +func (p *CheckAndSetRequest) ReadField2(iprot thrift.TProtocol) error { + p.CheckSortKey = &base.Blob{} + if err := p.CheckSortKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckSortKey), err) + } + return nil +} + +func (p *CheckAndSetRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := CasCheckType(v) + p.CheckType = temp + } + return nil +} + +func (p *CheckAndSetRequest) ReadField4(iprot thrift.TProtocol) error { + p.CheckOperand = &base.Blob{} + if err := p.CheckOperand.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckOperand), err) + } + return nil +} + +func (p *CheckAndSetRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.SetDiffSortKey = v + } + return nil +} + +func (p *CheckAndSetRequest) ReadField6(iprot thrift.TProtocol) error { + p.SetSortKey = &base.Blob{} + if err := p.SetSortKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SetSortKey), err) + } + return nil +} + +func (p *CheckAndSetRequest) ReadField7(iprot thrift.TProtocol) error { + p.SetValue = &base.Blob{} + if err := p.SetValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SetValue), err) + } + return nil +} + +func (p *CheckAndSetRequest) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.SetExpireTsSeconds = v + } + return nil +} + +func (p *CheckAndSetRequest) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.ReturnCheckValue = v + } + return nil +} + +func (p *CheckAndSetRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("check_and_set_request"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + 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 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 *CheckAndSetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err) + } + if err := p.HashKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err) + } + return err +} + +func (p *CheckAndSetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_sort_key", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:check_sort_key: ", p), err) + } + if err := p.CheckSortKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckSortKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:check_sort_key: ", p), err) + } + return err +} + +func (p *CheckAndSetRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:check_type: ", p), err) + } + if err := oprot.WriteI32(int32(p.CheckType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.check_type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:check_type: ", p), err) + } + return err +} + +func (p *CheckAndSetRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_operand", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:check_operand: ", p), err) + } + if err := p.CheckOperand.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckOperand), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:check_operand: ", p), err) + } + return err +} + +func (p *CheckAndSetRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("set_diff_sort_key", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:set_diff_sort_key: ", p), err) + } + if err := oprot.WriteBool(bool(p.SetDiffSortKey)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.set_diff_sort_key (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:set_diff_sort_key: ", p), err) + } + return err +} + +func (p *CheckAndSetRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("set_sort_key", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:set_sort_key: ", p), err) + } + if err := p.SetSortKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SetSortKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:set_sort_key: ", p), err) + } + return err +} + +func (p *CheckAndSetRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("set_value", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:set_value: ", p), err) + } + if err := p.SetValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SetValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:set_value: ", p), err) + } + return err +} + +func (p *CheckAndSetRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("set_expire_ts_seconds", thrift.I32, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:set_expire_ts_seconds: ", p), err) + } + if err := oprot.WriteI32(int32(p.SetExpireTsSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.set_expire_ts_seconds (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:set_expire_ts_seconds: ", p), err) + } + return err +} + +func (p *CheckAndSetRequest) writeField9(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("return_check_value", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:return_check_value: ", p), err) + } + if err := oprot.WriteBool(bool(p.ReturnCheckValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.return_check_value (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:return_check_value: ", p), err) + } + return err +} + +func (p *CheckAndSetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CheckAndSetRequest(%+v)", *p) +} + +// Attributes: +// - Error +// - CheckValueReturned +// - CheckValueExist +// - CheckValue +// - AppID +// - PartitionIndex +// - Decree +// - Server +type CheckAndSetResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + CheckValueReturned bool `thrift:"check_value_returned,2" db:"check_value_returned" json:"check_value_returned"` + CheckValueExist bool `thrift:"check_value_exist,3" db:"check_value_exist" json:"check_value_exist"` + CheckValue *base.Blob `thrift:"check_value,4" db:"check_value" json:"check_value"` + AppID int32 `thrift:"app_id,5" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,6" db:"partition_index" json:"partition_index"` + Decree int64 `thrift:"decree,7" db:"decree" json:"decree"` + Server string `thrift:"server,8" db:"server" json:"server"` +} + +func NewCheckAndSetResponse() *CheckAndSetResponse { + return &CheckAndSetResponse{} +} + +func (p *CheckAndSetResponse) GetError() int32 { + return p.Error +} + +func (p *CheckAndSetResponse) GetCheckValueReturned() bool { + return p.CheckValueReturned +} + +func (p *CheckAndSetResponse) GetCheckValueExist() bool { + return p.CheckValueExist +} + +var CheckAndSetResponse_CheckValue_DEFAULT *base.Blob + +func (p *CheckAndSetResponse) GetCheckValue() *base.Blob { + if !p.IsSetCheckValue() { + return CheckAndSetResponse_CheckValue_DEFAULT + } + return p.CheckValue +} + +func (p *CheckAndSetResponse) GetAppID() int32 { + return p.AppID +} + +func (p *CheckAndSetResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *CheckAndSetResponse) GetDecree() int64 { + return p.Decree +} + +func (p *CheckAndSetResponse) GetServer() string { + return p.Server +} +func (p *CheckAndSetResponse) IsSetCheckValue() bool { + return p.CheckValue != nil +} + +func (p *CheckAndSetResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I32 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I64 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRING { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *CheckAndSetResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *CheckAndSetResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.CheckValueReturned = v + } + return nil +} + +func (p *CheckAndSetResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.CheckValueExist = v + } + return nil +} + +func (p *CheckAndSetResponse) ReadField4(iprot thrift.TProtocol) error { + p.CheckValue = &base.Blob{} + if err := p.CheckValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckValue), err) + } + return nil +} + +func (p *CheckAndSetResponse) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *CheckAndSetResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *CheckAndSetResponse) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.Decree = v + } + return nil +} + +func (p *CheckAndSetResponse) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *CheckAndSetResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("check_and_set_response"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(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 *CheckAndSetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *CheckAndSetResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_value_returned", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:check_value_returned: ", p), err) + } + if err := oprot.WriteBool(bool(p.CheckValueReturned)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.check_value_returned (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:check_value_returned: ", p), err) + } + return err +} + +func (p *CheckAndSetResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_value_exist", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:check_value_exist: ", p), err) + } + if err := oprot.WriteBool(bool(p.CheckValueExist)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.check_value_exist (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:check_value_exist: ", p), err) + } + return err +} + +func (p *CheckAndSetResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:check_value: ", p), err) + } + if err := p.CheckValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:check_value: ", p), err) + } + return err +} + +func (p *CheckAndSetResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:app_id: ", p), err) + } + return err +} + +func (p *CheckAndSetResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:partition_index: ", p), err) + } + return err +} + +func (p *CheckAndSetResponse) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("decree", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.Decree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.decree (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:decree: ", p), err) + } + return err +} + +func (p *CheckAndSetResponse) writeField8(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:server: ", p), err) + } + return err +} + +func (p *CheckAndSetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CheckAndSetResponse(%+v)", *p) +} + +// Attributes: +// - Operation +// - SortKey +// - Value +// - SetExpireTsSeconds +type Mutate struct { + Operation MutateOperation `thrift:"operation,1" db:"operation" json:"operation"` + SortKey *base.Blob `thrift:"sort_key,2" db:"sort_key" json:"sort_key"` + Value *base.Blob `thrift:"value,3" db:"value" json:"value"` + SetExpireTsSeconds int32 `thrift:"set_expire_ts_seconds,4" db:"set_expire_ts_seconds" json:"set_expire_ts_seconds"` +} + +func NewMutate() *Mutate { + return &Mutate{} +} + +func (p *Mutate) GetOperation() MutateOperation { + return p.Operation +} + +var Mutate_SortKey_DEFAULT *base.Blob + +func (p *Mutate) GetSortKey() *base.Blob { + if !p.IsSetSortKey() { + return Mutate_SortKey_DEFAULT + } + return p.SortKey +} + +var Mutate_Value_DEFAULT *base.Blob + +func (p *Mutate) GetValue() *base.Blob { + if !p.IsSetValue() { + return Mutate_Value_DEFAULT + } + return p.Value +} + +func (p *Mutate) GetSetExpireTsSeconds() int32 { + return p.SetExpireTsSeconds +} +func (p *Mutate) IsSetSortKey() bool { + return p.SortKey != nil +} + +func (p *Mutate) IsSetValue() bool { + return p.Value != nil +} + +func (p *Mutate) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *Mutate) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := MutateOperation(v) + p.Operation = temp + } + return nil +} + +func (p *Mutate) ReadField2(iprot thrift.TProtocol) error { + p.SortKey = &base.Blob{} + if err := p.SortKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SortKey), err) + } + return nil +} + +func (p *Mutate) ReadField3(iprot thrift.TProtocol) error { + p.Value = &base.Blob{} + if err := p.Value.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *Mutate) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.SetExpireTsSeconds = v + } + return nil +} + +func (p *Mutate) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("mutate"); 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 *Mutate) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("operation", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operation: ", p), err) + } + if err := oprot.WriteI32(int32(p.Operation)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operation (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operation: ", p), err) + } + return err +} + +func (p *Mutate) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sort_key", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sort_key: ", p), err) + } + if err := p.SortKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SortKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sort_key: ", p), err) + } + return err +} + +func (p *Mutate) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:value: ", p), err) + } + if err := p.Value.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:value: ", p), err) + } + return err +} + +func (p *Mutate) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("set_expire_ts_seconds", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:set_expire_ts_seconds: ", p), err) + } + if err := oprot.WriteI32(int32(p.SetExpireTsSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.set_expire_ts_seconds (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:set_expire_ts_seconds: ", p), err) + } + return err +} + +func (p *Mutate) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Mutate(%+v)", *p) +} + +// Attributes: +// - HashKey +// - CheckSortKey +// - CheckType +// - CheckOperand +// - MutateList +// - ReturnCheckValue +type CheckAndMutateRequest struct { + HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"` + CheckSortKey *base.Blob `thrift:"check_sort_key,2" db:"check_sort_key" json:"check_sort_key"` + CheckType CasCheckType `thrift:"check_type,3" db:"check_type" json:"check_type"` + CheckOperand *base.Blob `thrift:"check_operand,4" db:"check_operand" json:"check_operand"` + MutateList []*Mutate `thrift:"mutate_list,5" db:"mutate_list" json:"mutate_list"` + ReturnCheckValue bool `thrift:"return_check_value,6" db:"return_check_value" json:"return_check_value"` +} + +func NewCheckAndMutateRequest() *CheckAndMutateRequest { + return &CheckAndMutateRequest{} +} + +var CheckAndMutateRequest_HashKey_DEFAULT *base.Blob + +func (p *CheckAndMutateRequest) GetHashKey() *base.Blob { + if !p.IsSetHashKey() { + return CheckAndMutateRequest_HashKey_DEFAULT + } + return p.HashKey +} + +var CheckAndMutateRequest_CheckSortKey_DEFAULT *base.Blob + +func (p *CheckAndMutateRequest) GetCheckSortKey() *base.Blob { + if !p.IsSetCheckSortKey() { + return CheckAndMutateRequest_CheckSortKey_DEFAULT + } + return p.CheckSortKey +} + +func (p *CheckAndMutateRequest) GetCheckType() CasCheckType { + return p.CheckType +} + +var CheckAndMutateRequest_CheckOperand_DEFAULT *base.Blob + +func (p *CheckAndMutateRequest) GetCheckOperand() *base.Blob { + if !p.IsSetCheckOperand() { + return CheckAndMutateRequest_CheckOperand_DEFAULT + } + return p.CheckOperand +} + +func (p *CheckAndMutateRequest) GetMutateList() []*Mutate { + return p.MutateList +} + +func (p *CheckAndMutateRequest) GetReturnCheckValue() bool { + return p.ReturnCheckValue +} +func (p *CheckAndMutateRequest) IsSetHashKey() bool { + return p.HashKey != nil +} + +func (p *CheckAndMutateRequest) IsSetCheckSortKey() bool { + return p.CheckSortKey != nil +} + +func (p *CheckAndMutateRequest) IsSetCheckOperand() bool { + return p.CheckOperand != nil +} + +func (p *CheckAndMutateRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *CheckAndMutateRequest) ReadField1(iprot thrift.TProtocol) error { + p.HashKey = &base.Blob{} + if err := p.HashKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err) + } + return nil +} + +func (p *CheckAndMutateRequest) ReadField2(iprot thrift.TProtocol) error { + p.CheckSortKey = &base.Blob{} + if err := p.CheckSortKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckSortKey), err) + } + return nil +} + +func (p *CheckAndMutateRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := CasCheckType(v) + p.CheckType = temp + } + return nil +} + +func (p *CheckAndMutateRequest) ReadField4(iprot thrift.TProtocol) error { + p.CheckOperand = &base.Blob{} + if err := p.CheckOperand.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckOperand), err) + } + return nil +} + +func (p *CheckAndMutateRequest) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Mutate, 0, size) + p.MutateList = tSlice + for i := 0; i < size; i++ { + _elem6 := &Mutate{} + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.MutateList = append(p.MutateList, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CheckAndMutateRequest) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.ReturnCheckValue = v + } + return nil +} + +func (p *CheckAndMutateRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("check_and_mutate_request"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(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 *CheckAndMutateRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err) + } + if err := p.HashKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err) + } + return err +} + +func (p *CheckAndMutateRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_sort_key", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:check_sort_key: ", p), err) + } + if err := p.CheckSortKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckSortKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:check_sort_key: ", p), err) + } + return err +} + +func (p *CheckAndMutateRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:check_type: ", p), err) + } + if err := oprot.WriteI32(int32(p.CheckType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.check_type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:check_type: ", p), err) + } + return err +} + +func (p *CheckAndMutateRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_operand", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:check_operand: ", p), err) + } + if err := p.CheckOperand.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckOperand), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:check_operand: ", p), err) + } + return err +} + +func (p *CheckAndMutateRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("mutate_list", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:mutate_list: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.MutateList)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.MutateList { + 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 5:mutate_list: ", p), err) + } + return err +} + +func (p *CheckAndMutateRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("return_check_value", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:return_check_value: ", p), err) + } + if err := oprot.WriteBool(bool(p.ReturnCheckValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.return_check_value (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:return_check_value: ", p), err) + } + return err +} + +func (p *CheckAndMutateRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CheckAndMutateRequest(%+v)", *p) +} + +// Attributes: +// - Error +// - CheckValueReturned +// - CheckValueExist +// - CheckValue +// - AppID +// - PartitionIndex +// - Decree +// - Server +type CheckAndMutateResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + CheckValueReturned bool `thrift:"check_value_returned,2" db:"check_value_returned" json:"check_value_returned"` + CheckValueExist bool `thrift:"check_value_exist,3" db:"check_value_exist" json:"check_value_exist"` + CheckValue *base.Blob `thrift:"check_value,4" db:"check_value" json:"check_value"` + AppID int32 `thrift:"app_id,5" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,6" db:"partition_index" json:"partition_index"` + Decree int64 `thrift:"decree,7" db:"decree" json:"decree"` + Server string `thrift:"server,8" db:"server" json:"server"` +} + +func NewCheckAndMutateResponse() *CheckAndMutateResponse { + return &CheckAndMutateResponse{} +} + +func (p *CheckAndMutateResponse) GetError() int32 { + return p.Error +} + +func (p *CheckAndMutateResponse) GetCheckValueReturned() bool { + return p.CheckValueReturned +} + +func (p *CheckAndMutateResponse) GetCheckValueExist() bool { + return p.CheckValueExist +} + +var CheckAndMutateResponse_CheckValue_DEFAULT *base.Blob + +func (p *CheckAndMutateResponse) GetCheckValue() *base.Blob { + if !p.IsSetCheckValue() { + return CheckAndMutateResponse_CheckValue_DEFAULT + } + return p.CheckValue +} + +func (p *CheckAndMutateResponse) GetAppID() int32 { + return p.AppID +} + +func (p *CheckAndMutateResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *CheckAndMutateResponse) GetDecree() int64 { + return p.Decree +} + +func (p *CheckAndMutateResponse) GetServer() string { + return p.Server +} +func (p *CheckAndMutateResponse) IsSetCheckValue() bool { + return p.CheckValue != nil +} + +func (p *CheckAndMutateResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I32 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I64 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRING { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *CheckAndMutateResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *CheckAndMutateResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.CheckValueReturned = v + } + return nil +} + +func (p *CheckAndMutateResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.CheckValueExist = v + } + return nil +} + +func (p *CheckAndMutateResponse) ReadField4(iprot thrift.TProtocol) error { + p.CheckValue = &base.Blob{} + if err := p.CheckValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckValue), err) + } + return nil +} + +func (p *CheckAndMutateResponse) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *CheckAndMutateResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *CheckAndMutateResponse) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.Decree = v + } + return nil +} + +func (p *CheckAndMutateResponse) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *CheckAndMutateResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("check_and_mutate_response"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(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 *CheckAndMutateResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *CheckAndMutateResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_value_returned", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:check_value_returned: ", p), err) + } + if err := oprot.WriteBool(bool(p.CheckValueReturned)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.check_value_returned (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:check_value_returned: ", p), err) + } + return err +} + +func (p *CheckAndMutateResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_value_exist", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:check_value_exist: ", p), err) + } + if err := oprot.WriteBool(bool(p.CheckValueExist)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.check_value_exist (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:check_value_exist: ", p), err) + } + return err +} + +func (p *CheckAndMutateResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("check_value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:check_value: ", p), err) + } + if err := p.CheckValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:check_value: ", p), err) + } + return err +} + +func (p *CheckAndMutateResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:app_id: ", p), err) + } + return err +} + +func (p *CheckAndMutateResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:partition_index: ", p), err) + } + return err +} + +func (p *CheckAndMutateResponse) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("decree", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:decree: ", p), err) + } + if err := oprot.WriteI64(int64(p.Decree)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.decree (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:decree: ", p), err) + } + return err +} + +func (p *CheckAndMutateResponse) writeField8(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:server: ", p), err) + } + return err +} + +func (p *CheckAndMutateResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CheckAndMutateResponse(%+v)", *p) +} + +// Attributes: +// - StartKey +// - StopKey +// - StartInclusive +// - StopInclusive +// - BatchSize +// - NoValue +// - HashKeyFilterType +// - HashKeyFilterPattern +// - SortKeyFilterType +// - SortKeyFilterPattern +// - ValidatePartitionHash +// - ReturnExpireTs +// - FullScan +// - OnlyReturnCount +type GetScannerRequest struct { + StartKey *base.Blob `thrift:"start_key,1" db:"start_key" json:"start_key"` + StopKey *base.Blob `thrift:"stop_key,2" db:"stop_key" json:"stop_key"` + StartInclusive bool `thrift:"start_inclusive,3" db:"start_inclusive" json:"start_inclusive"` + StopInclusive bool `thrift:"stop_inclusive,4" db:"stop_inclusive" json:"stop_inclusive"` + BatchSize int32 `thrift:"batch_size,5" db:"batch_size" json:"batch_size"` + NoValue bool `thrift:"no_value,6" db:"no_value" json:"no_value"` + HashKeyFilterType FilterType `thrift:"hash_key_filter_type,7" db:"hash_key_filter_type" json:"hash_key_filter_type"` + HashKeyFilterPattern *base.Blob `thrift:"hash_key_filter_pattern,8" db:"hash_key_filter_pattern" json:"hash_key_filter_pattern"` + SortKeyFilterType FilterType `thrift:"sort_key_filter_type,9" db:"sort_key_filter_type" json:"sort_key_filter_type"` + SortKeyFilterPattern *base.Blob `thrift:"sort_key_filter_pattern,10" db:"sort_key_filter_pattern" json:"sort_key_filter_pattern"` + ValidatePartitionHash *bool `thrift:"validate_partition_hash,11" db:"validate_partition_hash" json:"validate_partition_hash,omitempty"` + ReturnExpireTs *bool `thrift:"return_expire_ts,12" db:"return_expire_ts" json:"return_expire_ts,omitempty"` + FullScan *bool `thrift:"full_scan,13" db:"full_scan" json:"full_scan,omitempty"` + OnlyReturnCount bool `thrift:"only_return_count,14" db:"only_return_count" json:"only_return_count"` +} + +func NewGetScannerRequest() *GetScannerRequest { + return &GetScannerRequest{} +} + +var GetScannerRequest_StartKey_DEFAULT *base.Blob + +func (p *GetScannerRequest) GetStartKey() *base.Blob { + if !p.IsSetStartKey() { + return GetScannerRequest_StartKey_DEFAULT + } + return p.StartKey +} + +var GetScannerRequest_StopKey_DEFAULT *base.Blob + +func (p *GetScannerRequest) GetStopKey() *base.Blob { + if !p.IsSetStopKey() { + return GetScannerRequest_StopKey_DEFAULT + } + return p.StopKey +} + +func (p *GetScannerRequest) GetStartInclusive() bool { + return p.StartInclusive +} + +func (p *GetScannerRequest) GetStopInclusive() bool { + return p.StopInclusive +} + +func (p *GetScannerRequest) GetBatchSize() int32 { + return p.BatchSize +} + +func (p *GetScannerRequest) GetNoValue() bool { + return p.NoValue +} + +func (p *GetScannerRequest) GetHashKeyFilterType() FilterType { + return p.HashKeyFilterType +} + +var GetScannerRequest_HashKeyFilterPattern_DEFAULT *base.Blob + +func (p *GetScannerRequest) GetHashKeyFilterPattern() *base.Blob { + if !p.IsSetHashKeyFilterPattern() { + return GetScannerRequest_HashKeyFilterPattern_DEFAULT + } + return p.HashKeyFilterPattern +} + +func (p *GetScannerRequest) GetSortKeyFilterType() FilterType { + return p.SortKeyFilterType +} + +var GetScannerRequest_SortKeyFilterPattern_DEFAULT *base.Blob + +func (p *GetScannerRequest) GetSortKeyFilterPattern() *base.Blob { + if !p.IsSetSortKeyFilterPattern() { + return GetScannerRequest_SortKeyFilterPattern_DEFAULT + } + return p.SortKeyFilterPattern +} + +var GetScannerRequest_ValidatePartitionHash_DEFAULT bool + +func (p *GetScannerRequest) GetValidatePartitionHash() bool { + if !p.IsSetValidatePartitionHash() { + return GetScannerRequest_ValidatePartitionHash_DEFAULT + } + return *p.ValidatePartitionHash +} + +var GetScannerRequest_ReturnExpireTs_DEFAULT bool + +func (p *GetScannerRequest) GetReturnExpireTs() bool { + if !p.IsSetReturnExpireTs() { + return GetScannerRequest_ReturnExpireTs_DEFAULT + } + return *p.ReturnExpireTs +} + +var GetScannerRequest_FullScan_DEFAULT bool + +func (p *GetScannerRequest) GetFullScan() bool { + if !p.IsSetFullScan() { + return GetScannerRequest_FullScan_DEFAULT + } + return *p.FullScan +} + +var GetScannerRequest_OnlyReturnCount_DEFAULT bool = false + +func (p *GetScannerRequest) GetOnlyReturnCount() bool { + return p.OnlyReturnCount +} +func (p *GetScannerRequest) IsSetStartKey() bool { + return p.StartKey != nil +} + +func (p *GetScannerRequest) IsSetStopKey() bool { + return p.StopKey != nil +} + +func (p *GetScannerRequest) IsSetHashKeyFilterPattern() bool { + return p.HashKeyFilterPattern != nil +} + +func (p *GetScannerRequest) IsSetSortKeyFilterPattern() bool { + return p.SortKeyFilterPattern != nil +} + +func (p *GetScannerRequest) IsSetValidatePartitionHash() bool { + return p.ValidatePartitionHash != nil +} + +func (p *GetScannerRequest) IsSetReturnExpireTs() bool { + return p.ReturnExpireTs != nil +} + +func (p *GetScannerRequest) IsSetFullScan() bool { + return p.FullScan != nil +} + +func (p *GetScannerRequest) IsSetOnlyReturnCount() bool { + return p.OnlyReturnCount != GetScannerRequest_OnlyReturnCount_DEFAULT +} + +func (p *GetScannerRequest) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I32 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.I32 { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField10(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField11(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 12: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField12(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 13: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField13(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 14: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField14(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *GetScannerRequest) ReadField1(iprot thrift.TProtocol) error { + p.StartKey = &base.Blob{} + if err := p.StartKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StartKey), err) + } + return nil +} + +func (p *GetScannerRequest) ReadField2(iprot thrift.TProtocol) error { + p.StopKey = &base.Blob{} + if err := p.StopKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StopKey), err) + } + return nil +} + +func (p *GetScannerRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.StartInclusive = v + } + return nil +} + +func (p *GetScannerRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.StopInclusive = v + } + return nil +} + +func (p *GetScannerRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.BatchSize = v + } + return nil +} + +func (p *GetScannerRequest) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.NoValue = v + } + return nil +} + +func (p *GetScannerRequest) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + temp := FilterType(v) + p.HashKeyFilterType = temp + } + return nil +} + +func (p *GetScannerRequest) ReadField8(iprot thrift.TProtocol) error { + p.HashKeyFilterPattern = &base.Blob{} + if err := p.HashKeyFilterPattern.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKeyFilterPattern), err) + } + return nil +} + +func (p *GetScannerRequest) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + temp := FilterType(v) + p.SortKeyFilterType = temp + } + return nil +} + +func (p *GetScannerRequest) ReadField10(iprot thrift.TProtocol) error { + p.SortKeyFilterPattern = &base.Blob{} + if err := p.SortKeyFilterPattern.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SortKeyFilterPattern), err) + } + return nil +} + +func (p *GetScannerRequest) ReadField11(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 11: ", err) + } else { + p.ValidatePartitionHash = &v + } + return nil +} + +func (p *GetScannerRequest) ReadField12(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 12: ", err) + } else { + p.ReturnExpireTs = &v + } + return nil +} + +func (p *GetScannerRequest) ReadField13(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 13: ", err) + } else { + p.FullScan = &v + } + return nil +} + +func (p *GetScannerRequest) ReadField14(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 14: ", err) + } else { + p.OnlyReturnCount = v + } + return nil +} + +func (p *GetScannerRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("get_scanner_request"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := p.writeField9(oprot); err != nil { + return err + } + if err := p.writeField10(oprot); err != nil { + return err + } + if err := p.writeField11(oprot); err != nil { + return err + } + if err := p.writeField12(oprot); err != nil { + return err + } + if err := p.writeField13(oprot); err != nil { + return err + } + if err := p.writeField14(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 *GetScannerRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("start_key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:start_key: ", p), err) + } + if err := p.StartKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StartKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:start_key: ", p), err) + } + return err +} + +func (p *GetScannerRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("stop_key", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stop_key: ", p), err) + } + if err := p.StopKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StopKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stop_key: ", p), err) + } + return err +} + +func (p *GetScannerRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("start_inclusive", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:start_inclusive: ", p), err) + } + if err := oprot.WriteBool(bool(p.StartInclusive)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_inclusive (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:start_inclusive: ", p), err) + } + return err +} + +func (p *GetScannerRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("stop_inclusive", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stop_inclusive: ", p), err) + } + if err := oprot.WriteBool(bool(p.StopInclusive)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_inclusive (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stop_inclusive: ", p), err) + } + return err +} + +func (p *GetScannerRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("batch_size", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:batch_size: ", p), err) + } + if err := oprot.WriteI32(int32(p.BatchSize)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.batch_size (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:batch_size: ", p), err) + } + return err +} + +func (p *GetScannerRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("no_value", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:no_value: ", p), err) + } + if err := oprot.WriteBool(bool(p.NoValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.no_value (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:no_value: ", p), err) + } + return err +} + +func (p *GetScannerRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hash_key_filter_type", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:hash_key_filter_type: ", p), err) + } + if err := oprot.WriteI32(int32(p.HashKeyFilterType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hash_key_filter_type (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:hash_key_filter_type: ", p), err) + } + return err +} + +func (p *GetScannerRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hash_key_filter_pattern", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:hash_key_filter_pattern: ", p), err) + } + if err := p.HashKeyFilterPattern.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKeyFilterPattern), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:hash_key_filter_pattern: ", p), err) + } + return err +} + +func (p *GetScannerRequest) writeField9(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sort_key_filter_type", thrift.I32, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:sort_key_filter_type: ", p), err) + } + if err := oprot.WriteI32(int32(p.SortKeyFilterType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sort_key_filter_type (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:sort_key_filter_type: ", p), err) + } + return err +} + +func (p *GetScannerRequest) writeField10(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("sort_key_filter_pattern", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:sort_key_filter_pattern: ", p), err) + } + if err := p.SortKeyFilterPattern.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SortKeyFilterPattern), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:sort_key_filter_pattern: ", p), err) + } + return err +} + +func (p *GetScannerRequest) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetValidatePartitionHash() { + if err := oprot.WriteFieldBegin("validate_partition_hash", thrift.BOOL, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:validate_partition_hash: ", p), err) + } + if err := oprot.WriteBool(bool(*p.ValidatePartitionHash)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.validate_partition_hash (11) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:validate_partition_hash: ", p), err) + } + } + return err +} + +func (p *GetScannerRequest) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetReturnExpireTs() { + if err := oprot.WriteFieldBegin("return_expire_ts", thrift.BOOL, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:return_expire_ts: ", p), err) + } + if err := oprot.WriteBool(bool(*p.ReturnExpireTs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.return_expire_ts (12) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:return_expire_ts: ", p), err) + } + } + return err +} + +func (p *GetScannerRequest) writeField13(oprot thrift.TProtocol) (err error) { + if p.IsSetFullScan() { + if err := oprot.WriteFieldBegin("full_scan", thrift.BOOL, 13); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:full_scan: ", p), err) + } + if err := oprot.WriteBool(bool(*p.FullScan)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.full_scan (13) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 13:full_scan: ", p), err) + } + } + return err +} + +func (p *GetScannerRequest) writeField14(oprot thrift.TProtocol) (err error) { + if p.IsSetOnlyReturnCount() { + if err := oprot.WriteFieldBegin("only_return_count", thrift.BOOL, 14); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 14:only_return_count: ", p), err) + } + if err := oprot.WriteBool(bool(p.OnlyReturnCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_return_count (14) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 14:only_return_count: ", p), err) + } + } + return err +} + +func (p *GetScannerRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetScannerRequest(%+v)", *p) +} + +// Attributes: +// - ContextID +type ScanRequest struct { + ContextID int64 `thrift:"context_id,1" db:"context_id" json:"context_id"` +} + +func NewScanRequest() *ScanRequest { + return &ScanRequest{} +} + +func (p *ScanRequest) GetContextID() int64 { + return p.ContextID +} +func (p *ScanRequest) 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 fieldTypeId == thrift.I64 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ScanRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ContextID = v + } + return nil +} + +func (p *ScanRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("scan_request"); 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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ScanRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("context_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:context_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.ContextID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.context_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:context_id: ", p), err) + } + return err +} + +func (p *ScanRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanRequest(%+v)", *p) +} + +// Attributes: +// - Error +// - Kvs +// - ContextID +// - AppID +// - PartitionIndex +// - Server +// - KvCount +type ScanResponse struct { + Error int32 `thrift:"error,1" db:"error" json:"error"` + Kvs []*KeyValue `thrift:"kvs,2" db:"kvs" json:"kvs"` + ContextID int64 `thrift:"context_id,3" db:"context_id" json:"context_id"` + AppID int32 `thrift:"app_id,4" db:"app_id" json:"app_id"` + PartitionIndex int32 `thrift:"partition_index,5" db:"partition_index" json:"partition_index"` + Server string `thrift:"server,6" db:"server" json:"server"` + KvCount *int32 `thrift:"kv_count,7" db:"kv_count" json:"kv_count,omitempty"` +} + +func NewScanResponse() *ScanResponse { + return &ScanResponse{} +} + +func (p *ScanResponse) GetError() int32 { + return p.Error +} + +func (p *ScanResponse) GetKvs() []*KeyValue { + return p.Kvs +} + +func (p *ScanResponse) GetContextID() int64 { + return p.ContextID +} + +func (p *ScanResponse) GetAppID() int32 { + return p.AppID +} + +func (p *ScanResponse) GetPartitionIndex() int32 { + return p.PartitionIndex +} + +func (p *ScanResponse) GetServer() string { + return p.Server +} + +var ScanResponse_KvCount_DEFAULT int32 + +func (p *ScanResponse) GetKvCount() int32 { + if !p.IsSetKvCount() { + return ScanResponse_KvCount_DEFAULT + } + return *p.KvCount +} +func (p *ScanResponse) IsSetKvCount() bool { + return p.KvCount != nil +} + +func (p *ScanResponse) 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I32 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ScanResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Error = v + } + return nil +} + +func (p *ScanResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*KeyValue, 0, size) + p.Kvs = tSlice + for i := 0; i < size; i++ { + _elem7 := &KeyValue{} + if err := _elem7.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + } + p.Kvs = append(p.Kvs, _elem7) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ScanResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ContextID = v + } + return nil +} + +func (p *ScanResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.AppID = v + } + return nil +} + +func (p *ScanResponse) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.PartitionIndex = v + } + return nil +} + +func (p *ScanResponse) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Server = v + } + return nil +} + +func (p *ScanResponse) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.KvCount = &v + } + return nil +} + +func (p *ScanResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("scan_response"); 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 := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(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 *ScanResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err) + } + if err := oprot.WriteI32(int32(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err) + } + return err +} + +func (p *ScanResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("kvs", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:kvs: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Kvs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Kvs { + 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:kvs: ", p), err) + } + return err +} + +func (p *ScanResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("context_id", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:context_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.ContextID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.context_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:context_id: ", p), err) + } + return err +} + +func (p *ScanResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("app_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:app_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.AppID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.app_id (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:app_id: ", p), err) + } + return err +} + +func (p *ScanResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:partition_index: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_index (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:partition_index: ", p), err) + } + return err +} + +func (p *ScanResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err) + } + if err := oprot.WriteString(string(p.Server)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err) + } + return err +} + +func (p *ScanResponse) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetKvCount() { + if err := oprot.WriteFieldBegin("kv_count", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:kv_count: ", p), err) + } + if err := oprot.WriteI32(int32(*p.KvCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.kv_count (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:kv_count: ", p), err) + } + } + return err +} + +func (p *ScanResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanResponse(%+v)", *p) +} + +type Rrdb interface { + // Parameters: + // - Update + Put(ctx context.Context, update *UpdateRequest) (r *UpdateResponse, err error) + // Parameters: + // - Request + MultiPut(ctx context.Context, request *MultiPutRequest) (r *UpdateResponse, err error) + // Parameters: + // - Key + Remove(ctx context.Context, key *base.Blob) (r *UpdateResponse, err error) + // Parameters: + // - Request + MultiRemove(ctx context.Context, request *MultiRemoveRequest) (r *MultiRemoveResponse, err error) + // Parameters: + // - Request + Incr(ctx context.Context, request *IncrRequest) (r *IncrResponse, err error) + // Parameters: + // - Request + CheckAndSet(ctx context.Context, request *CheckAndSetRequest) (r *CheckAndSetResponse, err error) + // Parameters: + // - Request + CheckAndMutate(ctx context.Context, request *CheckAndMutateRequest) (r *CheckAndMutateResponse, err error) + // Parameters: + // - Key + Get(ctx context.Context, key *base.Blob) (r *ReadResponse, err error) + // Parameters: + // - Request + MultiGet(ctx context.Context, request *MultiGetRequest) (r *MultiGetResponse, err error) + // Parameters: + // - Request + BatchGet(ctx context.Context, request *BatchGetRequest) (r *BatchGetResponse, err error) + // Parameters: + // - HashKey + SortkeyCount(ctx context.Context, hash_key *base.Blob) (r *CountResponse, err error) + // Parameters: + // - Key + TTL(ctx context.Context, key *base.Blob) (r *TTLResponse, err error) + // Parameters: + // - Request + GetScanner(ctx context.Context, request *GetScannerRequest) (r *ScanResponse, err error) + // Parameters: + // - Request + Scan(ctx context.Context, request *ScanRequest) (r *ScanResponse, err error) + // Parameters: + // - ContextID + ClearScanner(ctx context.Context, context_id int64) (err error) +} + +type RrdbClient struct { + c thrift.TClient +} + +func NewRrdbClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *RrdbClient { + return &RrdbClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewRrdbClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *RrdbClient { + return &RrdbClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewRrdbClient(c thrift.TClient) *RrdbClient { + return &RrdbClient{ + c: c, + } +} + +func (p *RrdbClient) Client_() thrift.TClient { + return p.c +} + +// Parameters: +// - Update +func (p *RrdbClient) Put(ctx context.Context, update *UpdateRequest) (r *UpdateResponse, err error) { + var _args8 RrdbPutArgs + _args8.Update = update + var _result9 RrdbPutResult + if err = p.Client_().Call(ctx, "put", &_args8, &_result9); err != nil { + return + } + return _result9.GetSuccess(), nil +} + +// Parameters: +// - Request +func (p *RrdbClient) MultiPut(ctx context.Context, request *MultiPutRequest) (r *UpdateResponse, err error) { + var _args10 RrdbMultiPutArgs + _args10.Request = request + var _result11 RrdbMultiPutResult + if err = p.Client_().Call(ctx, "multi_put", &_args10, &_result11); err != nil { + return + } + return _result11.GetSuccess(), nil +} + +// Parameters: +// - Key +func (p *RrdbClient) Remove(ctx context.Context, key *base.Blob) (r *UpdateResponse, err error) { + var _args12 RrdbRemoveArgs + _args12.Key = key + var _result13 RrdbRemoveResult + if err = p.Client_().Call(ctx, "remove", &_args12, &_result13); err != nil { + return + } + return _result13.GetSuccess(), nil +} + +// Parameters: +// - Request +func (p *RrdbClient) MultiRemove(ctx context.Context, request *MultiRemoveRequest) (r *MultiRemoveResponse, err error) { + var _args14 RrdbMultiRemoveArgs + _args14.Request = request + var _result15 RrdbMultiRemoveResult + if err = p.Client_().Call(ctx, "multi_remove", &_args14, &_result15); err != nil { + return + } + return _result15.GetSuccess(), nil +} + +// Parameters: +// - Request +func (p *RrdbClient) Incr(ctx context.Context, request *IncrRequest) (r *IncrResponse, err error) { + var _args16 RrdbIncrArgs + _args16.Request = request + var _result17 RrdbIncrResult + if err = p.Client_().Call(ctx, "incr", &_args16, &_result17); err != nil { + return + } + return _result17.GetSuccess(), nil +} + +// Parameters: +// - Request +func (p *RrdbClient) CheckAndSet(ctx context.Context, request *CheckAndSetRequest) (r *CheckAndSetResponse, err error) { + var _args18 RrdbCheckAndSetArgs + _args18.Request = request + var _result19 RrdbCheckAndSetResult + if err = p.Client_().Call(ctx, "check_and_set", &_args18, &_result19); err != nil { + return + } + return _result19.GetSuccess(), nil +} + +// Parameters: +// - Request +func (p *RrdbClient) CheckAndMutate(ctx context.Context, request *CheckAndMutateRequest) (r *CheckAndMutateResponse, err error) { + var _args20 RrdbCheckAndMutateArgs + _args20.Request = request + var _result21 RrdbCheckAndMutateResult + if err = p.Client_().Call(ctx, "check_and_mutate", &_args20, &_result21); err != nil { + return + } + return _result21.GetSuccess(), nil +} + +// Parameters: +// - Key +func (p *RrdbClient) Get(ctx context.Context, key *base.Blob) (r *ReadResponse, err error) { + var _args22 RrdbGetArgs + _args22.Key = key + var _result23 RrdbGetResult + if err = p.Client_().Call(ctx, "get", &_args22, &_result23); err != nil { + return + } + return _result23.GetSuccess(), nil +} + +// Parameters: +// - Request +func (p *RrdbClient) MultiGet(ctx context.Context, request *MultiGetRequest) (r *MultiGetResponse, err error) { + var _args24 RrdbMultiGetArgs + _args24.Request = request + var _result25 RrdbMultiGetResult + if err = p.Client_().Call(ctx, "multi_get", &_args24, &_result25); err != nil { + return + } + return _result25.GetSuccess(), nil +} + +// Parameters: +// - Request +func (p *RrdbClient) BatchGet(ctx context.Context, request *BatchGetRequest) (r *BatchGetResponse, err error) { + var _args26 RrdbBatchGetArgs + _args26.Request = request + var _result27 RrdbBatchGetResult + if err = p.Client_().Call(ctx, "batch_get", &_args26, &_result27); err != nil { + return + } + return _result27.GetSuccess(), nil +} + +// Parameters: +// - HashKey +func (p *RrdbClient) SortkeyCount(ctx context.Context, hash_key *base.Blob) (r *CountResponse, err error) { + var _args28 RrdbSortkeyCountArgs + _args28.HashKey = hash_key + var _result29 RrdbSortkeyCountResult + if err = p.Client_().Call(ctx, "sortkey_count", &_args28, &_result29); err != nil { + return + } + return _result29.GetSuccess(), nil +} + +// Parameters: +// - Key +func (p *RrdbClient) TTL(ctx context.Context, key *base.Blob) (r *TTLResponse, err error) { + var _args30 RrdbTTLArgs + _args30.Key = key + var _result31 RrdbTTLResult + if err = p.Client_().Call(ctx, "ttl", &_args30, &_result31); err != nil { + return + } + return _result31.GetSuccess(), nil +} + +// Parameters: +// - Request +func (p *RrdbClient) GetScanner(ctx context.Context, request *GetScannerRequest) (r *ScanResponse, err error) { + var _args32 RrdbGetScannerArgs + _args32.Request = request + var _result33 RrdbGetScannerResult + if err = p.Client_().Call(ctx, "get_scanner", &_args32, &_result33); err != nil { + return + } + return _result33.GetSuccess(), nil +} + +// Parameters: +// - Request +func (p *RrdbClient) Scan(ctx context.Context, request *ScanRequest) (r *ScanResponse, err error) { + var _args34 RrdbScanArgs + _args34.Request = request + var _result35 RrdbScanResult + if err = p.Client_().Call(ctx, "scan", &_args34, &_result35); err != nil { + return + } + return _result35.GetSuccess(), nil +} + +// Parameters: +// - ContextID +func (p *RrdbClient) ClearScanner(ctx context.Context, context_id int64) (err error) { + var _args36 RrdbClearScannerArgs + _args36.ContextID = context_id + if err := p.Client_().Call(ctx, "clear_scanner", &_args36, nil); err != nil { + return err + } + return nil +} + +type RrdbProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler Rrdb +} + +func (p *RrdbProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *RrdbProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *RrdbProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewRrdbProcessor(handler Rrdb) *RrdbProcessor { + + self37 := &RrdbProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self37.processorMap["put"] = &rrdbProcessorPut{handler: handler} + self37.processorMap["multi_put"] = &rrdbProcessorMultiPut{handler: handler} + self37.processorMap["remove"] = &rrdbProcessorRemove{handler: handler} + self37.processorMap["multi_remove"] = &rrdbProcessorMultiRemove{handler: handler} + self37.processorMap["incr"] = &rrdbProcessorIncr{handler: handler} + self37.processorMap["check_and_set"] = &rrdbProcessorCheckAndSet{handler: handler} + self37.processorMap["check_and_mutate"] = &rrdbProcessorCheckAndMutate{handler: handler} + self37.processorMap["get"] = &rrdbProcessorGet{handler: handler} + self37.processorMap["multi_get"] = &rrdbProcessorMultiGet{handler: handler} + self37.processorMap["batch_get"] = &rrdbProcessorBatchGet{handler: handler} + self37.processorMap["sortkey_count"] = &rrdbProcessorSortkeyCount{handler: handler} + self37.processorMap["ttl"] = &rrdbProcessorTTL{handler: handler} + self37.processorMap["get_scanner"] = &rrdbProcessorGetScanner{handler: handler} + self37.processorMap["scan"] = &rrdbProcessorScan{handler: handler} + self37.processorMap["clear_scanner"] = &rrdbProcessorClearScanner{handler: handler} + return self37 +} + +func (p *RrdbProcessor) Process(ctx context.Context, 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(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x38 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x38.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x38 + +} + +type rrdbProcessorPut struct { + handler Rrdb +} + +func (p *rrdbProcessorPut) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbPutArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("put", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbPutResult{} + var retval *UpdateResponse + var err2 error + if retval, err2 = p.handler.Put(ctx, args.Update); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing put: "+err2.Error()) + oprot.WriteMessageBegin("put", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("put", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorMultiPut struct { + handler Rrdb +} + +func (p *rrdbProcessorMultiPut) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbMultiPutArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("multi_put", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbMultiPutResult{} + var retval *UpdateResponse + var err2 error + if retval, err2 = p.handler.MultiPut(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multi_put: "+err2.Error()) + oprot.WriteMessageBegin("multi_put", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("multi_put", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorRemove struct { + handler Rrdb +} + +func (p *rrdbProcessorRemove) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbRemoveArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("remove", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbRemoveResult{} + var retval *UpdateResponse + var err2 error + if retval, err2 = p.handler.Remove(ctx, args.Key); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: "+err2.Error()) + oprot.WriteMessageBegin("remove", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("remove", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorMultiRemove struct { + handler Rrdb +} + +func (p *rrdbProcessorMultiRemove) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbMultiRemoveArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("multi_remove", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbMultiRemoveResult{} + var retval *MultiRemoveResponse + var err2 error + if retval, err2 = p.handler.MultiRemove(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multi_remove: "+err2.Error()) + oprot.WriteMessageBegin("multi_remove", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("multi_remove", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorIncr struct { + handler Rrdb +} + +func (p *rrdbProcessorIncr) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbIncrArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("incr", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbIncrResult{} + var retval *IncrResponse + var err2 error + if retval, err2 = p.handler.Incr(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing incr: "+err2.Error()) + oprot.WriteMessageBegin("incr", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("incr", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorCheckAndSet struct { + handler Rrdb +} + +func (p *rrdbProcessorCheckAndSet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbCheckAndSetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("check_and_set", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbCheckAndSetResult{} + var retval *CheckAndSetResponse + var err2 error + if retval, err2 = p.handler.CheckAndSet(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing check_and_set: "+err2.Error()) + oprot.WriteMessageBegin("check_and_set", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("check_and_set", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorCheckAndMutate struct { + handler Rrdb +} + +func (p *rrdbProcessorCheckAndMutate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbCheckAndMutateArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("check_and_mutate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbCheckAndMutateResult{} + var retval *CheckAndMutateResponse + var err2 error + if retval, err2 = p.handler.CheckAndMutate(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing check_and_mutate: "+err2.Error()) + oprot.WriteMessageBegin("check_and_mutate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("check_and_mutate", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorGet struct { + handler Rrdb +} + +func (p *rrdbProcessorGet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbGetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("get", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbGetResult{} + var retval *ReadResponse + var err2 error + if retval, err2 = p.handler.Get(ctx, args.Key); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: "+err2.Error()) + oprot.WriteMessageBegin("get", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("get", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorMultiGet struct { + handler Rrdb +} + +func (p *rrdbProcessorMultiGet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbMultiGetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("multi_get", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbMultiGetResult{} + var retval *MultiGetResponse + var err2 error + if retval, err2 = p.handler.MultiGet(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multi_get: "+err2.Error()) + oprot.WriteMessageBegin("multi_get", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("multi_get", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorBatchGet struct { + handler Rrdb +} + +func (p *rrdbProcessorBatchGet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbBatchGetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("batch_get", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbBatchGetResult{} + var retval *BatchGetResponse + var err2 error + if retval, err2 = p.handler.BatchGet(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing batch_get: "+err2.Error()) + oprot.WriteMessageBegin("batch_get", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("batch_get", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorSortkeyCount struct { + handler Rrdb +} + +func (p *rrdbProcessorSortkeyCount) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbSortkeyCountArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("sortkey_count", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbSortkeyCountResult{} + var retval *CountResponse + var err2 error + if retval, err2 = p.handler.SortkeyCount(ctx, args.HashKey); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing sortkey_count: "+err2.Error()) + oprot.WriteMessageBegin("sortkey_count", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("sortkey_count", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorTTL struct { + handler Rrdb +} + +func (p *rrdbProcessorTTL) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbTTLArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ttl", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbTTLResult{} + var retval *TTLResponse + var err2 error + if retval, err2 = p.handler.TTL(ctx, args.Key); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ttl: "+err2.Error()) + oprot.WriteMessageBegin("ttl", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ttl", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorGetScanner struct { + handler Rrdb +} + +func (p *rrdbProcessorGetScanner) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbGetScannerArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("get_scanner", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbGetScannerResult{} + var retval *ScanResponse + var err2 error + if retval, err2 = p.handler.GetScanner(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_scanner: "+err2.Error()) + oprot.WriteMessageBegin("get_scanner", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("get_scanner", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorScan struct { + handler Rrdb +} + +func (p *rrdbProcessorScan) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbScanArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("scan", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := RrdbScanResult{} + var retval *ScanResponse + var err2 error + if retval, err2 = p.handler.Scan(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scan: "+err2.Error()) + oprot.WriteMessageBegin("scan", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("scan", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type rrdbProcessorClearScanner struct { + handler Rrdb +} + +func (p *rrdbProcessorClearScanner) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := RrdbClearScannerArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + if err2 = p.handler.ClearScanner(ctx, args.ContextID); err2 != nil { + return true, err2 + } + return true, nil +} + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Update +type RrdbPutArgs struct { + Update *UpdateRequest `thrift:"update,1" db:"update" json:"update"` +} + +func NewRrdbPutArgs() *RrdbPutArgs { + return &RrdbPutArgs{} +} + +var RrdbPutArgs_Update_DEFAULT *UpdateRequest + +func (p *RrdbPutArgs) GetUpdate() *UpdateRequest { + if !p.IsSetUpdate() { + return RrdbPutArgs_Update_DEFAULT + } + return p.Update +} +func (p *RrdbPutArgs) IsSetUpdate() bool { + return p.Update != nil +} + +func (p *RrdbPutArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbPutArgs) ReadField1(iprot thrift.TProtocol) error { + p.Update = &UpdateRequest{} + if err := p.Update.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Update), err) + } + return nil +} + +func (p *RrdbPutArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("put_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbPutArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("update", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:update: ", p), err) + } + if err := p.Update.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Update), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:update: ", p), err) + } + return err +} + +func (p *RrdbPutArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbPutArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbPutResult struct { + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbPutResult() *RrdbPutResult { + return &RrdbPutResult{} +} + +var RrdbPutResult_Success_DEFAULT *UpdateResponse + +func (p *RrdbPutResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return RrdbPutResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbPutResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbPutResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbPutResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &UpdateResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbPutResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("put_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 *RrdbPutResult) 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 *RrdbPutResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbPutResult(%+v)", *p) +} + +// Attributes: +// - Request +type RrdbMultiPutArgs struct { + Request *MultiPutRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewRrdbMultiPutArgs() *RrdbMultiPutArgs { + return &RrdbMultiPutArgs{} +} + +var RrdbMultiPutArgs_Request_DEFAULT *MultiPutRequest + +func (p *RrdbMultiPutArgs) GetRequest() *MultiPutRequest { + if !p.IsSetRequest() { + return RrdbMultiPutArgs_Request_DEFAULT + } + return p.Request +} +func (p *RrdbMultiPutArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *RrdbMultiPutArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbMultiPutArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &MultiPutRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *RrdbMultiPutArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_put_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbMultiPutArgs) 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 *RrdbMultiPutArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbMultiPutArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbMultiPutResult struct { + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbMultiPutResult() *RrdbMultiPutResult { + return &RrdbMultiPutResult{} +} + +var RrdbMultiPutResult_Success_DEFAULT *UpdateResponse + +func (p *RrdbMultiPutResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return RrdbMultiPutResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbMultiPutResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbMultiPutResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbMultiPutResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &UpdateResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbMultiPutResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_put_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 *RrdbMultiPutResult) 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 *RrdbMultiPutResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbMultiPutResult(%+v)", *p) +} + +// Attributes: +// - Key +type RrdbRemoveArgs struct { + Key *base.Blob `thrift:"key,1" db:"key" json:"key"` +} + +func NewRrdbRemoveArgs() *RrdbRemoveArgs { + return &RrdbRemoveArgs{} +} + +var RrdbRemoveArgs_Key_DEFAULT *base.Blob + +func (p *RrdbRemoveArgs) GetKey() *base.Blob { + if !p.IsSetKey() { + return RrdbRemoveArgs_Key_DEFAULT + } + return p.Key +} +func (p *RrdbRemoveArgs) IsSetKey() bool { + return p.Key != nil +} + +func (p *RrdbRemoveArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbRemoveArgs) ReadField1(iprot thrift.TProtocol) error { + p.Key = &base.Blob{} + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *RrdbRemoveArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("remove_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbRemoveArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) + } + if err := p.Key.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) + } + return err +} + +func (p *RrdbRemoveArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbRemoveArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbRemoveResult struct { + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbRemoveResult() *RrdbRemoveResult { + return &RrdbRemoveResult{} +} + +var RrdbRemoveResult_Success_DEFAULT *UpdateResponse + +func (p *RrdbRemoveResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return RrdbRemoveResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbRemoveResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbRemoveResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbRemoveResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &UpdateResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbRemoveResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("remove_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 *RrdbRemoveResult) 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 *RrdbRemoveResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbRemoveResult(%+v)", *p) +} + +// Attributes: +// - Request +type RrdbMultiRemoveArgs struct { + Request *MultiRemoveRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewRrdbMultiRemoveArgs() *RrdbMultiRemoveArgs { + return &RrdbMultiRemoveArgs{} +} + +var RrdbMultiRemoveArgs_Request_DEFAULT *MultiRemoveRequest + +func (p *RrdbMultiRemoveArgs) GetRequest() *MultiRemoveRequest { + if !p.IsSetRequest() { + return RrdbMultiRemoveArgs_Request_DEFAULT + } + return p.Request +} +func (p *RrdbMultiRemoveArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *RrdbMultiRemoveArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbMultiRemoveArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &MultiRemoveRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *RrdbMultiRemoveArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_remove_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbMultiRemoveArgs) 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 *RrdbMultiRemoveArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbMultiRemoveArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbMultiRemoveResult struct { + Success *MultiRemoveResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbMultiRemoveResult() *RrdbMultiRemoveResult { + return &RrdbMultiRemoveResult{} +} + +var RrdbMultiRemoveResult_Success_DEFAULT *MultiRemoveResponse + +func (p *RrdbMultiRemoveResult) GetSuccess() *MultiRemoveResponse { + if !p.IsSetSuccess() { + return RrdbMultiRemoveResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbMultiRemoveResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbMultiRemoveResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbMultiRemoveResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &MultiRemoveResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbMultiRemoveResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_remove_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 *RrdbMultiRemoveResult) 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 *RrdbMultiRemoveResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbMultiRemoveResult(%+v)", *p) +} + +// Attributes: +// - Request +type RrdbIncrArgs struct { + Request *IncrRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewRrdbIncrArgs() *RrdbIncrArgs { + return &RrdbIncrArgs{} +} + +var RrdbIncrArgs_Request_DEFAULT *IncrRequest + +func (p *RrdbIncrArgs) GetRequest() *IncrRequest { + if !p.IsSetRequest() { + return RrdbIncrArgs_Request_DEFAULT + } + return p.Request +} +func (p *RrdbIncrArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *RrdbIncrArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbIncrArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &IncrRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *RrdbIncrArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("incr_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbIncrArgs) 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 *RrdbIncrArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbIncrArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbIncrResult struct { + Success *IncrResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbIncrResult() *RrdbIncrResult { + return &RrdbIncrResult{} +} + +var RrdbIncrResult_Success_DEFAULT *IncrResponse + +func (p *RrdbIncrResult) GetSuccess() *IncrResponse { + if !p.IsSetSuccess() { + return RrdbIncrResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbIncrResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbIncrResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbIncrResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &IncrResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbIncrResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("incr_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 *RrdbIncrResult) 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 *RrdbIncrResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbIncrResult(%+v)", *p) +} + +// Attributes: +// - Request +type RrdbCheckAndSetArgs struct { + Request *CheckAndSetRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewRrdbCheckAndSetArgs() *RrdbCheckAndSetArgs { + return &RrdbCheckAndSetArgs{} +} + +var RrdbCheckAndSetArgs_Request_DEFAULT *CheckAndSetRequest + +func (p *RrdbCheckAndSetArgs) GetRequest() *CheckAndSetRequest { + if !p.IsSetRequest() { + return RrdbCheckAndSetArgs_Request_DEFAULT + } + return p.Request +} +func (p *RrdbCheckAndSetArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *RrdbCheckAndSetArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbCheckAndSetArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &CheckAndSetRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *RrdbCheckAndSetArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("check_and_set_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbCheckAndSetArgs) 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 *RrdbCheckAndSetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbCheckAndSetArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbCheckAndSetResult struct { + Success *CheckAndSetResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbCheckAndSetResult() *RrdbCheckAndSetResult { + return &RrdbCheckAndSetResult{} +} + +var RrdbCheckAndSetResult_Success_DEFAULT *CheckAndSetResponse + +func (p *RrdbCheckAndSetResult) GetSuccess() *CheckAndSetResponse { + if !p.IsSetSuccess() { + return RrdbCheckAndSetResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbCheckAndSetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbCheckAndSetResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbCheckAndSetResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &CheckAndSetResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbCheckAndSetResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("check_and_set_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 *RrdbCheckAndSetResult) 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 *RrdbCheckAndSetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbCheckAndSetResult(%+v)", *p) +} + +// Attributes: +// - Request +type RrdbCheckAndMutateArgs struct { + Request *CheckAndMutateRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewRrdbCheckAndMutateArgs() *RrdbCheckAndMutateArgs { + return &RrdbCheckAndMutateArgs{} +} + +var RrdbCheckAndMutateArgs_Request_DEFAULT *CheckAndMutateRequest + +func (p *RrdbCheckAndMutateArgs) GetRequest() *CheckAndMutateRequest { + if !p.IsSetRequest() { + return RrdbCheckAndMutateArgs_Request_DEFAULT + } + return p.Request +} +func (p *RrdbCheckAndMutateArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *RrdbCheckAndMutateArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbCheckAndMutateArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &CheckAndMutateRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *RrdbCheckAndMutateArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("check_and_mutate_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbCheckAndMutateArgs) 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 *RrdbCheckAndMutateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbCheckAndMutateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbCheckAndMutateResult struct { + Success *CheckAndMutateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbCheckAndMutateResult() *RrdbCheckAndMutateResult { + return &RrdbCheckAndMutateResult{} +} + +var RrdbCheckAndMutateResult_Success_DEFAULT *CheckAndMutateResponse + +func (p *RrdbCheckAndMutateResult) GetSuccess() *CheckAndMutateResponse { + if !p.IsSetSuccess() { + return RrdbCheckAndMutateResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbCheckAndMutateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbCheckAndMutateResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbCheckAndMutateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &CheckAndMutateResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbCheckAndMutateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("check_and_mutate_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 *RrdbCheckAndMutateResult) 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 *RrdbCheckAndMutateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbCheckAndMutateResult(%+v)", *p) +} + +// Attributes: +// - Key +type RrdbGetArgs struct { + Key *base.Blob `thrift:"key,1" db:"key" json:"key"` +} + +func NewRrdbGetArgs() *RrdbGetArgs { + return &RrdbGetArgs{} +} + +var RrdbGetArgs_Key_DEFAULT *base.Blob + +func (p *RrdbGetArgs) GetKey() *base.Blob { + if !p.IsSetKey() { + return RrdbGetArgs_Key_DEFAULT + } + return p.Key +} +func (p *RrdbGetArgs) IsSetKey() bool { + return p.Key != nil +} + +func (p *RrdbGetArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbGetArgs) ReadField1(iprot thrift.TProtocol) error { + p.Key = &base.Blob{} + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *RrdbGetArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("get_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbGetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) + } + if err := p.Key.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) + } + return err +} + +func (p *RrdbGetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbGetArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbGetResult struct { + Success *ReadResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbGetResult() *RrdbGetResult { + return &RrdbGetResult{} +} + +var RrdbGetResult_Success_DEFAULT *ReadResponse + +func (p *RrdbGetResult) GetSuccess() *ReadResponse { + if !p.IsSetSuccess() { + return RrdbGetResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbGetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbGetResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbGetResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ReadResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbGetResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("get_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 *RrdbGetResult) 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 *RrdbGetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbGetResult(%+v)", *p) +} + +// Attributes: +// - Request +type RrdbMultiGetArgs struct { + Request *MultiGetRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewRrdbMultiGetArgs() *RrdbMultiGetArgs { + return &RrdbMultiGetArgs{} +} + +var RrdbMultiGetArgs_Request_DEFAULT *MultiGetRequest + +func (p *RrdbMultiGetArgs) GetRequest() *MultiGetRequest { + if !p.IsSetRequest() { + return RrdbMultiGetArgs_Request_DEFAULT + } + return p.Request +} +func (p *RrdbMultiGetArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *RrdbMultiGetArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbMultiGetArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &MultiGetRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *RrdbMultiGetArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_get_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbMultiGetArgs) 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 *RrdbMultiGetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbMultiGetArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbMultiGetResult struct { + Success *MultiGetResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbMultiGetResult() *RrdbMultiGetResult { + return &RrdbMultiGetResult{} +} + +var RrdbMultiGetResult_Success_DEFAULT *MultiGetResponse + +func (p *RrdbMultiGetResult) GetSuccess() *MultiGetResponse { + if !p.IsSetSuccess() { + return RrdbMultiGetResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbMultiGetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbMultiGetResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbMultiGetResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &MultiGetResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbMultiGetResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("multi_get_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 *RrdbMultiGetResult) 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 *RrdbMultiGetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbMultiGetResult(%+v)", *p) +} + +// Attributes: +// - Request +type RrdbBatchGetArgs struct { + Request *BatchGetRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewRrdbBatchGetArgs() *RrdbBatchGetArgs { + return &RrdbBatchGetArgs{} +} + +var RrdbBatchGetArgs_Request_DEFAULT *BatchGetRequest + +func (p *RrdbBatchGetArgs) GetRequest() *BatchGetRequest { + if !p.IsSetRequest() { + return RrdbBatchGetArgs_Request_DEFAULT + } + return p.Request +} +func (p *RrdbBatchGetArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *RrdbBatchGetArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbBatchGetArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &BatchGetRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *RrdbBatchGetArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("batch_get_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbBatchGetArgs) 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 *RrdbBatchGetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbBatchGetArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbBatchGetResult struct { + Success *BatchGetResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbBatchGetResult() *RrdbBatchGetResult { + return &RrdbBatchGetResult{} +} + +var RrdbBatchGetResult_Success_DEFAULT *BatchGetResponse + +func (p *RrdbBatchGetResult) GetSuccess() *BatchGetResponse { + if !p.IsSetSuccess() { + return RrdbBatchGetResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbBatchGetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbBatchGetResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbBatchGetResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &BatchGetResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbBatchGetResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("batch_get_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 *RrdbBatchGetResult) 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 *RrdbBatchGetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbBatchGetResult(%+v)", *p) +} + +// Attributes: +// - HashKey +type RrdbSortkeyCountArgs struct { + HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"` +} + +func NewRrdbSortkeyCountArgs() *RrdbSortkeyCountArgs { + return &RrdbSortkeyCountArgs{} +} + +var RrdbSortkeyCountArgs_HashKey_DEFAULT *base.Blob + +func (p *RrdbSortkeyCountArgs) GetHashKey() *base.Blob { + if !p.IsSetHashKey() { + return RrdbSortkeyCountArgs_HashKey_DEFAULT + } + return p.HashKey +} +func (p *RrdbSortkeyCountArgs) IsSetHashKey() bool { + return p.HashKey != nil +} + +func (p *RrdbSortkeyCountArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbSortkeyCountArgs) ReadField1(iprot thrift.TProtocol) error { + p.HashKey = &base.Blob{} + if err := p.HashKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err) + } + return nil +} + +func (p *RrdbSortkeyCountArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("sortkey_count_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbSortkeyCountArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err) + } + if err := p.HashKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err) + } + return err +} + +func (p *RrdbSortkeyCountArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbSortkeyCountArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbSortkeyCountResult struct { + Success *CountResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbSortkeyCountResult() *RrdbSortkeyCountResult { + return &RrdbSortkeyCountResult{} +} + +var RrdbSortkeyCountResult_Success_DEFAULT *CountResponse + +func (p *RrdbSortkeyCountResult) GetSuccess() *CountResponse { + if !p.IsSetSuccess() { + return RrdbSortkeyCountResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbSortkeyCountResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbSortkeyCountResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbSortkeyCountResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &CountResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbSortkeyCountResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("sortkey_count_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 *RrdbSortkeyCountResult) 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 *RrdbSortkeyCountResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbSortkeyCountResult(%+v)", *p) +} + +// Attributes: +// - Key +type RrdbTTLArgs struct { + Key *base.Blob `thrift:"key,1" db:"key" json:"key"` +} + +func NewRrdbTTLArgs() *RrdbTTLArgs { + return &RrdbTTLArgs{} +} + +var RrdbTTLArgs_Key_DEFAULT *base.Blob + +func (p *RrdbTTLArgs) GetKey() *base.Blob { + if !p.IsSetKey() { + return RrdbTTLArgs_Key_DEFAULT + } + return p.Key +} +func (p *RrdbTTLArgs) IsSetKey() bool { + return p.Key != nil +} + +func (p *RrdbTTLArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbTTLArgs) ReadField1(iprot thrift.TProtocol) error { + p.Key = &base.Blob{} + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *RrdbTTLArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ttl_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbTTLArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) + } + if err := p.Key.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) + } + return err +} + +func (p *RrdbTTLArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbTTLArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbTTLResult struct { + Success *TTLResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbTTLResult() *RrdbTTLResult { + return &RrdbTTLResult{} +} + +var RrdbTTLResult_Success_DEFAULT *TTLResponse + +func (p *RrdbTTLResult) GetSuccess() *TTLResponse { + if !p.IsSetSuccess() { + return RrdbTTLResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbTTLResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbTTLResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbTTLResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &TTLResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbTTLResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ttl_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 *RrdbTTLResult) 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 *RrdbTTLResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbTTLResult(%+v)", *p) +} + +// Attributes: +// - Request +type RrdbGetScannerArgs struct { + Request *GetScannerRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewRrdbGetScannerArgs() *RrdbGetScannerArgs { + return &RrdbGetScannerArgs{} +} + +var RrdbGetScannerArgs_Request_DEFAULT *GetScannerRequest + +func (p *RrdbGetScannerArgs) GetRequest() *GetScannerRequest { + if !p.IsSetRequest() { + return RrdbGetScannerArgs_Request_DEFAULT + } + return p.Request +} +func (p *RrdbGetScannerArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *RrdbGetScannerArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbGetScannerArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &GetScannerRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *RrdbGetScannerArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("get_scanner_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbGetScannerArgs) 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 *RrdbGetScannerArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbGetScannerArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbGetScannerResult struct { + Success *ScanResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbGetScannerResult() *RrdbGetScannerResult { + return &RrdbGetScannerResult{} +} + +var RrdbGetScannerResult_Success_DEFAULT *ScanResponse + +func (p *RrdbGetScannerResult) GetSuccess() *ScanResponse { + if !p.IsSetSuccess() { + return RrdbGetScannerResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbGetScannerResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbGetScannerResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbGetScannerResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ScanResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbGetScannerResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("get_scanner_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 *RrdbGetScannerResult) 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 *RrdbGetScannerResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbGetScannerResult(%+v)", *p) +} + +// Attributes: +// - Request +type RrdbScanArgs struct { + Request *ScanRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewRrdbScanArgs() *RrdbScanArgs { + return &RrdbScanArgs{} +} + +var RrdbScanArgs_Request_DEFAULT *ScanRequest + +func (p *RrdbScanArgs) GetRequest() *ScanRequest { + if !p.IsSetRequest() { + return RrdbScanArgs_Request_DEFAULT + } + return p.Request +} +func (p *RrdbScanArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *RrdbScanArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbScanArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &ScanRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *RrdbScanArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("scan_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbScanArgs) 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 *RrdbScanArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbScanArgs(%+v)", *p) +} + +// Attributes: +// - Success +type RrdbScanResult struct { + Success *ScanResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewRrdbScanResult() *RrdbScanResult { + return &RrdbScanResult{} +} + +var RrdbScanResult_Success_DEFAULT *ScanResponse + +func (p *RrdbScanResult) GetSuccess() *ScanResponse { + if !p.IsSetSuccess() { + return RrdbScanResult_Success_DEFAULT + } + return p.Success +} +func (p *RrdbScanResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *RrdbScanResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbScanResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &ScanResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *RrdbScanResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("scan_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 *RrdbScanResult) 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 *RrdbScanResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbScanResult(%+v)", *p) +} + +// Attributes: +// - ContextID +type RrdbClearScannerArgs struct { + ContextID int64 `thrift:"context_id,1" db:"context_id" json:"context_id"` +} + +func NewRrdbClearScannerArgs() *RrdbClearScannerArgs { + return &RrdbClearScannerArgs{} +} + +func (p *RrdbClearScannerArgs) GetContextID() int64 { + return p.ContextID +} +func (p *RrdbClearScannerArgs) 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 fieldTypeId == thrift.I64 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *RrdbClearScannerArgs) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ContextID = v + } + return nil +} + +func (p *RrdbClearScannerArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("clear_scanner_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *RrdbClearScannerArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("context_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:context_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.ContextID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.context_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:context_id: ", p), err) + } + return err +} + +func (p *RrdbClearScannerArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RrdbClearScannerArgs(%+v)", *p) +} + +type Meta interface { + // Parameters: + // - Query + QueryCfg(ctx context.Context, query *replication.QueryCfgRequest) (r *replication.QueryCfgResponse, err error) +} + +type MetaClient struct { + c thrift.TClient +} + +func NewMetaClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *MetaClient { + return &MetaClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewMetaClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *MetaClient { + return &MetaClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewMetaClient(c thrift.TClient) *MetaClient { + return &MetaClient{ + c: c, + } +} + +func (p *MetaClient) Client_() thrift.TClient { + return p.c +} + +// Parameters: +// - Query +func (p *MetaClient) QueryCfg(ctx context.Context, query *replication.QueryCfgRequest) (r *replication.QueryCfgResponse, err error) { + var _args124 MetaQueryCfgArgs + _args124.Query = query + var _result125 MetaQueryCfgResult + if err = p.Client_().Call(ctx, "query_cfg", &_args124, &_result125); err != nil { + return + } + return _result125.GetSuccess(), nil +} + +type MetaProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler Meta +} + +func (p *MetaProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *MetaProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *MetaProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewMetaProcessor(handler Meta) *MetaProcessor { + + self126 := &MetaProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self126.processorMap["query_cfg"] = &metaProcessorQueryCfg{handler: handler} + return self126 +} + +func (p *MetaProcessor) Process(ctx context.Context, 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(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x127 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x127.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x127 + +} + +type metaProcessorQueryCfg struct { + handler Meta +} + +func (p *metaProcessorQueryCfg) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := MetaQueryCfgArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("query_cfg", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := MetaQueryCfgResult{} + var retval *replication.QueryCfgResponse + var err2 error + if retval, err2 = p.handler.QueryCfg(ctx, args.Query); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_cfg: "+err2.Error()) + oprot.WriteMessageBegin("query_cfg", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("query_cfg", 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(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Query +type MetaQueryCfgArgs struct { + Query *replication.QueryCfgRequest `thrift:"query,1" db:"query" json:"query"` +} + +func NewMetaQueryCfgArgs() *MetaQueryCfgArgs { + return &MetaQueryCfgArgs{} +} + +var MetaQueryCfgArgs_Query_DEFAULT *replication.QueryCfgRequest + +func (p *MetaQueryCfgArgs) GetQuery() *replication.QueryCfgRequest { + if !p.IsSetQuery() { + return MetaQueryCfgArgs_Query_DEFAULT + } + return p.Query +} +func (p *MetaQueryCfgArgs) IsSetQuery() bool { + return p.Query != nil +} + +func (p *MetaQueryCfgArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *MetaQueryCfgArgs) ReadField1(iprot thrift.TProtocol) error { + p.Query = &replication.QueryCfgRequest{} + if err := p.Query.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) + } + return nil +} + +func (p *MetaQueryCfgArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_cfg_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) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *MetaQueryCfgArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) + } + if err := p.Query.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) + } + return err +} + +func (p *MetaQueryCfgArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaQueryCfgArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaQueryCfgResult struct { + Success *replication.QueryCfgResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaQueryCfgResult() *MetaQueryCfgResult { + return &MetaQueryCfgResult{} +} + +var MetaQueryCfgResult_Success_DEFAULT *replication.QueryCfgResponse + +func (p *MetaQueryCfgResult) GetSuccess() *replication.QueryCfgResponse { + if !p.IsSetSuccess() { + return MetaQueryCfgResult_Success_DEFAULT + } + return p.Success +} +func (p *MetaQueryCfgResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaQueryCfgResult) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *MetaQueryCfgResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &replication.QueryCfgResponse{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaQueryCfgResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("query_cfg_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 *MetaQueryCfgResult) 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 *MetaQueryCfgResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaQueryCfgResult(%+v)", *p) +}