This is an automated email from the ASF dual-hosted git repository.

jiashuo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new e49a69d2 feat(dup_enhancement#26): update duplicate rpc thrift in 
go-client (#1007)
e49a69d2 is described below

commit e49a69d25a526575fe73bc6db7babdcf144ffcf3
Author: Jiashuo <[email protected]>
AuthorDate: Fri Jun 17 18:12:20 2022 +0800

    feat(dup_enhancement#26): update duplicate rpc thrift in go-client (#1007)
---
 .gitignore                   |   3 +
 go-client/idl/admin.thrift   |  44 +--
 go-client/idl/admin/admin.go | 830 ++++++++++++++++++++++---------------------
 3 files changed, 453 insertions(+), 424 deletions(-)

diff --git a/.gitignore b/.gitignore
index b2885d3a..be06ef13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -258,3 +258,6 @@ python-client/.mypy_cache/
 *.log*
 node_modules
 package-lock.json
+
+#go
+go-client/bin
diff --git a/go-client/idl/admin.thrift b/go-client/idl/admin.thrift
index 35ba5b8c..880cf453 100644
--- a/go-client/idl/admin.thrift
+++ b/go-client/idl/admin.thrift
@@ -62,18 +62,6 @@ struct drop_app_response
     1:base.error_code err;
 }
 
-struct recall_app_request
-{
-    1:i32 app_id;
-    2:string new_app_name;
-}
-
-struct recall_app_response
-{
-    1:base.error_code err;
-    2:app_info info;
-}
-
 enum app_status
 {
     AS_INVALID,
@@ -118,6 +106,18 @@ struct app_info
     14:optional bool    is_bulk_loading = false;
 }
 
+struct recall_app_request
+{
+    1:i32 app_id;
+    2:string new_app_name;
+}
+
+struct recall_app_response
+{
+    1:base.error_code err;
+    2:app_info info;
+}
+
 struct list_apps_request
 {
     1:app_status status = app_status.AS_INVALID;
@@ -269,15 +269,19 @@ struct meta_control_response
 
 /////////////////// duplication-related structs ////////////////////
 
-//  - INIT  -> START
-//  - START -> PAUSE
-//  - START -> REMOVED
-//  - PAUSE -> START
-//  - PAUSE -> REMOVED
+//  - INIT  -> PREPARE
+//  - PREPARE -> APP
+//  - APP -> LOG
+//  NOTE: Just LOG and PAUSE can be transferred states to each other
+//  - LOG -> PAUSE
+//  - PAUSE -> LOG
+//  - ALL -> REMOVED
 enum duplication_status
 {
     DS_INIT = 0,
-    DS_START,
+    DS_PREPARE,// replica prepare latest checkpoint for follower
+    DS_APP,// follower start duplicate checkpoint
+    DS_LOG,// master start batch send plog to follower
     DS_PAUSE,
     DS_REMOVED,
 }
@@ -304,8 +308,8 @@ struct duplication_add_request
     1:string  app_name;
     2:string  remote_cluster_name;
 
-    // True means to initialize the duplication in DS_PAUSE.
-    3:bool    freezed;
+    // True means to duplicate checkpoint.
+    3:optional bool is_duplicating_checkpoint = true;
 }
 
 struct duplication_add_response
diff --git a/go-client/idl/admin/admin.go b/go-client/idl/admin/admin.go
index cd0cf134..de5414a0 100644
--- a/go-client/idl/admin/admin.go
+++ b/go-client/idl/admin/admin.go
@@ -324,17 +324,23 @@ type DuplicationStatus int64
 
 const (
        DuplicationStatus_DS_INIT    DuplicationStatus = 0
-       DuplicationStatus_DS_START   DuplicationStatus = 1
-       DuplicationStatus_DS_PAUSE   DuplicationStatus = 2
-       DuplicationStatus_DS_REMOVED DuplicationStatus = 3
+       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_START:
-               return "DS_START"
+       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:
@@ -347,8 +353,12 @@ func DuplicationStatusFromString(s string) 
(DuplicationStatus, error) {
        switch s {
        case "DS_INIT":
                return DuplicationStatus_DS_INIT, nil
-       case "DS_START":
-               return DuplicationStatus_DS_START, 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":
@@ -2023,306 +2033,6 @@ func (p *DropAppResponse) String() string {
        return fmt.Sprintf("DropAppResponse(%+v)", *p)
 }
 
-// Attributes:
-//  - AppID
-//  - NewAppName_
-type RecallAppRequest 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 NewRecallAppRequest() *RecallAppRequest {
-       return &RecallAppRequest{}
-}
-
-func (p *RecallAppRequest) GetAppID() int32 {
-       return p.AppID
-}
-
-func (p *RecallAppRequest) GetNewAppName_() string {
-       return p.NewAppName_
-}
-func (p *RecallAppRequest) 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 *RecallAppRequest) 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 *RecallAppRequest) 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 *RecallAppRequest) Write(oprot thrift.TProtocol) error {
-       if err := oprot.WriteStructBegin("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 *RecallAppRequest) 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 *RecallAppRequest) 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 *RecallAppRequest) String() string {
-       if p == nil {
-               return "<nil>"
-       }
-       return fmt.Sprintf("RecallAppRequest(%+v)", *p)
-}
-
-// Attributes:
-//  - Err
-//  - Info
-type RecallAppResponse struct {
-       Err  *base.ErrorCode `thrift:"err,1" db:"err" json:"err"`
-       Info *AppInfo        `thrift:"info,2" db:"info" json:"info"`
-}
-
-func NewRecallAppResponse() *RecallAppResponse {
-       return &RecallAppResponse{}
-}
-
-var RecallAppResponse_Err_DEFAULT *base.ErrorCode
-
-func (p *RecallAppResponse) GetErr() *base.ErrorCode {
-       if !p.IsSetErr() {
-               return RecallAppResponse_Err_DEFAULT
-       }
-       return p.Err
-}
-
-var RecallAppResponse_Info_DEFAULT *AppInfo
-
-func (p *RecallAppResponse) GetInfo() *AppInfo {
-       if !p.IsSetInfo() {
-               return RecallAppResponse_Info_DEFAULT
-       }
-       return p.Info
-}
-func (p *RecallAppResponse) IsSetErr() bool {
-       return p.Err != nil
-}
-
-func (p *RecallAppResponse) IsSetInfo() bool {
-       return p.Info != nil
-}
-
-func (p *RecallAppResponse) 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 *RecallAppResponse) 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 *RecallAppResponse) ReadField2(iprot thrift.TProtocol) error {
-       p.Info = &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 *RecallAppResponse) Write(oprot thrift.TProtocol) error {
-       if err := oprot.WriteStructBegin("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 *RecallAppResponse) 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 *RecallAppResponse) 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 *RecallAppResponse) String() string {
-       if p == nil {
-               return "<nil>"
-       }
-       return fmt.Sprintf("RecallAppResponse(%+v)", *p)
-}
-
 // Attributes:
 //  - Status
 //  - AppType
@@ -2870,143 +2580,443 @@ func (p *AppInfo) writeField5(oprot thrift.TProtocol) 
(err error) {
        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)
+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 "<nil>"
+       }
+       return fmt.Sprintf("AppInfo(%+v)", *p)
+}
+
+// Attributes:
+//  - AppID
+//  - NewAppName_
+type RecallAppRequest 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 NewRecallAppRequest() *RecallAppRequest {
+       return &RecallAppRequest{}
+}
+
+func (p *RecallAppRequest) GetAppID() int32 {
+       return p.AppID
+}
+
+func (p *RecallAppRequest) GetNewAppName_() string {
+       return p.NewAppName_
+}
+func (p *RecallAppRequest) 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 *RecallAppRequest) 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 *RecallAppRequest) ReadField2(iprot thrift.TProtocol) error {
+       if v, err := iprot.ReadString(); err != nil {
+               return thrift.PrependError("error reading field 2: ", err)
+       } else {
+               p.NewAppName_ = v
        }
-       if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, 
len(p.Envs)); err != nil {
-               return thrift.PrependError("error writing map begin: ", err)
+       return nil
+}
+
+func (p *RecallAppRequest) Write(oprot thrift.TProtocol) error {
+       if err := oprot.WriteStructBegin("recall_app_request"); err != nil {
+               return thrift.PrependError(fmt.Sprintf("%T write struct begin 
error: ", p), 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 p != nil {
+               if err := p.writeField1(oprot); err != nil {
+                       return err
                }
-               if err := oprot.WriteString(string(v)); err != nil {
-                       return thrift.PrependError(fmt.Sprintf("%T. (0) field 
write error: ", p), err)
+               if err := p.writeField2(oprot); err != nil {
+                       return err
                }
        }
-       if err := oprot.WriteMapEnd(); err != nil {
-               return thrift.PrependError("error writing map end: ", err)
+       if err := oprot.WriteFieldStop(); err != nil {
+               return thrift.PrependError("write field stop error: ", err)
        }
-       if err := oprot.WriteFieldEnd(); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T write field end 
error 6:envs: ", p), err)
+       if err := oprot.WriteStructEnd(); err != nil {
+               return thrift.PrependError("write struct stop error: ", err)
        }
-       return err
+       return nil
 }
 
-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)
+func (p *RecallAppRequest) 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.WriteBool(bool(p.IsStateful)); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T.is_stateful (7) 
field write error: ", 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 7:is_stateful: ", p), err)
+               return thrift.PrependError(fmt.Sprintf("%T write field end 
error 1:app_id: ", 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)
+func (p *RecallAppRequest) 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.WriteI32(int32(p.MaxReplicaCount)); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T.max_replica_count 
(8) field write error: ", 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 8:max_replica_count: ", p), err)
+               return thrift.PrependError(fmt.Sprintf("%T write field end 
error 2:new_app_name: ", 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)
+func (p *RecallAppRequest) String() string {
+       if p == nil {
+               return "<nil>"
        }
-       if err := oprot.WriteI64(int64(p.ExpireSecond)); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T.expire_second (9) 
field write error: ", p), err)
+       return fmt.Sprintf("RecallAppRequest(%+v)", *p)
+}
+
+// Attributes:
+//  - Err
+//  - Info
+type RecallAppResponse struct {
+       Err  *base.ErrorCode `thrift:"err,1" db:"err" json:"err"`
+       Info *AppInfo        `thrift:"info,2" db:"info" json:"info"`
+}
+
+func NewRecallAppResponse() *RecallAppResponse {
+       return &RecallAppResponse{}
+}
+
+var RecallAppResponse_Err_DEFAULT *base.ErrorCode
+
+func (p *RecallAppResponse) GetErr() *base.ErrorCode {
+       if !p.IsSetErr() {
+               return RecallAppResponse_Err_DEFAULT
        }
-       if err := oprot.WriteFieldEnd(); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T write field end 
error 9:expire_second: ", p), err)
+       return p.Err
+}
+
+var RecallAppResponse_Info_DEFAULT *AppInfo
+
+func (p *RecallAppResponse) GetInfo() *AppInfo {
+       if !p.IsSetInfo() {
+               return RecallAppResponse_Info_DEFAULT
        }
-       return err
+       return p.Info
+}
+func (p *RecallAppResponse) IsSetErr() bool {
+       return p.Err != nil
 }
 
-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)
+func (p *RecallAppResponse) IsSetInfo() bool {
+       return p.Info != nil
+}
+
+func (p *RecallAppResponse) Read(iprot thrift.TProtocol) error {
+       if _, err := iprot.ReadStructBegin(); err != nil {
+               return thrift.PrependError(fmt.Sprintf("%T read error: ", 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)
+
+       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 := oprot.WriteFieldEnd(); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T write field end 
error 10:create_second: ", p), err)
+       if err := iprot.ReadStructEnd(); err != nil {
+               return thrift.PrependError(fmt.Sprintf("%T read struct end 
error: ", p), err)
        }
-       return err
+       return nil
 }
 
-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)
+func (p *RecallAppResponse) 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)
        }
-       if err := oprot.WriteI64(int64(p.DropSecond)); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T.drop_second (11) 
field write error: ", p), err)
+       return nil
+}
+
+func (p *RecallAppResponse) ReadField2(iprot thrift.TProtocol) error {
+       p.Info = &AppInfo{
+               Status: 0,
+
+               InitPartitionCount: -1,
        }
-       if err := oprot.WriteFieldEnd(); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T write field end 
error 11:drop_second: ", p), err)
+       if err := p.Info.Read(iprot); err != nil {
+               return thrift.PrependError(fmt.Sprintf("%T error reading 
struct: ", p.Info), err)
        }
-       return err
+       return nil
 }
 
-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)
+func (p *RecallAppResponse) Write(oprot thrift.TProtocol) error {
+       if err := oprot.WriteStructBegin("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 := oprot.WriteFieldEnd(); err != nil {
-                       return thrift.PrependError(fmt.Sprintf("%T write field 
end error 12:duplicating: ", p), err)
+               if err := p.writeField2(oprot); err != nil {
+                       return err
                }
        }
-       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) 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)
+func (p *RecallAppResponse) 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 := oprot.WriteI32(int32(p.InitPartitionCount)); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T.init_partition_count 
(13) field write error: ", 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 13:init_partition_count: ", p), err)
+               return thrift.PrependError(fmt.Sprintf("%T write field end 
error 1:err: ", 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)
-               }
+func (p *RecallAppResponse) 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 *AppInfo) String() string {
+func (p *RecallAppResponse) String() string {
        if p == nil {
                return "<nil>"
        }
-       return fmt.Sprintf("AppInfo(%+v)", *p)
+       return fmt.Sprintf("RecallAppResponse(%+v)", *p)
 }
 
 // Attributes:
@@ -5757,15 +5767,17 @@ func (p *MetaControlResponse) String() string {
 // Attributes:
 //  - AppName
 //  - RemoteClusterName
-//  - Freezed
+//  - IsDuplicatingCheckpoint
 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"`
-       Freezed           bool   `thrift:"freezed,3" db:"freezed" 
json:"freezed"`
+       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"`
 }
 
 func NewDuplicationAddRequest() *DuplicationAddRequest {
-       return &DuplicationAddRequest{}
+       return &DuplicationAddRequest{
+               IsDuplicatingCheckpoint: true,
+       }
 }
 
 func (p *DuplicationAddRequest) GetAppName() string {
@@ -5776,9 +5788,15 @@ func (p *DuplicationAddRequest) GetRemoteClusterName() 
string {
        return p.RemoteClusterName
 }
 
-func (p *DuplicationAddRequest) GetFreezed() bool {
-       return p.Freezed
+var DuplicationAddRequest_IsDuplicatingCheckpoint_DEFAULT bool = true
+
+func (p *DuplicationAddRequest) GetIsDuplicatingCheckpoint() bool {
+       return p.IsDuplicatingCheckpoint
 }
+func (p *DuplicationAddRequest) IsSetIsDuplicatingCheckpoint() bool {
+       return p.IsDuplicatingCheckpoint != 
DuplicationAddRequest_IsDuplicatingCheckpoint_DEFAULT
+}
+
 func (p *DuplicationAddRequest) Read(iprot thrift.TProtocol) error {
        if _, err := iprot.ReadStructBegin(); err != nil {
                return thrift.PrependError(fmt.Sprintf("%T read error: ", p), 
err)
@@ -5860,7 +5878,7 @@ 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.Freezed = v
+               p.IsDuplicatingCheckpoint = v
        }
        return nil
 }
@@ -5916,14 +5934,16 @@ func (p *DuplicationAddRequest) writeField2(oprot 
thrift.TProtocol) (err error)
 }
 
 func (p *DuplicationAddRequest) writeField3(oprot thrift.TProtocol) (err 
error) {
-       if err := oprot.WriteFieldBegin("freezed", thrift.BOOL, 3); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T write field begin 
error 3:freezed: ", p), err)
-       }
-       if err := oprot.WriteBool(bool(p.Freezed)); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T.freezed (3) field 
write error: ", p), err)
-       }
-       if err := oprot.WriteFieldEnd(); err != nil {
-               return thrift.PrependError(fmt.Sprintf("%T write field end 
error 3:freezed: ", p), err)
+       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
 }
@@ -15910,7 +15930,9 @@ func (p *AdminClientAddDuplicationArgs) Read(iprot 
thrift.TProtocol) error {
 }
 
 func (p *AdminClientAddDuplicationArgs) ReadField1(iprot thrift.TProtocol) 
error {
-       p.Req = &DuplicationAddRequest{}
+       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)
        }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to