From 4307f6233e417928ab338dc5edc4124ffdcae414 Mon Sep 17 00:00:00 2001 From: "jie.wang" <38901892+jievince@users.noreply.github.com> Date: Tue, 28 Dec 2021 11:50:03 +0800 Subject: [PATCH] Update thrift files and support duration data types (#175) * update thrift files * support duration * fix version string * add test --- client_test.go | 13 +- nebula/constants.go | 3 +- .../meta_service-remote.go | 1584 ++++++++------- nebula/meta/metaservice.go | 1470 +++++++++++--- nebula/meta/ttypes.go | 1769 +++++++++++------ .../general_storage_service-remote.go | 202 -- nebula/storage/generalstorageservice.go | 1086 ---------- .../graph_storage_service-remote.go | 346 ++-- nebula/storage/graphstorageservice.go | 86 +- .../storage_admin_service-remote.go | 288 +-- nebula/storage/storageadminservice.go | 36 +- nebula/storage/ttypes.go | 672 +++---- nebula/ttypes.go | 212 +- result_set_test.go | 6 + value_wrapper.go | 19 + 15 files changed, 4109 insertions(+), 3683 deletions(-) delete mode 100755 nebula/storage/general_storage_service-remote/general_storage_service-remote.go delete mode 100644 nebula/storage/generalstorageservice.go diff --git a/client_test.go b/client_test.go index f68dc94b..7e772731 100644 --- a/client_test.go +++ b/client_test.go @@ -371,7 +371,7 @@ func TestServiceDataIO(t *testing.T) { return } assert.Equal(t, - "(\"Bob\" :student{name: \"Bob\"} "+ + "(\"Bob\" :student{interval: P12M0DT0S, name: \"Bob\"} "+ ":person{age: 10, birthday: 2010-09-10T10:08:02.000000, book_num: 100, "+ "child_name: \"Hello Worl\", expend: 100.0, "+ "first_out_city: 1111, friends: 10, grade: 3, "+ @@ -931,6 +931,7 @@ func TestExecuteJson(t *testing.T) { "person.property": float64(1000), "person.start_school": `2017-09-10`, "student.name": "Bob", + "student.interval": `P12M0DT0S`, }, } @@ -1083,7 +1084,7 @@ func TestExecuteWithParameter(t *testing.T) { return } assert.Equal(t, - "(\"Bob\" :student{name: \"Bob\"} "+ + "(\"Bob\" :student{interval: P12M0DT0S, name: \"Bob\"} "+ ":person{age: 10, birthday: 2010-09-10T10:08:02.000000, book_num: 100, "+ "child_name: \"Hello Worl\", expend: 100.0, "+ "first_out_city: 1111, friends: 10, grade: 3, "+ @@ -1227,7 +1228,7 @@ func createTestDataSchema(t *testing.T, session *Session) { "start_school date, morning time, property double, " + "is_girl bool, child_name fixed_string(10), expend float, " + "first_out_city timestamp, hobby string); " + - "CREATE TAG IF NOT EXISTS student(name string); " + + "CREATE TAG IF NOT EXISTS student(name string, interval duration); " + "CREATE EDGE IF NOT EXISTS like(likeness double); " + "CREATE EDGE IF NOT EXISTS friend(start_Datetime datetime, end_Datetime datetime); " + "CREATE TAG INDEX IF NOT EXISTS person_name_index ON person(name(8));" @@ -1269,9 +1270,9 @@ func loadTestData(t *testing.T, session *Session) { checkResultSet(t, query, resultSet) query = - "INSERT VERTEX student(name) VALUES " + - "'Bob':('Bob'), 'Lily':('Lily'), " + - "'Tom':('Tom'), 'Jerry':('Jerry'), 'John':('John')" + "INSERT VERTEX student(name, interval) VALUES " + + "'Bob':('Bob', duration({years: 1, seconds: 0})), 'Lily':('Lily', duration({years: 1, seconds: 0})), " + + "'Tom':('Tom', duration({years: 1, seconds: 0})), 'Jerry':('Jerry', duration({years: 1, seconds: 0})), 'John':('John', duration({years: 1, seconds: 0}))" resultSet, err = tryToExecute(session, query) if err != nil { t.Fatalf(err.Error()) diff --git a/nebula/constants.go b/nebula/constants.go index 7383aee1..d0b39bb3 100644 --- a/nebula/constants.go +++ b/nebula/constants.go @@ -7,9 +7,9 @@ package nebula import ( "bytes" "context" + "sync" "fmt" thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" - "sync" ) // (needed to ensure safety because of naive import list construction.) @@ -23,3 +23,4 @@ const Version = "2.6.0" func init() { } + diff --git a/nebula/meta/meta_service-remote/meta_service-remote.go b/nebula/meta/meta_service-remote/meta_service-remote.go index f919dc47..d2863385 100755 --- a/nebula/meta/meta_service-remote/meta_service-remote.go +++ b/nebula/meta/meta_service-remote/meta_service-remote.go @@ -36,6 +36,9 @@ func Usage() { fmt.Fprintln(os.Stderr, " ExecResp dropEdge(DropEdgeReq req)") fmt.Fprintln(os.Stderr, " GetEdgeResp getEdge(GetEdgeReq req)") fmt.Fprintln(os.Stderr, " ListEdgesResp listEdges(ListEdgesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addHosts(AddHostsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addHostsIntoZone(AddHostsIntoZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropHosts(DropHostsReq req)") fmt.Fprintln(os.Stderr, " ListHostsResp listHosts(ListHostsReq req)") fmt.Fprintln(os.Stderr, " GetPartsAllocResp getPartsAlloc(GetPartsAllocReq req)") fmt.Fprintln(os.Stderr, " ListPartsResp listParts(ListPartsReq req)") @@ -75,10 +78,10 @@ func Usage() { fmt.Fprintln(os.Stderr, " ExecResp dropSnapshot(DropSnapshotReq req)") fmt.Fprintln(os.Stderr, " ListSnapshotsResp listSnapshots(ListSnapshotsReq req)") fmt.Fprintln(os.Stderr, " AdminJobResp runAdminJob(AdminJobReq req)") - fmt.Fprintln(os.Stderr, " ExecResp addZone(AddZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp mergeZone(MergeZoneReq req)") fmt.Fprintln(os.Stderr, " ExecResp dropZone(DropZoneReq req)") - fmt.Fprintln(os.Stderr, " ExecResp addHostIntoZone(AddHostIntoZoneReq req)") - fmt.Fprintln(os.Stderr, " ExecResp dropHostFromZone(DropHostFromZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp splitZone(SplitZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp renameZone(RenameZoneReq req)") fmt.Fprintln(os.Stderr, " GetZoneResp getZone(GetZoneReq req)") fmt.Fprintln(os.Stderr, " ListZonesResp listZones(ListZonesReq req)") fmt.Fprintln(os.Stderr, " CreateBackupResp createBackup(CreateBackupReq req)") @@ -202,19 +205,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateSpace requires 1 args") flag.Usage() } - arg98 := flag.Arg(1) - mbTrans99 := thrift.NewMemoryBufferLen(len(arg98)) - defer mbTrans99.Close() - _, err100 := mbTrans99.WriteString(arg98) - if err100 != nil { + arg102 := flag.Arg(1) + mbTrans103 := thrift.NewMemoryBufferLen(len(arg102)) + defer mbTrans103.Close() + _, err104 := mbTrans103.WriteString(arg102) + if err104 != nil { Usage() return } - factory101 := thrift.NewSimpleJSONProtocolFactory() - jsProt102 := factory101.GetProtocol(mbTrans99) + factory105 := thrift.NewSimpleJSONProtocolFactory() + jsProt106 := factory105.GetProtocol(mbTrans103) argvalue0 := meta.NewCreateSpaceReq() - err103 := argvalue0.Read(jsProt102) - if err103 != nil { + err107 := argvalue0.Read(jsProt106) + if err107 != nil { Usage() return } @@ -227,19 +230,19 @@ func main() { fmt.Fprintln(os.Stderr, "DropSpace requires 1 args") flag.Usage() } - arg104 := flag.Arg(1) - mbTrans105 := thrift.NewMemoryBufferLen(len(arg104)) - defer mbTrans105.Close() - _, err106 := mbTrans105.WriteString(arg104) - if err106 != nil { + arg108 := flag.Arg(1) + mbTrans109 := thrift.NewMemoryBufferLen(len(arg108)) + defer mbTrans109.Close() + _, err110 := mbTrans109.WriteString(arg108) + if err110 != nil { Usage() return } - factory107 := thrift.NewSimpleJSONProtocolFactory() - jsProt108 := factory107.GetProtocol(mbTrans105) + factory111 := thrift.NewSimpleJSONProtocolFactory() + jsProt112 := factory111.GetProtocol(mbTrans109) argvalue0 := meta.NewDropSpaceReq() - err109 := argvalue0.Read(jsProt108) - if err109 != nil { + err113 := argvalue0.Read(jsProt112) + if err113 != nil { Usage() return } @@ -252,19 +255,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetSpace requires 1 args") flag.Usage() } - arg110 := flag.Arg(1) - mbTrans111 := thrift.NewMemoryBufferLen(len(arg110)) - defer mbTrans111.Close() - _, err112 := mbTrans111.WriteString(arg110) - if err112 != nil { + arg114 := flag.Arg(1) + mbTrans115 := thrift.NewMemoryBufferLen(len(arg114)) + defer mbTrans115.Close() + _, err116 := mbTrans115.WriteString(arg114) + if err116 != nil { Usage() return } - factory113 := thrift.NewSimpleJSONProtocolFactory() - jsProt114 := factory113.GetProtocol(mbTrans111) + factory117 := thrift.NewSimpleJSONProtocolFactory() + jsProt118 := factory117.GetProtocol(mbTrans115) argvalue0 := meta.NewGetSpaceReq() - err115 := argvalue0.Read(jsProt114) - if err115 != nil { + err119 := argvalue0.Read(jsProt118) + if err119 != nil { Usage() return } @@ -277,19 +280,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListSpaces requires 1 args") flag.Usage() } - arg116 := flag.Arg(1) - mbTrans117 := thrift.NewMemoryBufferLen(len(arg116)) - defer mbTrans117.Close() - _, err118 := mbTrans117.WriteString(arg116) - if err118 != nil { + arg120 := flag.Arg(1) + mbTrans121 := thrift.NewMemoryBufferLen(len(arg120)) + defer mbTrans121.Close() + _, err122 := mbTrans121.WriteString(arg120) + if err122 != nil { Usage() return } - factory119 := thrift.NewSimpleJSONProtocolFactory() - jsProt120 := factory119.GetProtocol(mbTrans117) + factory123 := thrift.NewSimpleJSONProtocolFactory() + jsProt124 := factory123.GetProtocol(mbTrans121) argvalue0 := meta.NewListSpacesReq() - err121 := argvalue0.Read(jsProt120) - if err121 != nil { + err125 := argvalue0.Read(jsProt124) + if err125 != nil { Usage() return } @@ -302,19 +305,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateSpaceAs requires 1 args") flag.Usage() } - arg122 := flag.Arg(1) - mbTrans123 := thrift.NewMemoryBufferLen(len(arg122)) - defer mbTrans123.Close() - _, err124 := mbTrans123.WriteString(arg122) - if err124 != nil { + arg126 := flag.Arg(1) + mbTrans127 := thrift.NewMemoryBufferLen(len(arg126)) + defer mbTrans127.Close() + _, err128 := mbTrans127.WriteString(arg126) + if err128 != nil { Usage() return } - factory125 := thrift.NewSimpleJSONProtocolFactory() - jsProt126 := factory125.GetProtocol(mbTrans123) + factory129 := thrift.NewSimpleJSONProtocolFactory() + jsProt130 := factory129.GetProtocol(mbTrans127) argvalue0 := meta.NewCreateSpaceAsReq() - err127 := argvalue0.Read(jsProt126) - if err127 != nil { + err131 := argvalue0.Read(jsProt130) + if err131 != nil { Usage() return } @@ -327,19 +330,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateTag requires 1 args") flag.Usage() } - arg128 := flag.Arg(1) - mbTrans129 := thrift.NewMemoryBufferLen(len(arg128)) - defer mbTrans129.Close() - _, err130 := mbTrans129.WriteString(arg128) - if err130 != nil { + arg132 := flag.Arg(1) + mbTrans133 := thrift.NewMemoryBufferLen(len(arg132)) + defer mbTrans133.Close() + _, err134 := mbTrans133.WriteString(arg132) + if err134 != nil { Usage() return } - factory131 := thrift.NewSimpleJSONProtocolFactory() - jsProt132 := factory131.GetProtocol(mbTrans129) + factory135 := thrift.NewSimpleJSONProtocolFactory() + jsProt136 := factory135.GetProtocol(mbTrans133) argvalue0 := meta.NewCreateTagReq() - err133 := argvalue0.Read(jsProt132) - if err133 != nil { + err137 := argvalue0.Read(jsProt136) + if err137 != nil { Usage() return } @@ -352,19 +355,19 @@ func main() { fmt.Fprintln(os.Stderr, "AlterTag requires 1 args") flag.Usage() } - arg134 := flag.Arg(1) - mbTrans135 := thrift.NewMemoryBufferLen(len(arg134)) - defer mbTrans135.Close() - _, err136 := mbTrans135.WriteString(arg134) - if err136 != nil { + arg138 := flag.Arg(1) + mbTrans139 := thrift.NewMemoryBufferLen(len(arg138)) + defer mbTrans139.Close() + _, err140 := mbTrans139.WriteString(arg138) + if err140 != nil { Usage() return } - factory137 := thrift.NewSimpleJSONProtocolFactory() - jsProt138 := factory137.GetProtocol(mbTrans135) + factory141 := thrift.NewSimpleJSONProtocolFactory() + jsProt142 := factory141.GetProtocol(mbTrans139) argvalue0 := meta.NewAlterTagReq() - err139 := argvalue0.Read(jsProt138) - if err139 != nil { + err143 := argvalue0.Read(jsProt142) + if err143 != nil { Usage() return } @@ -377,19 +380,19 @@ func main() { fmt.Fprintln(os.Stderr, "DropTag requires 1 args") flag.Usage() } - arg140 := flag.Arg(1) - mbTrans141 := thrift.NewMemoryBufferLen(len(arg140)) - defer mbTrans141.Close() - _, err142 := mbTrans141.WriteString(arg140) - if err142 != nil { + arg144 := flag.Arg(1) + mbTrans145 := thrift.NewMemoryBufferLen(len(arg144)) + defer mbTrans145.Close() + _, err146 := mbTrans145.WriteString(arg144) + if err146 != nil { Usage() return } - factory143 := thrift.NewSimpleJSONProtocolFactory() - jsProt144 := factory143.GetProtocol(mbTrans141) + factory147 := thrift.NewSimpleJSONProtocolFactory() + jsProt148 := factory147.GetProtocol(mbTrans145) argvalue0 := meta.NewDropTagReq() - err145 := argvalue0.Read(jsProt144) - if err145 != nil { + err149 := argvalue0.Read(jsProt148) + if err149 != nil { Usage() return } @@ -402,19 +405,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetTag requires 1 args") flag.Usage() } - arg146 := flag.Arg(1) - mbTrans147 := thrift.NewMemoryBufferLen(len(arg146)) - defer mbTrans147.Close() - _, err148 := mbTrans147.WriteString(arg146) - if err148 != nil { + arg150 := flag.Arg(1) + mbTrans151 := thrift.NewMemoryBufferLen(len(arg150)) + defer mbTrans151.Close() + _, err152 := mbTrans151.WriteString(arg150) + if err152 != nil { Usage() return } - factory149 := thrift.NewSimpleJSONProtocolFactory() - jsProt150 := factory149.GetProtocol(mbTrans147) + factory153 := thrift.NewSimpleJSONProtocolFactory() + jsProt154 := factory153.GetProtocol(mbTrans151) argvalue0 := meta.NewGetTagReq() - err151 := argvalue0.Read(jsProt150) - if err151 != nil { + err155 := argvalue0.Read(jsProt154) + if err155 != nil { Usage() return } @@ -427,19 +430,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListTags requires 1 args") flag.Usage() } - arg152 := flag.Arg(1) - mbTrans153 := thrift.NewMemoryBufferLen(len(arg152)) - defer mbTrans153.Close() - _, err154 := mbTrans153.WriteString(arg152) - if err154 != nil { + arg156 := flag.Arg(1) + mbTrans157 := thrift.NewMemoryBufferLen(len(arg156)) + defer mbTrans157.Close() + _, err158 := mbTrans157.WriteString(arg156) + if err158 != nil { Usage() return } - factory155 := thrift.NewSimpleJSONProtocolFactory() - jsProt156 := factory155.GetProtocol(mbTrans153) + factory159 := thrift.NewSimpleJSONProtocolFactory() + jsProt160 := factory159.GetProtocol(mbTrans157) argvalue0 := meta.NewListTagsReq() - err157 := argvalue0.Read(jsProt156) - if err157 != nil { + err161 := argvalue0.Read(jsProt160) + if err161 != nil { Usage() return } @@ -452,19 +455,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateEdge requires 1 args") flag.Usage() } - arg158 := flag.Arg(1) - mbTrans159 := thrift.NewMemoryBufferLen(len(arg158)) - defer mbTrans159.Close() - _, err160 := mbTrans159.WriteString(arg158) - if err160 != nil { + arg162 := flag.Arg(1) + mbTrans163 := thrift.NewMemoryBufferLen(len(arg162)) + defer mbTrans163.Close() + _, err164 := mbTrans163.WriteString(arg162) + if err164 != nil { Usage() return } - factory161 := thrift.NewSimpleJSONProtocolFactory() - jsProt162 := factory161.GetProtocol(mbTrans159) + factory165 := thrift.NewSimpleJSONProtocolFactory() + jsProt166 := factory165.GetProtocol(mbTrans163) argvalue0 := meta.NewCreateEdgeReq() - err163 := argvalue0.Read(jsProt162) - if err163 != nil { + err167 := argvalue0.Read(jsProt166) + if err167 != nil { Usage() return } @@ -477,19 +480,19 @@ func main() { fmt.Fprintln(os.Stderr, "AlterEdge requires 1 args") flag.Usage() } - arg164 := flag.Arg(1) - mbTrans165 := thrift.NewMemoryBufferLen(len(arg164)) - defer mbTrans165.Close() - _, err166 := mbTrans165.WriteString(arg164) - if err166 != nil { + arg168 := flag.Arg(1) + mbTrans169 := thrift.NewMemoryBufferLen(len(arg168)) + defer mbTrans169.Close() + _, err170 := mbTrans169.WriteString(arg168) + if err170 != nil { Usage() return } - factory167 := thrift.NewSimpleJSONProtocolFactory() - jsProt168 := factory167.GetProtocol(mbTrans165) + factory171 := thrift.NewSimpleJSONProtocolFactory() + jsProt172 := factory171.GetProtocol(mbTrans169) argvalue0 := meta.NewAlterEdgeReq() - err169 := argvalue0.Read(jsProt168) - if err169 != nil { + err173 := argvalue0.Read(jsProt172) + if err173 != nil { Usage() return } @@ -502,19 +505,19 @@ func main() { fmt.Fprintln(os.Stderr, "DropEdge requires 1 args") flag.Usage() } - arg170 := flag.Arg(1) - mbTrans171 := thrift.NewMemoryBufferLen(len(arg170)) - defer mbTrans171.Close() - _, err172 := mbTrans171.WriteString(arg170) - if err172 != nil { + arg174 := flag.Arg(1) + mbTrans175 := thrift.NewMemoryBufferLen(len(arg174)) + defer mbTrans175.Close() + _, err176 := mbTrans175.WriteString(arg174) + if err176 != nil { Usage() return } - factory173 := thrift.NewSimpleJSONProtocolFactory() - jsProt174 := factory173.GetProtocol(mbTrans171) + factory177 := thrift.NewSimpleJSONProtocolFactory() + jsProt178 := factory177.GetProtocol(mbTrans175) argvalue0 := meta.NewDropEdgeReq() - err175 := argvalue0.Read(jsProt174) - if err175 != nil { + err179 := argvalue0.Read(jsProt178) + if err179 != nil { Usage() return } @@ -527,19 +530,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetEdge requires 1 args") flag.Usage() } - arg176 := flag.Arg(1) - mbTrans177 := thrift.NewMemoryBufferLen(len(arg176)) - defer mbTrans177.Close() - _, err178 := mbTrans177.WriteString(arg176) - if err178 != nil { + arg180 := flag.Arg(1) + mbTrans181 := thrift.NewMemoryBufferLen(len(arg180)) + defer mbTrans181.Close() + _, err182 := mbTrans181.WriteString(arg180) + if err182 != nil { Usage() return } - factory179 := thrift.NewSimpleJSONProtocolFactory() - jsProt180 := factory179.GetProtocol(mbTrans177) + factory183 := thrift.NewSimpleJSONProtocolFactory() + jsProt184 := factory183.GetProtocol(mbTrans181) argvalue0 := meta.NewGetEdgeReq() - err181 := argvalue0.Read(jsProt180) - if err181 != nil { + err185 := argvalue0.Read(jsProt184) + if err185 != nil { Usage() return } @@ -552,19 +555,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListEdges requires 1 args") flag.Usage() } - arg182 := flag.Arg(1) - mbTrans183 := thrift.NewMemoryBufferLen(len(arg182)) - defer mbTrans183.Close() - _, err184 := mbTrans183.WriteString(arg182) - if err184 != nil { + arg186 := flag.Arg(1) + mbTrans187 := thrift.NewMemoryBufferLen(len(arg186)) + defer mbTrans187.Close() + _, err188 := mbTrans187.WriteString(arg186) + if err188 != nil { Usage() return } - factory185 := thrift.NewSimpleJSONProtocolFactory() - jsProt186 := factory185.GetProtocol(mbTrans183) + factory189 := thrift.NewSimpleJSONProtocolFactory() + jsProt190 := factory189.GetProtocol(mbTrans187) argvalue0 := meta.NewListEdgesReq() - err187 := argvalue0.Read(jsProt186) - if err187 != nil { + err191 := argvalue0.Read(jsProt190) + if err191 != nil { Usage() return } @@ -572,24 +575,99 @@ func main() { fmt.Print(client.ListEdges(value0)) fmt.Print("\n") break + case "addHosts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddHosts requires 1 args") + flag.Usage() + } + arg192 := flag.Arg(1) + mbTrans193 := thrift.NewMemoryBufferLen(len(arg192)) + defer mbTrans193.Close() + _, err194 := mbTrans193.WriteString(arg192) + if err194 != nil { + Usage() + return + } + factory195 := thrift.NewSimpleJSONProtocolFactory() + jsProt196 := factory195.GetProtocol(mbTrans193) + argvalue0 := meta.NewAddHostsReq() + err197 := argvalue0.Read(jsProt196) + if err197 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddHosts(value0)) + fmt.Print("\n") + break + case "addHostsIntoZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddHostsIntoZone requires 1 args") + flag.Usage() + } + arg198 := flag.Arg(1) + mbTrans199 := thrift.NewMemoryBufferLen(len(arg198)) + defer mbTrans199.Close() + _, err200 := mbTrans199.WriteString(arg198) + if err200 != nil { + Usage() + return + } + factory201 := thrift.NewSimpleJSONProtocolFactory() + jsProt202 := factory201.GetProtocol(mbTrans199) + argvalue0 := meta.NewAddHostsIntoZoneReq() + err203 := argvalue0.Read(jsProt202) + if err203 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddHostsIntoZone(value0)) + fmt.Print("\n") + break + case "dropHosts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropHosts requires 1 args") + flag.Usage() + } + arg204 := flag.Arg(1) + mbTrans205 := thrift.NewMemoryBufferLen(len(arg204)) + defer mbTrans205.Close() + _, err206 := mbTrans205.WriteString(arg204) + if err206 != nil { + Usage() + return + } + factory207 := thrift.NewSimpleJSONProtocolFactory() + jsProt208 := factory207.GetProtocol(mbTrans205) + argvalue0 := meta.NewDropHostsReq() + err209 := argvalue0.Read(jsProt208) + if err209 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropHosts(value0)) + fmt.Print("\n") + break case "listHosts": if flag.NArg() - 1 != 1 { fmt.Fprintln(os.Stderr, "ListHosts requires 1 args") flag.Usage() } - arg188 := flag.Arg(1) - mbTrans189 := thrift.NewMemoryBufferLen(len(arg188)) - defer mbTrans189.Close() - _, err190 := mbTrans189.WriteString(arg188) - if err190 != nil { + arg210 := flag.Arg(1) + mbTrans211 := thrift.NewMemoryBufferLen(len(arg210)) + defer mbTrans211.Close() + _, err212 := mbTrans211.WriteString(arg210) + if err212 != nil { Usage() return } - factory191 := thrift.NewSimpleJSONProtocolFactory() - jsProt192 := factory191.GetProtocol(mbTrans189) + factory213 := thrift.NewSimpleJSONProtocolFactory() + jsProt214 := factory213.GetProtocol(mbTrans211) argvalue0 := meta.NewListHostsReq() - err193 := argvalue0.Read(jsProt192) - if err193 != nil { + err215 := argvalue0.Read(jsProt214) + if err215 != nil { Usage() return } @@ -602,19 +680,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetPartsAlloc requires 1 args") flag.Usage() } - arg194 := flag.Arg(1) - mbTrans195 := thrift.NewMemoryBufferLen(len(arg194)) - defer mbTrans195.Close() - _, err196 := mbTrans195.WriteString(arg194) - if err196 != nil { + arg216 := flag.Arg(1) + mbTrans217 := thrift.NewMemoryBufferLen(len(arg216)) + defer mbTrans217.Close() + _, err218 := mbTrans217.WriteString(arg216) + if err218 != nil { Usage() return } - factory197 := thrift.NewSimpleJSONProtocolFactory() - jsProt198 := factory197.GetProtocol(mbTrans195) + factory219 := thrift.NewSimpleJSONProtocolFactory() + jsProt220 := factory219.GetProtocol(mbTrans217) argvalue0 := meta.NewGetPartsAllocReq() - err199 := argvalue0.Read(jsProt198) - if err199 != nil { + err221 := argvalue0.Read(jsProt220) + if err221 != nil { Usage() return } @@ -627,19 +705,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListParts requires 1 args") flag.Usage() } - arg200 := flag.Arg(1) - mbTrans201 := thrift.NewMemoryBufferLen(len(arg200)) - defer mbTrans201.Close() - _, err202 := mbTrans201.WriteString(arg200) - if err202 != nil { + arg222 := flag.Arg(1) + mbTrans223 := thrift.NewMemoryBufferLen(len(arg222)) + defer mbTrans223.Close() + _, err224 := mbTrans223.WriteString(arg222) + if err224 != nil { Usage() return } - factory203 := thrift.NewSimpleJSONProtocolFactory() - jsProt204 := factory203.GetProtocol(mbTrans201) + factory225 := thrift.NewSimpleJSONProtocolFactory() + jsProt226 := factory225.GetProtocol(mbTrans223) argvalue0 := meta.NewListPartsReq() - err205 := argvalue0.Read(jsProt204) - if err205 != nil { + err227 := argvalue0.Read(jsProt226) + if err227 != nil { Usage() return } @@ -652,19 +730,19 @@ func main() { fmt.Fprintln(os.Stderr, "MultiPut requires 1 args") flag.Usage() } - arg206 := flag.Arg(1) - mbTrans207 := thrift.NewMemoryBufferLen(len(arg206)) - defer mbTrans207.Close() - _, err208 := mbTrans207.WriteString(arg206) - if err208 != nil { + arg228 := flag.Arg(1) + mbTrans229 := thrift.NewMemoryBufferLen(len(arg228)) + defer mbTrans229.Close() + _, err230 := mbTrans229.WriteString(arg228) + if err230 != nil { Usage() return } - factory209 := thrift.NewSimpleJSONProtocolFactory() - jsProt210 := factory209.GetProtocol(mbTrans207) + factory231 := thrift.NewSimpleJSONProtocolFactory() + jsProt232 := factory231.GetProtocol(mbTrans229) argvalue0 := meta.NewMultiPutReq() - err211 := argvalue0.Read(jsProt210) - if err211 != nil { + err233 := argvalue0.Read(jsProt232) + if err233 != nil { Usage() return } @@ -677,19 +755,19 @@ func main() { fmt.Fprintln(os.Stderr, "Get requires 1 args") flag.Usage() } - arg212 := flag.Arg(1) - mbTrans213 := thrift.NewMemoryBufferLen(len(arg212)) - defer mbTrans213.Close() - _, err214 := mbTrans213.WriteString(arg212) - if err214 != nil { + arg234 := flag.Arg(1) + mbTrans235 := thrift.NewMemoryBufferLen(len(arg234)) + defer mbTrans235.Close() + _, err236 := mbTrans235.WriteString(arg234) + if err236 != nil { Usage() return } - factory215 := thrift.NewSimpleJSONProtocolFactory() - jsProt216 := factory215.GetProtocol(mbTrans213) + factory237 := thrift.NewSimpleJSONProtocolFactory() + jsProt238 := factory237.GetProtocol(mbTrans235) argvalue0 := meta.NewGetReq() - err217 := argvalue0.Read(jsProt216) - if err217 != nil { + err239 := argvalue0.Read(jsProt238) + if err239 != nil { Usage() return } @@ -702,19 +780,19 @@ func main() { fmt.Fprintln(os.Stderr, "MultiGet requires 1 args") flag.Usage() } - arg218 := flag.Arg(1) - mbTrans219 := thrift.NewMemoryBufferLen(len(arg218)) - defer mbTrans219.Close() - _, err220 := mbTrans219.WriteString(arg218) - if err220 != nil { + arg240 := flag.Arg(1) + mbTrans241 := thrift.NewMemoryBufferLen(len(arg240)) + defer mbTrans241.Close() + _, err242 := mbTrans241.WriteString(arg240) + if err242 != nil { Usage() return } - factory221 := thrift.NewSimpleJSONProtocolFactory() - jsProt222 := factory221.GetProtocol(mbTrans219) + factory243 := thrift.NewSimpleJSONProtocolFactory() + jsProt244 := factory243.GetProtocol(mbTrans241) argvalue0 := meta.NewMultiGetReq() - err223 := argvalue0.Read(jsProt222) - if err223 != nil { + err245 := argvalue0.Read(jsProt244) + if err245 != nil { Usage() return } @@ -727,19 +805,19 @@ func main() { fmt.Fprintln(os.Stderr, "Remove requires 1 args") flag.Usage() } - arg224 := flag.Arg(1) - mbTrans225 := thrift.NewMemoryBufferLen(len(arg224)) - defer mbTrans225.Close() - _, err226 := mbTrans225.WriteString(arg224) - if err226 != nil { + arg246 := flag.Arg(1) + mbTrans247 := thrift.NewMemoryBufferLen(len(arg246)) + defer mbTrans247.Close() + _, err248 := mbTrans247.WriteString(arg246) + if err248 != nil { Usage() return } - factory227 := thrift.NewSimpleJSONProtocolFactory() - jsProt228 := factory227.GetProtocol(mbTrans225) + factory249 := thrift.NewSimpleJSONProtocolFactory() + jsProt250 := factory249.GetProtocol(mbTrans247) argvalue0 := meta.NewRemoveReq() - err229 := argvalue0.Read(jsProt228) - if err229 != nil { + err251 := argvalue0.Read(jsProt250) + if err251 != nil { Usage() return } @@ -752,19 +830,19 @@ func main() { fmt.Fprintln(os.Stderr, "RemoveRange requires 1 args") flag.Usage() } - arg230 := flag.Arg(1) - mbTrans231 := thrift.NewMemoryBufferLen(len(arg230)) - defer mbTrans231.Close() - _, err232 := mbTrans231.WriteString(arg230) - if err232 != nil { + arg252 := flag.Arg(1) + mbTrans253 := thrift.NewMemoryBufferLen(len(arg252)) + defer mbTrans253.Close() + _, err254 := mbTrans253.WriteString(arg252) + if err254 != nil { Usage() return } - factory233 := thrift.NewSimpleJSONProtocolFactory() - jsProt234 := factory233.GetProtocol(mbTrans231) + factory255 := thrift.NewSimpleJSONProtocolFactory() + jsProt256 := factory255.GetProtocol(mbTrans253) argvalue0 := meta.NewRemoveRangeReq() - err235 := argvalue0.Read(jsProt234) - if err235 != nil { + err257 := argvalue0.Read(jsProt256) + if err257 != nil { Usage() return } @@ -777,19 +855,19 @@ func main() { fmt.Fprintln(os.Stderr, "Scan requires 1 args") flag.Usage() } - arg236 := flag.Arg(1) - mbTrans237 := thrift.NewMemoryBufferLen(len(arg236)) - defer mbTrans237.Close() - _, err238 := mbTrans237.WriteString(arg236) - if err238 != nil { + arg258 := flag.Arg(1) + mbTrans259 := thrift.NewMemoryBufferLen(len(arg258)) + defer mbTrans259.Close() + _, err260 := mbTrans259.WriteString(arg258) + if err260 != nil { Usage() return } - factory239 := thrift.NewSimpleJSONProtocolFactory() - jsProt240 := factory239.GetProtocol(mbTrans237) + factory261 := thrift.NewSimpleJSONProtocolFactory() + jsProt262 := factory261.GetProtocol(mbTrans259) argvalue0 := meta.NewScanReq() - err241 := argvalue0.Read(jsProt240) - if err241 != nil { + err263 := argvalue0.Read(jsProt262) + if err263 != nil { Usage() return } @@ -802,19 +880,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateTagIndex requires 1 args") flag.Usage() } - arg242 := flag.Arg(1) - mbTrans243 := thrift.NewMemoryBufferLen(len(arg242)) - defer mbTrans243.Close() - _, err244 := mbTrans243.WriteString(arg242) - if err244 != nil { + arg264 := flag.Arg(1) + mbTrans265 := thrift.NewMemoryBufferLen(len(arg264)) + defer mbTrans265.Close() + _, err266 := mbTrans265.WriteString(arg264) + if err266 != nil { Usage() return } - factory245 := thrift.NewSimpleJSONProtocolFactory() - jsProt246 := factory245.GetProtocol(mbTrans243) + factory267 := thrift.NewSimpleJSONProtocolFactory() + jsProt268 := factory267.GetProtocol(mbTrans265) argvalue0 := meta.NewCreateTagIndexReq() - err247 := argvalue0.Read(jsProt246) - if err247 != nil { + err269 := argvalue0.Read(jsProt268) + if err269 != nil { Usage() return } @@ -827,19 +905,19 @@ func main() { fmt.Fprintln(os.Stderr, "DropTagIndex requires 1 args") flag.Usage() } - arg248 := flag.Arg(1) - mbTrans249 := thrift.NewMemoryBufferLen(len(arg248)) - defer mbTrans249.Close() - _, err250 := mbTrans249.WriteString(arg248) - if err250 != nil { + arg270 := flag.Arg(1) + mbTrans271 := thrift.NewMemoryBufferLen(len(arg270)) + defer mbTrans271.Close() + _, err272 := mbTrans271.WriteString(arg270) + if err272 != nil { Usage() return } - factory251 := thrift.NewSimpleJSONProtocolFactory() - jsProt252 := factory251.GetProtocol(mbTrans249) + factory273 := thrift.NewSimpleJSONProtocolFactory() + jsProt274 := factory273.GetProtocol(mbTrans271) argvalue0 := meta.NewDropTagIndexReq() - err253 := argvalue0.Read(jsProt252) - if err253 != nil { + err275 := argvalue0.Read(jsProt274) + if err275 != nil { Usage() return } @@ -852,19 +930,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetTagIndex requires 1 args") flag.Usage() } - arg254 := flag.Arg(1) - mbTrans255 := thrift.NewMemoryBufferLen(len(arg254)) - defer mbTrans255.Close() - _, err256 := mbTrans255.WriteString(arg254) - if err256 != nil { + arg276 := flag.Arg(1) + mbTrans277 := thrift.NewMemoryBufferLen(len(arg276)) + defer mbTrans277.Close() + _, err278 := mbTrans277.WriteString(arg276) + if err278 != nil { Usage() return } - factory257 := thrift.NewSimpleJSONProtocolFactory() - jsProt258 := factory257.GetProtocol(mbTrans255) + factory279 := thrift.NewSimpleJSONProtocolFactory() + jsProt280 := factory279.GetProtocol(mbTrans277) argvalue0 := meta.NewGetTagIndexReq() - err259 := argvalue0.Read(jsProt258) - if err259 != nil { + err281 := argvalue0.Read(jsProt280) + if err281 != nil { Usage() return } @@ -877,19 +955,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListTagIndexes requires 1 args") flag.Usage() } - arg260 := flag.Arg(1) - mbTrans261 := thrift.NewMemoryBufferLen(len(arg260)) - defer mbTrans261.Close() - _, err262 := mbTrans261.WriteString(arg260) - if err262 != nil { + arg282 := flag.Arg(1) + mbTrans283 := thrift.NewMemoryBufferLen(len(arg282)) + defer mbTrans283.Close() + _, err284 := mbTrans283.WriteString(arg282) + if err284 != nil { Usage() return } - factory263 := thrift.NewSimpleJSONProtocolFactory() - jsProt264 := factory263.GetProtocol(mbTrans261) + factory285 := thrift.NewSimpleJSONProtocolFactory() + jsProt286 := factory285.GetProtocol(mbTrans283) argvalue0 := meta.NewListTagIndexesReq() - err265 := argvalue0.Read(jsProt264) - if err265 != nil { + err287 := argvalue0.Read(jsProt286) + if err287 != nil { Usage() return } @@ -902,19 +980,19 @@ func main() { fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") flag.Usage() } - arg266 := flag.Arg(1) - mbTrans267 := thrift.NewMemoryBufferLen(len(arg266)) - defer mbTrans267.Close() - _, err268 := mbTrans267.WriteString(arg266) - if err268 != nil { + arg288 := flag.Arg(1) + mbTrans289 := thrift.NewMemoryBufferLen(len(arg288)) + defer mbTrans289.Close() + _, err290 := mbTrans289.WriteString(arg288) + if err290 != nil { Usage() return } - factory269 := thrift.NewSimpleJSONProtocolFactory() - jsProt270 := factory269.GetProtocol(mbTrans267) + factory291 := thrift.NewSimpleJSONProtocolFactory() + jsProt292 := factory291.GetProtocol(mbTrans289) argvalue0 := meta.NewRebuildIndexReq() - err271 := argvalue0.Read(jsProt270) - if err271 != nil { + err293 := argvalue0.Read(jsProt292) + if err293 != nil { Usage() return } @@ -927,19 +1005,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListTagIndexStatus requires 1 args") flag.Usage() } - arg272 := flag.Arg(1) - mbTrans273 := thrift.NewMemoryBufferLen(len(arg272)) - defer mbTrans273.Close() - _, err274 := mbTrans273.WriteString(arg272) - if err274 != nil { + arg294 := flag.Arg(1) + mbTrans295 := thrift.NewMemoryBufferLen(len(arg294)) + defer mbTrans295.Close() + _, err296 := mbTrans295.WriteString(arg294) + if err296 != nil { Usage() return } - factory275 := thrift.NewSimpleJSONProtocolFactory() - jsProt276 := factory275.GetProtocol(mbTrans273) + factory297 := thrift.NewSimpleJSONProtocolFactory() + jsProt298 := factory297.GetProtocol(mbTrans295) argvalue0 := meta.NewListIndexStatusReq() - err277 := argvalue0.Read(jsProt276) - if err277 != nil { + err299 := argvalue0.Read(jsProt298) + if err299 != nil { Usage() return } @@ -952,19 +1030,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateEdgeIndex requires 1 args") flag.Usage() } - arg278 := flag.Arg(1) - mbTrans279 := thrift.NewMemoryBufferLen(len(arg278)) - defer mbTrans279.Close() - _, err280 := mbTrans279.WriteString(arg278) - if err280 != nil { + arg300 := flag.Arg(1) + mbTrans301 := thrift.NewMemoryBufferLen(len(arg300)) + defer mbTrans301.Close() + _, err302 := mbTrans301.WriteString(arg300) + if err302 != nil { Usage() return } - factory281 := thrift.NewSimpleJSONProtocolFactory() - jsProt282 := factory281.GetProtocol(mbTrans279) + factory303 := thrift.NewSimpleJSONProtocolFactory() + jsProt304 := factory303.GetProtocol(mbTrans301) argvalue0 := meta.NewCreateEdgeIndexReq() - err283 := argvalue0.Read(jsProt282) - if err283 != nil { + err305 := argvalue0.Read(jsProt304) + if err305 != nil { Usage() return } @@ -977,19 +1055,19 @@ func main() { fmt.Fprintln(os.Stderr, "DropEdgeIndex requires 1 args") flag.Usage() } - arg284 := flag.Arg(1) - mbTrans285 := thrift.NewMemoryBufferLen(len(arg284)) - defer mbTrans285.Close() - _, err286 := mbTrans285.WriteString(arg284) - if err286 != nil { + arg306 := flag.Arg(1) + mbTrans307 := thrift.NewMemoryBufferLen(len(arg306)) + defer mbTrans307.Close() + _, err308 := mbTrans307.WriteString(arg306) + if err308 != nil { Usage() return } - factory287 := thrift.NewSimpleJSONProtocolFactory() - jsProt288 := factory287.GetProtocol(mbTrans285) + factory309 := thrift.NewSimpleJSONProtocolFactory() + jsProt310 := factory309.GetProtocol(mbTrans307) argvalue0 := meta.NewDropEdgeIndexReq() - err289 := argvalue0.Read(jsProt288) - if err289 != nil { + err311 := argvalue0.Read(jsProt310) + if err311 != nil { Usage() return } @@ -1002,19 +1080,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetEdgeIndex requires 1 args") flag.Usage() } - arg290 := flag.Arg(1) - mbTrans291 := thrift.NewMemoryBufferLen(len(arg290)) - defer mbTrans291.Close() - _, err292 := mbTrans291.WriteString(arg290) - if err292 != nil { + arg312 := flag.Arg(1) + mbTrans313 := thrift.NewMemoryBufferLen(len(arg312)) + defer mbTrans313.Close() + _, err314 := mbTrans313.WriteString(arg312) + if err314 != nil { Usage() return } - factory293 := thrift.NewSimpleJSONProtocolFactory() - jsProt294 := factory293.GetProtocol(mbTrans291) + factory315 := thrift.NewSimpleJSONProtocolFactory() + jsProt316 := factory315.GetProtocol(mbTrans313) argvalue0 := meta.NewGetEdgeIndexReq() - err295 := argvalue0.Read(jsProt294) - if err295 != nil { + err317 := argvalue0.Read(jsProt316) + if err317 != nil { Usage() return } @@ -1027,19 +1105,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListEdgeIndexes requires 1 args") flag.Usage() } - arg296 := flag.Arg(1) - mbTrans297 := thrift.NewMemoryBufferLen(len(arg296)) - defer mbTrans297.Close() - _, err298 := mbTrans297.WriteString(arg296) - if err298 != nil { + arg318 := flag.Arg(1) + mbTrans319 := thrift.NewMemoryBufferLen(len(arg318)) + defer mbTrans319.Close() + _, err320 := mbTrans319.WriteString(arg318) + if err320 != nil { Usage() return } - factory299 := thrift.NewSimpleJSONProtocolFactory() - jsProt300 := factory299.GetProtocol(mbTrans297) + factory321 := thrift.NewSimpleJSONProtocolFactory() + jsProt322 := factory321.GetProtocol(mbTrans319) argvalue0 := meta.NewListEdgeIndexesReq() - err301 := argvalue0.Read(jsProt300) - if err301 != nil { + err323 := argvalue0.Read(jsProt322) + if err323 != nil { Usage() return } @@ -1052,19 +1130,19 @@ func main() { fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") flag.Usage() } - arg302 := flag.Arg(1) - mbTrans303 := thrift.NewMemoryBufferLen(len(arg302)) - defer mbTrans303.Close() - _, err304 := mbTrans303.WriteString(arg302) - if err304 != nil { + arg324 := flag.Arg(1) + mbTrans325 := thrift.NewMemoryBufferLen(len(arg324)) + defer mbTrans325.Close() + _, err326 := mbTrans325.WriteString(arg324) + if err326 != nil { Usage() return } - factory305 := thrift.NewSimpleJSONProtocolFactory() - jsProt306 := factory305.GetProtocol(mbTrans303) + factory327 := thrift.NewSimpleJSONProtocolFactory() + jsProt328 := factory327.GetProtocol(mbTrans325) argvalue0 := meta.NewRebuildIndexReq() - err307 := argvalue0.Read(jsProt306) - if err307 != nil { + err329 := argvalue0.Read(jsProt328) + if err329 != nil { Usage() return } @@ -1077,19 +1155,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListEdgeIndexStatus requires 1 args") flag.Usage() } - arg308 := flag.Arg(1) - mbTrans309 := thrift.NewMemoryBufferLen(len(arg308)) - defer mbTrans309.Close() - _, err310 := mbTrans309.WriteString(arg308) - if err310 != nil { + arg330 := flag.Arg(1) + mbTrans331 := thrift.NewMemoryBufferLen(len(arg330)) + defer mbTrans331.Close() + _, err332 := mbTrans331.WriteString(arg330) + if err332 != nil { Usage() return } - factory311 := thrift.NewSimpleJSONProtocolFactory() - jsProt312 := factory311.GetProtocol(mbTrans309) + factory333 := thrift.NewSimpleJSONProtocolFactory() + jsProt334 := factory333.GetProtocol(mbTrans331) argvalue0 := meta.NewListIndexStatusReq() - err313 := argvalue0.Read(jsProt312) - if err313 != nil { + err335 := argvalue0.Read(jsProt334) + if err335 != nil { Usage() return } @@ -1102,19 +1180,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateUser requires 1 args") flag.Usage() } - arg314 := flag.Arg(1) - mbTrans315 := thrift.NewMemoryBufferLen(len(arg314)) - defer mbTrans315.Close() - _, err316 := mbTrans315.WriteString(arg314) - if err316 != nil { + arg336 := flag.Arg(1) + mbTrans337 := thrift.NewMemoryBufferLen(len(arg336)) + defer mbTrans337.Close() + _, err338 := mbTrans337.WriteString(arg336) + if err338 != nil { Usage() return } - factory317 := thrift.NewSimpleJSONProtocolFactory() - jsProt318 := factory317.GetProtocol(mbTrans315) + factory339 := thrift.NewSimpleJSONProtocolFactory() + jsProt340 := factory339.GetProtocol(mbTrans337) argvalue0 := meta.NewCreateUserReq() - err319 := argvalue0.Read(jsProt318) - if err319 != nil { + err341 := argvalue0.Read(jsProt340) + if err341 != nil { Usage() return } @@ -1127,19 +1205,19 @@ func main() { fmt.Fprintln(os.Stderr, "DropUser requires 1 args") flag.Usage() } - arg320 := flag.Arg(1) - mbTrans321 := thrift.NewMemoryBufferLen(len(arg320)) - defer mbTrans321.Close() - _, err322 := mbTrans321.WriteString(arg320) - if err322 != nil { + arg342 := flag.Arg(1) + mbTrans343 := thrift.NewMemoryBufferLen(len(arg342)) + defer mbTrans343.Close() + _, err344 := mbTrans343.WriteString(arg342) + if err344 != nil { Usage() return } - factory323 := thrift.NewSimpleJSONProtocolFactory() - jsProt324 := factory323.GetProtocol(mbTrans321) + factory345 := thrift.NewSimpleJSONProtocolFactory() + jsProt346 := factory345.GetProtocol(mbTrans343) argvalue0 := meta.NewDropUserReq() - err325 := argvalue0.Read(jsProt324) - if err325 != nil { + err347 := argvalue0.Read(jsProt346) + if err347 != nil { Usage() return } @@ -1152,19 +1230,19 @@ func main() { fmt.Fprintln(os.Stderr, "AlterUser requires 1 args") flag.Usage() } - arg326 := flag.Arg(1) - mbTrans327 := thrift.NewMemoryBufferLen(len(arg326)) - defer mbTrans327.Close() - _, err328 := mbTrans327.WriteString(arg326) - if err328 != nil { + arg348 := flag.Arg(1) + mbTrans349 := thrift.NewMemoryBufferLen(len(arg348)) + defer mbTrans349.Close() + _, err350 := mbTrans349.WriteString(arg348) + if err350 != nil { Usage() return } - factory329 := thrift.NewSimpleJSONProtocolFactory() - jsProt330 := factory329.GetProtocol(mbTrans327) + factory351 := thrift.NewSimpleJSONProtocolFactory() + jsProt352 := factory351.GetProtocol(mbTrans349) argvalue0 := meta.NewAlterUserReq() - err331 := argvalue0.Read(jsProt330) - if err331 != nil { + err353 := argvalue0.Read(jsProt352) + if err353 != nil { Usage() return } @@ -1177,19 +1255,19 @@ func main() { fmt.Fprintln(os.Stderr, "GrantRole requires 1 args") flag.Usage() } - arg332 := flag.Arg(1) - mbTrans333 := thrift.NewMemoryBufferLen(len(arg332)) - defer mbTrans333.Close() - _, err334 := mbTrans333.WriteString(arg332) - if err334 != nil { + arg354 := flag.Arg(1) + mbTrans355 := thrift.NewMemoryBufferLen(len(arg354)) + defer mbTrans355.Close() + _, err356 := mbTrans355.WriteString(arg354) + if err356 != nil { Usage() return } - factory335 := thrift.NewSimpleJSONProtocolFactory() - jsProt336 := factory335.GetProtocol(mbTrans333) + factory357 := thrift.NewSimpleJSONProtocolFactory() + jsProt358 := factory357.GetProtocol(mbTrans355) argvalue0 := meta.NewGrantRoleReq() - err337 := argvalue0.Read(jsProt336) - if err337 != nil { + err359 := argvalue0.Read(jsProt358) + if err359 != nil { Usage() return } @@ -1202,19 +1280,19 @@ func main() { fmt.Fprintln(os.Stderr, "RevokeRole requires 1 args") flag.Usage() } - arg338 := flag.Arg(1) - mbTrans339 := thrift.NewMemoryBufferLen(len(arg338)) - defer mbTrans339.Close() - _, err340 := mbTrans339.WriteString(arg338) - if err340 != nil { + arg360 := flag.Arg(1) + mbTrans361 := thrift.NewMemoryBufferLen(len(arg360)) + defer mbTrans361.Close() + _, err362 := mbTrans361.WriteString(arg360) + if err362 != nil { Usage() return } - factory341 := thrift.NewSimpleJSONProtocolFactory() - jsProt342 := factory341.GetProtocol(mbTrans339) + factory363 := thrift.NewSimpleJSONProtocolFactory() + jsProt364 := factory363.GetProtocol(mbTrans361) argvalue0 := meta.NewRevokeRoleReq() - err343 := argvalue0.Read(jsProt342) - if err343 != nil { + err365 := argvalue0.Read(jsProt364) + if err365 != nil { Usage() return } @@ -1227,19 +1305,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListUsers requires 1 args") flag.Usage() } - arg344 := flag.Arg(1) - mbTrans345 := thrift.NewMemoryBufferLen(len(arg344)) - defer mbTrans345.Close() - _, err346 := mbTrans345.WriteString(arg344) - if err346 != nil { + arg366 := flag.Arg(1) + mbTrans367 := thrift.NewMemoryBufferLen(len(arg366)) + defer mbTrans367.Close() + _, err368 := mbTrans367.WriteString(arg366) + if err368 != nil { Usage() return } - factory347 := thrift.NewSimpleJSONProtocolFactory() - jsProt348 := factory347.GetProtocol(mbTrans345) + factory369 := thrift.NewSimpleJSONProtocolFactory() + jsProt370 := factory369.GetProtocol(mbTrans367) argvalue0 := meta.NewListUsersReq() - err349 := argvalue0.Read(jsProt348) - if err349 != nil { + err371 := argvalue0.Read(jsProt370) + if err371 != nil { Usage() return } @@ -1252,19 +1330,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListRoles requires 1 args") flag.Usage() } - arg350 := flag.Arg(1) - mbTrans351 := thrift.NewMemoryBufferLen(len(arg350)) - defer mbTrans351.Close() - _, err352 := mbTrans351.WriteString(arg350) - if err352 != nil { + arg372 := flag.Arg(1) + mbTrans373 := thrift.NewMemoryBufferLen(len(arg372)) + defer mbTrans373.Close() + _, err374 := mbTrans373.WriteString(arg372) + if err374 != nil { Usage() return } - factory353 := thrift.NewSimpleJSONProtocolFactory() - jsProt354 := factory353.GetProtocol(mbTrans351) + factory375 := thrift.NewSimpleJSONProtocolFactory() + jsProt376 := factory375.GetProtocol(mbTrans373) argvalue0 := meta.NewListRolesReq() - err355 := argvalue0.Read(jsProt354) - if err355 != nil { + err377 := argvalue0.Read(jsProt376) + if err377 != nil { Usage() return } @@ -1277,19 +1355,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetUserRoles requires 1 args") flag.Usage() } - arg356 := flag.Arg(1) - mbTrans357 := thrift.NewMemoryBufferLen(len(arg356)) - defer mbTrans357.Close() - _, err358 := mbTrans357.WriteString(arg356) - if err358 != nil { + arg378 := flag.Arg(1) + mbTrans379 := thrift.NewMemoryBufferLen(len(arg378)) + defer mbTrans379.Close() + _, err380 := mbTrans379.WriteString(arg378) + if err380 != nil { Usage() return } - factory359 := thrift.NewSimpleJSONProtocolFactory() - jsProt360 := factory359.GetProtocol(mbTrans357) + factory381 := thrift.NewSimpleJSONProtocolFactory() + jsProt382 := factory381.GetProtocol(mbTrans379) argvalue0 := meta.NewGetUserRolesReq() - err361 := argvalue0.Read(jsProt360) - if err361 != nil { + err383 := argvalue0.Read(jsProt382) + if err383 != nil { Usage() return } @@ -1302,19 +1380,19 @@ func main() { fmt.Fprintln(os.Stderr, "ChangePassword requires 1 args") flag.Usage() } - arg362 := flag.Arg(1) - mbTrans363 := thrift.NewMemoryBufferLen(len(arg362)) - defer mbTrans363.Close() - _, err364 := mbTrans363.WriteString(arg362) - if err364 != nil { + arg384 := flag.Arg(1) + mbTrans385 := thrift.NewMemoryBufferLen(len(arg384)) + defer mbTrans385.Close() + _, err386 := mbTrans385.WriteString(arg384) + if err386 != nil { Usage() return } - factory365 := thrift.NewSimpleJSONProtocolFactory() - jsProt366 := factory365.GetProtocol(mbTrans363) + factory387 := thrift.NewSimpleJSONProtocolFactory() + jsProt388 := factory387.GetProtocol(mbTrans385) argvalue0 := meta.NewChangePasswordReq() - err367 := argvalue0.Read(jsProt366) - if err367 != nil { + err389 := argvalue0.Read(jsProt388) + if err389 != nil { Usage() return } @@ -1327,19 +1405,19 @@ func main() { fmt.Fprintln(os.Stderr, "HeartBeat requires 1 args") flag.Usage() } - arg368 := flag.Arg(1) - mbTrans369 := thrift.NewMemoryBufferLen(len(arg368)) - defer mbTrans369.Close() - _, err370 := mbTrans369.WriteString(arg368) - if err370 != nil { + arg390 := flag.Arg(1) + mbTrans391 := thrift.NewMemoryBufferLen(len(arg390)) + defer mbTrans391.Close() + _, err392 := mbTrans391.WriteString(arg390) + if err392 != nil { Usage() return } - factory371 := thrift.NewSimpleJSONProtocolFactory() - jsProt372 := factory371.GetProtocol(mbTrans369) + factory393 := thrift.NewSimpleJSONProtocolFactory() + jsProt394 := factory393.GetProtocol(mbTrans391) argvalue0 := meta.NewHBReq() - err373 := argvalue0.Read(jsProt372) - if err373 != nil { + err395 := argvalue0.Read(jsProt394) + if err395 != nil { Usage() return } @@ -1352,19 +1430,19 @@ func main() { fmt.Fprintln(os.Stderr, "RegConfig requires 1 args") flag.Usage() } - arg374 := flag.Arg(1) - mbTrans375 := thrift.NewMemoryBufferLen(len(arg374)) - defer mbTrans375.Close() - _, err376 := mbTrans375.WriteString(arg374) - if err376 != nil { + arg396 := flag.Arg(1) + mbTrans397 := thrift.NewMemoryBufferLen(len(arg396)) + defer mbTrans397.Close() + _, err398 := mbTrans397.WriteString(arg396) + if err398 != nil { Usage() return } - factory377 := thrift.NewSimpleJSONProtocolFactory() - jsProt378 := factory377.GetProtocol(mbTrans375) + factory399 := thrift.NewSimpleJSONProtocolFactory() + jsProt400 := factory399.GetProtocol(mbTrans397) argvalue0 := meta.NewRegConfigReq() - err379 := argvalue0.Read(jsProt378) - if err379 != nil { + err401 := argvalue0.Read(jsProt400) + if err401 != nil { Usage() return } @@ -1377,19 +1455,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetConfig requires 1 args") flag.Usage() } - arg380 := flag.Arg(1) - mbTrans381 := thrift.NewMemoryBufferLen(len(arg380)) - defer mbTrans381.Close() - _, err382 := mbTrans381.WriteString(arg380) - if err382 != nil { + arg402 := flag.Arg(1) + mbTrans403 := thrift.NewMemoryBufferLen(len(arg402)) + defer mbTrans403.Close() + _, err404 := mbTrans403.WriteString(arg402) + if err404 != nil { Usage() return } - factory383 := thrift.NewSimpleJSONProtocolFactory() - jsProt384 := factory383.GetProtocol(mbTrans381) + factory405 := thrift.NewSimpleJSONProtocolFactory() + jsProt406 := factory405.GetProtocol(mbTrans403) argvalue0 := meta.NewGetConfigReq() - err385 := argvalue0.Read(jsProt384) - if err385 != nil { + err407 := argvalue0.Read(jsProt406) + if err407 != nil { Usage() return } @@ -1402,19 +1480,19 @@ func main() { fmt.Fprintln(os.Stderr, "SetConfig requires 1 args") flag.Usage() } - arg386 := flag.Arg(1) - mbTrans387 := thrift.NewMemoryBufferLen(len(arg386)) - defer mbTrans387.Close() - _, err388 := mbTrans387.WriteString(arg386) - if err388 != nil { + arg408 := flag.Arg(1) + mbTrans409 := thrift.NewMemoryBufferLen(len(arg408)) + defer mbTrans409.Close() + _, err410 := mbTrans409.WriteString(arg408) + if err410 != nil { Usage() return } - factory389 := thrift.NewSimpleJSONProtocolFactory() - jsProt390 := factory389.GetProtocol(mbTrans387) + factory411 := thrift.NewSimpleJSONProtocolFactory() + jsProt412 := factory411.GetProtocol(mbTrans409) argvalue0 := meta.NewSetConfigReq() - err391 := argvalue0.Read(jsProt390) - if err391 != nil { + err413 := argvalue0.Read(jsProt412) + if err413 != nil { Usage() return } @@ -1427,19 +1505,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListConfigs requires 1 args") flag.Usage() } - arg392 := flag.Arg(1) - mbTrans393 := thrift.NewMemoryBufferLen(len(arg392)) - defer mbTrans393.Close() - _, err394 := mbTrans393.WriteString(arg392) - if err394 != nil { + arg414 := flag.Arg(1) + mbTrans415 := thrift.NewMemoryBufferLen(len(arg414)) + defer mbTrans415.Close() + _, err416 := mbTrans415.WriteString(arg414) + if err416 != nil { Usage() return } - factory395 := thrift.NewSimpleJSONProtocolFactory() - jsProt396 := factory395.GetProtocol(mbTrans393) + factory417 := thrift.NewSimpleJSONProtocolFactory() + jsProt418 := factory417.GetProtocol(mbTrans415) argvalue0 := meta.NewListConfigsReq() - err397 := argvalue0.Read(jsProt396) - if err397 != nil { + err419 := argvalue0.Read(jsProt418) + if err419 != nil { Usage() return } @@ -1452,19 +1530,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateSnapshot requires 1 args") flag.Usage() } - arg398 := flag.Arg(1) - mbTrans399 := thrift.NewMemoryBufferLen(len(arg398)) - defer mbTrans399.Close() - _, err400 := mbTrans399.WriteString(arg398) - if err400 != nil { + arg420 := flag.Arg(1) + mbTrans421 := thrift.NewMemoryBufferLen(len(arg420)) + defer mbTrans421.Close() + _, err422 := mbTrans421.WriteString(arg420) + if err422 != nil { Usage() return } - factory401 := thrift.NewSimpleJSONProtocolFactory() - jsProt402 := factory401.GetProtocol(mbTrans399) + factory423 := thrift.NewSimpleJSONProtocolFactory() + jsProt424 := factory423.GetProtocol(mbTrans421) argvalue0 := meta.NewCreateSnapshotReq() - err403 := argvalue0.Read(jsProt402) - if err403 != nil { + err425 := argvalue0.Read(jsProt424) + if err425 != nil { Usage() return } @@ -1477,19 +1555,19 @@ func main() { fmt.Fprintln(os.Stderr, "DropSnapshot requires 1 args") flag.Usage() } - arg404 := flag.Arg(1) - mbTrans405 := thrift.NewMemoryBufferLen(len(arg404)) - defer mbTrans405.Close() - _, err406 := mbTrans405.WriteString(arg404) - if err406 != nil { + arg426 := flag.Arg(1) + mbTrans427 := thrift.NewMemoryBufferLen(len(arg426)) + defer mbTrans427.Close() + _, err428 := mbTrans427.WriteString(arg426) + if err428 != nil { Usage() return } - factory407 := thrift.NewSimpleJSONProtocolFactory() - jsProt408 := factory407.GetProtocol(mbTrans405) + factory429 := thrift.NewSimpleJSONProtocolFactory() + jsProt430 := factory429.GetProtocol(mbTrans427) argvalue0 := meta.NewDropSnapshotReq() - err409 := argvalue0.Read(jsProt408) - if err409 != nil { + err431 := argvalue0.Read(jsProt430) + if err431 != nil { Usage() return } @@ -1502,19 +1580,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListSnapshots requires 1 args") flag.Usage() } - arg410 := flag.Arg(1) - mbTrans411 := thrift.NewMemoryBufferLen(len(arg410)) - defer mbTrans411.Close() - _, err412 := mbTrans411.WriteString(arg410) - if err412 != nil { + arg432 := flag.Arg(1) + mbTrans433 := thrift.NewMemoryBufferLen(len(arg432)) + defer mbTrans433.Close() + _, err434 := mbTrans433.WriteString(arg432) + if err434 != nil { Usage() return } - factory413 := thrift.NewSimpleJSONProtocolFactory() - jsProt414 := factory413.GetProtocol(mbTrans411) + factory435 := thrift.NewSimpleJSONProtocolFactory() + jsProt436 := factory435.GetProtocol(mbTrans433) argvalue0 := meta.NewListSnapshotsReq() - err415 := argvalue0.Read(jsProt414) - if err415 != nil { + err437 := argvalue0.Read(jsProt436) + if err437 != nil { Usage() return } @@ -1527,19 +1605,19 @@ func main() { fmt.Fprintln(os.Stderr, "RunAdminJob requires 1 args") flag.Usage() } - arg416 := flag.Arg(1) - mbTrans417 := thrift.NewMemoryBufferLen(len(arg416)) - defer mbTrans417.Close() - _, err418 := mbTrans417.WriteString(arg416) - if err418 != nil { + arg438 := flag.Arg(1) + mbTrans439 := thrift.NewMemoryBufferLen(len(arg438)) + defer mbTrans439.Close() + _, err440 := mbTrans439.WriteString(arg438) + if err440 != nil { Usage() return } - factory419 := thrift.NewSimpleJSONProtocolFactory() - jsProt420 := factory419.GetProtocol(mbTrans417) + factory441 := thrift.NewSimpleJSONProtocolFactory() + jsProt442 := factory441.GetProtocol(mbTrans439) argvalue0 := meta.NewAdminJobReq() - err421 := argvalue0.Read(jsProt420) - if err421 != nil { + err443 := argvalue0.Read(jsProt442) + if err443 != nil { Usage() return } @@ -1547,29 +1625,29 @@ func main() { fmt.Print(client.RunAdminJob(value0)) fmt.Print("\n") break - case "addZone": + case "mergeZone": if flag.NArg() - 1 != 1 { - fmt.Fprintln(os.Stderr, "AddZone requires 1 args") + fmt.Fprintln(os.Stderr, "MergeZone requires 1 args") flag.Usage() } - arg422 := flag.Arg(1) - mbTrans423 := thrift.NewMemoryBufferLen(len(arg422)) - defer mbTrans423.Close() - _, err424 := mbTrans423.WriteString(arg422) - if err424 != nil { + arg444 := flag.Arg(1) + mbTrans445 := thrift.NewMemoryBufferLen(len(arg444)) + defer mbTrans445.Close() + _, err446 := mbTrans445.WriteString(arg444) + if err446 != nil { Usage() return } - factory425 := thrift.NewSimpleJSONProtocolFactory() - jsProt426 := factory425.GetProtocol(mbTrans423) - argvalue0 := meta.NewAddZoneReq() - err427 := argvalue0.Read(jsProt426) - if err427 != nil { + factory447 := thrift.NewSimpleJSONProtocolFactory() + jsProt448 := factory447.GetProtocol(mbTrans445) + argvalue0 := meta.NewMergeZoneReq() + err449 := argvalue0.Read(jsProt448) + if err449 != nil { Usage() return } value0 := argvalue0 - fmt.Print(client.AddZone(value0)) + fmt.Print(client.MergeZone(value0)) fmt.Print("\n") break case "dropZone": @@ -1577,19 +1655,19 @@ func main() { fmt.Fprintln(os.Stderr, "DropZone requires 1 args") flag.Usage() } - arg428 := flag.Arg(1) - mbTrans429 := thrift.NewMemoryBufferLen(len(arg428)) - defer mbTrans429.Close() - _, err430 := mbTrans429.WriteString(arg428) - if err430 != nil { + arg450 := flag.Arg(1) + mbTrans451 := thrift.NewMemoryBufferLen(len(arg450)) + defer mbTrans451.Close() + _, err452 := mbTrans451.WriteString(arg450) + if err452 != nil { Usage() return } - factory431 := thrift.NewSimpleJSONProtocolFactory() - jsProt432 := factory431.GetProtocol(mbTrans429) + factory453 := thrift.NewSimpleJSONProtocolFactory() + jsProt454 := factory453.GetProtocol(mbTrans451) argvalue0 := meta.NewDropZoneReq() - err433 := argvalue0.Read(jsProt432) - if err433 != nil { + err455 := argvalue0.Read(jsProt454) + if err455 != nil { Usage() return } @@ -1597,54 +1675,54 @@ func main() { fmt.Print(client.DropZone(value0)) fmt.Print("\n") break - case "addHostIntoZone": + case "splitZone": if flag.NArg() - 1 != 1 { - fmt.Fprintln(os.Stderr, "AddHostIntoZone requires 1 args") + fmt.Fprintln(os.Stderr, "SplitZone requires 1 args") flag.Usage() } - arg434 := flag.Arg(1) - mbTrans435 := thrift.NewMemoryBufferLen(len(arg434)) - defer mbTrans435.Close() - _, err436 := mbTrans435.WriteString(arg434) - if err436 != nil { + arg456 := flag.Arg(1) + mbTrans457 := thrift.NewMemoryBufferLen(len(arg456)) + defer mbTrans457.Close() + _, err458 := mbTrans457.WriteString(arg456) + if err458 != nil { Usage() return } - factory437 := thrift.NewSimpleJSONProtocolFactory() - jsProt438 := factory437.GetProtocol(mbTrans435) - argvalue0 := meta.NewAddHostIntoZoneReq() - err439 := argvalue0.Read(jsProt438) - if err439 != nil { + factory459 := thrift.NewSimpleJSONProtocolFactory() + jsProt460 := factory459.GetProtocol(mbTrans457) + argvalue0 := meta.NewSplitZoneReq() + err461 := argvalue0.Read(jsProt460) + if err461 != nil { Usage() return } value0 := argvalue0 - fmt.Print(client.AddHostIntoZone(value0)) + fmt.Print(client.SplitZone(value0)) fmt.Print("\n") break - case "dropHostFromZone": + case "renameZone": if flag.NArg() - 1 != 1 { - fmt.Fprintln(os.Stderr, "DropHostFromZone requires 1 args") + fmt.Fprintln(os.Stderr, "RenameZone requires 1 args") flag.Usage() } - arg440 := flag.Arg(1) - mbTrans441 := thrift.NewMemoryBufferLen(len(arg440)) - defer mbTrans441.Close() - _, err442 := mbTrans441.WriteString(arg440) - if err442 != nil { + arg462 := flag.Arg(1) + mbTrans463 := thrift.NewMemoryBufferLen(len(arg462)) + defer mbTrans463.Close() + _, err464 := mbTrans463.WriteString(arg462) + if err464 != nil { Usage() return } - factory443 := thrift.NewSimpleJSONProtocolFactory() - jsProt444 := factory443.GetProtocol(mbTrans441) - argvalue0 := meta.NewDropHostFromZoneReq() - err445 := argvalue0.Read(jsProt444) - if err445 != nil { + factory465 := thrift.NewSimpleJSONProtocolFactory() + jsProt466 := factory465.GetProtocol(mbTrans463) + argvalue0 := meta.NewRenameZoneReq() + err467 := argvalue0.Read(jsProt466) + if err467 != nil { Usage() return } value0 := argvalue0 - fmt.Print(client.DropHostFromZone(value0)) + fmt.Print(client.RenameZone(value0)) fmt.Print("\n") break case "getZone": @@ -1652,19 +1730,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetZone requires 1 args") flag.Usage() } - arg446 := flag.Arg(1) - mbTrans447 := thrift.NewMemoryBufferLen(len(arg446)) - defer mbTrans447.Close() - _, err448 := mbTrans447.WriteString(arg446) - if err448 != nil { + arg468 := flag.Arg(1) + mbTrans469 := thrift.NewMemoryBufferLen(len(arg468)) + defer mbTrans469.Close() + _, err470 := mbTrans469.WriteString(arg468) + if err470 != nil { Usage() return } - factory449 := thrift.NewSimpleJSONProtocolFactory() - jsProt450 := factory449.GetProtocol(mbTrans447) + factory471 := thrift.NewSimpleJSONProtocolFactory() + jsProt472 := factory471.GetProtocol(mbTrans469) argvalue0 := meta.NewGetZoneReq() - err451 := argvalue0.Read(jsProt450) - if err451 != nil { + err473 := argvalue0.Read(jsProt472) + if err473 != nil { Usage() return } @@ -1677,19 +1755,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListZones requires 1 args") flag.Usage() } - arg452 := flag.Arg(1) - mbTrans453 := thrift.NewMemoryBufferLen(len(arg452)) - defer mbTrans453.Close() - _, err454 := mbTrans453.WriteString(arg452) - if err454 != nil { + arg474 := flag.Arg(1) + mbTrans475 := thrift.NewMemoryBufferLen(len(arg474)) + defer mbTrans475.Close() + _, err476 := mbTrans475.WriteString(arg474) + if err476 != nil { Usage() return } - factory455 := thrift.NewSimpleJSONProtocolFactory() - jsProt456 := factory455.GetProtocol(mbTrans453) + factory477 := thrift.NewSimpleJSONProtocolFactory() + jsProt478 := factory477.GetProtocol(mbTrans475) argvalue0 := meta.NewListZonesReq() - err457 := argvalue0.Read(jsProt456) - if err457 != nil { + err479 := argvalue0.Read(jsProt478) + if err479 != nil { Usage() return } @@ -1702,19 +1780,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateBackup requires 1 args") flag.Usage() } - arg458 := flag.Arg(1) - mbTrans459 := thrift.NewMemoryBufferLen(len(arg458)) - defer mbTrans459.Close() - _, err460 := mbTrans459.WriteString(arg458) - if err460 != nil { + arg480 := flag.Arg(1) + mbTrans481 := thrift.NewMemoryBufferLen(len(arg480)) + defer mbTrans481.Close() + _, err482 := mbTrans481.WriteString(arg480) + if err482 != nil { Usage() return } - factory461 := thrift.NewSimpleJSONProtocolFactory() - jsProt462 := factory461.GetProtocol(mbTrans459) + factory483 := thrift.NewSimpleJSONProtocolFactory() + jsProt484 := factory483.GetProtocol(mbTrans481) argvalue0 := meta.NewCreateBackupReq() - err463 := argvalue0.Read(jsProt462) - if err463 != nil { + err485 := argvalue0.Read(jsProt484) + if err485 != nil { Usage() return } @@ -1727,19 +1805,19 @@ func main() { fmt.Fprintln(os.Stderr, "RestoreMeta requires 1 args") flag.Usage() } - arg464 := flag.Arg(1) - mbTrans465 := thrift.NewMemoryBufferLen(len(arg464)) - defer mbTrans465.Close() - _, err466 := mbTrans465.WriteString(arg464) - if err466 != nil { + arg486 := flag.Arg(1) + mbTrans487 := thrift.NewMemoryBufferLen(len(arg486)) + defer mbTrans487.Close() + _, err488 := mbTrans487.WriteString(arg486) + if err488 != nil { Usage() return } - factory467 := thrift.NewSimpleJSONProtocolFactory() - jsProt468 := factory467.GetProtocol(mbTrans465) + factory489 := thrift.NewSimpleJSONProtocolFactory() + jsProt490 := factory489.GetProtocol(mbTrans487) argvalue0 := meta.NewRestoreMetaReq() - err469 := argvalue0.Read(jsProt468) - if err469 != nil { + err491 := argvalue0.Read(jsProt490) + if err491 != nil { Usage() return } @@ -1752,19 +1830,19 @@ func main() { fmt.Fprintln(os.Stderr, "AddListener requires 1 args") flag.Usage() } - arg470 := flag.Arg(1) - mbTrans471 := thrift.NewMemoryBufferLen(len(arg470)) - defer mbTrans471.Close() - _, err472 := mbTrans471.WriteString(arg470) - if err472 != nil { + arg492 := flag.Arg(1) + mbTrans493 := thrift.NewMemoryBufferLen(len(arg492)) + defer mbTrans493.Close() + _, err494 := mbTrans493.WriteString(arg492) + if err494 != nil { Usage() return } - factory473 := thrift.NewSimpleJSONProtocolFactory() - jsProt474 := factory473.GetProtocol(mbTrans471) + factory495 := thrift.NewSimpleJSONProtocolFactory() + jsProt496 := factory495.GetProtocol(mbTrans493) argvalue0 := meta.NewAddListenerReq() - err475 := argvalue0.Read(jsProt474) - if err475 != nil { + err497 := argvalue0.Read(jsProt496) + if err497 != nil { Usage() return } @@ -1777,19 +1855,19 @@ func main() { fmt.Fprintln(os.Stderr, "RemoveListener requires 1 args") flag.Usage() } - arg476 := flag.Arg(1) - mbTrans477 := thrift.NewMemoryBufferLen(len(arg476)) - defer mbTrans477.Close() - _, err478 := mbTrans477.WriteString(arg476) - if err478 != nil { + arg498 := flag.Arg(1) + mbTrans499 := thrift.NewMemoryBufferLen(len(arg498)) + defer mbTrans499.Close() + _, err500 := mbTrans499.WriteString(arg498) + if err500 != nil { Usage() return } - factory479 := thrift.NewSimpleJSONProtocolFactory() - jsProt480 := factory479.GetProtocol(mbTrans477) + factory501 := thrift.NewSimpleJSONProtocolFactory() + jsProt502 := factory501.GetProtocol(mbTrans499) argvalue0 := meta.NewRemoveListenerReq() - err481 := argvalue0.Read(jsProt480) - if err481 != nil { + err503 := argvalue0.Read(jsProt502) + if err503 != nil { Usage() return } @@ -1802,19 +1880,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListListener requires 1 args") flag.Usage() } - arg482 := flag.Arg(1) - mbTrans483 := thrift.NewMemoryBufferLen(len(arg482)) - defer mbTrans483.Close() - _, err484 := mbTrans483.WriteString(arg482) - if err484 != nil { + arg504 := flag.Arg(1) + mbTrans505 := thrift.NewMemoryBufferLen(len(arg504)) + defer mbTrans505.Close() + _, err506 := mbTrans505.WriteString(arg504) + if err506 != nil { Usage() return } - factory485 := thrift.NewSimpleJSONProtocolFactory() - jsProt486 := factory485.GetProtocol(mbTrans483) + factory507 := thrift.NewSimpleJSONProtocolFactory() + jsProt508 := factory507.GetProtocol(mbTrans505) argvalue0 := meta.NewListListenerReq() - err487 := argvalue0.Read(jsProt486) - if err487 != nil { + err509 := argvalue0.Read(jsProt508) + if err509 != nil { Usage() return } @@ -1827,19 +1905,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetStats requires 1 args") flag.Usage() } - arg488 := flag.Arg(1) - mbTrans489 := thrift.NewMemoryBufferLen(len(arg488)) - defer mbTrans489.Close() - _, err490 := mbTrans489.WriteString(arg488) - if err490 != nil { + arg510 := flag.Arg(1) + mbTrans511 := thrift.NewMemoryBufferLen(len(arg510)) + defer mbTrans511.Close() + _, err512 := mbTrans511.WriteString(arg510) + if err512 != nil { Usage() return } - factory491 := thrift.NewSimpleJSONProtocolFactory() - jsProt492 := factory491.GetProtocol(mbTrans489) + factory513 := thrift.NewSimpleJSONProtocolFactory() + jsProt514 := factory513.GetProtocol(mbTrans511) argvalue0 := meta.NewGetStatsReq() - err493 := argvalue0.Read(jsProt492) - if err493 != nil { + err515 := argvalue0.Read(jsProt514) + if err515 != nil { Usage() return } @@ -1852,19 +1930,19 @@ func main() { fmt.Fprintln(os.Stderr, "SignInFTService requires 1 args") flag.Usage() } - arg494 := flag.Arg(1) - mbTrans495 := thrift.NewMemoryBufferLen(len(arg494)) - defer mbTrans495.Close() - _, err496 := mbTrans495.WriteString(arg494) - if err496 != nil { + arg516 := flag.Arg(1) + mbTrans517 := thrift.NewMemoryBufferLen(len(arg516)) + defer mbTrans517.Close() + _, err518 := mbTrans517.WriteString(arg516) + if err518 != nil { Usage() return } - factory497 := thrift.NewSimpleJSONProtocolFactory() - jsProt498 := factory497.GetProtocol(mbTrans495) + factory519 := thrift.NewSimpleJSONProtocolFactory() + jsProt520 := factory519.GetProtocol(mbTrans517) argvalue0 := meta.NewSignInFTServiceReq() - err499 := argvalue0.Read(jsProt498) - if err499 != nil { + err521 := argvalue0.Read(jsProt520) + if err521 != nil { Usage() return } @@ -1877,19 +1955,19 @@ func main() { fmt.Fprintln(os.Stderr, "SignOutFTService requires 1 args") flag.Usage() } - arg500 := flag.Arg(1) - mbTrans501 := thrift.NewMemoryBufferLen(len(arg500)) - defer mbTrans501.Close() - _, err502 := mbTrans501.WriteString(arg500) - if err502 != nil { + arg522 := flag.Arg(1) + mbTrans523 := thrift.NewMemoryBufferLen(len(arg522)) + defer mbTrans523.Close() + _, err524 := mbTrans523.WriteString(arg522) + if err524 != nil { Usage() return } - factory503 := thrift.NewSimpleJSONProtocolFactory() - jsProt504 := factory503.GetProtocol(mbTrans501) + factory525 := thrift.NewSimpleJSONProtocolFactory() + jsProt526 := factory525.GetProtocol(mbTrans523) argvalue0 := meta.NewSignOutFTServiceReq() - err505 := argvalue0.Read(jsProt504) - if err505 != nil { + err527 := argvalue0.Read(jsProt526) + if err527 != nil { Usage() return } @@ -1902,19 +1980,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListFTClients requires 1 args") flag.Usage() } - arg506 := flag.Arg(1) - mbTrans507 := thrift.NewMemoryBufferLen(len(arg506)) - defer mbTrans507.Close() - _, err508 := mbTrans507.WriteString(arg506) - if err508 != nil { + arg528 := flag.Arg(1) + mbTrans529 := thrift.NewMemoryBufferLen(len(arg528)) + defer mbTrans529.Close() + _, err530 := mbTrans529.WriteString(arg528) + if err530 != nil { Usage() return } - factory509 := thrift.NewSimpleJSONProtocolFactory() - jsProt510 := factory509.GetProtocol(mbTrans507) + factory531 := thrift.NewSimpleJSONProtocolFactory() + jsProt532 := factory531.GetProtocol(mbTrans529) argvalue0 := meta.NewListFTClientsReq() - err511 := argvalue0.Read(jsProt510) - if err511 != nil { + err533 := argvalue0.Read(jsProt532) + if err533 != nil { Usage() return } @@ -1927,19 +2005,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateFTIndex requires 1 args") flag.Usage() } - arg512 := flag.Arg(1) - mbTrans513 := thrift.NewMemoryBufferLen(len(arg512)) - defer mbTrans513.Close() - _, err514 := mbTrans513.WriteString(arg512) - if err514 != nil { + arg534 := flag.Arg(1) + mbTrans535 := thrift.NewMemoryBufferLen(len(arg534)) + defer mbTrans535.Close() + _, err536 := mbTrans535.WriteString(arg534) + if err536 != nil { Usage() return } - factory515 := thrift.NewSimpleJSONProtocolFactory() - jsProt516 := factory515.GetProtocol(mbTrans513) + factory537 := thrift.NewSimpleJSONProtocolFactory() + jsProt538 := factory537.GetProtocol(mbTrans535) argvalue0 := meta.NewCreateFTIndexReq() - err517 := argvalue0.Read(jsProt516) - if err517 != nil { + err539 := argvalue0.Read(jsProt538) + if err539 != nil { Usage() return } @@ -1952,19 +2030,19 @@ func main() { fmt.Fprintln(os.Stderr, "DropFTIndex requires 1 args") flag.Usage() } - arg518 := flag.Arg(1) - mbTrans519 := thrift.NewMemoryBufferLen(len(arg518)) - defer mbTrans519.Close() - _, err520 := mbTrans519.WriteString(arg518) - if err520 != nil { + arg540 := flag.Arg(1) + mbTrans541 := thrift.NewMemoryBufferLen(len(arg540)) + defer mbTrans541.Close() + _, err542 := mbTrans541.WriteString(arg540) + if err542 != nil { Usage() return } - factory521 := thrift.NewSimpleJSONProtocolFactory() - jsProt522 := factory521.GetProtocol(mbTrans519) + factory543 := thrift.NewSimpleJSONProtocolFactory() + jsProt544 := factory543.GetProtocol(mbTrans541) argvalue0 := meta.NewDropFTIndexReq() - err523 := argvalue0.Read(jsProt522) - if err523 != nil { + err545 := argvalue0.Read(jsProt544) + if err545 != nil { Usage() return } @@ -1977,19 +2055,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListFTIndexes requires 1 args") flag.Usage() } - arg524 := flag.Arg(1) - mbTrans525 := thrift.NewMemoryBufferLen(len(arg524)) - defer mbTrans525.Close() - _, err526 := mbTrans525.WriteString(arg524) - if err526 != nil { + arg546 := flag.Arg(1) + mbTrans547 := thrift.NewMemoryBufferLen(len(arg546)) + defer mbTrans547.Close() + _, err548 := mbTrans547.WriteString(arg546) + if err548 != nil { Usage() return } - factory527 := thrift.NewSimpleJSONProtocolFactory() - jsProt528 := factory527.GetProtocol(mbTrans525) + factory549 := thrift.NewSimpleJSONProtocolFactory() + jsProt550 := factory549.GetProtocol(mbTrans547) argvalue0 := meta.NewListFTIndexesReq() - err529 := argvalue0.Read(jsProt528) - if err529 != nil { + err551 := argvalue0.Read(jsProt550) + if err551 != nil { Usage() return } @@ -2002,19 +2080,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateSession requires 1 args") flag.Usage() } - arg530 := flag.Arg(1) - mbTrans531 := thrift.NewMemoryBufferLen(len(arg530)) - defer mbTrans531.Close() - _, err532 := mbTrans531.WriteString(arg530) - if err532 != nil { + arg552 := flag.Arg(1) + mbTrans553 := thrift.NewMemoryBufferLen(len(arg552)) + defer mbTrans553.Close() + _, err554 := mbTrans553.WriteString(arg552) + if err554 != nil { Usage() return } - factory533 := thrift.NewSimpleJSONProtocolFactory() - jsProt534 := factory533.GetProtocol(mbTrans531) + factory555 := thrift.NewSimpleJSONProtocolFactory() + jsProt556 := factory555.GetProtocol(mbTrans553) argvalue0 := meta.NewCreateSessionReq() - err535 := argvalue0.Read(jsProt534) - if err535 != nil { + err557 := argvalue0.Read(jsProt556) + if err557 != nil { Usage() return } @@ -2027,19 +2105,19 @@ func main() { fmt.Fprintln(os.Stderr, "UpdateSessions requires 1 args") flag.Usage() } - arg536 := flag.Arg(1) - mbTrans537 := thrift.NewMemoryBufferLen(len(arg536)) - defer mbTrans537.Close() - _, err538 := mbTrans537.WriteString(arg536) - if err538 != nil { + arg558 := flag.Arg(1) + mbTrans559 := thrift.NewMemoryBufferLen(len(arg558)) + defer mbTrans559.Close() + _, err560 := mbTrans559.WriteString(arg558) + if err560 != nil { Usage() return } - factory539 := thrift.NewSimpleJSONProtocolFactory() - jsProt540 := factory539.GetProtocol(mbTrans537) + factory561 := thrift.NewSimpleJSONProtocolFactory() + jsProt562 := factory561.GetProtocol(mbTrans559) argvalue0 := meta.NewUpdateSessionsReq() - err541 := argvalue0.Read(jsProt540) - if err541 != nil { + err563 := argvalue0.Read(jsProt562) + if err563 != nil { Usage() return } @@ -2052,19 +2130,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListSessions requires 1 args") flag.Usage() } - arg542 := flag.Arg(1) - mbTrans543 := thrift.NewMemoryBufferLen(len(arg542)) - defer mbTrans543.Close() - _, err544 := mbTrans543.WriteString(arg542) - if err544 != nil { + arg564 := flag.Arg(1) + mbTrans565 := thrift.NewMemoryBufferLen(len(arg564)) + defer mbTrans565.Close() + _, err566 := mbTrans565.WriteString(arg564) + if err566 != nil { Usage() return } - factory545 := thrift.NewSimpleJSONProtocolFactory() - jsProt546 := factory545.GetProtocol(mbTrans543) + factory567 := thrift.NewSimpleJSONProtocolFactory() + jsProt568 := factory567.GetProtocol(mbTrans565) argvalue0 := meta.NewListSessionsReq() - err547 := argvalue0.Read(jsProt546) - if err547 != nil { + err569 := argvalue0.Read(jsProt568) + if err569 != nil { Usage() return } @@ -2077,19 +2155,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetSession requires 1 args") flag.Usage() } - arg548 := flag.Arg(1) - mbTrans549 := thrift.NewMemoryBufferLen(len(arg548)) - defer mbTrans549.Close() - _, err550 := mbTrans549.WriteString(arg548) - if err550 != nil { + arg570 := flag.Arg(1) + mbTrans571 := thrift.NewMemoryBufferLen(len(arg570)) + defer mbTrans571.Close() + _, err572 := mbTrans571.WriteString(arg570) + if err572 != nil { Usage() return } - factory551 := thrift.NewSimpleJSONProtocolFactory() - jsProt552 := factory551.GetProtocol(mbTrans549) + factory573 := thrift.NewSimpleJSONProtocolFactory() + jsProt574 := factory573.GetProtocol(mbTrans571) argvalue0 := meta.NewGetSessionReq() - err553 := argvalue0.Read(jsProt552) - if err553 != nil { + err575 := argvalue0.Read(jsProt574) + if err575 != nil { Usage() return } @@ -2102,19 +2180,19 @@ func main() { fmt.Fprintln(os.Stderr, "RemoveSession requires 1 args") flag.Usage() } - arg554 := flag.Arg(1) - mbTrans555 := thrift.NewMemoryBufferLen(len(arg554)) - defer mbTrans555.Close() - _, err556 := mbTrans555.WriteString(arg554) - if err556 != nil { + arg576 := flag.Arg(1) + mbTrans577 := thrift.NewMemoryBufferLen(len(arg576)) + defer mbTrans577.Close() + _, err578 := mbTrans577.WriteString(arg576) + if err578 != nil { Usage() return } - factory557 := thrift.NewSimpleJSONProtocolFactory() - jsProt558 := factory557.GetProtocol(mbTrans555) + factory579 := thrift.NewSimpleJSONProtocolFactory() + jsProt580 := factory579.GetProtocol(mbTrans577) argvalue0 := meta.NewRemoveSessionReq() - err559 := argvalue0.Read(jsProt558) - if err559 != nil { + err581 := argvalue0.Read(jsProt580) + if err581 != nil { Usage() return } @@ -2127,19 +2205,19 @@ func main() { fmt.Fprintln(os.Stderr, "KillQuery requires 1 args") flag.Usage() } - arg560 := flag.Arg(1) - mbTrans561 := thrift.NewMemoryBufferLen(len(arg560)) - defer mbTrans561.Close() - _, err562 := mbTrans561.WriteString(arg560) - if err562 != nil { + arg582 := flag.Arg(1) + mbTrans583 := thrift.NewMemoryBufferLen(len(arg582)) + defer mbTrans583.Close() + _, err584 := mbTrans583.WriteString(arg582) + if err584 != nil { Usage() return } - factory563 := thrift.NewSimpleJSONProtocolFactory() - jsProt564 := factory563.GetProtocol(mbTrans561) + factory585 := thrift.NewSimpleJSONProtocolFactory() + jsProt586 := factory585.GetProtocol(mbTrans583) argvalue0 := meta.NewKillQueryReq() - err565 := argvalue0.Read(jsProt564) - if err565 != nil { + err587 := argvalue0.Read(jsProt586) + if err587 != nil { Usage() return } @@ -2152,19 +2230,19 @@ func main() { fmt.Fprintln(os.Stderr, "ReportTaskFinish requires 1 args") flag.Usage() } - arg566 := flag.Arg(1) - mbTrans567 := thrift.NewMemoryBufferLen(len(arg566)) - defer mbTrans567.Close() - _, err568 := mbTrans567.WriteString(arg566) - if err568 != nil { + arg588 := flag.Arg(1) + mbTrans589 := thrift.NewMemoryBufferLen(len(arg588)) + defer mbTrans589.Close() + _, err590 := mbTrans589.WriteString(arg588) + if err590 != nil { Usage() return } - factory569 := thrift.NewSimpleJSONProtocolFactory() - jsProt570 := factory569.GetProtocol(mbTrans567) + factory591 := thrift.NewSimpleJSONProtocolFactory() + jsProt592 := factory591.GetProtocol(mbTrans589) argvalue0 := meta.NewReportTaskReq() - err571 := argvalue0.Read(jsProt570) - if err571 != nil { + err593 := argvalue0.Read(jsProt592) + if err593 != nil { Usage() return } @@ -2177,19 +2255,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListCluster requires 1 args") flag.Usage() } - arg572 := flag.Arg(1) - mbTrans573 := thrift.NewMemoryBufferLen(len(arg572)) - defer mbTrans573.Close() - _, err574 := mbTrans573.WriteString(arg572) - if err574 != nil { + arg594 := flag.Arg(1) + mbTrans595 := thrift.NewMemoryBufferLen(len(arg594)) + defer mbTrans595.Close() + _, err596 := mbTrans595.WriteString(arg594) + if err596 != nil { Usage() return } - factory575 := thrift.NewSimpleJSONProtocolFactory() - jsProt576 := factory575.GetProtocol(mbTrans573) + factory597 := thrift.NewSimpleJSONProtocolFactory() + jsProt598 := factory597.GetProtocol(mbTrans595) argvalue0 := meta.NewListClusterInfoReq() - err577 := argvalue0.Read(jsProt576) - if err577 != nil { + err599 := argvalue0.Read(jsProt598) + if err599 != nil { Usage() return } @@ -2202,19 +2280,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetMetaDirInfo requires 1 args") flag.Usage() } - arg578 := flag.Arg(1) - mbTrans579 := thrift.NewMemoryBufferLen(len(arg578)) - defer mbTrans579.Close() - _, err580 := mbTrans579.WriteString(arg578) - if err580 != nil { + arg600 := flag.Arg(1) + mbTrans601 := thrift.NewMemoryBufferLen(len(arg600)) + defer mbTrans601.Close() + _, err602 := mbTrans601.WriteString(arg600) + if err602 != nil { Usage() return } - factory581 := thrift.NewSimpleJSONProtocolFactory() - jsProt582 := factory581.GetProtocol(mbTrans579) + factory603 := thrift.NewSimpleJSONProtocolFactory() + jsProt604 := factory603.GetProtocol(mbTrans601) argvalue0 := meta.NewGetMetaDirInfoReq() - err583 := argvalue0.Read(jsProt582) - if err583 != nil { + err605 := argvalue0.Read(jsProt604) + if err605 != nil { Usage() return } @@ -2227,19 +2305,19 @@ func main() { fmt.Fprintln(os.Stderr, "VerifyClientVersion requires 1 args") flag.Usage() } - arg584 := flag.Arg(1) - mbTrans585 := thrift.NewMemoryBufferLen(len(arg584)) - defer mbTrans585.Close() - _, err586 := mbTrans585.WriteString(arg584) - if err586 != nil { + arg606 := flag.Arg(1) + mbTrans607 := thrift.NewMemoryBufferLen(len(arg606)) + defer mbTrans607.Close() + _, err608 := mbTrans607.WriteString(arg606) + if err608 != nil { Usage() return } - factory587 := thrift.NewSimpleJSONProtocolFactory() - jsProt588 := factory587.GetProtocol(mbTrans585) + factory609 := thrift.NewSimpleJSONProtocolFactory() + jsProt610 := factory609.GetProtocol(mbTrans607) argvalue0 := meta.NewVerifyClientVersionReq() - err589 := argvalue0.Read(jsProt588) - if err589 != nil { + err611 := argvalue0.Read(jsProt610) + if err611 != nil { Usage() return } diff --git a/nebula/meta/metaservice.go b/nebula/meta/metaservice.go index aa4b3cfc..e01332db 100644 --- a/nebula/meta/metaservice.go +++ b/nebula/meta/metaservice.go @@ -70,6 +70,15 @@ type MetaService interface { ListEdges(ctx context.Context, req *ListEdgesReq) (_r *ListEdgesResp, err error) // Parameters: // - Req + AddHosts(ctx context.Context, req *AddHostsReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddHostsIntoZone(ctx context.Context, req *AddHostsIntoZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropHosts(ctx context.Context, req *DropHostsReq) (_r *ExecResp, err error) + // Parameters: + // - Req ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, err error) // Parameters: // - Req @@ -187,16 +196,16 @@ type MetaService interface { RunAdminJob(ctx context.Context, req *AdminJobReq) (_r *AdminJobResp, err error) // Parameters: // - Req - AddZone(ctx context.Context, req *AddZoneReq) (_r *ExecResp, err error) + MergeZone(ctx context.Context, req *MergeZoneReq) (_r *ExecResp, err error) // Parameters: // - Req DropZone(ctx context.Context, req *DropZoneReq) (_r *ExecResp, err error) // Parameters: // - Req - AddHostIntoZone(ctx context.Context, req *AddHostIntoZoneReq) (_r *ExecResp, err error) + SplitZone(ctx context.Context, req *SplitZoneReq) (_r *ExecResp, err error) // Parameters: // - Req - DropHostFromZone(ctx context.Context, req *DropHostFromZoneReq) (_r *ExecResp, err error) + RenameZone(ctx context.Context, req *RenameZoneReq) (_r *ExecResp, err error) // Parameters: // - Req GetZone(ctx context.Context, req *GetZoneReq) (_r *GetZoneResp, err error) @@ -320,6 +329,15 @@ type MetaServiceClientInterface interface { ListEdges(req *ListEdgesReq) (_r *ListEdgesResp, err error) // Parameters: // - Req + AddHosts(req *AddHostsReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddHostsIntoZone(req *AddHostsIntoZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropHosts(req *DropHostsReq) (_r *ExecResp, err error) + // Parameters: + // - Req ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) // Parameters: // - Req @@ -437,16 +455,16 @@ type MetaServiceClientInterface interface { RunAdminJob(req *AdminJobReq) (_r *AdminJobResp, err error) // Parameters: // - Req - AddZone(req *AddZoneReq) (_r *ExecResp, err error) + MergeZone(req *MergeZoneReq) (_r *ExecResp, err error) // Parameters: // - Req DropZone(req *DropZoneReq) (_r *ExecResp, err error) // Parameters: // - Req - AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) + SplitZone(req *SplitZoneReq) (_r *ExecResp, err error) // Parameters: // - Req - DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) + RenameZone(req *RenameZoneReq) (_r *ExecResp, err error) // Parameters: // - Req GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) @@ -850,6 +868,66 @@ func (p *MetaServiceClient) recvListEdges() (value *ListEdgesResp, err error) { return result.GetSuccess(), nil } +// Parameters: +// - Req +func (p *MetaServiceClient) AddHosts(req *AddHostsReq) (_r *ExecResp, err error) { + args := MetaServiceAddHostsArgs{ + Req : req, + } + err = p.CC.SendMsg("addHosts", &args, thrift.CALL) + if err != nil { return } + return p.recvAddHosts() +} + + +func (p *MetaServiceClient) recvAddHosts() (value *ExecResp, err error) { + var result MetaServiceAddHostsResult + err = p.CC.RecvMsg("addHosts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddHostsIntoZone(req *AddHostsIntoZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddHostsIntoZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addHostsIntoZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddHostsIntoZone() +} + + +func (p *MetaServiceClient) recvAddHostsIntoZone() (value *ExecResp, err error) { + var result MetaServiceAddHostsIntoZoneResult + err = p.CC.RecvMsg("addHostsIntoZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropHosts(req *DropHostsReq) (_r *ExecResp, err error) { + args := MetaServiceDropHostsArgs{ + Req : req, + } + err = p.CC.SendMsg("dropHosts", &args, thrift.CALL) + if err != nil { return } + return p.recvDropHosts() +} + + +func (p *MetaServiceClient) recvDropHosts() (value *ExecResp, err error) { + var result MetaServiceDropHostsResult + err = p.CC.RecvMsg("dropHosts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + // Parameters: // - Req func (p *MetaServiceClient) ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) { @@ -1632,19 +1710,19 @@ func (p *MetaServiceClient) recvRunAdminJob() (value *AdminJobResp, err error) { // Parameters: // - Req -func (p *MetaServiceClient) AddZone(req *AddZoneReq) (_r *ExecResp, err error) { - args := MetaServiceAddZoneArgs{ +func (p *MetaServiceClient) MergeZone(req *MergeZoneReq) (_r *ExecResp, err error) { + args := MetaServiceMergeZoneArgs{ Req : req, } - err = p.CC.SendMsg("addZone", &args, thrift.CALL) + err = p.CC.SendMsg("mergeZone", &args, thrift.CALL) if err != nil { return } - return p.recvAddZone() + return p.recvMergeZone() } -func (p *MetaServiceClient) recvAddZone() (value *ExecResp, err error) { - var result MetaServiceAddZoneResult - err = p.CC.RecvMsg("addZone", &result) +func (p *MetaServiceClient) recvMergeZone() (value *ExecResp, err error) { + var result MetaServiceMergeZoneResult + err = p.CC.RecvMsg("mergeZone", &result) if err != nil { return } return result.GetSuccess(), nil @@ -1672,19 +1750,19 @@ func (p *MetaServiceClient) recvDropZone() (value *ExecResp, err error) { // Parameters: // - Req -func (p *MetaServiceClient) AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) { - args := MetaServiceAddHostIntoZoneArgs{ +func (p *MetaServiceClient) SplitZone(req *SplitZoneReq) (_r *ExecResp, err error) { + args := MetaServiceSplitZoneArgs{ Req : req, } - err = p.CC.SendMsg("addHostIntoZone", &args, thrift.CALL) + err = p.CC.SendMsg("splitZone", &args, thrift.CALL) if err != nil { return } - return p.recvAddHostIntoZone() + return p.recvSplitZone() } -func (p *MetaServiceClient) recvAddHostIntoZone() (value *ExecResp, err error) { - var result MetaServiceAddHostIntoZoneResult - err = p.CC.RecvMsg("addHostIntoZone", &result) +func (p *MetaServiceClient) recvSplitZone() (value *ExecResp, err error) { + var result MetaServiceSplitZoneResult + err = p.CC.RecvMsg("splitZone", &result) if err != nil { return } return result.GetSuccess(), nil @@ -1692,19 +1770,19 @@ func (p *MetaServiceClient) recvAddHostIntoZone() (value *ExecResp, err error) { // Parameters: // - Req -func (p *MetaServiceClient) DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) { - args := MetaServiceDropHostFromZoneArgs{ +func (p *MetaServiceClient) RenameZone(req *RenameZoneReq) (_r *ExecResp, err error) { + args := MetaServiceRenameZoneArgs{ Req : req, } - err = p.CC.SendMsg("dropHostFromZone", &args, thrift.CALL) + err = p.CC.SendMsg("renameZone", &args, thrift.CALL) if err != nil { return } - return p.recvDropHostFromZone() + return p.recvRenameZone() } -func (p *MetaServiceClient) recvDropHostFromZone() (value *ExecResp, err error) { - var result MetaServiceDropHostFromZoneResult - err = p.CC.RecvMsg("dropHostFromZone", &result) +func (p *MetaServiceClient) recvRenameZone() (value *ExecResp, err error) { + var result MetaServiceRenameZoneResult + err = p.CC.RecvMsg("renameZone", &result) if err != nil { return } return result.GetSuccess(), nil @@ -2557,6 +2635,72 @@ func (p *MetaServiceThreadsafeClient) recvListEdges() (value *ListEdgesResp, err return result.GetSuccess(), nil } +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddHosts(req *AddHostsReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddHostsArgs{ + Req : req, + } + err = p.CC.SendMsg("addHosts", &args, thrift.CALL) + if err != nil { return } + return p.recvAddHosts() +} + + +func (p *MetaServiceThreadsafeClient) recvAddHosts() (value *ExecResp, err error) { + var result MetaServiceAddHostsResult + err = p.CC.RecvMsg("addHosts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddHostsIntoZone(req *AddHostsIntoZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddHostsIntoZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addHostsIntoZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddHostsIntoZone() +} + + +func (p *MetaServiceThreadsafeClient) recvAddHostsIntoZone() (value *ExecResp, err error) { + var result MetaServiceAddHostsIntoZoneResult + err = p.CC.RecvMsg("addHostsIntoZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropHosts(req *DropHostsReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropHostsArgs{ + Req : req, + } + err = p.CC.SendMsg("dropHosts", &args, thrift.CALL) + if err != nil { return } + return p.recvDropHosts() +} + + +func (p *MetaServiceThreadsafeClient) recvDropHosts() (value *ExecResp, err error) { + var result MetaServiceDropHostsResult + err = p.CC.RecvMsg("dropHosts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + // Parameters: // - Req func (p *MetaServiceThreadsafeClient) ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) { @@ -3417,21 +3561,21 @@ func (p *MetaServiceThreadsafeClient) recvRunAdminJob() (value *AdminJobResp, er // Parameters: // - Req -func (p *MetaServiceThreadsafeClient) AddZone(req *AddZoneReq) (_r *ExecResp, err error) { +func (p *MetaServiceThreadsafeClient) MergeZone(req *MergeZoneReq) (_r *ExecResp, err error) { p.Mu.Lock() defer p.Mu.Unlock() - args := MetaServiceAddZoneArgs{ + args := MetaServiceMergeZoneArgs{ Req : req, } - err = p.CC.SendMsg("addZone", &args, thrift.CALL) + err = p.CC.SendMsg("mergeZone", &args, thrift.CALL) if err != nil { return } - return p.recvAddZone() + return p.recvMergeZone() } -func (p *MetaServiceThreadsafeClient) recvAddZone() (value *ExecResp, err error) { - var result MetaServiceAddZoneResult - err = p.CC.RecvMsg("addZone", &result) +func (p *MetaServiceThreadsafeClient) recvMergeZone() (value *ExecResp, err error) { + var result MetaServiceMergeZoneResult + err = p.CC.RecvMsg("mergeZone", &result) if err != nil { return } return result.GetSuccess(), nil @@ -3461,21 +3605,21 @@ func (p *MetaServiceThreadsafeClient) recvDropZone() (value *ExecResp, err error // Parameters: // - Req -func (p *MetaServiceThreadsafeClient) AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) { +func (p *MetaServiceThreadsafeClient) SplitZone(req *SplitZoneReq) (_r *ExecResp, err error) { p.Mu.Lock() defer p.Mu.Unlock() - args := MetaServiceAddHostIntoZoneArgs{ + args := MetaServiceSplitZoneArgs{ Req : req, } - err = p.CC.SendMsg("addHostIntoZone", &args, thrift.CALL) + err = p.CC.SendMsg("splitZone", &args, thrift.CALL) if err != nil { return } - return p.recvAddHostIntoZone() + return p.recvSplitZone() } -func (p *MetaServiceThreadsafeClient) recvAddHostIntoZone() (value *ExecResp, err error) { - var result MetaServiceAddHostIntoZoneResult - err = p.CC.RecvMsg("addHostIntoZone", &result) +func (p *MetaServiceThreadsafeClient) recvSplitZone() (value *ExecResp, err error) { + var result MetaServiceSplitZoneResult + err = p.CC.RecvMsg("splitZone", &result) if err != nil { return } return result.GetSuccess(), nil @@ -3483,21 +3627,21 @@ func (p *MetaServiceThreadsafeClient) recvAddHostIntoZone() (value *ExecResp, er // Parameters: // - Req -func (p *MetaServiceThreadsafeClient) DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) { +func (p *MetaServiceThreadsafeClient) RenameZone(req *RenameZoneReq) (_r *ExecResp, err error) { p.Mu.Lock() defer p.Mu.Unlock() - args := MetaServiceDropHostFromZoneArgs{ + args := MetaServiceRenameZoneArgs{ Req : req, } - err = p.CC.SendMsg("dropHostFromZone", &args, thrift.CALL) + err = p.CC.SendMsg("renameZone", &args, thrift.CALL) if err != nil { return } - return p.recvDropHostFromZone() + return p.recvRenameZone() } -func (p *MetaServiceThreadsafeClient) recvDropHostFromZone() (value *ExecResp, err error) { - var result MetaServiceDropHostFromZoneResult - err = p.CC.RecvMsg("dropHostFromZone", &result) +func (p *MetaServiceThreadsafeClient) recvRenameZone() (value *ExecResp, err error) { + var result MetaServiceRenameZoneResult + err = p.CC.RecvMsg("renameZone", &result) if err != nil { return } return result.GetSuccess(), nil @@ -4247,6 +4391,45 @@ func (p *MetaServiceChannelClient) ListEdges(ctx context.Context, req *ListEdges return result.GetSuccess(), nil } +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddHosts(ctx context.Context, req *AddHostsReq) (_r *ExecResp, err error) { + args := MetaServiceAddHostsArgs{ + Req : req, + } + var result MetaServiceAddHostsResult + err = p.RequestChannel.Call(ctx, "addHosts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddHostsIntoZone(ctx context.Context, req *AddHostsIntoZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddHostsIntoZoneArgs{ + Req : req, + } + var result MetaServiceAddHostsIntoZoneResult + err = p.RequestChannel.Call(ctx, "addHostsIntoZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropHosts(ctx context.Context, req *DropHostsReq) (_r *ExecResp, err error) { + args := MetaServiceDropHostsArgs{ + Req : req, + } + var result MetaServiceDropHostsResult + err = p.RequestChannel.Call(ctx, "dropHosts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + // Parameters: // - Req func (p *MetaServiceChannelClient) ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, err error) { @@ -4756,12 +4939,12 @@ func (p *MetaServiceChannelClient) RunAdminJob(ctx context.Context, req *AdminJo // Parameters: // - Req -func (p *MetaServiceChannelClient) AddZone(ctx context.Context, req *AddZoneReq) (_r *ExecResp, err error) { - args := MetaServiceAddZoneArgs{ +func (p *MetaServiceChannelClient) MergeZone(ctx context.Context, req *MergeZoneReq) (_r *ExecResp, err error) { + args := MetaServiceMergeZoneArgs{ Req : req, } - var result MetaServiceAddZoneResult - err = p.RequestChannel.Call(ctx, "addZone", &args, &result) + var result MetaServiceMergeZoneResult + err = p.RequestChannel.Call(ctx, "mergeZone", &args, &result) if err != nil { return } return result.GetSuccess(), nil @@ -4782,12 +4965,12 @@ func (p *MetaServiceChannelClient) DropZone(ctx context.Context, req *DropZoneRe // Parameters: // - Req -func (p *MetaServiceChannelClient) AddHostIntoZone(ctx context.Context, req *AddHostIntoZoneReq) (_r *ExecResp, err error) { - args := MetaServiceAddHostIntoZoneArgs{ +func (p *MetaServiceChannelClient) SplitZone(ctx context.Context, req *SplitZoneReq) (_r *ExecResp, err error) { + args := MetaServiceSplitZoneArgs{ Req : req, } - var result MetaServiceAddHostIntoZoneResult - err = p.RequestChannel.Call(ctx, "addHostIntoZone", &args, &result) + var result MetaServiceSplitZoneResult + err = p.RequestChannel.Call(ctx, "splitZone", &args, &result) if err != nil { return } return result.GetSuccess(), nil @@ -4795,12 +4978,12 @@ func (p *MetaServiceChannelClient) AddHostIntoZone(ctx context.Context, req *Add // Parameters: // - Req -func (p *MetaServiceChannelClient) DropHostFromZone(ctx context.Context, req *DropHostFromZoneReq) (_r *ExecResp, err error) { - args := MetaServiceDropHostFromZoneArgs{ +func (p *MetaServiceChannelClient) RenameZone(ctx context.Context, req *RenameZoneReq) (_r *ExecResp, err error) { + args := MetaServiceRenameZoneArgs{ Req : req, } - var result MetaServiceDropHostFromZoneResult - err = p.RequestChannel.Call(ctx, "dropHostFromZone", &args, &result) + var result MetaServiceRenameZoneResult + err = p.RequestChannel.Call(ctx, "renameZone", &args, &result) if err != nil { return } return result.GetSuccess(), nil @@ -5140,90 +5323,93 @@ func (p *MetaServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctio } func NewMetaServiceProcessor(handler MetaService) *MetaServiceProcessor { - self96 := &MetaServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} - self96.processorMap["createSpace"] = &metaServiceProcessorCreateSpace{handler:handler} - self96.processorMap["dropSpace"] = &metaServiceProcessorDropSpace{handler:handler} - self96.processorMap["getSpace"] = &metaServiceProcessorGetSpace{handler:handler} - self96.processorMap["listSpaces"] = &metaServiceProcessorListSpaces{handler:handler} - self96.processorMap["createSpaceAs"] = &metaServiceProcessorCreateSpaceAs{handler:handler} - self96.processorMap["createTag"] = &metaServiceProcessorCreateTag{handler:handler} - self96.processorMap["alterTag"] = &metaServiceProcessorAlterTag{handler:handler} - self96.processorMap["dropTag"] = &metaServiceProcessorDropTag{handler:handler} - self96.processorMap["getTag"] = &metaServiceProcessorGetTag{handler:handler} - self96.processorMap["listTags"] = &metaServiceProcessorListTags{handler:handler} - self96.processorMap["createEdge"] = &metaServiceProcessorCreateEdge{handler:handler} - self96.processorMap["alterEdge"] = &metaServiceProcessorAlterEdge{handler:handler} - self96.processorMap["dropEdge"] = &metaServiceProcessorDropEdge{handler:handler} - self96.processorMap["getEdge"] = &metaServiceProcessorGetEdge{handler:handler} - self96.processorMap["listEdges"] = &metaServiceProcessorListEdges{handler:handler} - self96.processorMap["listHosts"] = &metaServiceProcessorListHosts{handler:handler} - self96.processorMap["getPartsAlloc"] = &metaServiceProcessorGetPartsAlloc{handler:handler} - self96.processorMap["listParts"] = &metaServiceProcessorListParts{handler:handler} - self96.processorMap["multiPut"] = &metaServiceProcessorMultiPut{handler:handler} - self96.processorMap["get"] = &metaServiceProcessorGet{handler:handler} - self96.processorMap["multiGet"] = &metaServiceProcessorMultiGet{handler:handler} - self96.processorMap["remove"] = &metaServiceProcessorRemove{handler:handler} - self96.processorMap["removeRange"] = &metaServiceProcessorRemoveRange{handler:handler} - self96.processorMap["scan"] = &metaServiceProcessorScan{handler:handler} - self96.processorMap["createTagIndex"] = &metaServiceProcessorCreateTagIndex{handler:handler} - self96.processorMap["dropTagIndex"] = &metaServiceProcessorDropTagIndex{handler:handler} - self96.processorMap["getTagIndex"] = &metaServiceProcessorGetTagIndex{handler:handler} - self96.processorMap["listTagIndexes"] = &metaServiceProcessorListTagIndexes{handler:handler} - self96.processorMap["rebuildTagIndex"] = &metaServiceProcessorRebuildTagIndex{handler:handler} - self96.processorMap["listTagIndexStatus"] = &metaServiceProcessorListTagIndexStatus{handler:handler} - self96.processorMap["createEdgeIndex"] = &metaServiceProcessorCreateEdgeIndex{handler:handler} - self96.processorMap["dropEdgeIndex"] = &metaServiceProcessorDropEdgeIndex{handler:handler} - self96.processorMap["getEdgeIndex"] = &metaServiceProcessorGetEdgeIndex{handler:handler} - self96.processorMap["listEdgeIndexes"] = &metaServiceProcessorListEdgeIndexes{handler:handler} - self96.processorMap["rebuildEdgeIndex"] = &metaServiceProcessorRebuildEdgeIndex{handler:handler} - self96.processorMap["listEdgeIndexStatus"] = &metaServiceProcessorListEdgeIndexStatus{handler:handler} - self96.processorMap["createUser"] = &metaServiceProcessorCreateUser{handler:handler} - self96.processorMap["dropUser"] = &metaServiceProcessorDropUser{handler:handler} - self96.processorMap["alterUser"] = &metaServiceProcessorAlterUser{handler:handler} - self96.processorMap["grantRole"] = &metaServiceProcessorGrantRole{handler:handler} - self96.processorMap["revokeRole"] = &metaServiceProcessorRevokeRole{handler:handler} - self96.processorMap["listUsers"] = &metaServiceProcessorListUsers{handler:handler} - self96.processorMap["listRoles"] = &metaServiceProcessorListRoles{handler:handler} - self96.processorMap["getUserRoles"] = &metaServiceProcessorGetUserRoles{handler:handler} - self96.processorMap["changePassword"] = &metaServiceProcessorChangePassword{handler:handler} - self96.processorMap["heartBeat"] = &metaServiceProcessorHeartBeat{handler:handler} - self96.processorMap["regConfig"] = &metaServiceProcessorRegConfig{handler:handler} - self96.processorMap["getConfig"] = &metaServiceProcessorGetConfig{handler:handler} - self96.processorMap["setConfig"] = &metaServiceProcessorSetConfig{handler:handler} - self96.processorMap["listConfigs"] = &metaServiceProcessorListConfigs{handler:handler} - self96.processorMap["createSnapshot"] = &metaServiceProcessorCreateSnapshot{handler:handler} - self96.processorMap["dropSnapshot"] = &metaServiceProcessorDropSnapshot{handler:handler} - self96.processorMap["listSnapshots"] = &metaServiceProcessorListSnapshots{handler:handler} - self96.processorMap["runAdminJob"] = &metaServiceProcessorRunAdminJob{handler:handler} - self96.processorMap["addZone"] = &metaServiceProcessorAddZone{handler:handler} - self96.processorMap["dropZone"] = &metaServiceProcessorDropZone{handler:handler} - self96.processorMap["addHostIntoZone"] = &metaServiceProcessorAddHostIntoZone{handler:handler} - self96.processorMap["dropHostFromZone"] = &metaServiceProcessorDropHostFromZone{handler:handler} - self96.processorMap["getZone"] = &metaServiceProcessorGetZone{handler:handler} - self96.processorMap["listZones"] = &metaServiceProcessorListZones{handler:handler} - self96.processorMap["createBackup"] = &metaServiceProcessorCreateBackup{handler:handler} - self96.processorMap["restoreMeta"] = &metaServiceProcessorRestoreMeta{handler:handler} - self96.processorMap["addListener"] = &metaServiceProcessorAddListener{handler:handler} - self96.processorMap["removeListener"] = &metaServiceProcessorRemoveListener{handler:handler} - self96.processorMap["listListener"] = &metaServiceProcessorListListener{handler:handler} - self96.processorMap["getStats"] = &metaServiceProcessorGetStats{handler:handler} - self96.processorMap["signInFTService"] = &metaServiceProcessorSignInFTService{handler:handler} - self96.processorMap["signOutFTService"] = &metaServiceProcessorSignOutFTService{handler:handler} - self96.processorMap["listFTClients"] = &metaServiceProcessorListFTClients{handler:handler} - self96.processorMap["createFTIndex"] = &metaServiceProcessorCreateFTIndex{handler:handler} - self96.processorMap["dropFTIndex"] = &metaServiceProcessorDropFTIndex{handler:handler} - self96.processorMap["listFTIndexes"] = &metaServiceProcessorListFTIndexes{handler:handler} - self96.processorMap["createSession"] = &metaServiceProcessorCreateSession{handler:handler} - self96.processorMap["updateSessions"] = &metaServiceProcessorUpdateSessions{handler:handler} - self96.processorMap["listSessions"] = &metaServiceProcessorListSessions{handler:handler} - self96.processorMap["getSession"] = &metaServiceProcessorGetSession{handler:handler} - self96.processorMap["removeSession"] = &metaServiceProcessorRemoveSession{handler:handler} - self96.processorMap["killQuery"] = &metaServiceProcessorKillQuery{handler:handler} - self96.processorMap["reportTaskFinish"] = &metaServiceProcessorReportTaskFinish{handler:handler} - self96.processorMap["listCluster"] = &metaServiceProcessorListCluster{handler:handler} - self96.processorMap["getMetaDirInfo"] = &metaServiceProcessorGetMetaDirInfo{handler:handler} - self96.processorMap["verifyClientVersion"] = &metaServiceProcessorVerifyClientVersion{handler:handler} - return self96 + self100 := &MetaServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self100.processorMap["createSpace"] = &metaServiceProcessorCreateSpace{handler:handler} + self100.processorMap["dropSpace"] = &metaServiceProcessorDropSpace{handler:handler} + self100.processorMap["getSpace"] = &metaServiceProcessorGetSpace{handler:handler} + self100.processorMap["listSpaces"] = &metaServiceProcessorListSpaces{handler:handler} + self100.processorMap["createSpaceAs"] = &metaServiceProcessorCreateSpaceAs{handler:handler} + self100.processorMap["createTag"] = &metaServiceProcessorCreateTag{handler:handler} + self100.processorMap["alterTag"] = &metaServiceProcessorAlterTag{handler:handler} + self100.processorMap["dropTag"] = &metaServiceProcessorDropTag{handler:handler} + self100.processorMap["getTag"] = &metaServiceProcessorGetTag{handler:handler} + self100.processorMap["listTags"] = &metaServiceProcessorListTags{handler:handler} + self100.processorMap["createEdge"] = &metaServiceProcessorCreateEdge{handler:handler} + self100.processorMap["alterEdge"] = &metaServiceProcessorAlterEdge{handler:handler} + self100.processorMap["dropEdge"] = &metaServiceProcessorDropEdge{handler:handler} + self100.processorMap["getEdge"] = &metaServiceProcessorGetEdge{handler:handler} + self100.processorMap["listEdges"] = &metaServiceProcessorListEdges{handler:handler} + self100.processorMap["addHosts"] = &metaServiceProcessorAddHosts{handler:handler} + self100.processorMap["addHostsIntoZone"] = &metaServiceProcessorAddHostsIntoZone{handler:handler} + self100.processorMap["dropHosts"] = &metaServiceProcessorDropHosts{handler:handler} + self100.processorMap["listHosts"] = &metaServiceProcessorListHosts{handler:handler} + self100.processorMap["getPartsAlloc"] = &metaServiceProcessorGetPartsAlloc{handler:handler} + self100.processorMap["listParts"] = &metaServiceProcessorListParts{handler:handler} + self100.processorMap["multiPut"] = &metaServiceProcessorMultiPut{handler:handler} + self100.processorMap["get"] = &metaServiceProcessorGet{handler:handler} + self100.processorMap["multiGet"] = &metaServiceProcessorMultiGet{handler:handler} + self100.processorMap["remove"] = &metaServiceProcessorRemove{handler:handler} + self100.processorMap["removeRange"] = &metaServiceProcessorRemoveRange{handler:handler} + self100.processorMap["scan"] = &metaServiceProcessorScan{handler:handler} + self100.processorMap["createTagIndex"] = &metaServiceProcessorCreateTagIndex{handler:handler} + self100.processorMap["dropTagIndex"] = &metaServiceProcessorDropTagIndex{handler:handler} + self100.processorMap["getTagIndex"] = &metaServiceProcessorGetTagIndex{handler:handler} + self100.processorMap["listTagIndexes"] = &metaServiceProcessorListTagIndexes{handler:handler} + self100.processorMap["rebuildTagIndex"] = &metaServiceProcessorRebuildTagIndex{handler:handler} + self100.processorMap["listTagIndexStatus"] = &metaServiceProcessorListTagIndexStatus{handler:handler} + self100.processorMap["createEdgeIndex"] = &metaServiceProcessorCreateEdgeIndex{handler:handler} + self100.processorMap["dropEdgeIndex"] = &metaServiceProcessorDropEdgeIndex{handler:handler} + self100.processorMap["getEdgeIndex"] = &metaServiceProcessorGetEdgeIndex{handler:handler} + self100.processorMap["listEdgeIndexes"] = &metaServiceProcessorListEdgeIndexes{handler:handler} + self100.processorMap["rebuildEdgeIndex"] = &metaServiceProcessorRebuildEdgeIndex{handler:handler} + self100.processorMap["listEdgeIndexStatus"] = &metaServiceProcessorListEdgeIndexStatus{handler:handler} + self100.processorMap["createUser"] = &metaServiceProcessorCreateUser{handler:handler} + self100.processorMap["dropUser"] = &metaServiceProcessorDropUser{handler:handler} + self100.processorMap["alterUser"] = &metaServiceProcessorAlterUser{handler:handler} + self100.processorMap["grantRole"] = &metaServiceProcessorGrantRole{handler:handler} + self100.processorMap["revokeRole"] = &metaServiceProcessorRevokeRole{handler:handler} + self100.processorMap["listUsers"] = &metaServiceProcessorListUsers{handler:handler} + self100.processorMap["listRoles"] = &metaServiceProcessorListRoles{handler:handler} + self100.processorMap["getUserRoles"] = &metaServiceProcessorGetUserRoles{handler:handler} + self100.processorMap["changePassword"] = &metaServiceProcessorChangePassword{handler:handler} + self100.processorMap["heartBeat"] = &metaServiceProcessorHeartBeat{handler:handler} + self100.processorMap["regConfig"] = &metaServiceProcessorRegConfig{handler:handler} + self100.processorMap["getConfig"] = &metaServiceProcessorGetConfig{handler:handler} + self100.processorMap["setConfig"] = &metaServiceProcessorSetConfig{handler:handler} + self100.processorMap["listConfigs"] = &metaServiceProcessorListConfigs{handler:handler} + self100.processorMap["createSnapshot"] = &metaServiceProcessorCreateSnapshot{handler:handler} + self100.processorMap["dropSnapshot"] = &metaServiceProcessorDropSnapshot{handler:handler} + self100.processorMap["listSnapshots"] = &metaServiceProcessorListSnapshots{handler:handler} + self100.processorMap["runAdminJob"] = &metaServiceProcessorRunAdminJob{handler:handler} + self100.processorMap["mergeZone"] = &metaServiceProcessorMergeZone{handler:handler} + self100.processorMap["dropZone"] = &metaServiceProcessorDropZone{handler:handler} + self100.processorMap["splitZone"] = &metaServiceProcessorSplitZone{handler:handler} + self100.processorMap["renameZone"] = &metaServiceProcessorRenameZone{handler:handler} + self100.processorMap["getZone"] = &metaServiceProcessorGetZone{handler:handler} + self100.processorMap["listZones"] = &metaServiceProcessorListZones{handler:handler} + self100.processorMap["createBackup"] = &metaServiceProcessorCreateBackup{handler:handler} + self100.processorMap["restoreMeta"] = &metaServiceProcessorRestoreMeta{handler:handler} + self100.processorMap["addListener"] = &metaServiceProcessorAddListener{handler:handler} + self100.processorMap["removeListener"] = &metaServiceProcessorRemoveListener{handler:handler} + self100.processorMap["listListener"] = &metaServiceProcessorListListener{handler:handler} + self100.processorMap["getStats"] = &metaServiceProcessorGetStats{handler:handler} + self100.processorMap["signInFTService"] = &metaServiceProcessorSignInFTService{handler:handler} + self100.processorMap["signOutFTService"] = &metaServiceProcessorSignOutFTService{handler:handler} + self100.processorMap["listFTClients"] = &metaServiceProcessorListFTClients{handler:handler} + self100.processorMap["createFTIndex"] = &metaServiceProcessorCreateFTIndex{handler:handler} + self100.processorMap["dropFTIndex"] = &metaServiceProcessorDropFTIndex{handler:handler} + self100.processorMap["listFTIndexes"] = &metaServiceProcessorListFTIndexes{handler:handler} + self100.processorMap["createSession"] = &metaServiceProcessorCreateSession{handler:handler} + self100.processorMap["updateSessions"] = &metaServiceProcessorUpdateSessions{handler:handler} + self100.processorMap["listSessions"] = &metaServiceProcessorListSessions{handler:handler} + self100.processorMap["getSession"] = &metaServiceProcessorGetSession{handler:handler} + self100.processorMap["removeSession"] = &metaServiceProcessorRemoveSession{handler:handler} + self100.processorMap["killQuery"] = &metaServiceProcessorKillQuery{handler:handler} + self100.processorMap["reportTaskFinish"] = &metaServiceProcessorReportTaskFinish{handler:handler} + self100.processorMap["listCluster"] = &metaServiceProcessorListCluster{handler:handler} + self100.processorMap["getMetaDirInfo"] = &metaServiceProcessorGetMetaDirInfo{handler:handler} + self100.processorMap["verifyClientVersion"] = &metaServiceProcessorVerifyClientVersion{handler:handler} + return self100 } type metaServiceProcessorCreateSpace struct { @@ -5976,6 +6162,156 @@ func (p *metaServiceProcessorListEdges) RunContext(ctx context.Context, argStruc return &result, nil } +type metaServiceProcessorAddHosts struct { + handler MetaService +} + +func (p *metaServiceProcessorAddHosts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddHostsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddHosts) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("addHosts", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorAddHosts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddHostsArgs) + var result MetaServiceAddHostsResult + if retval, err := p.handler.AddHosts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHosts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddHostsIntoZone struct { + handler MetaService +} + +func (p *metaServiceProcessorAddHostsIntoZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddHostsIntoZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddHostsIntoZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("addHostsIntoZone", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorAddHostsIntoZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddHostsIntoZoneArgs) + var result MetaServiceAddHostsIntoZoneResult + if retval, err := p.handler.AddHostsIntoZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHostsIntoZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropHosts struct { + handler MetaService +} + +func (p *metaServiceProcessorDropHosts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropHostsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropHosts) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("dropHosts", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorDropHosts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropHostsArgs) + var result MetaServiceDropHostsResult + if retval, err := p.handler.DropHosts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropHosts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + type metaServiceProcessorListHosts struct { handler MetaService } @@ -7926,12 +8262,12 @@ func (p *metaServiceProcessorRunAdminJob) RunContext(ctx context.Context, argStr return &result, nil } -type metaServiceProcessorAddZone struct { +type metaServiceProcessorMergeZone struct { handler MetaService } -func (p *metaServiceProcessorAddZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceAddZoneArgs{} +func (p *metaServiceProcessorMergeZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceMergeZoneArgs{} if err := args.Read(iprot); err != nil { return nil, err } @@ -7939,14 +8275,14 @@ func (p *metaServiceProcessorAddZone) Read(iprot thrift.Protocol) (thrift.Struct return &args, nil } -func (p *metaServiceProcessorAddZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { +func (p *metaServiceProcessorMergeZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } - if err2 = oprot.WriteMessageBegin("addZone", messageType, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("mergeZone", messageType, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -7961,13 +8297,13 @@ func (p *metaServiceProcessorAddZone) Write(seqId int32, result thrift.WritableS return err } -func (p *metaServiceProcessorAddZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceAddZoneArgs) - var result MetaServiceAddZoneResult - if retval, err := p.handler.AddZone(ctx, args.Req); err != nil { +func (p *metaServiceProcessorMergeZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceMergeZoneArgs) + var result MetaServiceMergeZoneResult + if retval, err := p.handler.MergeZone(ctx, args.Req); err != nil { switch err.(type) { default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addZone: " + err.Error()) + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing mergeZone: " + err.Error()) return x, x } } else { @@ -8026,12 +8362,12 @@ func (p *metaServiceProcessorDropZone) RunContext(ctx context.Context, argStruct return &result, nil } -type metaServiceProcessorAddHostIntoZone struct { +type metaServiceProcessorSplitZone struct { handler MetaService } -func (p *metaServiceProcessorAddHostIntoZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceAddHostIntoZoneArgs{} +func (p *metaServiceProcessorSplitZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSplitZoneArgs{} if err := args.Read(iprot); err != nil { return nil, err } @@ -8039,14 +8375,14 @@ func (p *metaServiceProcessorAddHostIntoZone) Read(iprot thrift.Protocol) (thrif return &args, nil } -func (p *metaServiceProcessorAddHostIntoZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { +func (p *metaServiceProcessorSplitZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } - if err2 = oprot.WriteMessageBegin("addHostIntoZone", messageType, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("splitZone", messageType, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -8061,13 +8397,13 @@ func (p *metaServiceProcessorAddHostIntoZone) Write(seqId int32, result thrift.W return err } -func (p *metaServiceProcessorAddHostIntoZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceAddHostIntoZoneArgs) - var result MetaServiceAddHostIntoZoneResult - if retval, err := p.handler.AddHostIntoZone(ctx, args.Req); err != nil { +func (p *metaServiceProcessorSplitZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSplitZoneArgs) + var result MetaServiceSplitZoneResult + if retval, err := p.handler.SplitZone(ctx, args.Req); err != nil { switch err.(type) { default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHostIntoZone: " + err.Error()) + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing splitZone: " + err.Error()) return x, x } } else { @@ -8076,12 +8412,12 @@ func (p *metaServiceProcessorAddHostIntoZone) RunContext(ctx context.Context, ar return &result, nil } -type metaServiceProcessorDropHostFromZone struct { +type metaServiceProcessorRenameZone struct { handler MetaService } -func (p *metaServiceProcessorDropHostFromZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceDropHostFromZoneArgs{} +func (p *metaServiceProcessorRenameZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRenameZoneArgs{} if err := args.Read(iprot); err != nil { return nil, err } @@ -8089,14 +8425,14 @@ func (p *metaServiceProcessorDropHostFromZone) Read(iprot thrift.Protocol) (thri return &args, nil } -func (p *metaServiceProcessorDropHostFromZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { +func (p *metaServiceProcessorRenameZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } - if err2 = oprot.WriteMessageBegin("dropHostFromZone", messageType, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("renameZone", messageType, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -8111,13 +8447,13 @@ func (p *metaServiceProcessorDropHostFromZone) Write(seqId int32, result thrift. return err } -func (p *metaServiceProcessorDropHostFromZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceDropHostFromZoneArgs) - var result MetaServiceDropHostFromZoneResult - if retval, err := p.handler.DropHostFromZone(ctx, args.Req); err != nil { +func (p *metaServiceProcessorRenameZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRenameZoneArgs) + var result MetaServiceRenameZoneResult + if retval, err := p.handler.RenameZone(ctx, args.Req); err != nil { switch err.(type) { default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropHostFromZone: " + err.Error()) + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing renameZone: " + err.Error()) return x, x } } else { @@ -12329,6 +12665,606 @@ func (p *MetaServiceListEdgesResult) String() string { return fmt.Sprintf("MetaServiceListEdgesResult({Success:%s})", successVal) } +// Attributes: +// - Req +type MetaServiceAddHostsArgs struct { + thrift.IRequest + Req *AddHostsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddHostsArgs() *MetaServiceAddHostsArgs { + return &MetaServiceAddHostsArgs{ + Req: NewAddHostsReq(), + } +} + +var MetaServiceAddHostsArgs_Req_DEFAULT *AddHostsReq +func (p *MetaServiceAddHostsArgs) GetReq() *AddHostsReq { + if !p.IsSetReq() { + return MetaServiceAddHostsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddHostsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddHostsArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + 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 *MetaServiceAddHostsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddHostsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddHostsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHosts_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAddHostsArgs) writeField1(oprot thrift.Protocol) (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 *MetaServiceAddHostsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddHostsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddHostsResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddHostsResult() *MetaServiceAddHostsResult { + return &MetaServiceAddHostsResult{} +} + +var MetaServiceAddHostsResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddHostsResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddHostsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddHostsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddHostsResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAddHostsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddHostsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHosts_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + 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 *MetaServiceAddHostsResult) writeField0(oprot thrift.Protocol) (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 *MetaServiceAddHostsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddHostsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddHostsIntoZoneArgs struct { + thrift.IRequest + Req *AddHostsIntoZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddHostsIntoZoneArgs() *MetaServiceAddHostsIntoZoneArgs { + return &MetaServiceAddHostsIntoZoneArgs{ + Req: NewAddHostsIntoZoneReq(), + } +} + +var MetaServiceAddHostsIntoZoneArgs_Req_DEFAULT *AddHostsIntoZoneReq +func (p *MetaServiceAddHostsIntoZoneArgs) GetReq() *AddHostsIntoZoneReq { + if !p.IsSetReq() { + return MetaServiceAddHostsIntoZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddHostsIntoZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddHostsIntoZoneArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + 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 *MetaServiceAddHostsIntoZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddHostsIntoZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddHostsIntoZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHostsIntoZone_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAddHostsIntoZoneArgs) writeField1(oprot thrift.Protocol) (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 *MetaServiceAddHostsIntoZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddHostsIntoZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddHostsIntoZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddHostsIntoZoneResult() *MetaServiceAddHostsIntoZoneResult { + return &MetaServiceAddHostsIntoZoneResult{} +} + +var MetaServiceAddHostsIntoZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddHostsIntoZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddHostsIntoZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddHostsIntoZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddHostsIntoZoneResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAddHostsIntoZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddHostsIntoZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHostsIntoZone_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + 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 *MetaServiceAddHostsIntoZoneResult) writeField0(oprot thrift.Protocol) (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 *MetaServiceAddHostsIntoZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddHostsIntoZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropHostsArgs struct { + thrift.IRequest + Req *DropHostsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropHostsArgs() *MetaServiceDropHostsArgs { + return &MetaServiceDropHostsArgs{ + Req: NewDropHostsReq(), + } +} + +var MetaServiceDropHostsArgs_Req_DEFAULT *DropHostsReq +func (p *MetaServiceDropHostsArgs) GetReq() *DropHostsReq { + if !p.IsSetReq() { + return MetaServiceDropHostsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropHostsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropHostsArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + 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 *MetaServiceDropHostsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropHostsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropHostsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropHosts_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropHostsArgs) writeField1(oprot thrift.Protocol) (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 *MetaServiceDropHostsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropHostsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropHostsResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropHostsResult() *MetaServiceDropHostsResult { + return &MetaServiceDropHostsResult{} +} + +var MetaServiceDropHostsResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropHostsResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropHostsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropHostsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropHostsResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropHostsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropHostsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropHosts_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + 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 *MetaServiceDropHostsResult) writeField0(oprot thrift.Protocol) (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 *MetaServiceDropHostsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropHostsResult({Success:%s})", successVal) +} + // Attributes: // - Req type MetaServiceListHostsArgs struct { @@ -20131,29 +21067,29 @@ func (p *MetaServiceRunAdminJobResult) String() string { // Attributes: // - Req -type MetaServiceAddZoneArgs struct { +type MetaServiceMergeZoneArgs struct { thrift.IRequest - Req *AddZoneReq `thrift:"req,1" db:"req" json:"req"` + Req *MergeZoneReq `thrift:"req,1" db:"req" json:"req"` } -func NewMetaServiceAddZoneArgs() *MetaServiceAddZoneArgs { - return &MetaServiceAddZoneArgs{ - Req: NewAddZoneReq(), +func NewMetaServiceMergeZoneArgs() *MetaServiceMergeZoneArgs { + return &MetaServiceMergeZoneArgs{ + Req: NewMergeZoneReq(), } } -var MetaServiceAddZoneArgs_Req_DEFAULT *AddZoneReq -func (p *MetaServiceAddZoneArgs) GetReq() *AddZoneReq { +var MetaServiceMergeZoneArgs_Req_DEFAULT *MergeZoneReq +func (p *MetaServiceMergeZoneArgs) GetReq() *MergeZoneReq { if !p.IsSetReq() { - return MetaServiceAddZoneArgs_Req_DEFAULT + return MetaServiceMergeZoneArgs_Req_DEFAULT } return p.Req } -func (p *MetaServiceAddZoneArgs) IsSetReq() bool { +func (p *MetaServiceMergeZoneArgs) IsSetReq() bool { return p != nil && p.Req != nil } -func (p *MetaServiceAddZoneArgs) Read(iprot thrift.Protocol) error { +func (p *MetaServiceMergeZoneArgs) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -20185,16 +21121,16 @@ func (p *MetaServiceAddZoneArgs) Read(iprot thrift.Protocol) error { return nil } -func (p *MetaServiceAddZoneArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewAddZoneReq() +func (p *MetaServiceMergeZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMergeZoneReq() if err := p.Req.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *MetaServiceAddZoneArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("addZone_args"); err != nil { +func (p *MetaServiceMergeZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("mergeZone_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField1(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { @@ -20204,7 +21140,7 @@ func (p *MetaServiceAddZoneArgs) Write(oprot thrift.Protocol) error { return nil } -func (p *MetaServiceAddZoneArgs) writeField1(oprot thrift.Protocol) (err error) { +func (p *MetaServiceMergeZoneArgs) writeField1(oprot thrift.Protocol) (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 { @@ -20215,7 +21151,7 @@ func (p *MetaServiceAddZoneArgs) writeField1(oprot thrift.Protocol) (err error) return err } -func (p *MetaServiceAddZoneArgs) String() string { +func (p *MetaServiceMergeZoneArgs) String() string { if p == nil { return "" } @@ -20226,32 +21162,32 @@ func (p *MetaServiceAddZoneArgs) String() string { } else { reqVal = fmt.Sprintf("%v", p.Req) } - return fmt.Sprintf("MetaServiceAddZoneArgs({Req:%s})", reqVal) + return fmt.Sprintf("MetaServiceMergeZoneArgs({Req:%s})", reqVal) } // Attributes: // - Success -type MetaServiceAddZoneResult struct { +type MetaServiceMergeZoneResult struct { thrift.IResponse Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewMetaServiceAddZoneResult() *MetaServiceAddZoneResult { - return &MetaServiceAddZoneResult{} +func NewMetaServiceMergeZoneResult() *MetaServiceMergeZoneResult { + return &MetaServiceMergeZoneResult{} } -var MetaServiceAddZoneResult_Success_DEFAULT *ExecResp -func (p *MetaServiceAddZoneResult) GetSuccess() *ExecResp { +var MetaServiceMergeZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceMergeZoneResult) GetSuccess() *ExecResp { if !p.IsSetSuccess() { - return MetaServiceAddZoneResult_Success_DEFAULT + return MetaServiceMergeZoneResult_Success_DEFAULT } return p.Success } -func (p *MetaServiceAddZoneResult) IsSetSuccess() bool { +func (p *MetaServiceMergeZoneResult) IsSetSuccess() bool { return p != nil && p.Success != nil } -func (p *MetaServiceAddZoneResult) Read(iprot thrift.Protocol) error { +func (p *MetaServiceMergeZoneResult) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -20283,7 +21219,7 @@ func (p *MetaServiceAddZoneResult) Read(iprot thrift.Protocol) error { return nil } -func (p *MetaServiceAddZoneResult) ReadField0(iprot thrift.Protocol) error { +func (p *MetaServiceMergeZoneResult) ReadField0(iprot thrift.Protocol) error { p.Success = NewExecResp() if err := p.Success.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) @@ -20291,8 +21227,8 @@ func (p *MetaServiceAddZoneResult) ReadField0(iprot thrift.Protocol) error { return nil } -func (p *MetaServiceAddZoneResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("addZone_result"); err != nil { +func (p *MetaServiceMergeZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("mergeZone_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField0(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { @@ -20302,7 +21238,7 @@ func (p *MetaServiceAddZoneResult) Write(oprot thrift.Protocol) error { return nil } -func (p *MetaServiceAddZoneResult) writeField0(oprot thrift.Protocol) (err error) { +func (p *MetaServiceMergeZoneResult) writeField0(oprot thrift.Protocol) (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) } @@ -20315,7 +21251,7 @@ func (p *MetaServiceAddZoneResult) writeField0(oprot thrift.Protocol) (err error return err } -func (p *MetaServiceAddZoneResult) String() string { +func (p *MetaServiceMergeZoneResult) String() string { if p == nil { return "" } @@ -20326,7 +21262,7 @@ func (p *MetaServiceAddZoneResult) String() string { } else { successVal = fmt.Sprintf("%v", p.Success) } - return fmt.Sprintf("MetaServiceAddZoneResult({Success:%s})", successVal) + return fmt.Sprintf("MetaServiceMergeZoneResult({Success:%s})", successVal) } // Attributes: @@ -20531,29 +21467,29 @@ func (p *MetaServiceDropZoneResult) String() string { // Attributes: // - Req -type MetaServiceAddHostIntoZoneArgs struct { +type MetaServiceSplitZoneArgs struct { thrift.IRequest - Req *AddHostIntoZoneReq `thrift:"req,1" db:"req" json:"req"` + Req *SplitZoneReq `thrift:"req,1" db:"req" json:"req"` } -func NewMetaServiceAddHostIntoZoneArgs() *MetaServiceAddHostIntoZoneArgs { - return &MetaServiceAddHostIntoZoneArgs{ - Req: NewAddHostIntoZoneReq(), +func NewMetaServiceSplitZoneArgs() *MetaServiceSplitZoneArgs { + return &MetaServiceSplitZoneArgs{ + Req: NewSplitZoneReq(), } } -var MetaServiceAddHostIntoZoneArgs_Req_DEFAULT *AddHostIntoZoneReq -func (p *MetaServiceAddHostIntoZoneArgs) GetReq() *AddHostIntoZoneReq { +var MetaServiceSplitZoneArgs_Req_DEFAULT *SplitZoneReq +func (p *MetaServiceSplitZoneArgs) GetReq() *SplitZoneReq { if !p.IsSetReq() { - return MetaServiceAddHostIntoZoneArgs_Req_DEFAULT + return MetaServiceSplitZoneArgs_Req_DEFAULT } return p.Req } -func (p *MetaServiceAddHostIntoZoneArgs) IsSetReq() bool { +func (p *MetaServiceSplitZoneArgs) IsSetReq() bool { return p != nil && p.Req != nil } -func (p *MetaServiceAddHostIntoZoneArgs) Read(iprot thrift.Protocol) error { +func (p *MetaServiceSplitZoneArgs) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -20585,16 +21521,16 @@ func (p *MetaServiceAddHostIntoZoneArgs) Read(iprot thrift.Protocol) error { return nil } -func (p *MetaServiceAddHostIntoZoneArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewAddHostIntoZoneReq() +func (p *MetaServiceSplitZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSplitZoneReq() if err := p.Req.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *MetaServiceAddHostIntoZoneArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("addHostIntoZone_args"); err != nil { +func (p *MetaServiceSplitZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("splitZone_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField1(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { @@ -20604,7 +21540,7 @@ func (p *MetaServiceAddHostIntoZoneArgs) Write(oprot thrift.Protocol) error { return nil } -func (p *MetaServiceAddHostIntoZoneArgs) writeField1(oprot thrift.Protocol) (err error) { +func (p *MetaServiceSplitZoneArgs) writeField1(oprot thrift.Protocol) (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 { @@ -20615,7 +21551,7 @@ func (p *MetaServiceAddHostIntoZoneArgs) writeField1(oprot thrift.Protocol) (err return err } -func (p *MetaServiceAddHostIntoZoneArgs) String() string { +func (p *MetaServiceSplitZoneArgs) String() string { if p == nil { return "" } @@ -20626,32 +21562,32 @@ func (p *MetaServiceAddHostIntoZoneArgs) String() string { } else { reqVal = fmt.Sprintf("%v", p.Req) } - return fmt.Sprintf("MetaServiceAddHostIntoZoneArgs({Req:%s})", reqVal) + return fmt.Sprintf("MetaServiceSplitZoneArgs({Req:%s})", reqVal) } // Attributes: // - Success -type MetaServiceAddHostIntoZoneResult struct { +type MetaServiceSplitZoneResult struct { thrift.IResponse Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewMetaServiceAddHostIntoZoneResult() *MetaServiceAddHostIntoZoneResult { - return &MetaServiceAddHostIntoZoneResult{} +func NewMetaServiceSplitZoneResult() *MetaServiceSplitZoneResult { + return &MetaServiceSplitZoneResult{} } -var MetaServiceAddHostIntoZoneResult_Success_DEFAULT *ExecResp -func (p *MetaServiceAddHostIntoZoneResult) GetSuccess() *ExecResp { +var MetaServiceSplitZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSplitZoneResult) GetSuccess() *ExecResp { if !p.IsSetSuccess() { - return MetaServiceAddHostIntoZoneResult_Success_DEFAULT + return MetaServiceSplitZoneResult_Success_DEFAULT } return p.Success } -func (p *MetaServiceAddHostIntoZoneResult) IsSetSuccess() bool { +func (p *MetaServiceSplitZoneResult) IsSetSuccess() bool { return p != nil && p.Success != nil } -func (p *MetaServiceAddHostIntoZoneResult) Read(iprot thrift.Protocol) error { +func (p *MetaServiceSplitZoneResult) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -20683,7 +21619,7 @@ func (p *MetaServiceAddHostIntoZoneResult) Read(iprot thrift.Protocol) error { return nil } -func (p *MetaServiceAddHostIntoZoneResult) ReadField0(iprot thrift.Protocol) error { +func (p *MetaServiceSplitZoneResult) ReadField0(iprot thrift.Protocol) error { p.Success = NewExecResp() if err := p.Success.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) @@ -20691,8 +21627,8 @@ func (p *MetaServiceAddHostIntoZoneResult) ReadField0(iprot thrift.Protocol) er return nil } -func (p *MetaServiceAddHostIntoZoneResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("addHostIntoZone_result"); err != nil { +func (p *MetaServiceSplitZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("splitZone_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField0(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { @@ -20702,7 +21638,7 @@ func (p *MetaServiceAddHostIntoZoneResult) Write(oprot thrift.Protocol) error { return nil } -func (p *MetaServiceAddHostIntoZoneResult) writeField0(oprot thrift.Protocol) (err error) { +func (p *MetaServiceSplitZoneResult) writeField0(oprot thrift.Protocol) (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) } @@ -20715,7 +21651,7 @@ func (p *MetaServiceAddHostIntoZoneResult) writeField0(oprot thrift.Protocol) (e return err } -func (p *MetaServiceAddHostIntoZoneResult) String() string { +func (p *MetaServiceSplitZoneResult) String() string { if p == nil { return "" } @@ -20726,34 +21662,34 @@ func (p *MetaServiceAddHostIntoZoneResult) String() string { } else { successVal = fmt.Sprintf("%v", p.Success) } - return fmt.Sprintf("MetaServiceAddHostIntoZoneResult({Success:%s})", successVal) + return fmt.Sprintf("MetaServiceSplitZoneResult({Success:%s})", successVal) } // Attributes: // - Req -type MetaServiceDropHostFromZoneArgs struct { +type MetaServiceRenameZoneArgs struct { thrift.IRequest - Req *DropHostFromZoneReq `thrift:"req,1" db:"req" json:"req"` + Req *RenameZoneReq `thrift:"req,1" db:"req" json:"req"` } -func NewMetaServiceDropHostFromZoneArgs() *MetaServiceDropHostFromZoneArgs { - return &MetaServiceDropHostFromZoneArgs{ - Req: NewDropHostFromZoneReq(), +func NewMetaServiceRenameZoneArgs() *MetaServiceRenameZoneArgs { + return &MetaServiceRenameZoneArgs{ + Req: NewRenameZoneReq(), } } -var MetaServiceDropHostFromZoneArgs_Req_DEFAULT *DropHostFromZoneReq -func (p *MetaServiceDropHostFromZoneArgs) GetReq() *DropHostFromZoneReq { +var MetaServiceRenameZoneArgs_Req_DEFAULT *RenameZoneReq +func (p *MetaServiceRenameZoneArgs) GetReq() *RenameZoneReq { if !p.IsSetReq() { - return MetaServiceDropHostFromZoneArgs_Req_DEFAULT + return MetaServiceRenameZoneArgs_Req_DEFAULT } return p.Req } -func (p *MetaServiceDropHostFromZoneArgs) IsSetReq() bool { +func (p *MetaServiceRenameZoneArgs) IsSetReq() bool { return p != nil && p.Req != nil } -func (p *MetaServiceDropHostFromZoneArgs) Read(iprot thrift.Protocol) error { +func (p *MetaServiceRenameZoneArgs) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -20785,16 +21721,16 @@ func (p *MetaServiceDropHostFromZoneArgs) Read(iprot thrift.Protocol) error { return nil } -func (p *MetaServiceDropHostFromZoneArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewDropHostFromZoneReq() +func (p *MetaServiceRenameZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRenameZoneReq() if err := p.Req.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *MetaServiceDropHostFromZoneArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("dropHostFromZone_args"); err != nil { +func (p *MetaServiceRenameZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("renameZone_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField1(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { @@ -20804,7 +21740,7 @@ func (p *MetaServiceDropHostFromZoneArgs) Write(oprot thrift.Protocol) error { return nil } -func (p *MetaServiceDropHostFromZoneArgs) writeField1(oprot thrift.Protocol) (err error) { +func (p *MetaServiceRenameZoneArgs) writeField1(oprot thrift.Protocol) (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 { @@ -20815,7 +21751,7 @@ func (p *MetaServiceDropHostFromZoneArgs) writeField1(oprot thrift.Protocol) (er return err } -func (p *MetaServiceDropHostFromZoneArgs) String() string { +func (p *MetaServiceRenameZoneArgs) String() string { if p == nil { return "" } @@ -20826,32 +21762,32 @@ func (p *MetaServiceDropHostFromZoneArgs) String() string { } else { reqVal = fmt.Sprintf("%v", p.Req) } - return fmt.Sprintf("MetaServiceDropHostFromZoneArgs({Req:%s})", reqVal) + return fmt.Sprintf("MetaServiceRenameZoneArgs({Req:%s})", reqVal) } // Attributes: // - Success -type MetaServiceDropHostFromZoneResult struct { +type MetaServiceRenameZoneResult struct { thrift.IResponse Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewMetaServiceDropHostFromZoneResult() *MetaServiceDropHostFromZoneResult { - return &MetaServiceDropHostFromZoneResult{} +func NewMetaServiceRenameZoneResult() *MetaServiceRenameZoneResult { + return &MetaServiceRenameZoneResult{} } -var MetaServiceDropHostFromZoneResult_Success_DEFAULT *ExecResp -func (p *MetaServiceDropHostFromZoneResult) GetSuccess() *ExecResp { +var MetaServiceRenameZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRenameZoneResult) GetSuccess() *ExecResp { if !p.IsSetSuccess() { - return MetaServiceDropHostFromZoneResult_Success_DEFAULT + return MetaServiceRenameZoneResult_Success_DEFAULT } return p.Success } -func (p *MetaServiceDropHostFromZoneResult) IsSetSuccess() bool { +func (p *MetaServiceRenameZoneResult) IsSetSuccess() bool { return p != nil && p.Success != nil } -func (p *MetaServiceDropHostFromZoneResult) Read(iprot thrift.Protocol) error { +func (p *MetaServiceRenameZoneResult) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -20883,7 +21819,7 @@ func (p *MetaServiceDropHostFromZoneResult) Read(iprot thrift.Protocol) error { return nil } -func (p *MetaServiceDropHostFromZoneResult) ReadField0(iprot thrift.Protocol) error { +func (p *MetaServiceRenameZoneResult) ReadField0(iprot thrift.Protocol) error { p.Success = NewExecResp() if err := p.Success.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) @@ -20891,8 +21827,8 @@ func (p *MetaServiceDropHostFromZoneResult) ReadField0(iprot thrift.Protocol) e return nil } -func (p *MetaServiceDropHostFromZoneResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("dropHostFromZone_result"); err != nil { +func (p *MetaServiceRenameZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("renameZone_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField0(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { @@ -20902,7 +21838,7 @@ func (p *MetaServiceDropHostFromZoneResult) Write(oprot thrift.Protocol) error { return nil } -func (p *MetaServiceDropHostFromZoneResult) writeField0(oprot thrift.Protocol) (err error) { +func (p *MetaServiceRenameZoneResult) writeField0(oprot thrift.Protocol) (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) } @@ -20915,7 +21851,7 @@ func (p *MetaServiceDropHostFromZoneResult) writeField0(oprot thrift.Protocol) ( return err } -func (p *MetaServiceDropHostFromZoneResult) String() string { +func (p *MetaServiceRenameZoneResult) String() string { if p == nil { return "" } @@ -20926,7 +21862,7 @@ func (p *MetaServiceDropHostFromZoneResult) String() string { } else { successVal = fmt.Sprintf("%v", p.Success) } - return fmt.Sprintf("MetaServiceDropHostFromZoneResult({Success:%s})", successVal) + return fmt.Sprintf("MetaServiceRenameZoneResult({Success:%s})", successVal) } // Attributes: diff --git a/nebula/meta/ttypes.go b/nebula/meta/ttypes.go index f237860b..7dd305a6 100644 --- a/nebula/meta/ttypes.go +++ b/nebula/meta/ttypes.go @@ -2118,7 +2118,7 @@ func (p *IdName) String() string { // - CharsetName // - CollateName // - VidType -// - GroupName +// - ZoneNames // - IsolationLevel // - Comment type SpaceDesc struct { @@ -2128,7 +2128,7 @@ type SpaceDesc struct { CharsetName []byte `thrift:"charset_name,4" db:"charset_name" json:"charset_name"` CollateName []byte `thrift:"collate_name,5" db:"collate_name" json:"collate_name"` VidType *ColumnTypeDef `thrift:"vid_type,6" db:"vid_type" json:"vid_type"` - GroupName []byte `thrift:"group_name,7" db:"group_name" json:"group_name,omitempty"` + ZoneNames [][]byte `thrift:"zone_names,7" db:"zone_names" json:"zone_names"` IsolationLevel *IsolationLevel `thrift:"isolation_level,8" db:"isolation_level" json:"isolation_level,omitempty"` Comment []byte `thrift:"comment,9" db:"comment" json:"comment,omitempty"` } @@ -2169,10 +2169,9 @@ func (p *SpaceDesc) GetVidType() *ColumnTypeDef { } return p.VidType } -var SpaceDesc_GroupName_DEFAULT []byte -func (p *SpaceDesc) GetGroupName() []byte { - return p.GroupName +func (p *SpaceDesc) GetZoneNames() [][]byte { + return p.ZoneNames } var SpaceDesc_IsolationLevel_DEFAULT IsolationLevel func (p *SpaceDesc) GetIsolationLevel() IsolationLevel { @@ -2190,10 +2189,6 @@ func (p *SpaceDesc) IsSetVidType() bool { return p != nil && p.VidType != nil } -func (p *SpaceDesc) IsSetGroupName() bool { - return p != nil && p.GroupName != nil -} - func (p *SpaceDesc) IsSetIsolationLevel() bool { return p != nil && p.IsolationLevel != nil } @@ -2320,11 +2315,24 @@ func (p *SpaceDesc) ReadField6(iprot thrift.Protocol) error { } func (p *SpaceDesc) ReadField7(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 7: ", err) + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.ZoneNames = tSlice + for i := 0; i < size; i ++ { +var _elem2 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) } else { - p.GroupName = v + _elem2 = v } + p.ZoneNames = append(p.ZoneNames, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } return nil } @@ -2428,14 +2436,20 @@ func (p *SpaceDesc) writeField6(oprot thrift.Protocol) (err error) { } func (p *SpaceDesc) writeField7(oprot thrift.Protocol) (err error) { - if p.IsSetGroupName() { - if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:group_name: ", p), err) } - if err := oprot.WriteBinary(p.GroupName); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.group_name (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:group_name: ", p), err) } + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:zone_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(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 7:zone_names: ", p), err) } return err } @@ -2479,7 +2493,7 @@ func (p *SpaceDesc) String() string { } else { vidTypeVal = fmt.Sprintf("%v", p.VidType) } - groupNameVal := fmt.Sprintf("%v", p.GroupName) + zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) var isolationLevelVal string if p.IsolationLevel == nil { isolationLevelVal = "" @@ -2487,7 +2501,7 @@ func (p *SpaceDesc) String() string { isolationLevelVal = fmt.Sprintf("%v", *p.IsolationLevel) } commentVal := fmt.Sprintf("%v", p.Comment) - return fmt.Sprintf("SpaceDesc({SpaceName:%s PartitionNum:%s ReplicaFactor:%s CharsetName:%s CollateName:%s VidType:%s GroupName:%s IsolationLevel:%s Comment:%s})", spaceNameVal, partitionNumVal, replicaFactorVal, charsetNameVal, collateNameVal, vidTypeVal, groupNameVal, isolationLevelVal, commentVal) + return fmt.Sprintf("SpaceDesc({SpaceName:%s PartitionNum:%s ReplicaFactor:%s CharsetName:%s CollateName:%s VidType:%s ZoneNames:%s IsolationLevel:%s Comment:%s})", spaceNameVal, partitionNumVal, replicaFactorVal, charsetNameVal, collateNameVal, vidTypeVal, zoneNamesVal, isolationLevelVal, commentVal) } // Attributes: @@ -3140,6 +3154,150 @@ func (p *EdgeItem) String() string { return fmt.Sprintf("EdgeItem({EdgeType:%s EdgeName:%s Version:%s Schema:%s})", edgeTypeVal, edgeNameVal, versionVal, schemaVal) } +// Attributes: +// - S2MaxLevel +// - S2MaxCells +type IndexParams struct { + S2MaxLevel *int32 `thrift:"s2_max_level,1" db:"s2_max_level" json:"s2_max_level,omitempty"` + S2MaxCells *int32 `thrift:"s2_max_cells,2" db:"s2_max_cells" json:"s2_max_cells,omitempty"` +} + +func NewIndexParams() *IndexParams { + return &IndexParams{} +} + +var IndexParams_S2MaxLevel_DEFAULT int32 +func (p *IndexParams) GetS2MaxLevel() int32 { + if !p.IsSetS2MaxLevel() { + return IndexParams_S2MaxLevel_DEFAULT + } +return *p.S2MaxLevel +} +var IndexParams_S2MaxCells_DEFAULT int32 +func (p *IndexParams) GetS2MaxCells() int32 { + if !p.IsSetS2MaxCells() { + return IndexParams_S2MaxCells_DEFAULT + } +return *p.S2MaxCells +} +func (p *IndexParams) IsSetS2MaxLevel() bool { + return p != nil && p.S2MaxLevel != nil +} + +func (p *IndexParams) IsSetS2MaxCells() bool { + return p != nil && p.S2MaxCells != nil +} + +func (p *IndexParams) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexParams) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.S2MaxLevel = &v +} + return nil +} + +func (p *IndexParams) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.S2MaxCells = &v +} + return nil +} + +func (p *IndexParams) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexParams"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return 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 *IndexParams) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetS2MaxLevel() { + if err := oprot.WriteFieldBegin("s2_max_level", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:s2_max_level: ", p), err) } + if err := oprot.WriteI32(int32(*p.S2MaxLevel)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.s2_max_level (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:s2_max_level: ", p), err) } + } + return err +} + +func (p *IndexParams) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetS2MaxCells() { + if err := oprot.WriteFieldBegin("s2_max_cells", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:s2_max_cells: ", p), err) } + if err := oprot.WriteI32(int32(*p.S2MaxCells)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.s2_max_cells (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:s2_max_cells: ", p), err) } + } + return err +} + +func (p *IndexParams) String() string { + if p == nil { + return "" + } + + var s2MaxLevelVal string + if p.S2MaxLevel == nil { + s2MaxLevelVal = "" + } else { + s2MaxLevelVal = fmt.Sprintf("%v", *p.S2MaxLevel) + } + var s2MaxCellsVal string + if p.S2MaxCells == nil { + s2MaxCellsVal = "" + } else { + s2MaxCellsVal = fmt.Sprintf("%v", *p.S2MaxCells) + } + return fmt.Sprintf("IndexParams({S2MaxLevel:%s S2MaxCells:%s})", s2MaxLevelVal, s2MaxCellsVal) +} + // Attributes: // - IndexID // - IndexName @@ -3147,6 +3305,7 @@ func (p *EdgeItem) String() string { // - SchemaName // - Fields // - Comment +// - IndexParams type IndexItem struct { IndexID nebula0.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` @@ -3154,6 +3313,7 @@ type IndexItem struct { SchemaName []byte `thrift:"schema_name,4" db:"schema_name" json:"schema_name"` Fields []*ColumnDef `thrift:"fields,5" db:"fields" json:"fields"` Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` + IndexParams *IndexParams `thrift:"index_params,7" db:"index_params" json:"index_params,omitempty"` } func NewIndexItem() *IndexItem { @@ -3188,6 +3348,13 @@ var IndexItem_Comment_DEFAULT []byte func (p *IndexItem) GetComment() []byte { return p.Comment } +var IndexItem_IndexParams_DEFAULT *IndexParams +func (p *IndexItem) GetIndexParams() *IndexParams { + if !p.IsSetIndexParams() { + return IndexItem_IndexParams_DEFAULT + } +return p.IndexParams +} func (p *IndexItem) IsSetSchemaID() bool { return p != nil && p.SchemaID != nil } @@ -3196,6 +3363,10 @@ func (p *IndexItem) IsSetComment() bool { return p != nil && p.Comment != nil } +func (p *IndexItem) IsSetIndexParams() bool { + return p != nil && p.IndexParams != nil +} + func (p *IndexItem) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -3233,6 +3404,10 @@ func (p *IndexItem) Read(iprot thrift.Protocol) error { if err := p.ReadField6(iprot); err != nil { return err } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -3292,11 +3467,11 @@ func (p *IndexItem) ReadField5(iprot thrift.Protocol) error { tSlice := make([]*ColumnDef, 0, size) p.Fields = tSlice for i := 0; i < size; i ++ { - _elem2 := NewColumnDef() - if err := _elem2.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + _elem3 := NewColumnDef() + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) } - p.Fields = append(p.Fields, _elem2) + p.Fields = append(p.Fields, _elem3) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -3313,6 +3488,14 @@ func (p *IndexItem) ReadField6(iprot thrift.Protocol) error { return nil } +func (p *IndexItem) ReadField7(iprot thrift.Protocol) error { + p.IndexParams = NewIndexParams() + if err := p.IndexParams.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.IndexParams), err) + } + return nil +} + func (p *IndexItem) Write(oprot thrift.Protocol) error { if err := oprot.WriteStructBegin("IndexItem"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -3322,6 +3505,7 @@ func (p *IndexItem) Write(oprot thrift.Protocol) error { if err := p.writeField4(oprot); err != nil { return err } if err := p.writeField5(oprot); err != nil { return err } if err := p.writeField6(oprot); err != nil { return err } + if err := 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 { @@ -3401,6 +3585,19 @@ func (p *IndexItem) writeField6(oprot thrift.Protocol) (err error) { return err } +func (p *IndexItem) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetIndexParams() { + if err := oprot.WriteFieldBegin("index_params", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:index_params: ", p), err) } + if err := p.IndexParams.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IndexParams), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:index_params: ", p), err) } + } + return err +} + func (p *IndexItem) String() string { if p == nil { return "" @@ -3417,7 +3614,13 @@ func (p *IndexItem) String() string { schemaNameVal := fmt.Sprintf("%v", p.SchemaName) fieldsVal := fmt.Sprintf("%v", p.Fields) commentVal := fmt.Sprintf("%v", p.Comment) - return fmt.Sprintf("IndexItem({IndexID:%s IndexName:%s SchemaID:%s SchemaName:%s Fields:%s Comment:%s})", indexIDVal, indexNameVal, schemaIDVal, schemaNameVal, fieldsVal, commentVal) + var indexParamsVal string + if p.IndexParams == nil { + indexParamsVal = "" + } else { + indexParamsVal = fmt.Sprintf("%v", p.IndexParams) + } + return fmt.Sprintf("IndexItem({IndexID:%s IndexName:%s SchemaID:%s SchemaName:%s Fields:%s Comment:%s IndexParams:%s})", indexIDVal, indexNameVal, schemaIDVal, schemaNameVal, fieldsVal, commentVal, indexParamsVal) } // Attributes: @@ -3581,32 +3784,32 @@ func (p *HostItem) ReadField3(iprot thrift.Protocol) error { tMap := make(map[string][]nebula0.PartitionID, size) p.LeaderParts = tMap for i := 0; i < size; i ++ { -var _key3 string +var _key4 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key3 = v + _key4 = v } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]nebula0.PartitionID, 0, size) - _val4 := tSlice + _val5 := tSlice for i := 0; i < size; i ++ { -var _elem5 nebula0.PartitionID +var _elem6 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem5 = temp + _elem6 = temp } - _val4 = append(_val4, _elem5) + _val5 = append(_val5, _elem6) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.LeaderParts[_key3] = _val4 + p.LeaderParts[_key4] = _val5 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -3622,32 +3825,32 @@ func (p *HostItem) ReadField4(iprot thrift.Protocol) error { tMap := make(map[string][]nebula0.PartitionID, size) p.AllParts = tMap for i := 0; i < size; i ++ { -var _key6 string +var _key7 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key6 = v + _key7 = v } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]nebula0.PartitionID, 0, size) - _val7 := tSlice + _val8 := tSlice for i := 0; i < size; i ++ { -var _elem8 nebula0.PartitionID +var _elem9 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem8 = temp + _elem9 = temp } - _val7 = append(_val7, _elem8) + _val8 = append(_val8, _elem9) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.AllParts[_key6] = _val7 + p.AllParts[_key7] = _val8 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -4509,13 +4712,13 @@ func (p *AdminJobReq) ReadField3(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Paras = tSlice for i := 0; i < size; i ++ { -var _elem9 []byte +var _elem10 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem9 = v + _elem10 = v } - p.Paras = append(p.Paras, _elem9) + p.Paras = append(p.Paras, _elem10) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -4708,13 +4911,13 @@ func (p *JobDesc) ReadField3(iprot thrift.Protocol) error { tSlice := make([]string, 0, size) p.Paras = tSlice for i := 0; i < size; i ++ { -var _elem10 string +var _elem11 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem10 = v + _elem11 = v } - p.Paras = append(p.Paras, _elem10) + p.Paras = append(p.Paras, _elem11) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -5220,11 +5423,11 @@ func (p *AdminJobResult_) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*JobDesc, 0, size) p.JobDesc = tSlice for i := 0; i < size; i ++ { - _elem11 := NewJobDesc() - if err := _elem11.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + _elem12 := NewJobDesc() + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) } - p.JobDesc = append(p.JobDesc, _elem11) + p.JobDesc = append(p.JobDesc, _elem12) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -5240,11 +5443,11 @@ func (p *AdminJobResult_) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*TaskDesc, 0, size) p.TaskDesc = tSlice for i := 0; i < size; i ++ { - _elem12 := NewTaskDesc() - if err := _elem12.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + _elem13 := NewTaskDesc() + if err := _elem13.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) } - p.TaskDesc = append(p.TaskDesc, _elem12) + p.TaskDesc = append(p.TaskDesc, _elem13) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -5769,19 +5972,19 @@ func (p *StatsItem) ReadField1(iprot thrift.Protocol) error { tMap := make(map[string]int64, size) p.TagVertices = tMap for i := 0; i < size; i ++ { -var _key13 string +var _key14 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key13 = v + _key14 = v } -var _val14 int64 +var _val15 int64 if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val14 = v + _val15 = v } - p.TagVertices[_key13] = _val14 + p.TagVertices[_key14] = _val15 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -5797,19 +6000,19 @@ func (p *StatsItem) ReadField2(iprot thrift.Protocol) error { tMap := make(map[string]int64, size) p.Edges = tMap for i := 0; i < size; i ++ { -var _key15 string +var _key16 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key15 = v + _key16 = v } -var _val16 int64 +var _val17 int64 if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val16 = v + _val17 = v } - p.Edges[_key15] = _val16 + p.Edges[_key16] = _val17 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -5843,30 +6046,30 @@ func (p *StatsItem) ReadField5(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*Correlativity, size) p.PositivePartCorrelativity = tMap for i := 0; i < size; i ++ { -var _key17 nebula0.PartitionID +var _key18 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key17 = temp + _key18 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*Correlativity, 0, size) - _val18 := tSlice + _val19 := tSlice for i := 0; i < size; i ++ { - _elem19 := NewCorrelativity() - if err := _elem19.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + _elem20 := NewCorrelativity() + if err := _elem20.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem20), err) } - _val18 = append(_val18, _elem19) + _val19 = append(_val19, _elem20) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.PositivePartCorrelativity[_key17] = _val18 + p.PositivePartCorrelativity[_key18] = _val19 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -5882,30 +6085,30 @@ func (p *StatsItem) ReadField6(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*Correlativity, size) p.NegativePartCorrelativity = tMap for i := 0; i < size; i ++ { -var _key20 nebula0.PartitionID +var _key21 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key20 = temp + _key21 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*Correlativity, 0, size) - _val21 := tSlice + _val22 := tSlice for i := 0; i < size; i ++ { - _elem22 := NewCorrelativity() - if err := _elem22.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + _elem23 := NewCorrelativity() + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) } - _val21 = append(_val21, _elem22) + _val22 = append(_val22, _elem23) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.NegativePartCorrelativity[_key20] = _val21 + p.NegativePartCorrelativity[_key21] = _val22 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -6596,11 +6799,11 @@ func (p *ListSpacesResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*IdName, 0, size) p.Spaces = tSlice for i := 0; i < size; i ++ { - _elem23 := NewIdName() - if err := _elem23.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + _elem24 := NewIdName() + if err := _elem24.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) } - p.Spaces = append(p.Spaces, _elem23) + p.Spaces = append(p.Spaces, _elem24) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7242,11 +7445,11 @@ func (p *AlterTagReq) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*AlterSchemaItem, 0, size) p.TagItems = tSlice for i := 0; i < size; i ++ { - _elem24 := NewAlterSchemaItem() - if err := _elem24.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) + _elem25 := NewAlterSchemaItem() + if err := _elem25.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) } - p.TagItems = append(p.TagItems, _elem24) + p.TagItems = append(p.TagItems, _elem25) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7678,11 +7881,11 @@ func (p *ListTagsResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*TagItem, 0, size) p.Tags = tSlice for i := 0; i < size; i ++ { - _elem25 := NewTagItem() - if err := _elem25.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) + _elem26 := NewTagItem() + if err := _elem26.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) } - p.Tags = append(p.Tags, _elem25) + p.Tags = append(p.Tags, _elem26) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -8388,11 +8591,11 @@ func (p *AlterEdgeReq) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*AlterSchemaItem, 0, size) p.EdgeItems = tSlice for i := 0; i < size; i ++ { - _elem26 := NewAlterSchemaItem() - if err := _elem26.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) + _elem27 := NewAlterSchemaItem() + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) } - p.EdgeItems = append(p.EdgeItems, _elem26) + p.EdgeItems = append(p.EdgeItems, _elem27) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9148,11 +9351,11 @@ func (p *ListEdgesResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*EdgeItem, 0, size) p.Edges = tSlice for i := 0; i < size; i ++ { - _elem27 := NewEdgeItem() - if err := _elem27.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) + _elem28 := NewEdgeItem() + if err := _elem28.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) } - p.Edges = append(p.Edges, _elem27) + p.Edges = append(p.Edges, _elem28) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9183,24 +9386,241 @@ func (p *ListEdgesResp) writeField1(oprot thrift.Protocol) (err error) { return err } -func (p *ListEdgesResp) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) } - if err := p.Leader.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } - return err +func (p *ListEdgesResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) } + if err := p.Leader.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListEdgesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edges", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edges: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Edges)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Edges { + 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:edges: ", p), err) } + return err +} + +func (p *ListEdgesResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + edgesVal := fmt.Sprintf("%v", p.Edges) + return fmt.Sprintf("ListEdgesResp({Code:%s Leader:%s Edges:%s})", codeVal, leaderVal, edgesVal) +} + +// Attributes: +// - Hosts +type AddHostsReq struct { + Hosts []*nebula0.HostAddr `thrift:"hosts,1" db:"hosts" json:"hosts"` +} + +func NewAddHostsReq() *AddHostsReq { + return &AddHostsReq{} +} + + +func (p *AddHostsReq) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +func (p *AddHostsReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + 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 *AddHostsReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem29 := nebula0.NewHostAddr() + if err := _elem29.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) + } + p.Hosts = append(p.Hosts, _elem29) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddHostsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddHostsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddHostsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Hosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Hosts { + 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:hosts: ", p), err) } + return err +} + +func (p *AddHostsReq) String() string { + if p == nil { + return "" + } + + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("AddHostsReq({Hosts:%s})", hostsVal) +} + +// Attributes: +// - Hosts +type DropHostsReq struct { + Hosts []*nebula0.HostAddr `thrift:"hosts,1" db:"hosts" json:"hosts"` +} + +func NewDropHostsReq() *DropHostsReq { + return &DropHostsReq{} +} + + +func (p *DropHostsReq) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +func (p *DropHostsReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + 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 *DropHostsReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem30 := nebula0.NewHostAddr() + if err := _elem30.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) + } + p.Hosts = append(p.Hosts, _elem30) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DropHostsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropHostsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } -func (p *ListEdgesResp) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("edges", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edges: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Edges)); err != nil { +func (p *DropHostsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Hosts)); err != nil { return thrift.PrependError("error writing list begin: ", err) } - for _, v := range p.Edges { + for _, v := range p.Hosts { if err := v.Write(oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) } @@ -9209,24 +9629,17 @@ func (p *ListEdgesResp) writeField3(oprot thrift.Protocol) (err error) { 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:edges: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) } return err } -func (p *ListEdgesResp) String() string { +func (p *DropHostsReq) String() string { if p == nil { return "" } - codeVal := fmt.Sprintf("%v", p.Code) - var leaderVal string - if p.Leader == nil { - leaderVal = "" - } else { - leaderVal = fmt.Sprintf("%v", p.Leader) - } - edgesVal := fmt.Sprintf("%v", p.Edges) - return fmt.Sprintf("ListEdgesResp({Code:%s Leader:%s Edges:%s})", codeVal, leaderVal, edgesVal) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("DropHostsReq({Hosts:%s})", hostsVal) } // Attributes: @@ -9416,11 +9829,11 @@ func (p *ListHostsResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*HostItem, 0, size) p.Hosts = tSlice for i := 0; i < size; i ++ { - _elem28 := NewHostItem() - if err := _elem28.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) + _elem31 := NewHostItem() + if err := _elem31.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err) } - p.Hosts = append(p.Hosts, _elem28) + p.Hosts = append(p.Hosts, _elem31) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9621,11 +10034,11 @@ func (p *PartItem) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Peers = tSlice for i := 0; i < size; i ++ { - _elem29 := nebula0.NewHostAddr() - if err := _elem29.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) + _elem32 := nebula0.NewHostAddr() + if err := _elem32.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) } - p.Peers = append(p.Peers, _elem29) + p.Peers = append(p.Peers, _elem32) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9641,11 +10054,11 @@ func (p *PartItem) ReadField4(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Losts = tSlice for i := 0; i < size; i ++ { - _elem30 := nebula0.NewHostAddr() - if err := _elem30.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) + _elem33 := nebula0.NewHostAddr() + if err := _elem33.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem33), err) } - p.Losts = append(p.Losts, _elem30) + p.Losts = append(p.Losts, _elem33) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9819,14 +10232,14 @@ func (p *ListPartsReq) ReadField2(iprot thrift.Protocol) error { tSlice := make([]nebula0.PartitionID, 0, size) p.PartIds = tSlice for i := 0; i < size; i ++ { -var _elem31 nebula0.PartitionID +var _elem34 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem31 = temp + _elem34 = temp } - p.PartIds = append(p.PartIds, _elem31) + p.PartIds = append(p.PartIds, _elem34) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9985,11 +10398,11 @@ func (p *ListPartsResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*PartItem, 0, size) p.Parts = tSlice for i := 0; i < size; i ++ { - _elem32 := NewPartItem() - if err := _elem32.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) + _elem35 := NewPartItem() + if err := _elem35.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) } - p.Parts = append(p.Parts, _elem32) + p.Parts = append(p.Parts, _elem35) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10268,30 +10681,30 @@ func (p *GetPartsAllocResp) ReadField3(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*nebula0.HostAddr, size) p.Parts = tMap for i := 0; i < size; i ++ { -var _key33 nebula0.PartitionID +var _key36 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key33 = temp + _key36 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*nebula0.HostAddr, 0, size) - _val34 := tSlice + _val37 := tSlice for i := 0; i < size; i ++ { - _elem35 := nebula0.NewHostAddr() - if err := _elem35.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) + _elem38 := nebula0.NewHostAddr() + if err := _elem38.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem38), err) } - _val34 = append(_val34, _elem35) + _val37 = append(_val37, _elem38) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key33] = _val34 + p.Parts[_key36] = _val37 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -10307,20 +10720,20 @@ func (p *GetPartsAllocResp) ReadField4(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID]int64, size) p.Terms = tMap for i := 0; i < size; i ++ { -var _key36 nebula0.PartitionID +var _key39 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key36 = temp + _key39 = temp } -var _val37 int64 +var _val40 int64 if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val37 = v + _val40 = v } - p.Terms[_key36] = _val37 + p.Terms[_key39] = _val40 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -10504,11 +10917,11 @@ func (p *MultiPutReq) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*nebula0.KeyValue, 0, size) p.Pairs = tSlice for i := 0; i < size; i ++ { - _elem38 := nebula0.NewKeyValue() - if err := _elem38.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem38), err) + _elem41 := nebula0.NewKeyValue() + if err := _elem41.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err) } - p.Pairs = append(p.Pairs, _elem38) + p.Pairs = append(p.Pairs, _elem41) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10918,13 +11331,13 @@ func (p *MultiGetReq) ReadField2(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Keys = tSlice for i := 0; i < size; i ++ { -var _elem39 []byte +var _elem42 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem39 = v + _elem42 = v } - p.Keys = append(p.Keys, _elem39) + p.Keys = append(p.Keys, _elem42) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -11083,13 +11496,13 @@ func (p *MultiGetResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Values = tSlice for i := 0; i < size; i ++ { -var _elem40 []byte +var _elem43 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem40 = v + _elem43 = v } - p.Values = append(p.Values, _elem40) + p.Values = append(p.Values, _elem43) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -11676,13 +12089,13 @@ func (p *ScanResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Values = tSlice for i := 0; i < size; i ++ { -var _elem41 []byte +var _elem44 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem41 = v + _elem44 = v } - p.Values = append(p.Values, _elem41) + p.Values = append(p.Values, _elem44) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -12154,14 +12567,14 @@ func (p *PartitionList) ReadField1(iprot thrift.Protocol) error { tSlice := make([]nebula0.PartitionID, 0, size) p.PartList = tSlice for i := 0; i < size; i ++ { -var _elem42 nebula0.PartitionID +var _elem45 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem42 = temp + _elem45 = temp } - p.PartList = append(p.PartList, _elem42) + p.PartList = append(p.PartList, _elem45) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -12358,30 +12771,30 @@ func (p *HBReq) ReadField4(iprot thrift.Protocol) error { tMap := make(map[nebula0.GraphSpaceID][]*LeaderInfo, size) p.LeaderPartIds = tMap for i := 0; i < size; i ++ { -var _key43 nebula0.GraphSpaceID +var _key46 nebula0.GraphSpaceID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.GraphSpaceID(v) - _key43 = temp + _key46 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*LeaderInfo, 0, size) - _val44 := tSlice + _val47 := tSlice for i := 0; i < size; i ++ { - _elem45 := NewLeaderInfo() - if err := _elem45.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) + _elem48 := NewLeaderInfo() + if err := _elem48.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem48), err) } - _val44 = append(_val44, _elem45) + _val47 = append(_val47, _elem48) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.LeaderPartIds[_key43] = _val44 + p.LeaderPartIds[_key46] = _val47 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -12406,36 +12819,36 @@ func (p *HBReq) ReadField6(iprot thrift.Protocol) error { tMap := make(map[nebula0.GraphSpaceID]map[string]*PartitionList, size) p.DiskParts = tMap for i := 0; i < size; i ++ { -var _key46 nebula0.GraphSpaceID +var _key49 nebula0.GraphSpaceID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.GraphSpaceID(v) - _key46 = temp + _key49 = temp } _, _, size, err := iprot.ReadMapBegin() if err != nil { return thrift.PrependError("error reading map begin: ", err) } tMap := make(map[string]*PartitionList, size) - _val47 := tMap + _val50 := tMap for i := 0; i < size; i ++ { -var _key48 string +var _key51 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key48 = v + _key51 = v } - _val49 := NewPartitionList() - if err := _val49.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val49), err) + _val52 := NewPartitionList() + if err := _val52.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val52), err) } - _val47[_key48] = _val49 + _val50[_key51] = _val52 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) } - p.DiskParts[_key46] = _val47 + p.DiskParts[_key49] = _val50 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -12725,6 +13138,7 @@ func (p *IndexFieldDef) String() string { // - Fields // - IfNotExists // - Comment +// - IndexParams type CreateTagIndexReq struct { SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` @@ -12732,6 +13146,7 @@ type CreateTagIndexReq struct { Fields []*IndexFieldDef `thrift:"fields,4" db:"fields" json:"fields"` IfNotExists bool `thrift:"if_not_exists,5" db:"if_not_exists" json:"if_not_exists"` Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` + IndexParams *IndexParams `thrift:"index_params,7" db:"index_params" json:"index_params,omitempty"` } func NewCreateTagIndexReq() *CreateTagIndexReq { @@ -12763,10 +13178,21 @@ var CreateTagIndexReq_Comment_DEFAULT []byte func (p *CreateTagIndexReq) GetComment() []byte { return p.Comment } +var CreateTagIndexReq_IndexParams_DEFAULT *IndexParams +func (p *CreateTagIndexReq) GetIndexParams() *IndexParams { + if !p.IsSetIndexParams() { + return CreateTagIndexReq_IndexParams_DEFAULT + } +return p.IndexParams +} func (p *CreateTagIndexReq) IsSetComment() bool { return p != nil && p.Comment != nil } +func (p *CreateTagIndexReq) IsSetIndexParams() bool { + return p != nil && p.IndexParams != nil +} + func (p *CreateTagIndexReq) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -12804,6 +13230,10 @@ func (p *CreateTagIndexReq) Read(iprot thrift.Protocol) error { if err := p.ReadField6(iprot); err != nil { return err } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -12855,11 +13285,11 @@ func (p *CreateTagIndexReq) ReadField4(iprot thrift.Protocol) error { tSlice := make([]*IndexFieldDef, 0, size) p.Fields = tSlice for i := 0; i < size; i ++ { - _elem50 := NewIndexFieldDef() - if err := _elem50.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem50), err) + _elem53 := NewIndexFieldDef() + if err := _elem53.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem53), err) } - p.Fields = append(p.Fields, _elem50) + p.Fields = append(p.Fields, _elem53) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -12885,6 +13315,14 @@ func (p *CreateTagIndexReq) ReadField6(iprot thrift.Protocol) error { return nil } +func (p *CreateTagIndexReq) ReadField7(iprot thrift.Protocol) error { + p.IndexParams = NewIndexParams() + if err := p.IndexParams.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.IndexParams), err) + } + return nil +} + func (p *CreateTagIndexReq) Write(oprot thrift.Protocol) error { if err := oprot.WriteStructBegin("CreateTagIndexReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -12894,6 +13332,7 @@ func (p *CreateTagIndexReq) Write(oprot thrift.Protocol) error { if err := p.writeField4(oprot); err != nil { return err } if err := p.writeField5(oprot); err != nil { return err } if err := p.writeField6(oprot); err != nil { return err } + if err := 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 { @@ -12972,6 +13411,19 @@ func (p *CreateTagIndexReq) writeField6(oprot thrift.Protocol) (err error) { return err } +func (p *CreateTagIndexReq) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetIndexParams() { + if err := oprot.WriteFieldBegin("index_params", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:index_params: ", p), err) } + if err := p.IndexParams.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IndexParams), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:index_params: ", p), err) } + } + return err +} + func (p *CreateTagIndexReq) String() string { if p == nil { return "" @@ -12983,7 +13435,13 @@ func (p *CreateTagIndexReq) String() string { fieldsVal := fmt.Sprintf("%v", p.Fields) ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) commentVal := fmt.Sprintf("%v", p.Comment) - return fmt.Sprintf("CreateTagIndexReq({SpaceID:%s IndexName:%s TagName:%s Fields:%s IfNotExists:%s Comment:%s})", spaceIDVal, indexNameVal, tagNameVal, fieldsVal, ifNotExistsVal, commentVal) + var indexParamsVal string + if p.IndexParams == nil { + indexParamsVal = "" + } else { + indexParamsVal = fmt.Sprintf("%v", p.IndexParams) + } + return fmt.Sprintf("CreateTagIndexReq({SpaceID:%s IndexName:%s TagName:%s Fields:%s IfNotExists:%s Comment:%s IndexParams:%s})", spaceIDVal, indexNameVal, tagNameVal, fieldsVal, ifNotExistsVal, commentVal, indexParamsVal) } // Attributes: @@ -13613,11 +14071,11 @@ func (p *ListTagIndexesResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*IndexItem, 0, size) p.Items = tSlice for i := 0; i < size; i ++ { - _elem51 := NewIndexItem() - if err := _elem51.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) + _elem54 := NewIndexItem() + if err := _elem54.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) } - p.Items = append(p.Items, _elem51) + p.Items = append(p.Items, _elem54) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -13701,6 +14159,7 @@ func (p *ListTagIndexesResp) String() string { // - Fields // - IfNotExists // - Comment +// - IndexParams type CreateEdgeIndexReq struct { SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` @@ -13708,6 +14167,7 @@ type CreateEdgeIndexReq struct { Fields []*IndexFieldDef `thrift:"fields,4" db:"fields" json:"fields"` IfNotExists bool `thrift:"if_not_exists,5" db:"if_not_exists" json:"if_not_exists"` Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` + IndexParams *IndexParams `thrift:"index_params,7" db:"index_params" json:"index_params,omitempty"` } func NewCreateEdgeIndexReq() *CreateEdgeIndexReq { @@ -13739,10 +14199,21 @@ var CreateEdgeIndexReq_Comment_DEFAULT []byte func (p *CreateEdgeIndexReq) GetComment() []byte { return p.Comment } +var CreateEdgeIndexReq_IndexParams_DEFAULT *IndexParams +func (p *CreateEdgeIndexReq) GetIndexParams() *IndexParams { + if !p.IsSetIndexParams() { + return CreateEdgeIndexReq_IndexParams_DEFAULT + } +return p.IndexParams +} func (p *CreateEdgeIndexReq) IsSetComment() bool { return p != nil && p.Comment != nil } +func (p *CreateEdgeIndexReq) IsSetIndexParams() bool { + return p != nil && p.IndexParams != nil +} + func (p *CreateEdgeIndexReq) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -13780,6 +14251,10 @@ func (p *CreateEdgeIndexReq) Read(iprot thrift.Protocol) error { if err := p.ReadField6(iprot); err != nil { return err } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -13831,11 +14306,11 @@ func (p *CreateEdgeIndexReq) ReadField4(iprot thrift.Protocol) error { tSlice := make([]*IndexFieldDef, 0, size) p.Fields = tSlice for i := 0; i < size; i ++ { - _elem52 := NewIndexFieldDef() - if err := _elem52.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + _elem55 := NewIndexFieldDef() + if err := _elem55.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem55), err) } - p.Fields = append(p.Fields, _elem52) + p.Fields = append(p.Fields, _elem55) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -13861,6 +14336,14 @@ func (p *CreateEdgeIndexReq) ReadField6(iprot thrift.Protocol) error { return nil } +func (p *CreateEdgeIndexReq) ReadField7(iprot thrift.Protocol) error { + p.IndexParams = NewIndexParams() + if err := p.IndexParams.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.IndexParams), err) + } + return nil +} + func (p *CreateEdgeIndexReq) Write(oprot thrift.Protocol) error { if err := oprot.WriteStructBegin("CreateEdgeIndexReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -13870,6 +14353,7 @@ func (p *CreateEdgeIndexReq) Write(oprot thrift.Protocol) error { if err := p.writeField4(oprot); err != nil { return err } if err := p.writeField5(oprot); err != nil { return err } if err := p.writeField6(oprot); err != nil { return err } + if err := 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 { @@ -13948,6 +14432,19 @@ func (p *CreateEdgeIndexReq) writeField6(oprot thrift.Protocol) (err error) { return err } +func (p *CreateEdgeIndexReq) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetIndexParams() { + if err := oprot.WriteFieldBegin("index_params", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:index_params: ", p), err) } + if err := p.IndexParams.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IndexParams), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:index_params: ", p), err) } + } + return err +} + func (p *CreateEdgeIndexReq) String() string { if p == nil { return "" @@ -13959,7 +14456,13 @@ func (p *CreateEdgeIndexReq) String() string { fieldsVal := fmt.Sprintf("%v", p.Fields) ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) commentVal := fmt.Sprintf("%v", p.Comment) - return fmt.Sprintf("CreateEdgeIndexReq({SpaceID:%s IndexName:%s EdgeName:%s Fields:%s IfNotExists:%s Comment:%s})", spaceIDVal, indexNameVal, edgeNameVal, fieldsVal, ifNotExistsVal, commentVal) + var indexParamsVal string + if p.IndexParams == nil { + indexParamsVal = "" + } else { + indexParamsVal = fmt.Sprintf("%v", p.IndexParams) + } + return fmt.Sprintf("CreateEdgeIndexReq({SpaceID:%s IndexName:%s EdgeName:%s Fields:%s IfNotExists:%s Comment:%s IndexParams:%s})", spaceIDVal, indexNameVal, edgeNameVal, fieldsVal, ifNotExistsVal, commentVal, indexParamsVal) } // Attributes: @@ -14589,11 +15092,11 @@ func (p *ListEdgeIndexesResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*IndexItem, 0, size) p.Items = tSlice for i := 0; i < size; i ++ { - _elem53 := NewIndexItem() - if err := _elem53.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem53), err) + _elem56 := NewIndexItem() + if err := _elem56.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) } - p.Items = append(p.Items, _elem53) + p.Items = append(p.Items, _elem56) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -15515,19 +16018,19 @@ func (p *ListUsersResp) ReadField3(iprot thrift.Protocol) error { tMap := make(map[string][]byte, size) p.Users = tMap for i := 0; i < size; i ++ { -var _key54 string +var _key57 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key54 = v + _key57 = v } -var _val55 []byte +var _val58 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val55 = v + _val58 = v } - p.Users[_key54] = _val55 + p.Users[_key57] = _val58 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -15792,11 +16295,11 @@ func (p *ListRolesResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*RoleItem, 0, size) p.Roles = tSlice for i := 0; i < size; i ++ { - _elem56 := NewRoleItem() - if err := _elem56.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + _elem59 := NewRoleItem() + if err := _elem59.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) } - p.Roles = append(p.Roles, _elem56) + p.Roles = append(p.Roles, _elem59) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -16561,11 +17064,11 @@ func (p *RegConfigReq) ReadField1(iprot thrift.Protocol) error { tSlice := make([]*ConfigItem, 0, size) p.Items = tSlice for i := 0; i < size; i ++ { - _elem57 := NewConfigItem() - if err := _elem57.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem57), err) + _elem60 := NewConfigItem() + if err := _elem60.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem60), err) } - p.Items = append(p.Items, _elem57) + p.Items = append(p.Items, _elem60) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -16812,11 +17315,11 @@ func (p *GetConfigResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*ConfigItem, 0, size) p.Items = tSlice for i := 0; i < size; i ++ { - _elem58 := NewConfigItem() - if err := _elem58.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem58), err) + _elem61 := NewConfigItem() + if err := _elem61.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem61), err) } - p.Items = append(p.Items, _elem58) + p.Items = append(p.Items, _elem61) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -17210,11 +17713,11 @@ func (p *ListConfigsResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*ConfigItem, 0, size) p.Items = tSlice for i := 0; i < size; i ++ { - _elem59 := NewConfigItem() - if err := _elem59.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) + _elem62 := NewConfigItem() + if err := _elem62.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) } - p.Items = append(p.Items, _elem59) + p.Items = append(p.Items, _elem62) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -17725,11 +18228,11 @@ func (p *ListSnapshotsResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*Snapshot, 0, size) p.Snapshots = tSlice for i := 0; i < size; i ++ { - _elem60 := NewSnapshot() - if err := _elem60.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem60), err) + _elem63 := NewSnapshot() + if err := _elem63.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem63), err) } - p.Snapshots = append(p.Snapshots, _elem60) + p.Snapshots = append(p.Snapshots, _elem63) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -18109,11 +18612,158 @@ func (p *ListIndexStatusResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*IndexStatus, 0, size) p.Statuses = tSlice for i := 0; i < size; i ++ { - _elem61 := NewIndexStatus() - if err := _elem61.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem61), err) + _elem64 := NewIndexStatus() + if err := _elem64.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) + } + p.Statuses = append(p.Statuses, _elem64) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListIndexStatusResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListIndexStatusResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return 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 *ListIndexStatusResp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) } + if err := p.Leader.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("statuses", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statuses: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Statuses)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Statuses { + 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:statuses: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + statusesVal := fmt.Sprintf("%v", p.Statuses) + return fmt.Sprintf("ListIndexStatusResp({Code:%s Leader:%s Statuses:%s})", codeVal, leaderVal, statusesVal) +} + +// Attributes: +// - Zones +// - ZoneName +type MergeZoneReq struct { + Zones [][]byte `thrift:"zones,1" db:"zones" json:"zones"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewMergeZoneReq() *MergeZoneReq { + return &MergeZoneReq{} +} + + +func (p *MergeZoneReq) GetZones() [][]byte { + return p.Zones +} + +func (p *MergeZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *MergeZoneReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err } - p.Statuses = append(p.Statuses, _elem61) + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MergeZoneReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Zones = tSlice + for i := 0; i < size; i ++ { +var _elem65 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem65 = v +} + p.Zones = append(p.Zones, _elem65) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -18121,12 +18771,20 @@ func (p *ListIndexStatusResp) ReadField3(iprot thrift.Protocol) error { return nil } -func (p *ListIndexStatusResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ListIndexStatusResp"); err != nil { +func (p *MergeZoneReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *MergeZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MergeZoneReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField1(oprot); err != nil { return err } if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } if err := oprot.WriteStructEnd(); err != nil { @@ -18134,83 +18792,59 @@ func (p *ListIndexStatusResp) Write(oprot thrift.Protocol) error { return nil } -func (p *ListIndexStatusResp) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } - if err := oprot.WriteI32(int32(p.Code)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } - return err -} - -func (p *ListIndexStatusResp) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) } - if err := p.Leader.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } - return err -} - -func (p *ListIndexStatusResp) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("statuses", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statuses: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Statuses)); err != nil { +func (p *MergeZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zones", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zones: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Zones)); err != nil { return thrift.PrependError("error writing list begin: ", err) } - for _, v := range p.Statuses { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } + for _, v := range p.Zones { + if err := oprot.WriteBinary(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:statuses: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zones: ", p), err) } return err } -func (p *ListIndexStatusResp) String() string { +func (p *MergeZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) } + return err +} + +func (p *MergeZoneReq) String() string { if p == nil { return "" } - codeVal := fmt.Sprintf("%v", p.Code) - var leaderVal string - if p.Leader == nil { - leaderVal = "" - } else { - leaderVal = fmt.Sprintf("%v", p.Leader) - } - statusesVal := fmt.Sprintf("%v", p.Statuses) - return fmt.Sprintf("ListIndexStatusResp({Code:%s Leader:%s Statuses:%s})", codeVal, leaderVal, statusesVal) + zonesVal := fmt.Sprintf("%v", p.Zones) + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("MergeZoneReq({Zones:%s ZoneName:%s})", zonesVal, zoneNameVal) } // Attributes: // - ZoneName -// - Nodes -type AddZoneReq struct { +type DropZoneReq struct { ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` - Nodes []*nebula0.HostAddr `thrift:"nodes,2" db:"nodes" json:"nodes"` } -func NewAddZoneReq() *AddZoneReq { - return &AddZoneReq{} +func NewDropZoneReq() *DropZoneReq { + return &DropZoneReq{} } -func (p *AddZoneReq) GetZoneName() []byte { +func (p *DropZoneReq) GetZoneName() []byte { return p.ZoneName } - -func (p *AddZoneReq) GetNodes() []*nebula0.HostAddr { - return p.Nodes -} -func (p *AddZoneReq) Read(iprot thrift.Protocol) error { +func (p *DropZoneReq) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -18227,10 +18861,6 @@ func (p *AddZoneReq) Read(iprot thrift.Protocol) error { if err := p.ReadField1(iprot); err != nil { return err } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -18246,7 +18876,7 @@ func (p *AddZoneReq) Read(iprot thrift.Protocol) error { return nil } -func (p *AddZoneReq) ReadField1(iprot thrift.Protocol) error { +func (p *DropZoneReq) ReadField1(iprot thrift.Protocol) error { if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { @@ -18255,31 +18885,10 @@ func (p *AddZoneReq) ReadField1(iprot thrift.Protocol) error { return nil } -func (p *AddZoneReq) ReadField2(iprot thrift.Protocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.HostAddr, 0, size) - p.Nodes = tSlice - for i := 0; i < size; i ++ { - _elem62 := nebula0.NewHostAddr() - if err := _elem62.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) - } - p.Nodes = append(p.Nodes, _elem62) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *AddZoneReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("AddZoneReq"); err != nil { +func (p *DropZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropZoneReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } if err := oprot.WriteStructEnd(); err != nil { @@ -18287,7 +18896,7 @@ func (p *AddZoneReq) Write(oprot thrift.Protocol) error { return nil } -func (p *AddZoneReq) writeField1(oprot thrift.Protocol) (err error) { +func (p *DropZoneReq) writeField1(oprot thrift.Protocol) (err error) { if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } if err := oprot.WriteBinary(p.ZoneName); err != nil { @@ -18297,50 +18906,30 @@ func (p *AddZoneReq) writeField1(oprot thrift.Protocol) (err error) { return err } -func (p *AddZoneReq) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("nodes", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nodes: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Nodes)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Nodes { - 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:nodes: ", p), err) } - return err -} - -func (p *AddZoneReq) String() string { +func (p *DropZoneReq) String() string { if p == nil { return "" } zoneNameVal := fmt.Sprintf("%v", p.ZoneName) - nodesVal := fmt.Sprintf("%v", p.Nodes) - return fmt.Sprintf("AddZoneReq({ZoneName:%s Nodes:%s})", zoneNameVal, nodesVal) + return fmt.Sprintf("DropZoneReq({ZoneName:%s})", zoneNameVal) } // Attributes: // - ZoneName -type DropZoneReq struct { +type SplitZoneReq struct { ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` } -func NewDropZoneReq() *DropZoneReq { - return &DropZoneReq{} +func NewSplitZoneReq() *SplitZoneReq { + return &SplitZoneReq{} } -func (p *DropZoneReq) GetZoneName() []byte { +func (p *SplitZoneReq) GetZoneName() []byte { return p.ZoneName } -func (p *DropZoneReq) Read(iprot thrift.Protocol) error { +func (p *SplitZoneReq) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -18372,7 +18961,7 @@ func (p *DropZoneReq) Read(iprot thrift.Protocol) error { return nil } -func (p *DropZoneReq) ReadField1(iprot thrift.Protocol) error { +func (p *SplitZoneReq) ReadField1(iprot thrift.Protocol) error { if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { @@ -18381,8 +18970,8 @@ func (p *DropZoneReq) ReadField1(iprot thrift.Protocol) error { return nil } -func (p *DropZoneReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("DropZoneReq"); err != nil { +func (p *SplitZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SplitZoneReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField1(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { @@ -18392,7 +18981,7 @@ func (p *DropZoneReq) Write(oprot thrift.Protocol) error { return nil } -func (p *DropZoneReq) writeField1(oprot thrift.Protocol) (err error) { +func (p *SplitZoneReq) writeField1(oprot thrift.Protocol) (err error) { if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } if err := oprot.WriteBinary(p.ZoneName); err != nil { @@ -18402,45 +18991,36 @@ func (p *DropZoneReq) writeField1(oprot thrift.Protocol) (err error) { return err } -func (p *DropZoneReq) String() string { +func (p *SplitZoneReq) String() string { if p == nil { return "" } zoneNameVal := fmt.Sprintf("%v", p.ZoneName) - return fmt.Sprintf("DropZoneReq({ZoneName:%s})", zoneNameVal) + return fmt.Sprintf("SplitZoneReq({ZoneName:%s})", zoneNameVal) } // Attributes: -// - Node +// - OriginalZoneName // - ZoneName -type AddHostIntoZoneReq struct { - Node *nebula0.HostAddr `thrift:"node,1" db:"node" json:"node"` +type RenameZoneReq struct { + OriginalZoneName []byte `thrift:"original_zone_name,1" db:"original_zone_name" json:"original_zone_name"` ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` } -func NewAddHostIntoZoneReq() *AddHostIntoZoneReq { - return &AddHostIntoZoneReq{ - Node: nebula0.NewHostAddr(), - } +func NewRenameZoneReq() *RenameZoneReq { + return &RenameZoneReq{} } -var AddHostIntoZoneReq_Node_DEFAULT *nebula0.HostAddr -func (p *AddHostIntoZoneReq) GetNode() *nebula0.HostAddr { - if !p.IsSetNode() { - return AddHostIntoZoneReq_Node_DEFAULT - } -return p.Node + +func (p *RenameZoneReq) GetOriginalZoneName() []byte { + return p.OriginalZoneName } -func (p *AddHostIntoZoneReq) GetZoneName() []byte { +func (p *RenameZoneReq) GetZoneName() []byte { return p.ZoneName } -func (p *AddHostIntoZoneReq) IsSetNode() bool { - return p != nil && p.Node != nil -} - -func (p *AddHostIntoZoneReq) Read(iprot thrift.Protocol) error { +func (p *RenameZoneReq) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -18476,15 +19056,16 @@ func (p *AddHostIntoZoneReq) Read(iprot thrift.Protocol) error { return nil } -func (p *AddHostIntoZoneReq) ReadField1(iprot thrift.Protocol) error { - p.Node = nebula0.NewHostAddr() - if err := p.Node.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) - } +func (p *RenameZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.OriginalZoneName = v +} return nil } -func (p *AddHostIntoZoneReq) ReadField2(iprot thrift.Protocol) error { +func (p *RenameZoneReq) ReadField2(iprot thrift.Protocol) error { if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { @@ -18493,8 +19074,8 @@ func (p *AddHostIntoZoneReq) ReadField2(iprot thrift.Protocol) error { return nil } -func (p *AddHostIntoZoneReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("AddHostIntoZoneReq"); err != nil { +func (p *RenameZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RenameZoneReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField1(oprot); err != nil { return err } if err := p.writeField2(oprot); err != nil { return err } @@ -18505,18 +19086,17 @@ func (p *AddHostIntoZoneReq) Write(oprot thrift.Protocol) error { return nil } -func (p *AddHostIntoZoneReq) writeField1(oprot thrift.Protocol) (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) - } +func (p *RenameZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("original_zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:original_zone_name: ", p), err) } + if err := oprot.WriteBinary(p.OriginalZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.original_zone_name (1) field write error: ", p), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:original_zone_name: ", p), err) } return err } -func (p *AddHostIntoZoneReq) writeField2(oprot thrift.Protocol) (err error) { +func (p *RenameZoneReq) writeField2(oprot thrift.Protocol) (err error) { if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) } if err := oprot.WriteBinary(p.ZoneName); err != nil { @@ -18526,51 +19106,43 @@ func (p *AddHostIntoZoneReq) writeField2(oprot thrift.Protocol) (err error) { return err } -func (p *AddHostIntoZoneReq) String() string { +func (p *RenameZoneReq) String() string { if p == nil { return "" } - var nodeVal string - if p.Node == nil { - nodeVal = "" - } else { - nodeVal = fmt.Sprintf("%v", p.Node) - } + originalZoneNameVal := fmt.Sprintf("%v", p.OriginalZoneName) zoneNameVal := fmt.Sprintf("%v", p.ZoneName) - return fmt.Sprintf("AddHostIntoZoneReq({Node:%s ZoneName:%s})", nodeVal, zoneNameVal) + return fmt.Sprintf("RenameZoneReq({OriginalZoneName:%s ZoneName:%s})", originalZoneNameVal, zoneNameVal) } // Attributes: -// - Node +// - Hosts // - ZoneName -type DropHostFromZoneReq struct { - Node *nebula0.HostAddr `thrift:"node,1" db:"node" json:"node"` +// - IsNew +type AddHostsIntoZoneReq struct { + Hosts []*nebula0.HostAddr `thrift:"hosts,1" db:"hosts" json:"hosts"` ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` + IsNew bool `thrift:"is_new,3" db:"is_new" json:"is_new"` } -func NewDropHostFromZoneReq() *DropHostFromZoneReq { - return &DropHostFromZoneReq{ - Node: nebula0.NewHostAddr(), - } +func NewAddHostsIntoZoneReq() *AddHostsIntoZoneReq { + return &AddHostsIntoZoneReq{} } -var DropHostFromZoneReq_Node_DEFAULT *nebula0.HostAddr -func (p *DropHostFromZoneReq) GetNode() *nebula0.HostAddr { - if !p.IsSetNode() { - return DropHostFromZoneReq_Node_DEFAULT - } -return p.Node + +func (p *AddHostsIntoZoneReq) GetHosts() []*nebula0.HostAddr { + return p.Hosts } -func (p *DropHostFromZoneReq) GetZoneName() []byte { +func (p *AddHostsIntoZoneReq) GetZoneName() []byte { return p.ZoneName } -func (p *DropHostFromZoneReq) IsSetNode() bool { - return p != nil && p.Node != nil -} -func (p *DropHostFromZoneReq) Read(iprot thrift.Protocol) error { +func (p *AddHostsIntoZoneReq) GetIsNew() bool { + return p.IsNew +} +func (p *AddHostsIntoZoneReq) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -18591,6 +19163,10 @@ func (p *DropHostFromZoneReq) Read(iprot thrift.Protocol) error { if err := p.ReadField2(iprot); err != nil { return err } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -18606,15 +19182,27 @@ func (p *DropHostFromZoneReq) Read(iprot thrift.Protocol) error { return nil } -func (p *DropHostFromZoneReq) ReadField1(iprot thrift.Protocol) error { - p.Node = nebula0.NewHostAddr() - if err := p.Node.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) +func (p *AddHostsIntoZoneReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem66 := nebula0.NewHostAddr() + if err := _elem66.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem66), err) + } + p.Hosts = append(p.Hosts, _elem66) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *DropHostFromZoneReq) ReadField2(iprot thrift.Protocol) error { +func (p *AddHostsIntoZoneReq) ReadField2(iprot thrift.Protocol) error { if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { @@ -18623,11 +19211,21 @@ func (p *DropHostFromZoneReq) ReadField2(iprot thrift.Protocol) error { return nil } -func (p *DropHostFromZoneReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("DropHostFromZoneReq"); err != nil { +func (p *AddHostsIntoZoneReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IsNew = v +} + return nil +} + +func (p *AddHostsIntoZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddHostsIntoZoneReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField1(oprot); err != nil { return err } if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } if err := oprot.WriteStructEnd(); err != nil { @@ -18635,18 +19233,26 @@ func (p *DropHostFromZoneReq) Write(oprot thrift.Protocol) error { return nil } -func (p *DropHostFromZoneReq) writeField1(oprot thrift.Protocol) (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) +func (p *AddHostsIntoZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Hosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Hosts { + 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:node: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) } return err } -func (p *DropHostFromZoneReq) writeField2(oprot thrift.Protocol) (err error) { +func (p *AddHostsIntoZoneReq) writeField2(oprot thrift.Protocol) (err error) { if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) } if err := oprot.WriteBinary(p.ZoneName); err != nil { @@ -18656,19 +19262,25 @@ func (p *DropHostFromZoneReq) writeField2(oprot thrift.Protocol) (err error) { return err } -func (p *DropHostFromZoneReq) String() string { +func (p *AddHostsIntoZoneReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_new", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:is_new: ", p), err) } + if err := oprot.WriteBool(bool(p.IsNew)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_new (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:is_new: ", p), err) } + return err +} + +func (p *AddHostsIntoZoneReq) String() string { if p == nil { return "" } - var nodeVal string - if p.Node == nil { - nodeVal = "" - } else { - nodeVal = fmt.Sprintf("%v", p.Node) - } + hostsVal := fmt.Sprintf("%v", p.Hosts) zoneNameVal := fmt.Sprintf("%v", p.ZoneName) - return fmt.Sprintf("DropHostFromZoneReq({Node:%s ZoneName:%s})", nodeVal, zoneNameVal) + isNewVal := fmt.Sprintf("%v", p.IsNew) + return fmt.Sprintf("AddHostsIntoZoneReq({Hosts:%s ZoneName:%s IsNew:%s})", hostsVal, zoneNameVal, isNewVal) } // Attributes: @@ -18857,11 +19469,11 @@ func (p *GetZoneResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Hosts = tSlice for i := 0; i < size; i ++ { - _elem63 := nebula0.NewHostAddr() - if err := _elem63.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem63), err) + _elem67 := nebula0.NewHostAddr() + if err := _elem67.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem67), err) } - p.Hosts = append(p.Hosts, _elem63) + p.Hosts = append(p.Hosts, _elem67) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -19061,11 +19673,11 @@ func (p *Zone) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Nodes = tSlice for i := 0; i < size; i ++ { - _elem64 := nebula0.NewHostAddr() - if err := _elem64.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) + _elem68 := nebula0.NewHostAddr() + if err := _elem68.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem68), err) } - p.Nodes = append(p.Nodes, _elem64) + p.Nodes = append(p.Nodes, _elem68) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -19225,11 +19837,11 @@ func (p *ListZonesResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*Zone, 0, size) p.Zones = tSlice for i := 0; i < size; i ++ { - _elem65 := NewZone() - if err := _elem65.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem65), err) + _elem69 := NewZone() + if err := _elem69.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem69), err) } - p.Zones = append(p.Zones, _elem65) + p.Zones = append(p.Zones, _elem69) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -19400,11 +20012,11 @@ func (p *AddListenerReq) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Hosts = tSlice for i := 0; i < size; i ++ { - _elem66 := nebula0.NewHostAddr() - if err := _elem66.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem66), err) + _elem70 := nebula0.NewHostAddr() + if err := _elem70.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem70), err) } - p.Hosts = append(p.Hosts, _elem66) + p.Hosts = append(p.Hosts, _elem70) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -19975,11 +20587,11 @@ func (p *ListListenerResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*ListenerInfo, 0, size) p.Listeners = tSlice for i := 0; i < size; i ++ { - _elem67 := NewListenerInfo() - if err := _elem67.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem67), err) + _elem71 := NewListenerInfo() + if err := _elem71.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem71), err) } - p.Listeners = append(p.Listeners, _elem67) + p.Listeners = append(p.Listeners, _elem71) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -20398,11 +21010,11 @@ func (p *BackupInfo) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*nebula0.CheckpointInfo, 0, size) p.Info = tSlice for i := 0; i < size; i ++ { - _elem68 := nebula0.NewCheckpointInfo() - if err := _elem68.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem68), err) + _elem72 := nebula0.NewCheckpointInfo() + if err := _elem72.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem72), err) } - p.Info = append(p.Info, _elem68) + p.Info = append(p.Info, _elem72) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -20548,11 +21160,11 @@ func (p *SpaceBackupInfo) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*BackupInfo, 0, size) p.Info = tSlice for i := 0; i < size; i ++ { - _elem69 := NewBackupInfo() - if err := _elem69.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem69), err) + _elem73 := NewBackupInfo() + if err := _elem73.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem73), err) } - p.Info = append(p.Info, _elem69) + p.Info = append(p.Info, _elem73) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -20721,18 +21333,18 @@ func (p *BackupMeta) ReadField1(iprot thrift.Protocol) error { tMap := make(map[nebula0.GraphSpaceID]*SpaceBackupInfo, size) p.BackupInfo = tMap for i := 0; i < size; i ++ { -var _key70 nebula0.GraphSpaceID +var _key74 nebula0.GraphSpaceID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.GraphSpaceID(v) - _key70 = temp + _key74 = temp } - _val71 := NewSpaceBackupInfo() - if err := _val71.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val71), err) + _val75 := NewSpaceBackupInfo() + if err := _val75.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val75), err) } - p.BackupInfo[_key70] = _val71 + p.BackupInfo[_key74] = _val75 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -20748,13 +21360,13 @@ func (p *BackupMeta) ReadField2(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.MetaFiles = tSlice for i := 0; i < size; i ++ { -var _elem72 []byte +var _elem76 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem72 = v + _elem76 = v } - p.MetaFiles = append(p.MetaFiles, _elem72) + p.MetaFiles = append(p.MetaFiles, _elem76) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -20966,13 +21578,13 @@ func (p *CreateBackupReq) ReadField1(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Spaces = tSlice for i := 0; i < size; i ++ { -var _elem73 []byte +var _elem77 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem73 = v + _elem77 = v } - p.Spaces = append(p.Spaces, _elem73) + p.Spaces = append(p.Spaces, _elem77) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -21402,13 +22014,13 @@ func (p *RestoreMetaReq) ReadField1(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Files = tSlice for i := 0; i < size; i ++ { -var _elem74 []byte +var _elem78 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem74 = v + _elem78 = v } - p.Files = append(p.Files, _elem74) + p.Files = append(p.Files, _elem78) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -21424,11 +22036,11 @@ func (p *RestoreMetaReq) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*HostPair, 0, size) p.Hosts = tSlice for i := 0; i < size; i ++ { - _elem75 := NewHostPair() - if err := _elem75.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem75), err) + _elem79 := NewHostPair() + if err := _elem79.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem79), err) } - p.Hosts = append(p.Hosts, _elem75) + p.Hosts = append(p.Hosts, _elem79) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -21787,11 +22399,11 @@ func (p *SignInFTServiceReq) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*FTClient, 0, size) p.Clients = tSlice for i := 0; i < size; i ++ { - _elem76 := NewFTClient() - if err := _elem76.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem76), err) + _elem80 := NewFTClient() + if err := _elem80.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem80), err) } - p.Clients = append(p.Clients, _elem76) + p.Clients = append(p.Clients, _elem80) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -22051,11 +22663,11 @@ func (p *ListFTClientsResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*FTClient, 0, size) p.Clients = tSlice for i := 0; i < size; i ++ { - _elem77 := NewFTClient() - if err := _elem77.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem77), err) + _elem81 := NewFTClient() + if err := _elem81.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem81), err) } - p.Clients = append(p.Clients, _elem77) + p.Clients = append(p.Clients, _elem81) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -22231,13 +22843,13 @@ func (p *FTIndex) ReadField3(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Fields = tSlice for i := 0; i < size; i ++ { -var _elem78 []byte +var _elem82 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem78 = v + _elem82 = v } - p.Fields = append(p.Fields, _elem78) + p.Fields = append(p.Fields, _elem82) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -22711,17 +23323,17 @@ func (p *ListFTIndexesResp) ReadField3(iprot thrift.Protocol) error { tMap := make(map[string]*FTIndex, size) p.Indexes = tMap for i := 0; i < size; i ++ { -var _key79 string +var _key83 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key79 = v + _key83 = v } - _val80 := NewFTIndex() - if err := _val80.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val80), err) + _val84 := NewFTIndex() + if err := _val84.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val84), err) } - p.Indexes[_key79] = _val80 + p.Indexes[_key83] = _val84 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -23252,17 +23864,17 @@ func (p *Session) ReadField9(iprot thrift.Protocol) error { tMap := make(map[string]*nebula0.Value, size) p.Configs = tMap for i := 0; i < size; i ++ { -var _key81 string +var _key85 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key81 = v + _key85 = v } - _val82 := nebula0.NewValue() - if err := _val82.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val82), err) + _val86 := nebula0.NewValue() + if err := _val86.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val86), err) } - p.Configs[_key81] = _val82 + p.Configs[_key85] = _val86 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -23278,18 +23890,18 @@ func (p *Session) ReadField10(iprot thrift.Protocol) error { tMap := make(map[nebula0.ExecutionPlanID]*QueryDesc, size) p.Queries = tMap for i := 0; i < size; i ++ { -var _key83 nebula0.ExecutionPlanID +var _key87 nebula0.ExecutionPlanID if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.ExecutionPlanID(v) - _key83 = temp + _key87 = temp } - _val84 := NewQueryDesc() - if err := _val84.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val84), err) + _val88 := NewQueryDesc() + if err := _val88.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val88), err) } - p.Queries[_key83] = _val84 + p.Queries[_key87] = _val88 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -23853,11 +24465,11 @@ func (p *UpdateSessionsReq) ReadField1(iprot thrift.Protocol) error { tSlice := make([]*Session, 0, size) p.Sessions = tSlice for i := 0; i < size; i ++ { - _elem85 := NewSession() - if err := _elem85.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem85), err) + _elem89 := NewSession() + if err := _elem89.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem89), err) } - p.Sessions = append(p.Sessions, _elem85) + p.Sessions = append(p.Sessions, _elem89) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -24005,37 +24617,37 @@ func (p *UpdateSessionsResp) ReadField3(iprot thrift.Protocol) error { tMap := make(map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc, size) p.KilledQueries = tMap for i := 0; i < size; i ++ { -var _key86 nebula0.SessionID +var _key90 nebula0.SessionID if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.SessionID(v) - _key86 = temp + _key90 = temp } _, _, size, err := iprot.ReadMapBegin() if err != nil { return thrift.PrependError("error reading map begin: ", err) } tMap := make(map[nebula0.ExecutionPlanID]*QueryDesc, size) - _val87 := tMap + _val91 := tMap for i := 0; i < size; i ++ { -var _key88 nebula0.ExecutionPlanID +var _key92 nebula0.ExecutionPlanID if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.ExecutionPlanID(v) - _key88 = temp + _key92 = temp } - _val89 := NewQueryDesc() - if err := _val89.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val89), err) + _val93 := NewQueryDesc() + if err := _val93.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val93), err) } - _val87[_key88] = _val89 + _val91[_key92] = _val93 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) } - p.KilledQueries[_key86] = _val87 + p.KilledQueries[_key90] = _val91 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -24275,11 +24887,11 @@ func (p *ListSessionsResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*Session, 0, size) p.Sessions = tSlice for i := 0; i < size; i ++ { - _elem90 := NewSession() - if err := _elem90.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem90), err) + _elem94 := NewSession() + if err := _elem94.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem94), err) } - p.Sessions = append(p.Sessions, _elem90) + p.Sessions = append(p.Sessions, _elem94) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -24757,33 +25369,33 @@ func (p *KillQueryReq) ReadField1(iprot thrift.Protocol) error { tMap := make(map[nebula0.SessionID][]nebula0.ExecutionPlanID, size) p.KillQueries = tMap for i := 0; i < size; i ++ { -var _key91 nebula0.SessionID +var _key95 nebula0.SessionID if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.SessionID(v) - _key91 = temp + _key95 = temp } _, size, err := iprot.ReadSetBegin() if err != nil { return thrift.PrependError("error reading set begin: ", err) } tSet := make([]nebula0.ExecutionPlanID, 0, size) - _val92 := tSet + _val96 := tSet for i := 0; i < size; i ++ { -var _elem93 nebula0.ExecutionPlanID +var _elem97 nebula0.ExecutionPlanID if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.ExecutionPlanID(v) - _elem93 = temp + _elem97 = temp } - _val92 = append(_val92, _elem93) + _val96 = append(_val96, _elem97) } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) } - p.KillQueries[_key91] = _val92 + p.KillQueries[_key95] = _val96 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -25150,11 +25762,11 @@ func (p *ListClusterInfoResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.MetaServers = tSlice for i := 0; i < size; i ++ { - _elem94 := nebula0.NewHostAddr() - if err := _elem94.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem94), err) + _elem98 := nebula0.NewHostAddr() + if err := _elem98.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem98), err) } - p.MetaServers = append(p.MetaServers, _elem94) + p.MetaServers = append(p.MetaServers, _elem98) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -25170,11 +25782,11 @@ func (p *ListClusterInfoResp) ReadField4(iprot thrift.Protocol) error { tSlice := make([]*nebula0.NodeInfo, 0, size) p.StorageServers = tSlice for i := 0; i < size; i ++ { - _elem95 := nebula0.NewNodeInfo() - if err := _elem95.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem95), err) + _elem99 := nebula0.NewNodeInfo() + if err := _elem99.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem99), err) } - p.StorageServers = append(p.StorageServers, _elem95) + p.StorageServers = append(p.StorageServers, _elem99) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -25673,23 +26285,25 @@ func (p *VerifyClientVersionResp) String() string { } // Attributes: -// - Version +// - ClientVersion // - Host +// - BuildVersion type VerifyClientVersionReq struct { - Version []byte `thrift:"version,1,required" db:"version" json:"version"` + ClientVersion []byte `thrift:"client_version,1,required" db:"client_version" json:"client_version"` Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + BuildVersion []byte `thrift:"build_version,3" db:"build_version" json:"build_version"` } func NewVerifyClientVersionReq() *VerifyClientVersionReq { return &VerifyClientVersionReq{ - Version: []byte("2.6.0"), + ClientVersion: []byte("2.6.0"), Host: nebula0.NewHostAddr(), } } -func (p *VerifyClientVersionReq) GetVersion() []byte { - return p.Version +func (p *VerifyClientVersionReq) GetClientVersion() []byte { + return p.ClientVersion } var VerifyClientVersionReq_Host_DEFAULT *nebula0.HostAddr func (p *VerifyClientVersionReq) GetHost() *nebula0.HostAddr { @@ -25698,6 +26312,10 @@ func (p *VerifyClientVersionReq) GetHost() *nebula0.HostAddr { } return p.Host } + +func (p *VerifyClientVersionReq) GetBuildVersion() []byte { + return p.BuildVersion +} func (p *VerifyClientVersionReq) IsSetHost() bool { return p != nil && p.Host != nil } @@ -25707,7 +26325,7 @@ func (p *VerifyClientVersionReq) Read(iprot thrift.Protocol) error { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetVersion bool = false; + var issetClientVersion bool = false; for { _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() @@ -25720,11 +26338,15 @@ func (p *VerifyClientVersionReq) Read(iprot thrift.Protocol) error { if err := p.ReadField1(iprot); err != nil { return err } - issetVersion = true + issetClientVersion = true case 2: if err := p.ReadField2(iprot); err != nil { return err } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -25737,8 +26359,8 @@ func (p *VerifyClientVersionReq) Read(iprot thrift.Protocol) error { if err := iprot.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetVersion{ - return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Version is not set")); + if !issetClientVersion{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ClientVersion is not set")); } return nil } @@ -25747,7 +26369,7 @@ func (p *VerifyClientVersionReq) ReadField1(iprot thrift.Protocol) error { if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { - p.Version = v + p.ClientVersion = v } return nil } @@ -25760,11 +26382,21 @@ func (p *VerifyClientVersionReq) ReadField2(iprot thrift.Protocol) error { return nil } +func (p *VerifyClientVersionReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.BuildVersion = v +} + return nil +} + func (p *VerifyClientVersionReq) Write(oprot thrift.Protocol) error { if err := oprot.WriteStructBegin("VerifyClientVersionReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField1(oprot); err != nil { return err } if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } if err := oprot.WriteStructEnd(); err != nil { @@ -25773,12 +26405,12 @@ func (p *VerifyClientVersionReq) Write(oprot thrift.Protocol) error { } func (p *VerifyClientVersionReq) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("version", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:version: ", p), err) } - if err := oprot.WriteBinary(p.Version); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.version (1) field write error: ", p), err) } + if err := oprot.WriteFieldBegin("client_version", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_version: ", p), err) } + if err := oprot.WriteBinary(p.ClientVersion); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_version (1) field write error: ", p), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:version: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_version: ", p), err) } return err } @@ -25793,18 +26425,29 @@ func (p *VerifyClientVersionReq) writeField2(oprot thrift.Protocol) (err error) return err } +func (p *VerifyClientVersionReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("build_version", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:build_version: ", p), err) } + if err := oprot.WriteBinary(p.BuildVersion); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.build_version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:build_version: ", p), err) } + return err +} + func (p *VerifyClientVersionReq) String() string { if p == nil { return "" } - versionVal := fmt.Sprintf("%v", p.Version) + clientVersionVal := fmt.Sprintf("%v", p.ClientVersion) var hostVal string if p.Host == nil { hostVal = "" } else { hostVal = fmt.Sprintf("%v", p.Host) } - return fmt.Sprintf("VerifyClientVersionReq({Version:%s Host:%s})", versionVal, hostVal) + buildVersionVal := fmt.Sprintf("%v", p.BuildVersion) + return fmt.Sprintf("VerifyClientVersionReq({ClientVersion:%s Host:%s BuildVersion:%s})", clientVersionVal, hostVal, buildVersionVal) } diff --git a/nebula/storage/general_storage_service-remote/general_storage_service-remote.go b/nebula/storage/general_storage_service-remote/general_storage_service-remote.go deleted file mode 100755 index e333dd1a..00000000 --- a/nebula/storage/general_storage_service-remote/general_storage_service-remote.go +++ /dev/null @@ -1,202 +0,0 @@ -// Autogenerated by Thrift Compiler (facebook) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -// @generated - -package main - -import ( - "flag" - "fmt" - "math" - "net" - "net/url" - "os" - "strconv" - "strings" - thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" - "../../github.com/vesoft-inc/nebula-go/v2/nebula/storage" -) - -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, " KVGetResponse get(KVGetRequest req)") - fmt.Fprintln(os.Stderr, " ExecResponse put(KVPutRequest req)") - fmt.Fprintln(os.Stderr, " ExecResponse remove(KVRemoveRequest req)") - fmt.Fprintln(os.Stderr) - os.Exit(0) -} - -func main() { - flag.Usage = Usage - var host string - var port int - var protocol string - var urlString string - var framed bool - var useHttp bool - var parsedUrl url.URL - var trans thrift.Transport - _ = strconv.Atoi - _ = math.Abs - flag.Usage = Usage - flag.StringVar(&host, "h", "localhost", "Specify host") - 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.Parse() - - if len(urlString) > 0 { - 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" - } 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.NewHTTPPostClient(parsedUrl.String()) - } 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.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) - if err != nil { - fmt.Fprintln(os.Stderr, "error resolving address:", err) - os.Exit(1) - } - if framed { - trans = thrift.NewFramedTransport(trans) - } - } - if err != nil { - fmt.Fprintln(os.Stderr, "Error creating transport", err) - os.Exit(1) - } - defer trans.Close() - var protocolFactory thrift.ProtocolFactory - switch protocol { - case "compact": - protocolFactory = thrift.NewCompactProtocolFactory() - break - case "simplejson": - protocolFactory = thrift.NewSimpleJSONProtocolFactory() - break - case "json": - protocolFactory = thrift.NewJSONProtocolFactory() - break - case "binary", "": - protocolFactory = thrift.NewBinaryProtocolFactoryDefault() - break - default: - fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) - Usage() - os.Exit(1) - } - client := storage.NewGeneralStorageServiceClientFactory(trans, protocolFactory) - if err := trans.Open(); err != nil { - fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) - os.Exit(1) - } - - switch cmd { - case "get": - if flag.NArg() - 1 != 1 { - fmt.Fprintln(os.Stderr, "Get requires 1 args") - flag.Usage() - } - arg293 := flag.Arg(1) - mbTrans294 := thrift.NewMemoryBufferLen(len(arg293)) - defer mbTrans294.Close() - _, err295 := mbTrans294.WriteString(arg293) - if err295 != nil { - Usage() - return - } - factory296 := thrift.NewSimpleJSONProtocolFactory() - jsProt297 := factory296.GetProtocol(mbTrans294) - argvalue0 := storage.NewKVGetRequest() - err298 := argvalue0.Read(jsProt297) - if err298 != nil { - Usage() - return - } - value0 := argvalue0 - fmt.Print(client.Get(value0)) - fmt.Print("\n") - break - case "put": - if flag.NArg() - 1 != 1 { - fmt.Fprintln(os.Stderr, "Put requires 1 args") - flag.Usage() - } - arg299 := flag.Arg(1) - mbTrans300 := thrift.NewMemoryBufferLen(len(arg299)) - defer mbTrans300.Close() - _, err301 := mbTrans300.WriteString(arg299) - if err301 != nil { - Usage() - return - } - factory302 := thrift.NewSimpleJSONProtocolFactory() - jsProt303 := factory302.GetProtocol(mbTrans300) - argvalue0 := storage.NewKVPutRequest() - err304 := argvalue0.Read(jsProt303) - if err304 != nil { - Usage() - return - } - value0 := argvalue0 - fmt.Print(client.Put(value0)) - fmt.Print("\n") - break - case "remove": - if flag.NArg() - 1 != 1 { - fmt.Fprintln(os.Stderr, "Remove requires 1 args") - flag.Usage() - } - arg305 := flag.Arg(1) - mbTrans306 := thrift.NewMemoryBufferLen(len(arg305)) - defer mbTrans306.Close() - _, err307 := mbTrans306.WriteString(arg305) - if err307 != nil { - Usage() - return - } - factory308 := thrift.NewSimpleJSONProtocolFactory() - jsProt309 := factory308.GetProtocol(mbTrans306) - argvalue0 := storage.NewKVRemoveRequest() - err310 := argvalue0.Read(jsProt309) - if err310 != nil { - Usage() - return - } - value0 := argvalue0 - fmt.Print(client.Remove(value0)) - fmt.Print("\n") - break - case "": - Usage() - break - default: - fmt.Fprintln(os.Stderr, "Invalid function ", cmd) - } -} diff --git a/nebula/storage/generalstorageservice.go b/nebula/storage/generalstorageservice.go deleted file mode 100644 index 855946ea..00000000 --- a/nebula/storage/generalstorageservice.go +++ /dev/null @@ -1,1086 +0,0 @@ -// Autogenerated by Thrift Compiler (facebook) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -// @generated - -package storage - -import ( - "bytes" - "context" - "sync" - "fmt" - thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v2/nebula" - meta1 "github.com/vesoft-inc/nebula-go/v2/nebula/meta" - -) - -// (needed to ensure safety because of naive import list construction.) -var _ = thrift.ZERO -var _ = fmt.Printf -var _ = sync.Mutex{} -var _ = bytes.Equal -var _ = context.Background - -var _ = nebula0.GoUnusedProtection__ -var _ = meta1.GoUnusedProtection__ -type GeneralStorageService interface { - // Parameters: - // - Req - Get(ctx context.Context, req *KVGetRequest) (_r *KVGetResponse, err error) - // Parameters: - // - Req - Put(ctx context.Context, req *KVPutRequest) (_r *ExecResponse, err error) - // Parameters: - // - Req - Remove(ctx context.Context, req *KVRemoveRequest) (_r *ExecResponse, err error) -} - -type GeneralStorageServiceClientInterface interface { - thrift.ClientInterface - // Parameters: - // - Req - Get(req *KVGetRequest) (_r *KVGetResponse, err error) - // Parameters: - // - Req - Put(req *KVPutRequest) (_r *ExecResponse, err error) - // Parameters: - // - Req - Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) -} - -type GeneralStorageServiceClient struct { - GeneralStorageServiceClientInterface - CC thrift.ClientConn -} - -func(client *GeneralStorageServiceClient) Open() error { - return client.CC.Open() -} - -func(client *GeneralStorageServiceClient) Close() error { - return client.CC.Close() -} - -func(client *GeneralStorageServiceClient) IsOpen() bool { - return client.CC.IsOpen() -} - -func NewGeneralStorageServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GeneralStorageServiceClient { - return &GeneralStorageServiceClient{ CC: thrift.NewClientConn(t, f) } -} - -func NewGeneralStorageServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GeneralStorageServiceClient { - return &GeneralStorageServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } -} - -func NewGeneralStorageServiceClientProtocol(prot thrift.Protocol) *GeneralStorageServiceClient { - return NewGeneralStorageServiceClient(prot.Transport(), prot, prot) -} - -// Parameters: -// - Req -func (p *GeneralStorageServiceClient) Get(req *KVGetRequest) (_r *KVGetResponse, err error) { - args := GeneralStorageServiceGetArgs{ - Req : req, - } - err = p.CC.SendMsg("get", &args, thrift.CALL) - if err != nil { return } - return p.recvGet() -} - - -func (p *GeneralStorageServiceClient) recvGet() (value *KVGetResponse, err error) { - var result GeneralStorageServiceGetResult - err = p.CC.RecvMsg("get", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GeneralStorageServiceClient) Put(req *KVPutRequest) (_r *ExecResponse, err error) { - args := GeneralStorageServicePutArgs{ - Req : req, - } - err = p.CC.SendMsg("put", &args, thrift.CALL) - if err != nil { return } - return p.recvPut() -} - - -func (p *GeneralStorageServiceClient) recvPut() (value *ExecResponse, err error) { - var result GeneralStorageServicePutResult - err = p.CC.RecvMsg("put", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GeneralStorageServiceClient) Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) { - args := GeneralStorageServiceRemoveArgs{ - Req : req, - } - err = p.CC.SendMsg("remove", &args, thrift.CALL) - if err != nil { return } - return p.recvRemove() -} - - -func (p *GeneralStorageServiceClient) recvRemove() (value *ExecResponse, err error) { - var result GeneralStorageServiceRemoveResult - err = p.CC.RecvMsg("remove", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - - -type GeneralStorageServiceThreadsafeClient struct { - GeneralStorageServiceClientInterface - CC thrift.ClientConn - Mu sync.Mutex -} - -func(client *GeneralStorageServiceThreadsafeClient) Open() error { - client.Mu.Lock() - defer client.Mu.Unlock() - return client.CC.Open() -} - -func(client *GeneralStorageServiceThreadsafeClient) Close() error { - client.Mu.Lock() - defer client.Mu.Unlock() - return client.CC.Close() -} - -func(client *GeneralStorageServiceThreadsafeClient) IsOpen() bool { - client.Mu.Lock() - defer client.Mu.Unlock() - return client.CC.IsOpen() -} - -func NewGeneralStorageServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GeneralStorageServiceThreadsafeClient { - return &GeneralStorageServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } -} - -func NewGeneralStorageServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GeneralStorageServiceThreadsafeClient { - return &GeneralStorageServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } -} - -func NewGeneralStorageServiceThreadsafeClientProtocol(prot thrift.Protocol) *GeneralStorageServiceThreadsafeClient { - return NewGeneralStorageServiceThreadsafeClient(prot.Transport(), prot, prot) -} - -// Parameters: -// - Req -func (p *GeneralStorageServiceThreadsafeClient) Get(req *KVGetRequest) (_r *KVGetResponse, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GeneralStorageServiceGetArgs{ - Req : req, - } - err = p.CC.SendMsg("get", &args, thrift.CALL) - if err != nil { return } - return p.recvGet() -} - - -func (p *GeneralStorageServiceThreadsafeClient) recvGet() (value *KVGetResponse, err error) { - var result GeneralStorageServiceGetResult - err = p.CC.RecvMsg("get", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GeneralStorageServiceThreadsafeClient) Put(req *KVPutRequest) (_r *ExecResponse, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GeneralStorageServicePutArgs{ - Req : req, - } - err = p.CC.SendMsg("put", &args, thrift.CALL) - if err != nil { return } - return p.recvPut() -} - - -func (p *GeneralStorageServiceThreadsafeClient) recvPut() (value *ExecResponse, err error) { - var result GeneralStorageServicePutResult - err = p.CC.RecvMsg("put", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GeneralStorageServiceThreadsafeClient) Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GeneralStorageServiceRemoveArgs{ - Req : req, - } - err = p.CC.SendMsg("remove", &args, thrift.CALL) - if err != nil { return } - return p.recvRemove() -} - - -func (p *GeneralStorageServiceThreadsafeClient) recvRemove() (value *ExecResponse, err error) { - var result GeneralStorageServiceRemoveResult - err = p.CC.RecvMsg("remove", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - - -type GeneralStorageServiceChannelClient struct { - RequestChannel thrift.RequestChannel -} - -func (c *GeneralStorageServiceChannelClient) Close() error { - return c.RequestChannel.Close() -} - -func (c *GeneralStorageServiceChannelClient) IsOpen() bool { - return c.RequestChannel.IsOpen() -} - -func (c *GeneralStorageServiceChannelClient) Open() error { - return c.RequestChannel.Open() -} - -func NewGeneralStorageServiceChannelClient(channel thrift.RequestChannel) *GeneralStorageServiceChannelClient { - return &GeneralStorageServiceChannelClient{RequestChannel: channel} -} - -// Parameters: -// - Req -func (p *GeneralStorageServiceChannelClient) Get(ctx context.Context, req *KVGetRequest) (_r *KVGetResponse, err error) { - args := GeneralStorageServiceGetArgs{ - Req : req, - } - var result GeneralStorageServiceGetResult - err = p.RequestChannel.Call(ctx, "get", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GeneralStorageServiceChannelClient) Put(ctx context.Context, req *KVPutRequest) (_r *ExecResponse, err error) { - args := GeneralStorageServicePutArgs{ - Req : req, - } - var result GeneralStorageServicePutResult - err = p.RequestChannel.Call(ctx, "put", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GeneralStorageServiceChannelClient) Remove(ctx context.Context, req *KVRemoveRequest) (_r *ExecResponse, err error) { - args := GeneralStorageServiceRemoveArgs{ - Req : req, - } - var result GeneralStorageServiceRemoveResult - err = p.RequestChannel.Call(ctx, "remove", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - - -type GeneralStorageServiceProcessor struct { - processorMap map[string]thrift.ProcessorFunctionContext - handler GeneralStorageService -} - -func (p *GeneralStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { - p.processorMap[key] = processor -} - -func (p *GeneralStorageServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { - if processor, ok := p.processorMap[key]; ok { - return processor, nil - } - return nil, nil // generic error message will be sent -} - -func (p *GeneralStorageServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { - return p.processorMap -} - -func NewGeneralStorageServiceProcessor(handler GeneralStorageService) *GeneralStorageServiceProcessor { - self291 := &GeneralStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} - self291.processorMap["get"] = &generalStorageServiceProcessorGet{handler:handler} - self291.processorMap["put"] = &generalStorageServiceProcessorPut{handler:handler} - self291.processorMap["remove"] = &generalStorageServiceProcessorRemove{handler:handler} - return self291 -} - -type generalStorageServiceProcessorGet struct { - handler GeneralStorageService -} - -func (p *generalStorageServiceProcessorGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GeneralStorageServiceGetArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *generalStorageServiceProcessorGet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("get", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *generalStorageServiceProcessorGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GeneralStorageServiceGetArgs) - var result GeneralStorageServiceGetResult - if retval, err := p.handler.Get(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type generalStorageServiceProcessorPut struct { - handler GeneralStorageService -} - -func (p *generalStorageServiceProcessorPut) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GeneralStorageServicePutArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *generalStorageServiceProcessorPut) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("put", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *generalStorageServiceProcessorPut) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GeneralStorageServicePutArgs) - var result GeneralStorageServicePutResult - if retval, err := p.handler.Put(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing put: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type generalStorageServiceProcessorRemove struct { - handler GeneralStorageService -} - -func (p *generalStorageServiceProcessorRemove) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GeneralStorageServiceRemoveArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *generalStorageServiceProcessorRemove) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("remove", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *generalStorageServiceProcessorRemove) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GeneralStorageServiceRemoveArgs) - var result GeneralStorageServiceRemoveResult - if retval, err := p.handler.Remove(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - - -// HELPER FUNCTIONS AND STRUCTURES - -// Attributes: -// - Req -type GeneralStorageServiceGetArgs struct { - thrift.IRequest - Req *KVGetRequest `thrift:"req,1" db:"req" json:"req"` -} - -func NewGeneralStorageServiceGetArgs() *GeneralStorageServiceGetArgs { - return &GeneralStorageServiceGetArgs{ - Req: NewKVGetRequest(), - } -} - -var GeneralStorageServiceGetArgs_Req_DEFAULT *KVGetRequest -func (p *GeneralStorageServiceGetArgs) GetReq() *KVGetRequest { - if !p.IsSetReq() { - return GeneralStorageServiceGetArgs_Req_DEFAULT - } -return p.Req -} -func (p *GeneralStorageServiceGetArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -func (p *GeneralStorageServiceGetArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - 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 *GeneralStorageServiceGetArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewKVGetRequest() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *GeneralStorageServiceGetArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("get_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GeneralStorageServiceGetArgs) writeField1(oprot thrift.Protocol) (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 *GeneralStorageServiceGetArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("GeneralStorageServiceGetArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type GeneralStorageServiceGetResult struct { - thrift.IResponse - Success *KVGetResponse `thrift:"success,0" db:"success" json:"success,omitempty"` -} - -func NewGeneralStorageServiceGetResult() *GeneralStorageServiceGetResult { - return &GeneralStorageServiceGetResult{} -} - -var GeneralStorageServiceGetResult_Success_DEFAULT *KVGetResponse -func (p *GeneralStorageServiceGetResult) GetSuccess() *KVGetResponse { - if !p.IsSetSuccess() { - return GeneralStorageServiceGetResult_Success_DEFAULT - } -return p.Success -} -func (p *GeneralStorageServiceGetResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -func (p *GeneralStorageServiceGetResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GeneralStorageServiceGetResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewKVGetResponse() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *GeneralStorageServiceGetResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("get_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - 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 *GeneralStorageServiceGetResult) writeField0(oprot thrift.Protocol) (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 *GeneralStorageServiceGetResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GeneralStorageServiceGetResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type GeneralStorageServicePutArgs struct { - thrift.IRequest - Req *KVPutRequest `thrift:"req,1" db:"req" json:"req"` -} - -func NewGeneralStorageServicePutArgs() *GeneralStorageServicePutArgs { - return &GeneralStorageServicePutArgs{ - Req: NewKVPutRequest(), - } -} - -var GeneralStorageServicePutArgs_Req_DEFAULT *KVPutRequest -func (p *GeneralStorageServicePutArgs) GetReq() *KVPutRequest { - if !p.IsSetReq() { - return GeneralStorageServicePutArgs_Req_DEFAULT - } -return p.Req -} -func (p *GeneralStorageServicePutArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -func (p *GeneralStorageServicePutArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - 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 *GeneralStorageServicePutArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewKVPutRequest() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *GeneralStorageServicePutArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("put_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GeneralStorageServicePutArgs) writeField1(oprot thrift.Protocol) (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 *GeneralStorageServicePutArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("GeneralStorageServicePutArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type GeneralStorageServicePutResult struct { - thrift.IResponse - Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` -} - -func NewGeneralStorageServicePutResult() *GeneralStorageServicePutResult { - return &GeneralStorageServicePutResult{} -} - -var GeneralStorageServicePutResult_Success_DEFAULT *ExecResponse -func (p *GeneralStorageServicePutResult) GetSuccess() *ExecResponse { - if !p.IsSetSuccess() { - return GeneralStorageServicePutResult_Success_DEFAULT - } -return p.Success -} -func (p *GeneralStorageServicePutResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -func (p *GeneralStorageServicePutResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GeneralStorageServicePutResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewExecResponse() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *GeneralStorageServicePutResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("put_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - 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 *GeneralStorageServicePutResult) writeField0(oprot thrift.Protocol) (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 *GeneralStorageServicePutResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GeneralStorageServicePutResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type GeneralStorageServiceRemoveArgs struct { - thrift.IRequest - Req *KVRemoveRequest `thrift:"req,1" db:"req" json:"req"` -} - -func NewGeneralStorageServiceRemoveArgs() *GeneralStorageServiceRemoveArgs { - return &GeneralStorageServiceRemoveArgs{ - Req: NewKVRemoveRequest(), - } -} - -var GeneralStorageServiceRemoveArgs_Req_DEFAULT *KVRemoveRequest -func (p *GeneralStorageServiceRemoveArgs) GetReq() *KVRemoveRequest { - if !p.IsSetReq() { - return GeneralStorageServiceRemoveArgs_Req_DEFAULT - } -return p.Req -} -func (p *GeneralStorageServiceRemoveArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -func (p *GeneralStorageServiceRemoveArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - 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 *GeneralStorageServiceRemoveArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewKVRemoveRequest() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *GeneralStorageServiceRemoveArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("remove_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GeneralStorageServiceRemoveArgs) writeField1(oprot thrift.Protocol) (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 *GeneralStorageServiceRemoveArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("GeneralStorageServiceRemoveArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type GeneralStorageServiceRemoveResult struct { - thrift.IResponse - Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` -} - -func NewGeneralStorageServiceRemoveResult() *GeneralStorageServiceRemoveResult { - return &GeneralStorageServiceRemoveResult{} -} - -var GeneralStorageServiceRemoveResult_Success_DEFAULT *ExecResponse -func (p *GeneralStorageServiceRemoveResult) GetSuccess() *ExecResponse { - if !p.IsSetSuccess() { - return GeneralStorageServiceRemoveResult_Success_DEFAULT - } -return p.Success -} -func (p *GeneralStorageServiceRemoveResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -func (p *GeneralStorageServiceRemoveResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GeneralStorageServiceRemoveResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewExecResponse() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *GeneralStorageServiceRemoveResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("remove_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - 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 *GeneralStorageServiceRemoveResult) writeField0(oprot thrift.Protocol) (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 *GeneralStorageServiceRemoveResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GeneralStorageServiceRemoveResult({Success:%s})", successVal) -} - - diff --git a/nebula/storage/graph_storage_service-remote/graph_storage_service-remote.go b/nebula/storage/graph_storage_service-remote/graph_storage_service-remote.go index 47a5b9b8..37663b56 100755 --- a/nebula/storage/graph_storage_service-remote/graph_storage_service-remote.go +++ b/nebula/storage/graph_storage_service-remote/graph_storage_service-remote.go @@ -30,8 +30,8 @@ func Usage() { fmt.Fprintln(os.Stderr, " ExecResponse deleteTags(DeleteTagsRequest req)") fmt.Fprintln(os.Stderr, " UpdateResponse updateVertex(UpdateVertexRequest req)") fmt.Fprintln(os.Stderr, " UpdateResponse updateEdge(UpdateEdgeRequest req)") - fmt.Fprintln(os.Stderr, " ScanVertexResponse scanVertex(ScanVertexRequest req)") - fmt.Fprintln(os.Stderr, " ScanEdgeResponse scanEdge(ScanEdgeRequest req)") + fmt.Fprintln(os.Stderr, " ScanResponse scanVertex(ScanVertexRequest req)") + fmt.Fprintln(os.Stderr, " ScanResponse scanEdge(ScanEdgeRequest req)") fmt.Fprintln(os.Stderr, " GetUUIDResp getUUID(GetUUIDReq req)") fmt.Fprintln(os.Stderr, " LookupIndexResp lookupIndex(LookupIndexRequest req)") fmt.Fprintln(os.Stderr, " GetNeighborsResponse lookupAndTraverse(LookupAndTraverseRequest req)") @@ -139,19 +139,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetNeighbors requires 1 args") flag.Usage() } - arg97 := flag.Arg(1) - mbTrans98 := thrift.NewMemoryBufferLen(len(arg97)) - defer mbTrans98.Close() - _, err99 := mbTrans98.WriteString(arg97) - if err99 != nil { + arg96 := flag.Arg(1) + mbTrans97 := thrift.NewMemoryBufferLen(len(arg96)) + defer mbTrans97.Close() + _, err98 := mbTrans97.WriteString(arg96) + if err98 != nil { Usage() return } - factory100 := thrift.NewSimpleJSONProtocolFactory() - jsProt101 := factory100.GetProtocol(mbTrans98) + factory99 := thrift.NewSimpleJSONProtocolFactory() + jsProt100 := factory99.GetProtocol(mbTrans97) argvalue0 := storage.NewGetNeighborsRequest() - err102 := argvalue0.Read(jsProt101) - if err102 != nil { + err101 := argvalue0.Read(jsProt100) + if err101 != nil { Usage() return } @@ -164,19 +164,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetProps requires 1 args") flag.Usage() } - arg103 := flag.Arg(1) - mbTrans104 := thrift.NewMemoryBufferLen(len(arg103)) - defer mbTrans104.Close() - _, err105 := mbTrans104.WriteString(arg103) - if err105 != nil { + arg102 := flag.Arg(1) + mbTrans103 := thrift.NewMemoryBufferLen(len(arg102)) + defer mbTrans103.Close() + _, err104 := mbTrans103.WriteString(arg102) + if err104 != nil { Usage() return } - factory106 := thrift.NewSimpleJSONProtocolFactory() - jsProt107 := factory106.GetProtocol(mbTrans104) + factory105 := thrift.NewSimpleJSONProtocolFactory() + jsProt106 := factory105.GetProtocol(mbTrans103) argvalue0 := storage.NewGetPropRequest() - err108 := argvalue0.Read(jsProt107) - if err108 != nil { + err107 := argvalue0.Read(jsProt106) + if err107 != nil { Usage() return } @@ -189,19 +189,19 @@ func main() { fmt.Fprintln(os.Stderr, "AddVertices requires 1 args") flag.Usage() } - arg109 := flag.Arg(1) - mbTrans110 := thrift.NewMemoryBufferLen(len(arg109)) - defer mbTrans110.Close() - _, err111 := mbTrans110.WriteString(arg109) - if err111 != nil { + arg108 := flag.Arg(1) + mbTrans109 := thrift.NewMemoryBufferLen(len(arg108)) + defer mbTrans109.Close() + _, err110 := mbTrans109.WriteString(arg108) + if err110 != nil { Usage() return } - factory112 := thrift.NewSimpleJSONProtocolFactory() - jsProt113 := factory112.GetProtocol(mbTrans110) + factory111 := thrift.NewSimpleJSONProtocolFactory() + jsProt112 := factory111.GetProtocol(mbTrans109) argvalue0 := storage.NewAddVerticesRequest() - err114 := argvalue0.Read(jsProt113) - if err114 != nil { + err113 := argvalue0.Read(jsProt112) + if err113 != nil { Usage() return } @@ -214,19 +214,19 @@ func main() { fmt.Fprintln(os.Stderr, "AddEdges requires 1 args") flag.Usage() } - arg115 := flag.Arg(1) - mbTrans116 := thrift.NewMemoryBufferLen(len(arg115)) - defer mbTrans116.Close() - _, err117 := mbTrans116.WriteString(arg115) - if err117 != nil { + arg114 := flag.Arg(1) + mbTrans115 := thrift.NewMemoryBufferLen(len(arg114)) + defer mbTrans115.Close() + _, err116 := mbTrans115.WriteString(arg114) + if err116 != nil { Usage() return } - factory118 := thrift.NewSimpleJSONProtocolFactory() - jsProt119 := factory118.GetProtocol(mbTrans116) + factory117 := thrift.NewSimpleJSONProtocolFactory() + jsProt118 := factory117.GetProtocol(mbTrans115) argvalue0 := storage.NewAddEdgesRequest() - err120 := argvalue0.Read(jsProt119) - if err120 != nil { + err119 := argvalue0.Read(jsProt118) + if err119 != nil { Usage() return } @@ -239,19 +239,19 @@ func main() { fmt.Fprintln(os.Stderr, "DeleteEdges requires 1 args") flag.Usage() } - arg121 := flag.Arg(1) - mbTrans122 := thrift.NewMemoryBufferLen(len(arg121)) - defer mbTrans122.Close() - _, err123 := mbTrans122.WriteString(arg121) - if err123 != nil { + arg120 := flag.Arg(1) + mbTrans121 := thrift.NewMemoryBufferLen(len(arg120)) + defer mbTrans121.Close() + _, err122 := mbTrans121.WriteString(arg120) + if err122 != nil { Usage() return } - factory124 := thrift.NewSimpleJSONProtocolFactory() - jsProt125 := factory124.GetProtocol(mbTrans122) + factory123 := thrift.NewSimpleJSONProtocolFactory() + jsProt124 := factory123.GetProtocol(mbTrans121) argvalue0 := storage.NewDeleteEdgesRequest() - err126 := argvalue0.Read(jsProt125) - if err126 != nil { + err125 := argvalue0.Read(jsProt124) + if err125 != nil { Usage() return } @@ -264,19 +264,19 @@ func main() { fmt.Fprintln(os.Stderr, "DeleteVertices requires 1 args") flag.Usage() } - arg127 := flag.Arg(1) - mbTrans128 := thrift.NewMemoryBufferLen(len(arg127)) - defer mbTrans128.Close() - _, err129 := mbTrans128.WriteString(arg127) - if err129 != nil { + arg126 := flag.Arg(1) + mbTrans127 := thrift.NewMemoryBufferLen(len(arg126)) + defer mbTrans127.Close() + _, err128 := mbTrans127.WriteString(arg126) + if err128 != nil { Usage() return } - factory130 := thrift.NewSimpleJSONProtocolFactory() - jsProt131 := factory130.GetProtocol(mbTrans128) + factory129 := thrift.NewSimpleJSONProtocolFactory() + jsProt130 := factory129.GetProtocol(mbTrans127) argvalue0 := storage.NewDeleteVerticesRequest() - err132 := argvalue0.Read(jsProt131) - if err132 != nil { + err131 := argvalue0.Read(jsProt130) + if err131 != nil { Usage() return } @@ -289,19 +289,19 @@ func main() { fmt.Fprintln(os.Stderr, "DeleteTags requires 1 args") flag.Usage() } - arg133 := flag.Arg(1) - mbTrans134 := thrift.NewMemoryBufferLen(len(arg133)) - defer mbTrans134.Close() - _, err135 := mbTrans134.WriteString(arg133) - if err135 != nil { + arg132 := flag.Arg(1) + mbTrans133 := thrift.NewMemoryBufferLen(len(arg132)) + defer mbTrans133.Close() + _, err134 := mbTrans133.WriteString(arg132) + if err134 != nil { Usage() return } - factory136 := thrift.NewSimpleJSONProtocolFactory() - jsProt137 := factory136.GetProtocol(mbTrans134) + factory135 := thrift.NewSimpleJSONProtocolFactory() + jsProt136 := factory135.GetProtocol(mbTrans133) argvalue0 := storage.NewDeleteTagsRequest() - err138 := argvalue0.Read(jsProt137) - if err138 != nil { + err137 := argvalue0.Read(jsProt136) + if err137 != nil { Usage() return } @@ -314,19 +314,19 @@ func main() { fmt.Fprintln(os.Stderr, "UpdateVertex requires 1 args") flag.Usage() } - arg139 := flag.Arg(1) - mbTrans140 := thrift.NewMemoryBufferLen(len(arg139)) - defer mbTrans140.Close() - _, err141 := mbTrans140.WriteString(arg139) - if err141 != nil { + arg138 := flag.Arg(1) + mbTrans139 := thrift.NewMemoryBufferLen(len(arg138)) + defer mbTrans139.Close() + _, err140 := mbTrans139.WriteString(arg138) + if err140 != nil { Usage() return } - factory142 := thrift.NewSimpleJSONProtocolFactory() - jsProt143 := factory142.GetProtocol(mbTrans140) + factory141 := thrift.NewSimpleJSONProtocolFactory() + jsProt142 := factory141.GetProtocol(mbTrans139) argvalue0 := storage.NewUpdateVertexRequest() - err144 := argvalue0.Read(jsProt143) - if err144 != nil { + err143 := argvalue0.Read(jsProt142) + if err143 != nil { Usage() return } @@ -339,19 +339,19 @@ func main() { fmt.Fprintln(os.Stderr, "UpdateEdge requires 1 args") flag.Usage() } - arg145 := flag.Arg(1) - mbTrans146 := thrift.NewMemoryBufferLen(len(arg145)) - defer mbTrans146.Close() - _, err147 := mbTrans146.WriteString(arg145) - if err147 != nil { + arg144 := flag.Arg(1) + mbTrans145 := thrift.NewMemoryBufferLen(len(arg144)) + defer mbTrans145.Close() + _, err146 := mbTrans145.WriteString(arg144) + if err146 != nil { Usage() return } - factory148 := thrift.NewSimpleJSONProtocolFactory() - jsProt149 := factory148.GetProtocol(mbTrans146) + factory147 := thrift.NewSimpleJSONProtocolFactory() + jsProt148 := factory147.GetProtocol(mbTrans145) argvalue0 := storage.NewUpdateEdgeRequest() - err150 := argvalue0.Read(jsProt149) - if err150 != nil { + err149 := argvalue0.Read(jsProt148) + if err149 != nil { Usage() return } @@ -364,19 +364,19 @@ func main() { fmt.Fprintln(os.Stderr, "ScanVertex requires 1 args") flag.Usage() } - arg151 := flag.Arg(1) - mbTrans152 := thrift.NewMemoryBufferLen(len(arg151)) - defer mbTrans152.Close() - _, err153 := mbTrans152.WriteString(arg151) - if err153 != nil { + arg150 := flag.Arg(1) + mbTrans151 := thrift.NewMemoryBufferLen(len(arg150)) + defer mbTrans151.Close() + _, err152 := mbTrans151.WriteString(arg150) + if err152 != nil { Usage() return } - factory154 := thrift.NewSimpleJSONProtocolFactory() - jsProt155 := factory154.GetProtocol(mbTrans152) + factory153 := thrift.NewSimpleJSONProtocolFactory() + jsProt154 := factory153.GetProtocol(mbTrans151) argvalue0 := storage.NewScanVertexRequest() - err156 := argvalue0.Read(jsProt155) - if err156 != nil { + err155 := argvalue0.Read(jsProt154) + if err155 != nil { Usage() return } @@ -389,19 +389,19 @@ func main() { fmt.Fprintln(os.Stderr, "ScanEdge requires 1 args") flag.Usage() } - arg157 := flag.Arg(1) - mbTrans158 := thrift.NewMemoryBufferLen(len(arg157)) - defer mbTrans158.Close() - _, err159 := mbTrans158.WriteString(arg157) - if err159 != nil { + arg156 := flag.Arg(1) + mbTrans157 := thrift.NewMemoryBufferLen(len(arg156)) + defer mbTrans157.Close() + _, err158 := mbTrans157.WriteString(arg156) + if err158 != nil { Usage() return } - factory160 := thrift.NewSimpleJSONProtocolFactory() - jsProt161 := factory160.GetProtocol(mbTrans158) + factory159 := thrift.NewSimpleJSONProtocolFactory() + jsProt160 := factory159.GetProtocol(mbTrans157) argvalue0 := storage.NewScanEdgeRequest() - err162 := argvalue0.Read(jsProt161) - if err162 != nil { + err161 := argvalue0.Read(jsProt160) + if err161 != nil { Usage() return } @@ -414,19 +414,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetUUID requires 1 args") flag.Usage() } - arg163 := flag.Arg(1) - mbTrans164 := thrift.NewMemoryBufferLen(len(arg163)) - defer mbTrans164.Close() - _, err165 := mbTrans164.WriteString(arg163) - if err165 != nil { + arg162 := flag.Arg(1) + mbTrans163 := thrift.NewMemoryBufferLen(len(arg162)) + defer mbTrans163.Close() + _, err164 := mbTrans163.WriteString(arg162) + if err164 != nil { Usage() return } - factory166 := thrift.NewSimpleJSONProtocolFactory() - jsProt167 := factory166.GetProtocol(mbTrans164) + factory165 := thrift.NewSimpleJSONProtocolFactory() + jsProt166 := factory165.GetProtocol(mbTrans163) argvalue0 := storage.NewGetUUIDReq() - err168 := argvalue0.Read(jsProt167) - if err168 != nil { + err167 := argvalue0.Read(jsProt166) + if err167 != nil { Usage() return } @@ -439,19 +439,19 @@ func main() { fmt.Fprintln(os.Stderr, "LookupIndex requires 1 args") flag.Usage() } - arg169 := flag.Arg(1) - mbTrans170 := thrift.NewMemoryBufferLen(len(arg169)) - defer mbTrans170.Close() - _, err171 := mbTrans170.WriteString(arg169) - if err171 != nil { + arg168 := flag.Arg(1) + mbTrans169 := thrift.NewMemoryBufferLen(len(arg168)) + defer mbTrans169.Close() + _, err170 := mbTrans169.WriteString(arg168) + if err170 != nil { Usage() return } - factory172 := thrift.NewSimpleJSONProtocolFactory() - jsProt173 := factory172.GetProtocol(mbTrans170) + factory171 := thrift.NewSimpleJSONProtocolFactory() + jsProt172 := factory171.GetProtocol(mbTrans169) argvalue0 := storage.NewLookupIndexRequest() - err174 := argvalue0.Read(jsProt173) - if err174 != nil { + err173 := argvalue0.Read(jsProt172) + if err173 != nil { Usage() return } @@ -464,19 +464,19 @@ func main() { fmt.Fprintln(os.Stderr, "LookupAndTraverse requires 1 args") flag.Usage() } - arg175 := flag.Arg(1) - mbTrans176 := thrift.NewMemoryBufferLen(len(arg175)) - defer mbTrans176.Close() - _, err177 := mbTrans176.WriteString(arg175) - if err177 != nil { + arg174 := flag.Arg(1) + mbTrans175 := thrift.NewMemoryBufferLen(len(arg174)) + defer mbTrans175.Close() + _, err176 := mbTrans175.WriteString(arg174) + if err176 != nil { Usage() return } - factory178 := thrift.NewSimpleJSONProtocolFactory() - jsProt179 := factory178.GetProtocol(mbTrans176) + factory177 := thrift.NewSimpleJSONProtocolFactory() + jsProt178 := factory177.GetProtocol(mbTrans175) argvalue0 := storage.NewLookupAndTraverseRequest() - err180 := argvalue0.Read(jsProt179) - if err180 != nil { + err179 := argvalue0.Read(jsProt178) + if err179 != nil { Usage() return } @@ -489,19 +489,19 @@ func main() { fmt.Fprintln(os.Stderr, "ChainUpdateEdge requires 1 args") flag.Usage() } - arg181 := flag.Arg(1) - mbTrans182 := thrift.NewMemoryBufferLen(len(arg181)) - defer mbTrans182.Close() - _, err183 := mbTrans182.WriteString(arg181) - if err183 != nil { + arg180 := flag.Arg(1) + mbTrans181 := thrift.NewMemoryBufferLen(len(arg180)) + defer mbTrans181.Close() + _, err182 := mbTrans181.WriteString(arg180) + if err182 != nil { Usage() return } - factory184 := thrift.NewSimpleJSONProtocolFactory() - jsProt185 := factory184.GetProtocol(mbTrans182) + factory183 := thrift.NewSimpleJSONProtocolFactory() + jsProt184 := factory183.GetProtocol(mbTrans181) argvalue0 := storage.NewUpdateEdgeRequest() - err186 := argvalue0.Read(jsProt185) - if err186 != nil { + err185 := argvalue0.Read(jsProt184) + if err185 != nil { Usage() return } @@ -514,19 +514,19 @@ func main() { fmt.Fprintln(os.Stderr, "ChainAddEdges requires 1 args") flag.Usage() } - arg187 := flag.Arg(1) - mbTrans188 := thrift.NewMemoryBufferLen(len(arg187)) - defer mbTrans188.Close() - _, err189 := mbTrans188.WriteString(arg187) - if err189 != nil { + arg186 := flag.Arg(1) + mbTrans187 := thrift.NewMemoryBufferLen(len(arg186)) + defer mbTrans187.Close() + _, err188 := mbTrans187.WriteString(arg186) + if err188 != nil { Usage() return } - factory190 := thrift.NewSimpleJSONProtocolFactory() - jsProt191 := factory190.GetProtocol(mbTrans188) + factory189 := thrift.NewSimpleJSONProtocolFactory() + jsProt190 := factory189.GetProtocol(mbTrans187) argvalue0 := storage.NewAddEdgesRequest() - err192 := argvalue0.Read(jsProt191) - if err192 != nil { + err191 := argvalue0.Read(jsProt190) + if err191 != nil { Usage() return } @@ -539,19 +539,19 @@ func main() { fmt.Fprintln(os.Stderr, "Get requires 1 args") flag.Usage() } - arg193 := flag.Arg(1) - mbTrans194 := thrift.NewMemoryBufferLen(len(arg193)) - defer mbTrans194.Close() - _, err195 := mbTrans194.WriteString(arg193) - if err195 != nil { + arg192 := flag.Arg(1) + mbTrans193 := thrift.NewMemoryBufferLen(len(arg192)) + defer mbTrans193.Close() + _, err194 := mbTrans193.WriteString(arg192) + if err194 != nil { Usage() return } - factory196 := thrift.NewSimpleJSONProtocolFactory() - jsProt197 := factory196.GetProtocol(mbTrans194) + factory195 := thrift.NewSimpleJSONProtocolFactory() + jsProt196 := factory195.GetProtocol(mbTrans193) argvalue0 := storage.NewKVGetRequest() - err198 := argvalue0.Read(jsProt197) - if err198 != nil { + err197 := argvalue0.Read(jsProt196) + if err197 != nil { Usage() return } @@ -564,19 +564,19 @@ func main() { fmt.Fprintln(os.Stderr, "Put requires 1 args") flag.Usage() } - arg199 := flag.Arg(1) - mbTrans200 := thrift.NewMemoryBufferLen(len(arg199)) - defer mbTrans200.Close() - _, err201 := mbTrans200.WriteString(arg199) - if err201 != nil { + arg198 := flag.Arg(1) + mbTrans199 := thrift.NewMemoryBufferLen(len(arg198)) + defer mbTrans199.Close() + _, err200 := mbTrans199.WriteString(arg198) + if err200 != nil { Usage() return } - factory202 := thrift.NewSimpleJSONProtocolFactory() - jsProt203 := factory202.GetProtocol(mbTrans200) + factory201 := thrift.NewSimpleJSONProtocolFactory() + jsProt202 := factory201.GetProtocol(mbTrans199) argvalue0 := storage.NewKVPutRequest() - err204 := argvalue0.Read(jsProt203) - if err204 != nil { + err203 := argvalue0.Read(jsProt202) + if err203 != nil { Usage() return } @@ -589,19 +589,19 @@ func main() { fmt.Fprintln(os.Stderr, "Remove requires 1 args") flag.Usage() } - arg205 := flag.Arg(1) - mbTrans206 := thrift.NewMemoryBufferLen(len(arg205)) - defer mbTrans206.Close() - _, err207 := mbTrans206.WriteString(arg205) - if err207 != nil { + arg204 := flag.Arg(1) + mbTrans205 := thrift.NewMemoryBufferLen(len(arg204)) + defer mbTrans205.Close() + _, err206 := mbTrans205.WriteString(arg204) + if err206 != nil { Usage() return } - factory208 := thrift.NewSimpleJSONProtocolFactory() - jsProt209 := factory208.GetProtocol(mbTrans206) + factory207 := thrift.NewSimpleJSONProtocolFactory() + jsProt208 := factory207.GetProtocol(mbTrans205) argvalue0 := storage.NewKVRemoveRequest() - err210 := argvalue0.Read(jsProt209) - if err210 != nil { + err209 := argvalue0.Read(jsProt208) + if err209 != nil { Usage() return } diff --git a/nebula/storage/graphstorageservice.go b/nebula/storage/graphstorageservice.go index 266282f7..56795ba4 100644 --- a/nebula/storage/graphstorageservice.go +++ b/nebula/storage/graphstorageservice.go @@ -54,10 +54,10 @@ type GraphStorageService interface { UpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, err error) // Parameters: // - Req - ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanVertexResponse, err error) + ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanResponse, err error) // Parameters: // - Req - ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) + ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanResponse, err error) // Parameters: // - Req GetUUID(ctx context.Context, req *GetUUIDReq) (_r *GetUUIDResp, err error) @@ -115,10 +115,10 @@ type GraphStorageServiceClientInterface interface { UpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) // Parameters: // - Req - ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) + ScanVertex(req *ScanVertexRequest) (_r *ScanResponse, err error) // Parameters: // - Req - ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) + ScanEdge(req *ScanEdgeRequest) (_r *ScanResponse, err error) // Parameters: // - Req GetUUID(req *GetUUIDReq) (_r *GetUUIDResp, err error) @@ -356,7 +356,7 @@ func (p *GraphStorageServiceClient) recvUpdateEdge() (value *UpdateResponse, err // Parameters: // - Req -func (p *GraphStorageServiceClient) ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { +func (p *GraphStorageServiceClient) ScanVertex(req *ScanVertexRequest) (_r *ScanResponse, err error) { args := GraphStorageServiceScanVertexArgs{ Req : req, } @@ -366,7 +366,7 @@ func (p *GraphStorageServiceClient) ScanVertex(req *ScanVertexRequest) (_r *Scan } -func (p *GraphStorageServiceClient) recvScanVertex() (value *ScanVertexResponse, err error) { +func (p *GraphStorageServiceClient) recvScanVertex() (value *ScanResponse, err error) { var result GraphStorageServiceScanVertexResult err = p.CC.RecvMsg("scanVertex", &result) if err != nil { return } @@ -376,7 +376,7 @@ func (p *GraphStorageServiceClient) recvScanVertex() (value *ScanVertexResponse, // Parameters: // - Req -func (p *GraphStorageServiceClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { +func (p *GraphStorageServiceClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanResponse, err error) { args := GraphStorageServiceScanEdgeArgs{ Req : req, } @@ -386,7 +386,7 @@ func (p *GraphStorageServiceClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanEdge } -func (p *GraphStorageServiceClient) recvScanEdge() (value *ScanEdgeResponse, err error) { +func (p *GraphStorageServiceClient) recvScanEdge() (value *ScanResponse, err error) { var result GraphStorageServiceScanEdgeResult err = p.CC.RecvMsg("scanEdge", &result) if err != nil { return } @@ -791,7 +791,7 @@ func (p *GraphStorageServiceThreadsafeClient) recvUpdateEdge() (value *UpdateRes // Parameters: // - Req -func (p *GraphStorageServiceThreadsafeClient) ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { +func (p *GraphStorageServiceThreadsafeClient) ScanVertex(req *ScanVertexRequest) (_r *ScanResponse, err error) { p.Mu.Lock() defer p.Mu.Unlock() args := GraphStorageServiceScanVertexArgs{ @@ -803,7 +803,7 @@ func (p *GraphStorageServiceThreadsafeClient) ScanVertex(req *ScanVertexRequest) } -func (p *GraphStorageServiceThreadsafeClient) recvScanVertex() (value *ScanVertexResponse, err error) { +func (p *GraphStorageServiceThreadsafeClient) recvScanVertex() (value *ScanResponse, err error) { var result GraphStorageServiceScanVertexResult err = p.CC.RecvMsg("scanVertex", &result) if err != nil { return } @@ -813,7 +813,7 @@ func (p *GraphStorageServiceThreadsafeClient) recvScanVertex() (value *ScanVerte // Parameters: // - Req -func (p *GraphStorageServiceThreadsafeClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { +func (p *GraphStorageServiceThreadsafeClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanResponse, err error) { p.Mu.Lock() defer p.Mu.Unlock() args := GraphStorageServiceScanEdgeArgs{ @@ -825,7 +825,7 @@ func (p *GraphStorageServiceThreadsafeClient) ScanEdge(req *ScanEdgeRequest) (_r } -func (p *GraphStorageServiceThreadsafeClient) recvScanEdge() (value *ScanEdgeResponse, err error) { +func (p *GraphStorageServiceThreadsafeClient) recvScanEdge() (value *ScanResponse, err error) { var result GraphStorageServiceScanEdgeResult err = p.CC.RecvMsg("scanEdge", &result) if err != nil { return } @@ -1149,7 +1149,7 @@ func (p *GraphStorageServiceChannelClient) UpdateEdge(ctx context.Context, req * // Parameters: // - Req -func (p *GraphStorageServiceChannelClient) ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { +func (p *GraphStorageServiceChannelClient) ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanResponse, err error) { args := GraphStorageServiceScanVertexArgs{ Req : req, } @@ -1162,7 +1162,7 @@ func (p *GraphStorageServiceChannelClient) ScanVertex(ctx context.Context, req * // Parameters: // - Req -func (p *GraphStorageServiceChannelClient) ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { +func (p *GraphStorageServiceChannelClient) ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanResponse, err error) { args := GraphStorageServiceScanEdgeArgs{ Req : req, } @@ -1299,27 +1299,27 @@ func (p *GraphStorageServiceProcessor) ProcessorMap() map[string]thrift.Processo } func NewGraphStorageServiceProcessor(handler GraphStorageService) *GraphStorageServiceProcessor { - self95 := &GraphStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} - self95.processorMap["getNeighbors"] = &graphStorageServiceProcessorGetNeighbors{handler:handler} - self95.processorMap["getProps"] = &graphStorageServiceProcessorGetProps{handler:handler} - self95.processorMap["addVertices"] = &graphStorageServiceProcessorAddVertices{handler:handler} - self95.processorMap["addEdges"] = &graphStorageServiceProcessorAddEdges{handler:handler} - self95.processorMap["deleteEdges"] = &graphStorageServiceProcessorDeleteEdges{handler:handler} - self95.processorMap["deleteVertices"] = &graphStorageServiceProcessorDeleteVertices{handler:handler} - self95.processorMap["deleteTags"] = &graphStorageServiceProcessorDeleteTags{handler:handler} - self95.processorMap["updateVertex"] = &graphStorageServiceProcessorUpdateVertex{handler:handler} - self95.processorMap["updateEdge"] = &graphStorageServiceProcessorUpdateEdge{handler:handler} - self95.processorMap["scanVertex"] = &graphStorageServiceProcessorScanVertex{handler:handler} - self95.processorMap["scanEdge"] = &graphStorageServiceProcessorScanEdge{handler:handler} - self95.processorMap["getUUID"] = &graphStorageServiceProcessorGetUUID{handler:handler} - self95.processorMap["lookupIndex"] = &graphStorageServiceProcessorLookupIndex{handler:handler} - self95.processorMap["lookupAndTraverse"] = &graphStorageServiceProcessorLookupAndTraverse{handler:handler} - self95.processorMap["chainUpdateEdge"] = &graphStorageServiceProcessorChainUpdateEdge{handler:handler} - self95.processorMap["chainAddEdges"] = &graphStorageServiceProcessorChainAddEdges{handler:handler} - self95.processorMap["get"] = &graphStorageServiceProcessorGet{handler:handler} - self95.processorMap["put"] = &graphStorageServiceProcessorPut{handler:handler} - self95.processorMap["remove"] = &graphStorageServiceProcessorRemove{handler:handler} - return self95 + self94 := &GraphStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self94.processorMap["getNeighbors"] = &graphStorageServiceProcessorGetNeighbors{handler:handler} + self94.processorMap["getProps"] = &graphStorageServiceProcessorGetProps{handler:handler} + self94.processorMap["addVertices"] = &graphStorageServiceProcessorAddVertices{handler:handler} + self94.processorMap["addEdges"] = &graphStorageServiceProcessorAddEdges{handler:handler} + self94.processorMap["deleteEdges"] = &graphStorageServiceProcessorDeleteEdges{handler:handler} + self94.processorMap["deleteVertices"] = &graphStorageServiceProcessorDeleteVertices{handler:handler} + self94.processorMap["deleteTags"] = &graphStorageServiceProcessorDeleteTags{handler:handler} + self94.processorMap["updateVertex"] = &graphStorageServiceProcessorUpdateVertex{handler:handler} + self94.processorMap["updateEdge"] = &graphStorageServiceProcessorUpdateEdge{handler:handler} + self94.processorMap["scanVertex"] = &graphStorageServiceProcessorScanVertex{handler:handler} + self94.processorMap["scanEdge"] = &graphStorageServiceProcessorScanEdge{handler:handler} + self94.processorMap["getUUID"] = &graphStorageServiceProcessorGetUUID{handler:handler} + self94.processorMap["lookupIndex"] = &graphStorageServiceProcessorLookupIndex{handler:handler} + self94.processorMap["lookupAndTraverse"] = &graphStorageServiceProcessorLookupAndTraverse{handler:handler} + self94.processorMap["chainUpdateEdge"] = &graphStorageServiceProcessorChainUpdateEdge{handler:handler} + self94.processorMap["chainAddEdges"] = &graphStorageServiceProcessorChainAddEdges{handler:handler} + self94.processorMap["get"] = &graphStorageServiceProcessorGet{handler:handler} + self94.processorMap["put"] = &graphStorageServiceProcessorPut{handler:handler} + self94.processorMap["remove"] = &graphStorageServiceProcessorRemove{handler:handler} + return self94 } type graphStorageServiceProcessorGetNeighbors struct { @@ -4179,15 +4179,15 @@ func (p *GraphStorageServiceScanVertexArgs) String() string { // - Success type GraphStorageServiceScanVertexResult struct { thrift.IResponse - Success *ScanVertexResponse `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *ScanResponse `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewGraphStorageServiceScanVertexResult() *GraphStorageServiceScanVertexResult { return &GraphStorageServiceScanVertexResult{} } -var GraphStorageServiceScanVertexResult_Success_DEFAULT *ScanVertexResponse -func (p *GraphStorageServiceScanVertexResult) GetSuccess() *ScanVertexResponse { +var GraphStorageServiceScanVertexResult_Success_DEFAULT *ScanResponse +func (p *GraphStorageServiceScanVertexResult) GetSuccess() *ScanResponse { if !p.IsSetSuccess() { return GraphStorageServiceScanVertexResult_Success_DEFAULT } @@ -4230,7 +4230,7 @@ func (p *GraphStorageServiceScanVertexResult) Read(iprot thrift.Protocol) error } func (p *GraphStorageServiceScanVertexResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewScanVertexResponse() + p.Success = NewScanResponse() if err := p.Success.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) } @@ -4379,15 +4379,15 @@ func (p *GraphStorageServiceScanEdgeArgs) String() string { // - Success type GraphStorageServiceScanEdgeResult struct { thrift.IResponse - Success *ScanEdgeResponse `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *ScanResponse `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewGraphStorageServiceScanEdgeResult() *GraphStorageServiceScanEdgeResult { return &GraphStorageServiceScanEdgeResult{} } -var GraphStorageServiceScanEdgeResult_Success_DEFAULT *ScanEdgeResponse -func (p *GraphStorageServiceScanEdgeResult) GetSuccess() *ScanEdgeResponse { +var GraphStorageServiceScanEdgeResult_Success_DEFAULT *ScanResponse +func (p *GraphStorageServiceScanEdgeResult) GetSuccess() *ScanResponse { if !p.IsSetSuccess() { return GraphStorageServiceScanEdgeResult_Success_DEFAULT } @@ -4430,7 +4430,7 @@ func (p *GraphStorageServiceScanEdgeResult) Read(iprot thrift.Protocol) error { } func (p *GraphStorageServiceScanEdgeResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewScanEdgeResponse() + p.Success = NewScanResponse() if err := p.Success.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) } diff --git a/nebula/storage/storage_admin_service-remote/storage_admin_service-remote.go b/nebula/storage/storage_admin_service-remote/storage_admin_service-remote.go index 40b1be30..45836f6f 100755 --- a/nebula/storage/storage_admin_service-remote/storage_admin_service-remote.go +++ b/nebula/storage/storage_admin_service-remote/storage_admin_service-remote.go @@ -136,19 +136,19 @@ func main() { fmt.Fprintln(os.Stderr, "TransLeader requires 1 args") flag.Usage() } - arg213 := flag.Arg(1) - mbTrans214 := thrift.NewMemoryBufferLen(len(arg213)) - defer mbTrans214.Close() - _, err215 := mbTrans214.WriteString(arg213) - if err215 != nil { + arg212 := flag.Arg(1) + mbTrans213 := thrift.NewMemoryBufferLen(len(arg212)) + defer mbTrans213.Close() + _, err214 := mbTrans213.WriteString(arg212) + if err214 != nil { Usage() return } - factory216 := thrift.NewSimpleJSONProtocolFactory() - jsProt217 := factory216.GetProtocol(mbTrans214) + factory215 := thrift.NewSimpleJSONProtocolFactory() + jsProt216 := factory215.GetProtocol(mbTrans213) argvalue0 := storage.NewTransLeaderReq() - err218 := argvalue0.Read(jsProt217) - if err218 != nil { + err217 := argvalue0.Read(jsProt216) + if err217 != nil { Usage() return } @@ -161,19 +161,19 @@ func main() { fmt.Fprintln(os.Stderr, "AddPart requires 1 args") flag.Usage() } - arg219 := flag.Arg(1) - mbTrans220 := thrift.NewMemoryBufferLen(len(arg219)) - defer mbTrans220.Close() - _, err221 := mbTrans220.WriteString(arg219) - if err221 != nil { + arg218 := flag.Arg(1) + mbTrans219 := thrift.NewMemoryBufferLen(len(arg218)) + defer mbTrans219.Close() + _, err220 := mbTrans219.WriteString(arg218) + if err220 != nil { Usage() return } - factory222 := thrift.NewSimpleJSONProtocolFactory() - jsProt223 := factory222.GetProtocol(mbTrans220) + factory221 := thrift.NewSimpleJSONProtocolFactory() + jsProt222 := factory221.GetProtocol(mbTrans219) argvalue0 := storage.NewAddPartReq() - err224 := argvalue0.Read(jsProt223) - if err224 != nil { + err223 := argvalue0.Read(jsProt222) + if err223 != nil { Usage() return } @@ -186,19 +186,19 @@ func main() { fmt.Fprintln(os.Stderr, "AddLearner requires 1 args") flag.Usage() } - arg225 := flag.Arg(1) - mbTrans226 := thrift.NewMemoryBufferLen(len(arg225)) - defer mbTrans226.Close() - _, err227 := mbTrans226.WriteString(arg225) - if err227 != nil { + arg224 := flag.Arg(1) + mbTrans225 := thrift.NewMemoryBufferLen(len(arg224)) + defer mbTrans225.Close() + _, err226 := mbTrans225.WriteString(arg224) + if err226 != nil { Usage() return } - factory228 := thrift.NewSimpleJSONProtocolFactory() - jsProt229 := factory228.GetProtocol(mbTrans226) + factory227 := thrift.NewSimpleJSONProtocolFactory() + jsProt228 := factory227.GetProtocol(mbTrans225) argvalue0 := storage.NewAddLearnerReq() - err230 := argvalue0.Read(jsProt229) - if err230 != nil { + err229 := argvalue0.Read(jsProt228) + if err229 != nil { Usage() return } @@ -211,19 +211,19 @@ func main() { fmt.Fprintln(os.Stderr, "RemovePart requires 1 args") flag.Usage() } - arg231 := flag.Arg(1) - mbTrans232 := thrift.NewMemoryBufferLen(len(arg231)) - defer mbTrans232.Close() - _, err233 := mbTrans232.WriteString(arg231) - if err233 != nil { + arg230 := flag.Arg(1) + mbTrans231 := thrift.NewMemoryBufferLen(len(arg230)) + defer mbTrans231.Close() + _, err232 := mbTrans231.WriteString(arg230) + if err232 != nil { Usage() return } - factory234 := thrift.NewSimpleJSONProtocolFactory() - jsProt235 := factory234.GetProtocol(mbTrans232) + factory233 := thrift.NewSimpleJSONProtocolFactory() + jsProt234 := factory233.GetProtocol(mbTrans231) argvalue0 := storage.NewRemovePartReq() - err236 := argvalue0.Read(jsProt235) - if err236 != nil { + err235 := argvalue0.Read(jsProt234) + if err235 != nil { Usage() return } @@ -236,19 +236,19 @@ func main() { fmt.Fprintln(os.Stderr, "MemberChange requires 1 args") flag.Usage() } - arg237 := flag.Arg(1) - mbTrans238 := thrift.NewMemoryBufferLen(len(arg237)) - defer mbTrans238.Close() - _, err239 := mbTrans238.WriteString(arg237) - if err239 != nil { + arg236 := flag.Arg(1) + mbTrans237 := thrift.NewMemoryBufferLen(len(arg236)) + defer mbTrans237.Close() + _, err238 := mbTrans237.WriteString(arg236) + if err238 != nil { Usage() return } - factory240 := thrift.NewSimpleJSONProtocolFactory() - jsProt241 := factory240.GetProtocol(mbTrans238) + factory239 := thrift.NewSimpleJSONProtocolFactory() + jsProt240 := factory239.GetProtocol(mbTrans237) argvalue0 := storage.NewMemberChangeReq() - err242 := argvalue0.Read(jsProt241) - if err242 != nil { + err241 := argvalue0.Read(jsProt240) + if err241 != nil { Usage() return } @@ -261,19 +261,19 @@ func main() { fmt.Fprintln(os.Stderr, "WaitingForCatchUpData requires 1 args") flag.Usage() } - arg243 := flag.Arg(1) - mbTrans244 := thrift.NewMemoryBufferLen(len(arg243)) - defer mbTrans244.Close() - _, err245 := mbTrans244.WriteString(arg243) - if err245 != nil { + arg242 := flag.Arg(1) + mbTrans243 := thrift.NewMemoryBufferLen(len(arg242)) + defer mbTrans243.Close() + _, err244 := mbTrans243.WriteString(arg242) + if err244 != nil { Usage() return } - factory246 := thrift.NewSimpleJSONProtocolFactory() - jsProt247 := factory246.GetProtocol(mbTrans244) + factory245 := thrift.NewSimpleJSONProtocolFactory() + jsProt246 := factory245.GetProtocol(mbTrans243) argvalue0 := storage.NewCatchUpDataReq() - err248 := argvalue0.Read(jsProt247) - if err248 != nil { + err247 := argvalue0.Read(jsProt246) + if err247 != nil { Usage() return } @@ -286,19 +286,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateCheckpoint requires 1 args") flag.Usage() } - arg249 := flag.Arg(1) - mbTrans250 := thrift.NewMemoryBufferLen(len(arg249)) - defer mbTrans250.Close() - _, err251 := mbTrans250.WriteString(arg249) - if err251 != nil { + arg248 := flag.Arg(1) + mbTrans249 := thrift.NewMemoryBufferLen(len(arg248)) + defer mbTrans249.Close() + _, err250 := mbTrans249.WriteString(arg248) + if err250 != nil { Usage() return } - factory252 := thrift.NewSimpleJSONProtocolFactory() - jsProt253 := factory252.GetProtocol(mbTrans250) + factory251 := thrift.NewSimpleJSONProtocolFactory() + jsProt252 := factory251.GetProtocol(mbTrans249) argvalue0 := storage.NewCreateCPRequest() - err254 := argvalue0.Read(jsProt253) - if err254 != nil { + err253 := argvalue0.Read(jsProt252) + if err253 != nil { Usage() return } @@ -311,19 +311,19 @@ func main() { fmt.Fprintln(os.Stderr, "DropCheckpoint requires 1 args") flag.Usage() } - arg255 := flag.Arg(1) - mbTrans256 := thrift.NewMemoryBufferLen(len(arg255)) - defer mbTrans256.Close() - _, err257 := mbTrans256.WriteString(arg255) - if err257 != nil { + arg254 := flag.Arg(1) + mbTrans255 := thrift.NewMemoryBufferLen(len(arg254)) + defer mbTrans255.Close() + _, err256 := mbTrans255.WriteString(arg254) + if err256 != nil { Usage() return } - factory258 := thrift.NewSimpleJSONProtocolFactory() - jsProt259 := factory258.GetProtocol(mbTrans256) + factory257 := thrift.NewSimpleJSONProtocolFactory() + jsProt258 := factory257.GetProtocol(mbTrans255) argvalue0 := storage.NewDropCPRequest() - err260 := argvalue0.Read(jsProt259) - if err260 != nil { + err259 := argvalue0.Read(jsProt258) + if err259 != nil { Usage() return } @@ -336,19 +336,19 @@ func main() { fmt.Fprintln(os.Stderr, "BlockingWrites requires 1 args") flag.Usage() } - arg261 := flag.Arg(1) - mbTrans262 := thrift.NewMemoryBufferLen(len(arg261)) - defer mbTrans262.Close() - _, err263 := mbTrans262.WriteString(arg261) - if err263 != nil { + arg260 := flag.Arg(1) + mbTrans261 := thrift.NewMemoryBufferLen(len(arg260)) + defer mbTrans261.Close() + _, err262 := mbTrans261.WriteString(arg260) + if err262 != nil { Usage() return } - factory264 := thrift.NewSimpleJSONProtocolFactory() - jsProt265 := factory264.GetProtocol(mbTrans262) + factory263 := thrift.NewSimpleJSONProtocolFactory() + jsProt264 := factory263.GetProtocol(mbTrans261) argvalue0 := storage.NewBlockingSignRequest() - err266 := argvalue0.Read(jsProt265) - if err266 != nil { + err265 := argvalue0.Read(jsProt264) + if err265 != nil { Usage() return } @@ -361,19 +361,19 @@ func main() { fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") flag.Usage() } - arg267 := flag.Arg(1) - mbTrans268 := thrift.NewMemoryBufferLen(len(arg267)) - defer mbTrans268.Close() - _, err269 := mbTrans268.WriteString(arg267) - if err269 != nil { + arg266 := flag.Arg(1) + mbTrans267 := thrift.NewMemoryBufferLen(len(arg266)) + defer mbTrans267.Close() + _, err268 := mbTrans267.WriteString(arg266) + if err268 != nil { Usage() return } - factory270 := thrift.NewSimpleJSONProtocolFactory() - jsProt271 := factory270.GetProtocol(mbTrans268) + factory269 := thrift.NewSimpleJSONProtocolFactory() + jsProt270 := factory269.GetProtocol(mbTrans267) argvalue0 := storage.NewRebuildIndexRequest() - err272 := argvalue0.Read(jsProt271) - if err272 != nil { + err271 := argvalue0.Read(jsProt270) + if err271 != nil { Usage() return } @@ -386,19 +386,19 @@ func main() { fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") flag.Usage() } - arg273 := flag.Arg(1) - mbTrans274 := thrift.NewMemoryBufferLen(len(arg273)) - defer mbTrans274.Close() - _, err275 := mbTrans274.WriteString(arg273) - if err275 != nil { + arg272 := flag.Arg(1) + mbTrans273 := thrift.NewMemoryBufferLen(len(arg272)) + defer mbTrans273.Close() + _, err274 := mbTrans273.WriteString(arg272) + if err274 != nil { Usage() return } - factory276 := thrift.NewSimpleJSONProtocolFactory() - jsProt277 := factory276.GetProtocol(mbTrans274) + factory275 := thrift.NewSimpleJSONProtocolFactory() + jsProt276 := factory275.GetProtocol(mbTrans273) argvalue0 := storage.NewRebuildIndexRequest() - err278 := argvalue0.Read(jsProt277) - if err278 != nil { + err277 := argvalue0.Read(jsProt276) + if err277 != nil { Usage() return } @@ -411,19 +411,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetLeaderParts requires 1 args") flag.Usage() } - arg279 := flag.Arg(1) - mbTrans280 := thrift.NewMemoryBufferLen(len(arg279)) - defer mbTrans280.Close() - _, err281 := mbTrans280.WriteString(arg279) - if err281 != nil { + arg278 := flag.Arg(1) + mbTrans279 := thrift.NewMemoryBufferLen(len(arg278)) + defer mbTrans279.Close() + _, err280 := mbTrans279.WriteString(arg278) + if err280 != nil { Usage() return } - factory282 := thrift.NewSimpleJSONProtocolFactory() - jsProt283 := factory282.GetProtocol(mbTrans280) + factory281 := thrift.NewSimpleJSONProtocolFactory() + jsProt282 := factory281.GetProtocol(mbTrans279) argvalue0 := storage.NewGetLeaderReq() - err284 := argvalue0.Read(jsProt283) - if err284 != nil { + err283 := argvalue0.Read(jsProt282) + if err283 != nil { Usage() return } @@ -436,19 +436,19 @@ func main() { fmt.Fprintln(os.Stderr, "CheckPeers requires 1 args") flag.Usage() } - arg285 := flag.Arg(1) - mbTrans286 := thrift.NewMemoryBufferLen(len(arg285)) - defer mbTrans286.Close() - _, err287 := mbTrans286.WriteString(arg285) - if err287 != nil { + arg284 := flag.Arg(1) + mbTrans285 := thrift.NewMemoryBufferLen(len(arg284)) + defer mbTrans285.Close() + _, err286 := mbTrans285.WriteString(arg284) + if err286 != nil { Usage() return } - factory288 := thrift.NewSimpleJSONProtocolFactory() - jsProt289 := factory288.GetProtocol(mbTrans286) + factory287 := thrift.NewSimpleJSONProtocolFactory() + jsProt288 := factory287.GetProtocol(mbTrans285) argvalue0 := storage.NewCheckPeersReq() - err290 := argvalue0.Read(jsProt289) - if err290 != nil { + err289 := argvalue0.Read(jsProt288) + if err289 != nil { Usage() return } @@ -461,19 +461,19 @@ func main() { fmt.Fprintln(os.Stderr, "AddAdminTask requires 1 args") flag.Usage() } - arg291 := flag.Arg(1) - mbTrans292 := thrift.NewMemoryBufferLen(len(arg291)) - defer mbTrans292.Close() - _, err293 := mbTrans292.WriteString(arg291) - if err293 != nil { + arg290 := flag.Arg(1) + mbTrans291 := thrift.NewMemoryBufferLen(len(arg290)) + defer mbTrans291.Close() + _, err292 := mbTrans291.WriteString(arg290) + if err292 != nil { Usage() return } - factory294 := thrift.NewSimpleJSONProtocolFactory() - jsProt295 := factory294.GetProtocol(mbTrans292) + factory293 := thrift.NewSimpleJSONProtocolFactory() + jsProt294 := factory293.GetProtocol(mbTrans291) argvalue0 := storage.NewAddAdminTaskRequest() - err296 := argvalue0.Read(jsProt295) - if err296 != nil { + err295 := argvalue0.Read(jsProt294) + if err295 != nil { Usage() return } @@ -486,19 +486,19 @@ func main() { fmt.Fprintln(os.Stderr, "StopAdminTask requires 1 args") flag.Usage() } - arg297 := flag.Arg(1) - mbTrans298 := thrift.NewMemoryBufferLen(len(arg297)) - defer mbTrans298.Close() - _, err299 := mbTrans298.WriteString(arg297) - if err299 != nil { + arg296 := flag.Arg(1) + mbTrans297 := thrift.NewMemoryBufferLen(len(arg296)) + defer mbTrans297.Close() + _, err298 := mbTrans297.WriteString(arg296) + if err298 != nil { Usage() return } - factory300 := thrift.NewSimpleJSONProtocolFactory() - jsProt301 := factory300.GetProtocol(mbTrans298) + factory299 := thrift.NewSimpleJSONProtocolFactory() + jsProt300 := factory299.GetProtocol(mbTrans297) argvalue0 := storage.NewStopAdminTaskRequest() - err302 := argvalue0.Read(jsProt301) - if err302 != nil { + err301 := argvalue0.Read(jsProt300) + if err301 != nil { Usage() return } @@ -511,19 +511,19 @@ func main() { fmt.Fprintln(os.Stderr, "ListClusterInfo requires 1 args") flag.Usage() } - arg303 := flag.Arg(1) - mbTrans304 := thrift.NewMemoryBufferLen(len(arg303)) - defer mbTrans304.Close() - _, err305 := mbTrans304.WriteString(arg303) - if err305 != nil { + arg302 := flag.Arg(1) + mbTrans303 := thrift.NewMemoryBufferLen(len(arg302)) + defer mbTrans303.Close() + _, err304 := mbTrans303.WriteString(arg302) + if err304 != nil { Usage() return } - factory306 := thrift.NewSimpleJSONProtocolFactory() - jsProt307 := factory306.GetProtocol(mbTrans304) + factory305 := thrift.NewSimpleJSONProtocolFactory() + jsProt306 := factory305.GetProtocol(mbTrans303) argvalue0 := storage.NewListClusterInfoReq() - err308 := argvalue0.Read(jsProt307) - if err308 != nil { + err307 := argvalue0.Read(jsProt306) + if err307 != nil { Usage() return } diff --git a/nebula/storage/storageadminservice.go b/nebula/storage/storageadminservice.go index 683423c1..40f8dcd0 100644 --- a/nebula/storage/storageadminservice.go +++ b/nebula/storage/storageadminservice.go @@ -1116,24 +1116,24 @@ func (p *StorageAdminServiceProcessor) ProcessorMap() map[string]thrift.Processo } func NewStorageAdminServiceProcessor(handler StorageAdminService) *StorageAdminServiceProcessor { - self211 := &StorageAdminServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} - self211.processorMap["transLeader"] = &storageAdminServiceProcessorTransLeader{handler:handler} - self211.processorMap["addPart"] = &storageAdminServiceProcessorAddPart{handler:handler} - self211.processorMap["addLearner"] = &storageAdminServiceProcessorAddLearner{handler:handler} - self211.processorMap["removePart"] = &storageAdminServiceProcessorRemovePart{handler:handler} - self211.processorMap["memberChange"] = &storageAdminServiceProcessorMemberChange{handler:handler} - self211.processorMap["waitingForCatchUpData"] = &storageAdminServiceProcessorWaitingForCatchUpData{handler:handler} - self211.processorMap["createCheckpoint"] = &storageAdminServiceProcessorCreateCheckpoint{handler:handler} - self211.processorMap["dropCheckpoint"] = &storageAdminServiceProcessorDropCheckpoint{handler:handler} - self211.processorMap["blockingWrites"] = &storageAdminServiceProcessorBlockingWrites{handler:handler} - self211.processorMap["rebuildTagIndex"] = &storageAdminServiceProcessorRebuildTagIndex{handler:handler} - self211.processorMap["rebuildEdgeIndex"] = &storageAdminServiceProcessorRebuildEdgeIndex{handler:handler} - self211.processorMap["getLeaderParts"] = &storageAdminServiceProcessorGetLeaderParts{handler:handler} - self211.processorMap["checkPeers"] = &storageAdminServiceProcessorCheckPeers{handler:handler} - self211.processorMap["addAdminTask"] = &storageAdminServiceProcessorAddAdminTask{handler:handler} - self211.processorMap["stopAdminTask"] = &storageAdminServiceProcessorStopAdminTask{handler:handler} - self211.processorMap["listClusterInfo"] = &storageAdminServiceProcessorListClusterInfo{handler:handler} - return self211 + self210 := &StorageAdminServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self210.processorMap["transLeader"] = &storageAdminServiceProcessorTransLeader{handler:handler} + self210.processorMap["addPart"] = &storageAdminServiceProcessorAddPart{handler:handler} + self210.processorMap["addLearner"] = &storageAdminServiceProcessorAddLearner{handler:handler} + self210.processorMap["removePart"] = &storageAdminServiceProcessorRemovePart{handler:handler} + self210.processorMap["memberChange"] = &storageAdminServiceProcessorMemberChange{handler:handler} + self210.processorMap["waitingForCatchUpData"] = &storageAdminServiceProcessorWaitingForCatchUpData{handler:handler} + self210.processorMap["createCheckpoint"] = &storageAdminServiceProcessorCreateCheckpoint{handler:handler} + self210.processorMap["dropCheckpoint"] = &storageAdminServiceProcessorDropCheckpoint{handler:handler} + self210.processorMap["blockingWrites"] = &storageAdminServiceProcessorBlockingWrites{handler:handler} + self210.processorMap["rebuildTagIndex"] = &storageAdminServiceProcessorRebuildTagIndex{handler:handler} + self210.processorMap["rebuildEdgeIndex"] = &storageAdminServiceProcessorRebuildEdgeIndex{handler:handler} + self210.processorMap["getLeaderParts"] = &storageAdminServiceProcessorGetLeaderParts{handler:handler} + self210.processorMap["checkPeers"] = &storageAdminServiceProcessorCheckPeers{handler:handler} + self210.processorMap["addAdminTask"] = &storageAdminServiceProcessorAddAdminTask{handler:handler} + self210.processorMap["stopAdminTask"] = &storageAdminServiceProcessorStopAdminTask{handler:handler} + self210.processorMap["listClusterInfo"] = &storageAdminServiceProcessorListClusterInfo{handler:handler} + return self210 } type storageAdminServiceProcessorTransLeader struct { diff --git a/nebula/storage/ttypes.go b/nebula/storage/ttypes.go index b94888c2..9ce98b48 100644 --- a/nebula/storage/ttypes.go +++ b/nebula/storage/ttypes.go @@ -3986,13 +3986,15 @@ func (p *NewEdge_) String() string { // - Parts // - PropNames // - IfNotExists +// - IgnoreExistedIndex // - Common type AddVerticesRequest struct { SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` Parts map[nebula0.PartitionID][]*NewVertex_ `thrift:"parts,2" db:"parts" json:"parts"` PropNames map[nebula0.TagID][][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` - Common *RequestCommon `thrift:"common,5" db:"common" json:"common,omitempty"` + IgnoreExistedIndex bool `thrift:"ignore_existed_index,5" db:"ignore_existed_index" json:"ignore_existed_index"` + Common *RequestCommon `thrift:"common,6" db:"common" json:"common,omitempty"` } func NewAddVerticesRequest() *AddVerticesRequest { @@ -4015,6 +4017,10 @@ func (p *AddVerticesRequest) GetPropNames() map[nebula0.TagID][][]byte { func (p *AddVerticesRequest) GetIfNotExists() bool { return p.IfNotExists } + +func (p *AddVerticesRequest) GetIgnoreExistedIndex() bool { + return p.IgnoreExistedIndex +} var AddVerticesRequest_Common_DEFAULT *RequestCommon func (p *AddVerticesRequest) GetCommon() *RequestCommon { if !p.IsSetCommon() { @@ -4059,6 +4065,10 @@ func (p *AddVerticesRequest) Read(iprot thrift.Protocol) error { if err := p.ReadField5(iprot); err != nil { return err } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -4174,6 +4184,15 @@ func (p *AddVerticesRequest) ReadField4(iprot thrift.Protocol) error { } func (p *AddVerticesRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IgnoreExistedIndex = v +} + return nil +} + +func (p *AddVerticesRequest) ReadField6(iprot thrift.Protocol) error { p.Common = NewRequestCommon() if err := p.Common.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) @@ -4189,6 +4208,7 @@ func (p *AddVerticesRequest) Write(oprot thrift.Protocol) error { 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 { @@ -4274,14 +4294,24 @@ func (p *AddVerticesRequest) writeField4(oprot thrift.Protocol) (err error) { } func (p *AddVerticesRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ignore_existed_index", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ignore_existed_index: ", p), err) } + if err := oprot.WriteBool(bool(p.IgnoreExistedIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ignore_existed_index (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ignore_existed_index: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField6(oprot thrift.Protocol) (err error) { if p.IsSetCommon() { - if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:common: ", p), err) } + if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:common: ", p), err) } if err := p.Common.Write(oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:common: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:common: ", p), err) } } return err } @@ -4295,13 +4325,14 @@ func (p *AddVerticesRequest) String() string { partsVal := fmt.Sprintf("%v", p.Parts) propNamesVal := fmt.Sprintf("%v", p.PropNames) ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + ignoreExistedIndexVal := fmt.Sprintf("%v", p.IgnoreExistedIndex) var commonVal string if p.Common == nil { commonVal = "" } else { commonVal = fmt.Sprintf("%v", p.Common) } - return fmt.Sprintf("AddVerticesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s Common:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal, commonVal) + return fmt.Sprintf("AddVerticesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s IgnoreExistedIndex:%s Common:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal, ignoreExistedIndexVal, commonVal) } // Attributes: @@ -4309,13 +4340,15 @@ func (p *AddVerticesRequest) String() string { // - Parts // - PropNames // - IfNotExists +// - IgnoreExistedIndex // - Common type AddEdgesRequest struct { SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` Parts map[nebula0.PartitionID][]*NewEdge_ `thrift:"parts,2" db:"parts" json:"parts"` PropNames [][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` - Common *RequestCommon `thrift:"common,5" db:"common" json:"common,omitempty"` + IgnoreExistedIndex bool `thrift:"ignore_existed_index,5" db:"ignore_existed_index" json:"ignore_existed_index"` + Common *RequestCommon `thrift:"common,6" db:"common" json:"common,omitempty"` } func NewAddEdgesRequest() *AddEdgesRequest { @@ -4338,6 +4371,10 @@ func (p *AddEdgesRequest) GetPropNames() [][]byte { func (p *AddEdgesRequest) GetIfNotExists() bool { return p.IfNotExists } + +func (p *AddEdgesRequest) GetIgnoreExistedIndex() bool { + return p.IgnoreExistedIndex +} var AddEdgesRequest_Common_DEFAULT *RequestCommon func (p *AddEdgesRequest) GetCommon() *RequestCommon { if !p.IsSetCommon() { @@ -4382,6 +4419,10 @@ func (p *AddEdgesRequest) Read(iprot thrift.Protocol) error { if err := p.ReadField5(iprot); err != nil { return err } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -4478,6 +4519,15 @@ func (p *AddEdgesRequest) ReadField4(iprot thrift.Protocol) error { } func (p *AddEdgesRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IgnoreExistedIndex = v +} + return nil +} + +func (p *AddEdgesRequest) ReadField6(iprot thrift.Protocol) error { p.Common = NewRequestCommon() if err := p.Common.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) @@ -4493,6 +4543,7 @@ func (p *AddEdgesRequest) Write(oprot thrift.Protocol) error { 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 { @@ -4568,14 +4619,24 @@ func (p *AddEdgesRequest) writeField4(oprot thrift.Protocol) (err error) { } func (p *AddEdgesRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ignore_existed_index", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ignore_existed_index: ", p), err) } + if err := oprot.WriteBool(bool(p.IgnoreExistedIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ignore_existed_index (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ignore_existed_index: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField6(oprot thrift.Protocol) (err error) { if p.IsSetCommon() { - if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:common: ", p), err) } + if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:common: ", p), err) } if err := p.Common.Write(oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:common: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:common: ", p), err) } } return err } @@ -4589,13 +4650,14 @@ func (p *AddEdgesRequest) String() string { partsVal := fmt.Sprintf("%v", p.Parts) propNamesVal := fmt.Sprintf("%v", p.PropNames) ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + ignoreExistedIndexVal := fmt.Sprintf("%v", p.IgnoreExistedIndex) var commonVal string if p.Common == nil { commonVal = "" } else { commonVal = fmt.Sprintf("%v", p.Common) } - return fmt.Sprintf("AddEdgesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s Common:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal, commonVal) + return fmt.Sprintf("AddEdgesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s IgnoreExistedIndex:%s Common:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal, ignoreExistedIndexVal, commonVal) } // Attributes: @@ -8184,22 +8246,15 @@ func (p *LookupAndTraverseRequest) String() string { } // Attributes: -// - HasNext // - NextCursor type ScanCursor struct { - // unused fields # 1 to 2 - HasNext bool `thrift:"has_next,3" db:"has_next" json:"has_next"` - NextCursor []byte `thrift:"next_cursor,4" db:"next_cursor" json:"next_cursor,omitempty"` + NextCursor []byte `thrift:"next_cursor,1" db:"next_cursor" json:"next_cursor,omitempty"` } func NewScanCursor() *ScanCursor { return &ScanCursor{} } - -func (p *ScanCursor) GetHasNext() bool { - return p.HasNext -} var ScanCursor_NextCursor_DEFAULT []byte func (p *ScanCursor) GetNextCursor() []byte { @@ -8222,12 +8277,8 @@ func (p *ScanCursor) Read(iprot thrift.Protocol) error { } if fieldTypeId == thrift.STOP { break; } switch fieldId { - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - case 4: - if err := p.ReadField4(iprot); err != nil { + case 1: + if err := p.ReadField1(iprot); err != nil { return err } default: @@ -8245,18 +8296,9 @@ func (p *ScanCursor) Read(iprot thrift.Protocol) error { return nil } -func (p *ScanCursor) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.HasNext = v -} - return nil -} - -func (p *ScanCursor) ReadField4(iprot thrift.Protocol) error { +func (p *ScanCursor) ReadField1(iprot thrift.Protocol) error { if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 4: ", err) + return thrift.PrependError("error reading field 1: ", err) } else { p.NextCursor = v } @@ -8266,8 +8308,7 @@ func (p *ScanCursor) ReadField4(iprot thrift.Protocol) error { func (p *ScanCursor) Write(oprot thrift.Protocol) error { if err := oprot.WriteStructBegin("ScanCursor"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField1(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } if err := oprot.WriteStructEnd(); err != nil { @@ -8275,24 +8316,14 @@ func (p *ScanCursor) Write(oprot thrift.Protocol) error { return nil } -func (p *ScanCursor) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("has_next", thrift.BOOL, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:has_next: ", p), err) } - if err := oprot.WriteBool(bool(p.HasNext)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.has_next (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:has_next: ", p), err) } - return err -} - -func (p *ScanCursor) writeField4(oprot thrift.Protocol) (err error) { +func (p *ScanCursor) writeField1(oprot thrift.Protocol) (err error) { if p.IsSetNextCursor() { - if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:next_cursor: ", p), err) } + if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:next_cursor: ", p), err) } if err := oprot.WriteBinary(p.NextCursor); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.next_cursor (4) field write error: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T.next_cursor (1) field write error: ", p), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:next_cursor: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:next_cursor: ", p), err) } } return err } @@ -8302,9 +8333,8 @@ func (p *ScanCursor) String() string { return "" } - hasNextVal := fmt.Sprintf("%v", p.HasNext) nextCursorVal := fmt.Sprintf("%v", p.NextCursor) - return fmt.Sprintf("ScanCursor({HasNext:%s NextCursor:%s})", hasNextVal, nextCursorVal) + return fmt.Sprintf("ScanCursor({NextCursor:%s})", nextCursorVal) } // Attributes: @@ -8772,214 +8802,6 @@ func (p *ScanVertexRequest) String() string { return fmt.Sprintf("ScanVertexRequest({SpaceID:%s Parts:%s ReturnColumns:%s Limit:%s StartTime:%s EndTime:%s Filter:%s OnlyLatestVersion:%s EnableReadFromFollower:%s Common:%s})", spaceIDVal, partsVal, returnColumnsVal, limitVal, startTimeVal, endTimeVal, filterVal, onlyLatestVersionVal, enableReadFromFollowerVal, commonVal) } -// Attributes: -// - Result_ -// - VertexData -// - Cursors -type ScanVertexResponse struct { - Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` - VertexData *nebula0.DataSet `thrift:"vertex_data,2" db:"vertex_data" json:"vertex_data"` - Cursors map[nebula0.PartitionID]*ScanCursor `thrift:"cursors,3" db:"cursors" json:"cursors"` -} - -func NewScanVertexResponse() *ScanVertexResponse { - return &ScanVertexResponse{ - Result_: NewResponseCommon(), - VertexData: nebula0.NewDataSet(), - } -} - -var ScanVertexResponse_Result__DEFAULT *ResponseCommon -func (p *ScanVertexResponse) GetResult_() *ResponseCommon { - if !p.IsSetResult_() { - return ScanVertexResponse_Result__DEFAULT - } -return p.Result_ -} -var ScanVertexResponse_VertexData_DEFAULT *nebula0.DataSet -func (p *ScanVertexResponse) GetVertexData() *nebula0.DataSet { - if !p.IsSetVertexData() { - return ScanVertexResponse_VertexData_DEFAULT - } -return p.VertexData -} - -func (p *ScanVertexResponse) GetCursors() map[nebula0.PartitionID]*ScanCursor { - return p.Cursors -} -func (p *ScanVertexResponse) IsSetResult_() bool { - return p != nil && p.Result_ != nil -} - -func (p *ScanVertexResponse) IsSetVertexData() bool { - return p != nil && p.VertexData != nil -} - -func (p *ScanVertexResponse) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetResult_ bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - issetResult_ = true - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetResult_{ - return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); - } - return nil -} - -func (p *ScanVertexResponse) ReadField1(iprot thrift.Protocol) error { - p.Result_ = NewResponseCommon() - if err := p.Result_.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) - } - return nil -} - -func (p *ScanVertexResponse) ReadField2(iprot thrift.Protocol) error { - p.VertexData = nebula0.NewDataSet() - if err := p.VertexData.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VertexData), err) - } - return nil -} - -func (p *ScanVertexResponse) ReadField3(iprot thrift.Protocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[nebula0.PartitionID]*ScanCursor, size) - p.Cursors = tMap - for i := 0; i < size; i ++ { -var _key59 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - temp := nebula0.PartitionID(v) - _key59 = temp -} - _val60 := NewScanCursor() - if err := _val60.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val60), err) - } - p.Cursors[_key59] = _val60 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *ScanVertexResponse) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ScanVertexResponse"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return 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 *ScanVertexResponse) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:result: ", p), err) } - if err := p.Result_.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } - return err -} - -func (p *ScanVertexResponse) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("vertex_data", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vertex_data: ", p), err) } - if err := p.VertexData.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VertexData), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vertex_data: ", p), err) } - return err -} - -func (p *ScanVertexResponse) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("cursors", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursors: ", p), err) } - if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.Cursors)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.Cursors { - 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.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursors: ", p), err) } - return err -} - -func (p *ScanVertexResponse) String() string { - if p == nil { - return "" - } - - var resultVal string - if p.Result_ == nil { - resultVal = "" - } else { - resultVal = fmt.Sprintf("%v", p.Result_) - } - var vertexDataVal string - if p.VertexData == nil { - vertexDataVal = "" - } else { - vertexDataVal = fmt.Sprintf("%v", p.VertexData) - } - cursorsVal := fmt.Sprintf("%v", p.Cursors) - return fmt.Sprintf("ScanVertexResponse({Result_:%s VertexData:%s Cursors:%s})", resultVal, vertexDataVal, cursorsVal) -} - // Attributes: // - SpaceID // - Parts @@ -8994,7 +8816,7 @@ func (p *ScanVertexResponse) String() string { type ScanEdgeRequest struct { SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` Parts map[nebula0.PartitionID]*ScanCursor `thrift:"parts,2" db:"parts" json:"parts"` - ReturnColumns *EdgeProp `thrift:"return_columns,3" db:"return_columns" json:"return_columns"` + ReturnColumns []*EdgeProp `thrift:"return_columns,3" db:"return_columns" json:"return_columns"` Limit int64 `thrift:"limit,4" db:"limit" json:"limit"` StartTime *int64 `thrift:"start_time,5" db:"start_time" json:"start_time,omitempty"` EndTime *int64 `thrift:"end_time,6" db:"end_time" json:"end_time,omitempty"` @@ -9006,7 +8828,6 @@ type ScanEdgeRequest struct { func NewScanEdgeRequest() *ScanEdgeRequest { return &ScanEdgeRequest{ - ReturnColumns: NewEdgeProp(), EnableReadFromFollower: true, } } @@ -9019,12 +8840,9 @@ func (p *ScanEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { func (p *ScanEdgeRequest) GetParts() map[nebula0.PartitionID]*ScanCursor { return p.Parts } -var ScanEdgeRequest_ReturnColumns_DEFAULT *EdgeProp -func (p *ScanEdgeRequest) GetReturnColumns() *EdgeProp { - if !p.IsSetReturnColumns() { - return ScanEdgeRequest_ReturnColumns_DEFAULT - } -return p.ReturnColumns + +func (p *ScanEdgeRequest) GetReturnColumns() []*EdgeProp { + return p.ReturnColumns } func (p *ScanEdgeRequest) GetLimit() int64 { @@ -9064,10 +8882,6 @@ func (p *ScanEdgeRequest) GetCommon() *RequestCommon { } return p.Common } -func (p *ScanEdgeRequest) IsSetReturnColumns() bool { - return p != nil && p.ReturnColumns != nil -} - func (p *ScanEdgeRequest) IsSetStartTime() bool { return p != nil && p.StartTime != nil } @@ -9170,18 +8984,18 @@ func (p *ScanEdgeRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID]*ScanCursor, size) p.Parts = tMap for i := 0; i < size; i ++ { -var _key61 nebula0.PartitionID +var _key59 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key61 = temp + _key59 = temp } - _val62 := NewScanCursor() - if err := _val62.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val62), err) + _val60 := NewScanCursor() + if err := _val60.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val60), err) } - p.Parts[_key61] = _val62 + p.Parts[_key59] = _val60 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -9190,9 +9004,21 @@ var _key61 nebula0.PartitionID } func (p *ScanEdgeRequest) ReadField3(iprot thrift.Protocol) error { - p.ReturnColumns = NewEdgeProp() - if err := p.ReturnColumns.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ReturnColumns), err) + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeProp, 0, size) + p.ReturnColumns = tSlice + for i := 0; i < size; i ++ { + _elem61 := NewEdgeProp() + if err := _elem61.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem61), err) + } + p.ReturnColumns = append(p.ReturnColumns, _elem61) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) } return nil } @@ -9311,10 +9137,18 @@ func (p *ScanEdgeRequest) writeField2(oprot thrift.Protocol) (err error) { } func (p *ScanEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("return_columns", thrift.STRUCT, 3); err != nil { + if err := oprot.WriteFieldBegin("return_columns", thrift.LIST, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:return_columns: ", p), err) } - if err := p.ReturnColumns.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ReturnColumns), err) + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ReturnColumns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnColumns { + 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:return_columns: ", p), err) } @@ -9407,12 +9241,7 @@ func (p *ScanEdgeRequest) String() string { spaceIDVal := fmt.Sprintf("%v", p.SpaceID) partsVal := fmt.Sprintf("%v", p.Parts) - var returnColumnsVal string - if p.ReturnColumns == nil { - returnColumnsVal = "" - } else { - returnColumnsVal = fmt.Sprintf("%v", p.ReturnColumns) - } + returnColumnsVal := fmt.Sprintf("%v", p.ReturnColumns) limitVal := fmt.Sprintf("%v", p.Limit) var startTimeVal string if p.StartTime == nil { @@ -9440,48 +9269,47 @@ func (p *ScanEdgeRequest) String() string { // Attributes: // - Result_ -// - EdgeData +// - Props // - Cursors -type ScanEdgeResponse struct { +type ScanResponse struct { Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` - EdgeData *nebula0.DataSet `thrift:"edge_data,2" db:"edge_data" json:"edge_data"` + Props *nebula0.DataSet `thrift:"props,2" db:"props" json:"props,omitempty"` Cursors map[nebula0.PartitionID]*ScanCursor `thrift:"cursors,3" db:"cursors" json:"cursors"` } -func NewScanEdgeResponse() *ScanEdgeResponse { - return &ScanEdgeResponse{ +func NewScanResponse() *ScanResponse { + return &ScanResponse{ Result_: NewResponseCommon(), - EdgeData: nebula0.NewDataSet(), } } -var ScanEdgeResponse_Result__DEFAULT *ResponseCommon -func (p *ScanEdgeResponse) GetResult_() *ResponseCommon { +var ScanResponse_Result__DEFAULT *ResponseCommon +func (p *ScanResponse) GetResult_() *ResponseCommon { if !p.IsSetResult_() { - return ScanEdgeResponse_Result__DEFAULT + return ScanResponse_Result__DEFAULT } return p.Result_ } -var ScanEdgeResponse_EdgeData_DEFAULT *nebula0.DataSet -func (p *ScanEdgeResponse) GetEdgeData() *nebula0.DataSet { - if !p.IsSetEdgeData() { - return ScanEdgeResponse_EdgeData_DEFAULT +var ScanResponse_Props_DEFAULT *nebula0.DataSet +func (p *ScanResponse) GetProps() *nebula0.DataSet { + if !p.IsSetProps() { + return ScanResponse_Props_DEFAULT } -return p.EdgeData +return p.Props } -func (p *ScanEdgeResponse) GetCursors() map[nebula0.PartitionID]*ScanCursor { +func (p *ScanResponse) GetCursors() map[nebula0.PartitionID]*ScanCursor { return p.Cursors } -func (p *ScanEdgeResponse) IsSetResult_() bool { +func (p *ScanResponse) IsSetResult_() bool { return p != nil && p.Result_ != nil } -func (p *ScanEdgeResponse) IsSetEdgeData() bool { - return p != nil && p.EdgeData != nil +func (p *ScanResponse) IsSetProps() bool { + return p != nil && p.Props != nil } -func (p *ScanEdgeResponse) Read(iprot thrift.Protocol) error { +func (p *ScanResponse) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -9526,7 +9354,7 @@ func (p *ScanEdgeResponse) Read(iprot thrift.Protocol) error { return nil } -func (p *ScanEdgeResponse) ReadField1(iprot thrift.Protocol) error { +func (p *ScanResponse) ReadField1(iprot thrift.Protocol) error { p.Result_ = NewResponseCommon() if err := p.Result_.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) @@ -9534,15 +9362,15 @@ func (p *ScanEdgeResponse) ReadField1(iprot thrift.Protocol) error { return nil } -func (p *ScanEdgeResponse) ReadField2(iprot thrift.Protocol) error { - p.EdgeData = nebula0.NewDataSet() - if err := p.EdgeData.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EdgeData), err) +func (p *ScanResponse) ReadField2(iprot thrift.Protocol) error { + p.Props = nebula0.NewDataSet() + if err := p.Props.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) } return nil } -func (p *ScanEdgeResponse) ReadField3(iprot thrift.Protocol) error { +func (p *ScanResponse) ReadField3(iprot thrift.Protocol) error { _, _, size, err := iprot.ReadMapBegin() if err != nil { return thrift.PrependError("error reading map begin: ", err) @@ -9550,18 +9378,18 @@ func (p *ScanEdgeResponse) ReadField3(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID]*ScanCursor, size) p.Cursors = tMap for i := 0; i < size; i ++ { -var _key63 nebula0.PartitionID +var _key62 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key63 = temp + _key62 = temp } - _val64 := NewScanCursor() - if err := _val64.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val64), err) + _val63 := NewScanCursor() + if err := _val63.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val63), err) } - p.Cursors[_key63] = _val64 + p.Cursors[_key62] = _val63 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -9569,8 +9397,8 @@ var _key63 nebula0.PartitionID return nil } -func (p *ScanEdgeResponse) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ScanEdgeResponse"); err != nil { +func (p *ScanResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanResponse"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if err := p.writeField1(oprot); err != nil { return err } if err := p.writeField2(oprot); err != nil { return err } @@ -9582,7 +9410,7 @@ func (p *ScanEdgeResponse) Write(oprot thrift.Protocol) error { return nil } -func (p *ScanEdgeResponse) writeField1(oprot thrift.Protocol) (err error) { +func (p *ScanResponse) writeField1(oprot thrift.Protocol) (err error) { if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:result: ", p), err) } if err := p.Result_.Write(oprot); err != nil { @@ -9593,18 +9421,20 @@ func (p *ScanEdgeResponse) writeField1(oprot thrift.Protocol) (err error) { return err } -func (p *ScanEdgeResponse) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("edge_data", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_data: ", p), err) } - if err := p.EdgeData.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EdgeData), err) +func (p *ScanResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin("props", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := p.Props.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_data: ", p), err) } return err } -func (p *ScanEdgeResponse) writeField3(oprot thrift.Protocol) (err error) { +func (p *ScanResponse) writeField3(oprot thrift.Protocol) (err error) { if err := oprot.WriteFieldBegin("cursors", thrift.MAP, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursors: ", p), err) } if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.Cursors)); err != nil { @@ -9625,7 +9455,7 @@ func (p *ScanEdgeResponse) writeField3(oprot thrift.Protocol) (err error) { return err } -func (p *ScanEdgeResponse) String() string { +func (p *ScanResponse) String() string { if p == nil { return "" } @@ -9636,14 +9466,14 @@ func (p *ScanEdgeResponse) String() string { } else { resultVal = fmt.Sprintf("%v", p.Result_) } - var edgeDataVal string - if p.EdgeData == nil { - edgeDataVal = "" + var propsVal string + if p.Props == nil { + propsVal = "" } else { - edgeDataVal = fmt.Sprintf("%v", p.EdgeData) + propsVal = fmt.Sprintf("%v", p.Props) } cursorsVal := fmt.Sprintf("%v", p.Cursors) - return fmt.Sprintf("ScanEdgeResponse({Result_:%s EdgeData:%s Cursors:%s})", resultVal, edgeDataVal, cursorsVal) + return fmt.Sprintf("ScanResponse({Result_:%s Props:%s Cursors:%s})", resultVal, propsVal, cursorsVal) } // Attributes: @@ -9740,14 +9570,14 @@ func (p *TaskPara) ReadField2(iprot thrift.Protocol) error { tSlice := make([]nebula0.PartitionID, 0, size) p.Parts = tSlice for i := 0; i < size; i ++ { -var _elem65 nebula0.PartitionID +var _elem64 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem65 = temp + _elem64 = temp } - p.Parts = append(p.Parts, _elem65) + p.Parts = append(p.Parts, _elem64) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9763,13 +9593,13 @@ func (p *TaskPara) ReadField3(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.TaskSpecificParas = tSlice for i := 0; i < size; i ++ { -var _elem66 []byte +var _elem65 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem66 = v + _elem65 = v } - p.TaskSpecificParas = append(p.TaskSpecificParas, _elem66) + p.TaskSpecificParas = append(p.TaskSpecificParas, _elem65) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9935,32 +9765,32 @@ func (p *KVGetRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][][]byte, size) p.Parts = tMap for i := 0; i < size; i ++ { -var _key67 nebula0.PartitionID +var _key66 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key67 = temp + _key66 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([][]byte, 0, size) - _val68 := tSlice + _val67 := tSlice for i := 0; i < size; i ++ { -var _elem69 []byte +var _elem68 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem69 = v + _elem68 = v } - _val68 = append(_val68, _elem69) + _val67 = append(_val67, _elem68) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key67] = _val68 + p.Parts[_key66] = _val67 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -10135,19 +9965,19 @@ func (p *KVGetResponse) ReadField2(iprot thrift.Protocol) error { tMap := make(map[string][]byte, size) p.KeyValues = tMap for i := 0; i < size; i ++ { -var _key70 string +var _key69 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key70 = v + _key69 = v } -var _val71 []byte +var _val70 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val71 = v + _val70 = v } - p.KeyValues[_key70] = _val71 + p.KeyValues[_key69] = _val70 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -10287,30 +10117,30 @@ func (p *KVPutRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*nebula0.KeyValue, size) p.Parts = tMap for i := 0; i < size; i ++ { -var _key72 nebula0.PartitionID +var _key71 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key72 = temp + _key71 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*nebula0.KeyValue, 0, size) - _val73 := tSlice + _val72 := tSlice for i := 0; i < size; i ++ { - _elem74 := nebula0.NewKeyValue() - if err := _elem74.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem74), err) + _elem73 := nebula0.NewKeyValue() + if err := _elem73.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem73), err) } - _val73 = append(_val73, _elem74) + _val72 = append(_val72, _elem73) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key72] = _val73 + p.Parts[_key71] = _val72 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -10453,32 +10283,32 @@ func (p *KVRemoveRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][][]byte, size) p.Parts = tMap for i := 0; i < size; i ++ { -var _key75 nebula0.PartitionID +var _key74 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key75 = temp + _key74 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([][]byte, 0, size) - _val76 := tSlice + _val75 := tSlice for i := 0; i < size; i ++ { -var _elem77 []byte +var _elem76 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem77 = v + _elem76 = v } - _val76 = append(_val76, _elem77) + _val75 = append(_val75, _elem76) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key75] = _val76 + p.Parts[_key74] = _val75 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -10971,11 +10801,11 @@ func (p *AddPartReq) ReadField4(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Peers = tSlice for i := 0; i < size; i ++ { - _elem78 := nebula0.NewHostAddr() - if err := _elem78.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem78), err) + _elem77 := nebula0.NewHostAddr() + if err := _elem77.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem77), err) } - p.Peers = append(p.Peers, _elem78) + p.Peers = append(p.Peers, _elem77) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -12189,33 +12019,33 @@ func (p *GetLeaderPartsResp) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.GraphSpaceID][]nebula0.PartitionID, size) p.LeaderParts = tMap for i := 0; i < size; i ++ { -var _key79 nebula0.GraphSpaceID +var _key78 nebula0.GraphSpaceID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.GraphSpaceID(v) - _key79 = temp + _key78 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]nebula0.PartitionID, 0, size) - _val80 := tSlice + _val79 := tSlice for i := 0; i < size; i ++ { -var _elem81 nebula0.PartitionID +var _elem80 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem81 = temp + _elem80 = temp } - _val80 = append(_val80, _elem81) + _val79 = append(_val79, _elem80) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.LeaderParts[_key79] = _val80 + p.LeaderParts[_key78] = _val79 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -12383,11 +12213,11 @@ func (p *CheckPeersReq) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Peers = tSlice for i := 0; i < size; i ++ { - _elem82 := nebula0.NewHostAddr() - if err := _elem82.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem82), err) + _elem81 := nebula0.NewHostAddr() + if err := _elem81.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem81), err) } - p.Peers = append(p.Peers, _elem82) + p.Peers = append(p.Peers, _elem81) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -12542,14 +12372,14 @@ func (p *RebuildIndexRequest) ReadField2(iprot thrift.Protocol) error { tSlice := make([]nebula0.PartitionID, 0, size) p.Parts = tSlice for i := 0; i < size; i ++ { -var _elem83 nebula0.PartitionID +var _elem82 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem83 = temp + _elem82 = temp } - p.Parts = append(p.Parts, _elem83) + p.Parts = append(p.Parts, _elem82) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -12715,11 +12545,11 @@ func (p *CreateCPResp) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*nebula0.CheckpointInfo, 0, size) p.Info = tSlice for i := 0; i < size; i ++ { - _elem84 := nebula0.NewCheckpointInfo() - if err := _elem84.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem84), err) + _elem83 := nebula0.NewCheckpointInfo() + if err := _elem83.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem83), err) } - p.Info = append(p.Info, _elem84) + p.Info = append(p.Info, _elem83) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -13458,20 +13288,20 @@ func (p *InternalTxnRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID]int64, size) p.TermOfParts = tMap for i := 0; i < size; i ++ { -var _key85 nebula0.PartitionID +var _key84 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key85 = temp + _key84 = temp } -var _val86 int64 +var _val85 int64 if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val86 = v + _val85 = v } - p.TermOfParts[_key85] = _val86 + p.TermOfParts[_key84] = _val85 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -13503,32 +13333,32 @@ func (p *InternalTxnRequest) ReadField5(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]int64, size) p.EdgeVer = tMap for i := 0; i < size; i ++ { -var _key87 nebula0.PartitionID +var _key86 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key87 = temp + _key86 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]int64, 0, size) - _val88 := tSlice + _val87 := tSlice for i := 0; i < size; i ++ { -var _elem89 int64 +var _elem88 int64 if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem89 = v + _elem88 = v } - _val88 = append(_val88, _elem89) + _val87 = append(_val87, _elem88) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.EdgeVer[_key87] = _val88 + p.EdgeVer[_key86] = _val87 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -13781,30 +13611,30 @@ func (p *ChainAddEdgesRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*NewEdge_, size) p.Parts = tMap for i := 0; i < size; i ++ { -var _key90 nebula0.PartitionID +var _key89 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key90 = temp + _key89 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*NewEdge_, 0, size) - _val91 := tSlice + _val90 := tSlice for i := 0; i < size; i ++ { - _elem92 := NewNewEdge_() - if err := _elem92.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem92), err) + _elem91 := NewNewEdge_() + if err := _elem91.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem91), err) } - _val91 = append(_val91, _elem92) + _val90 = append(_val90, _elem91) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key90] = _val91 + p.Parts[_key89] = _val90 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -13820,13 +13650,13 @@ func (p *ChainAddEdgesRequest) ReadField3(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.PropNames = tSlice for i := 0; i < size; i ++ { -var _elem93 []byte +var _elem92 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem93 = v + _elem92 = v } - p.PropNames = append(p.PropNames, _elem93) + p.PropNames = append(p.PropNames, _elem92) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -14136,14 +13966,14 @@ func (p *ChainUpdateEdgeRequest) ReadField5(iprot thrift.Protocol) error { tSlice := make([]nebula0.PartitionID, 0, size) p.Parts = tSlice for i := 0; i < size; i ++ { -var _elem94 nebula0.PartitionID +var _elem93 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem94 = temp + _elem93 = temp } - p.Parts = append(p.Parts, _elem94) + p.Parts = append(p.Parts, _elem93) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) diff --git a/nebula/ttypes.go b/nebula/ttypes.go index 393df6d5..cf9896ee 100644 --- a/nebula/ttypes.go +++ b/nebula/ttypes.go @@ -107,6 +107,7 @@ const ( PropertyType_INT16 PropertyType = 9 PropertyType_INT32 PropertyType = 10 PropertyType_TIMESTAMP PropertyType = 21 + PropertyType_DURATION PropertyType = 23 PropertyType_DATE PropertyType = 24 PropertyType_DATETIME PropertyType = 25 PropertyType_TIME PropertyType = 26 @@ -126,6 +127,7 @@ var PropertyTypeToName = map[PropertyType]string { PropertyType_INT16: "INT16", PropertyType_INT32: "INT32", PropertyType_TIMESTAMP: "TIMESTAMP", + PropertyType_DURATION: "DURATION", PropertyType_DATE: "DATE", PropertyType_DATETIME: "DATETIME", PropertyType_TIME: "TIME", @@ -145,6 +147,7 @@ var PropertyTypeToValue = map[string]PropertyType { "INT16": PropertyType_INT16, "INT32": PropertyType_INT32, "TIMESTAMP": PropertyType_TIMESTAMP, + "DURATION": PropertyType_DURATION, "DATE": PropertyType_DATE, "DATETIME": PropertyType_DATETIME, "TIME": PropertyType_TIME, @@ -164,6 +167,7 @@ var PropertyTypeNames = []string { "INT16", "INT32", "TIMESTAMP", + "DURATION", "DATE", "DATETIME", "TIME", @@ -183,6 +187,7 @@ var PropertyTypeValues = []PropertyType { PropertyType_INT16, PropertyType_INT32, PropertyType_TIMESTAMP, + PropertyType_DURATION, PropertyType_DATE, PropertyType_DATETIME, PropertyType_TIME, @@ -220,7 +225,7 @@ const ( ErrorCode_E_TAG_PROP_NOT_FOUND ErrorCode = -10 ErrorCode_E_ROLE_NOT_FOUND ErrorCode = -11 ErrorCode_E_CONFIG_NOT_FOUND ErrorCode = -12 - ErrorCode_E_GROUP_NOT_FOUND ErrorCode = -13 + ErrorCode_E_MACHINE_NOT_FOUND ErrorCode = -13 ErrorCode_E_ZONE_NOT_FOUND ErrorCode = -14 ErrorCode_E_LISTENER_NOT_FOUND ErrorCode = -15 ErrorCode_E_PART_NOT_FOUND ErrorCode = -16 @@ -344,7 +349,7 @@ var ErrorCodeToName = map[ErrorCode]string { ErrorCode_E_TAG_PROP_NOT_FOUND: "E_TAG_PROP_NOT_FOUND", ErrorCode_E_ROLE_NOT_FOUND: "E_ROLE_NOT_FOUND", ErrorCode_E_CONFIG_NOT_FOUND: "E_CONFIG_NOT_FOUND", - ErrorCode_E_GROUP_NOT_FOUND: "E_GROUP_NOT_FOUND", + ErrorCode_E_MACHINE_NOT_FOUND: "E_MACHINE_NOT_FOUND", ErrorCode_E_ZONE_NOT_FOUND: "E_ZONE_NOT_FOUND", ErrorCode_E_LISTENER_NOT_FOUND: "E_LISTENER_NOT_FOUND", ErrorCode_E_PART_NOT_FOUND: "E_PART_NOT_FOUND", @@ -468,7 +473,7 @@ var ErrorCodeToValue = map[string]ErrorCode { "E_TAG_PROP_NOT_FOUND": ErrorCode_E_TAG_PROP_NOT_FOUND, "E_ROLE_NOT_FOUND": ErrorCode_E_ROLE_NOT_FOUND, "E_CONFIG_NOT_FOUND": ErrorCode_E_CONFIG_NOT_FOUND, - "E_GROUP_NOT_FOUND": ErrorCode_E_GROUP_NOT_FOUND, + "E_MACHINE_NOT_FOUND": ErrorCode_E_MACHINE_NOT_FOUND, "E_ZONE_NOT_FOUND": ErrorCode_E_ZONE_NOT_FOUND, "E_LISTENER_NOT_FOUND": ErrorCode_E_LISTENER_NOT_FOUND, "E_PART_NOT_FOUND": ErrorCode_E_PART_NOT_FOUND, @@ -592,7 +597,7 @@ var ErrorCodeNames = []string { "E_TAG_PROP_NOT_FOUND", "E_ROLE_NOT_FOUND", "E_CONFIG_NOT_FOUND", - "E_GROUP_NOT_FOUND", + "E_MACHINE_NOT_FOUND", "E_ZONE_NOT_FOUND", "E_LISTENER_NOT_FOUND", "E_PART_NOT_FOUND", @@ -716,7 +721,7 @@ var ErrorCodeValues = []ErrorCode { ErrorCode_E_TAG_PROP_NOT_FOUND, ErrorCode_E_ROLE_NOT_FOUND, ErrorCode_E_CONFIG_NOT_FOUND, - ErrorCode_E_GROUP_NOT_FOUND, + ErrorCode_E_MACHINE_NOT_FOUND, ErrorCode_E_ZONE_NOT_FOUND, ErrorCode_E_LISTENER_NOT_FOUND, ErrorCode_E_PART_NOT_FOUND, @@ -1678,6 +1683,7 @@ func (p *DateTime) String() string { // - UVal // - GVal // - GgVal +// - DuVal type Value struct { NVal *NullType `thrift:"nVal,1" db:"nVal" json:"nVal,omitempty"` BVal *bool `thrift:"bVal,2" db:"bVal" json:"bVal,omitempty"` @@ -1695,6 +1701,7 @@ type Value struct { UVal *NSet `thrift:"uVal,14" db:"uVal" json:"uVal,omitempty"` GVal *DataSet `thrift:"gVal,15" db:"gVal" json:"gVal,omitempty"` GgVal *Geography `thrift:"ggVal,16" db:"ggVal" json:"ggVal,omitempty"` + DuVal *Duration `thrift:"duVal,17" db:"duVal" json:"duVal,omitempty"` } func NewValue() *Value { @@ -1811,6 +1818,13 @@ func (p *Value) GetGgVal() *Geography { } return p.GgVal } +var Value_DuVal_DEFAULT *Duration +func (p *Value) GetDuVal() *Duration { + if !p.IsSetDuVal() { + return Value_DuVal_DEFAULT + } +return p.DuVal +} func (p *Value) CountSetFieldsValue() int { count := 0 if (p.IsSetNVal()) { @@ -1861,6 +1875,9 @@ func (p *Value) CountSetFieldsValue() int { if (p.IsSetGgVal()) { count++ } + if (p.IsSetDuVal()) { + count++ + } return count } @@ -1929,6 +1946,10 @@ func (p *Value) IsSetGgVal() bool { return p != nil && p.GgVal != nil } +func (p *Value) IsSetDuVal() bool { + return p != nil && p.DuVal != nil +} + func (p *Value) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -2006,6 +2027,10 @@ func (p *Value) Read(iprot thrift.Protocol) error { if err := p.ReadField16(iprot); err != nil { return err } + case 17: + if err := p.ReadField17(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -2155,6 +2180,14 @@ func (p *Value) ReadField16(iprot thrift.Protocol) error { return nil } +func (p *Value) ReadField17(iprot thrift.Protocol) error { + p.DuVal = NewDuration() + if err := p.DuVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DuVal), err) + } + return nil +} + func (p *Value) Write(oprot thrift.Protocol) error { if c := p.CountSetFieldsValue(); c > 1 { return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) @@ -2177,6 +2210,7 @@ func (p *Value) Write(oprot thrift.Protocol) error { if err := p.writeField14(oprot); err != nil { return err } if err := p.writeField15(oprot); err != nil { return err } if err := p.writeField16(oprot); err != nil { return err } + if err := p.writeField17(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 { @@ -2387,6 +2421,19 @@ func (p *Value) writeField16(oprot thrift.Protocol) (err error) { return err } +func (p *Value) writeField17(oprot thrift.Protocol) (err error) { + if p.IsSetDuVal() { + if err := oprot.WriteFieldBegin("duVal", thrift.STRUCT, 17); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 17:duVal: ", p), err) } + if err := p.DuVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DuVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 17:duVal: ", p), err) } + } + return err +} + func (p *Value) String() string { if p == nil { return "" @@ -2483,7 +2530,13 @@ func (p *Value) String() string { } else { ggValVal = fmt.Sprintf("%v", p.GgVal) } - return fmt.Sprintf("Value({NVal:%s BVal:%s IVal:%s FVal:%s SVal:%s DVal:%s TVal:%s DtVal:%s VVal:%s EVal:%s PVal:%s LVal:%s MVal:%s UVal:%s GVal:%s GgVal:%s})", nValVal, bValVal, iValVal, fValVal, sValVal, dValVal, tValVal, dtValVal, vValVal, eValVal, pValVal, lValVal, mValVal, uValVal, gValVal, ggValVal) + var duValVal string + if p.DuVal == nil { + duValVal = "" + } else { + duValVal = fmt.Sprintf("%v", p.DuVal) + } + return fmt.Sprintf("Value({NVal:%s BVal:%s IVal:%s FVal:%s SVal:%s DVal:%s TVal:%s DtVal:%s VVal:%s EVal:%s PVal:%s LVal:%s MVal:%s UVal:%s GVal:%s GgVal:%s DuVal:%s})", nValVal, bValVal, iValVal, fValVal, sValVal, dValVal, tValVal, dtValVal, vValVal, eValVal, pValVal, lValVal, mValVal, uValVal, gValVal, ggValVal, duValVal) } // Attributes: @@ -4952,6 +5005,153 @@ func (p *KeyValue) String() string { return fmt.Sprintf("KeyValue({Key:%s Value:%s})", keyVal, valueVal) } +// Attributes: +// - Seconds +// - Microseconds +// - Months +type Duration struct { + Seconds int64 `thrift:"seconds,1" db:"seconds" json:"seconds"` + Microseconds int32 `thrift:"microseconds,2" db:"microseconds" json:"microseconds"` + Months int32 `thrift:"months,3" db:"months" json:"months"` +} + +func NewDuration() *Duration { + return &Duration{} +} + + +func (p *Duration) GetSeconds() int64 { + return p.Seconds +} + +func (p *Duration) GetMicroseconds() int32 { + return p.Microseconds +} + +func (p *Duration) GetMonths() int32 { + return p.Months +} +func (p *Duration) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + 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 *Duration) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Seconds = v +} + return nil +} + +func (p *Duration) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Microseconds = v +} + return nil +} + +func (p *Duration) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Months = v +} + return nil +} + +func (p *Duration) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Duration"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return 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 *Duration) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("seconds", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:seconds: ", p), err) } + if err := oprot.WriteI64(int64(p.Seconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.seconds (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:seconds: ", p), err) } + return err +} + +func (p *Duration) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("microseconds", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:microseconds: ", p), err) } + if err := oprot.WriteI32(int32(p.Microseconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microseconds (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:microseconds: ", p), err) } + return err +} + +func (p *Duration) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("months", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:months: ", p), err) } + if err := oprot.WriteI32(int32(p.Months)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.months (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:months: ", p), err) } + return err +} + +func (p *Duration) String() string { + if p == nil { + return "" + } + + secondsVal := fmt.Sprintf("%v", p.Seconds) + microsecondsVal := fmt.Sprintf("%v", p.Microseconds) + monthsVal := fmt.Sprintf("%v", p.Months) + return fmt.Sprintf("Duration({Seconds:%s Microseconds:%s Months:%s})", secondsVal, microsecondsVal, monthsVal) +} + // Attributes: // - LogID // - TermID diff --git a/result_set_test.go b/result_set_test.go index de3520d6..25358ccb 100644 --- a/result_set_test.go +++ b/result_set_test.go @@ -419,6 +419,12 @@ func TestAsGeography(t *testing.T) { assert.Equal(t, "POLYGON((48.3 78.6, 77.9 89.6, -24 -49.7, -36 78.3, 48.3 78.6))", polygonWrap.String()) } +func TestAsDuration(t *testing.T) { + value := nebula.Value{DuVal: &nebula.Duration{86400, 3000, 12}} + valWrap := ValueWrapper{&value, testTimezone} + assert.Equal(t, true, valWrap.IsDuration()) + assert.Equal(t, "P12M1DT86400S", valWrap.String()) +} func TestNode(t *testing.T) { vertex := getVertex("Tom", 3, 5) node, err := genNode(vertex, testTimezone) diff --git a/value_wrapper.go b/value_wrapper.go index cf66f691..c128b23e 100644 --- a/value_wrapper.go +++ b/value_wrapper.go @@ -86,6 +86,10 @@ func (valWrap ValueWrapper) IsGeography() bool { return valWrap.value.IsSetGgVal() } +func (valWrap ValueWrapper) IsDuration() bool { + return valWrap.value.IsSetDuVal() +} + // AsNull converts the ValueWrapper to nebula.NullType func (valWrap ValueWrapper) AsNull() (nebula.NullType, error) { if valWrap.value.IsSetNVal() { @@ -246,6 +250,15 @@ func (valWrap ValueWrapper) AsGeography() (*nebula.Geography, error) { return nil, fmt.Errorf("failed to convert value %s to nebula.Geography, value is not an geography", valWrap.GetType()) } +// AsDuration converts the ValueWrapper to a DurationWrapper +func (valWrap ValueWrapper) AsDuration() (*nebula.Duration, error) { + if valWrap.value.IsSetDuVal() { + rawDuration := valWrap.value.GetDuVal() + return rawDuration, nil + } + return nil, fmt.Errorf("failed to convert value %s to Duration", valWrap.GetType()) +} + // GetType returns the value type of value in the valWrap as a string func (valWrap ValueWrapper) GetType() string { if valWrap.value.IsSetNVal() { @@ -278,6 +291,8 @@ func (valWrap ValueWrapper) GetType() string { return "set" } else if valWrap.value.IsSetGgVal() { return "geography" + } else if valWrap.value.IsSetDuVal() { + return "duration" } return "empty" } @@ -387,6 +402,10 @@ func (valWrap ValueWrapper) String() string { } else if value.IsSetGgVal() { ggval := value.GetGgVal() return toWKT(ggval) + } else if value.IsSetDuVal() { + duval := value.GetDuVal() + days := duval.GetSeconds() / (24 * 60 * 60) + return fmt.Sprintf("P%vM%vDT%vS", duval.GetMonths(), days, duval.GetSeconds()) } else { // is empty return "" }