diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c2dabe29..11f77f99 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,6 +24,8 @@ jobs: make up sleep 10 make test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 - name: down if: always() run: | diff --git a/README.md b/README.md index d99db5df..b7b48983 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/vesoft-inc/nebula-go/v3.svg)](https://pkg.go.dev/github.com/vesoft-inc/nebula-go/v3) ![functional tests](https://github.com/vesoft-inc/nebula-go/actions/workflows/test.yaml/badge.svg) +[![codecov](https://codecov.io/gh/vesoft-inc/nebula-go/branch/master/graph/badge.svg?token=dzUo5KdSux)](https://codecov.io/gh/vesoft-inc/nebula-go) **IMPORTANT: Code of Nebula go client has been transferred from [nebula-clients](https://github.com/vesoft-inc/nebula-clients) to this repository(nebula-go), and new releases in the future will be published in this repository. Please update your go.mod and imports correspondingly.** diff --git a/client_test.go b/client_test.go index 432419d1..ce65f210 100644 --- a/client_test.go +++ b/client_test.go @@ -1147,38 +1147,42 @@ func TestExecuteWithParameter(t *testing.T) { col3) } // Complex result - { - resp, err := tryToExecuteWithParameter(session, "MATCH (v:person {name: $p4.b}) WHERE v.person.age>$p2-3 and $p1==true RETURN v ORDER BY $p3[0] LIMIT $p2", params) - if err != nil { - t.Fatalf(err.Error()) - return - } - assert.Equal(t, 1, resp.GetRowSize()) - record, err := resp.GetRowValuesByIndex(0) - if err != nil { - t.Fatalf(err.Error()) - return - } - valWrap, err := record.GetValueByIndex(0) - if err != nil { - t.Fatalf(err.Error()) - return - } - node, err := valWrap.AsNode() - if err != nil { - t.Fatalf(err.Error()) - return - } - assert.Equal(t, - "(\"Bob\" :student{interval: P1MT100.000020000S, 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, "+ - "hobby: __NULL__, is_girl: false, "+ - "morning: 07:10:00.000000, name: \"Bob\", "+ - "property: 1000.0, start_school: 2017-09-10})", - node.String()) - } + // FIXME(Aiee) uncomment this after https://github.com/vesoft-inc/nebula/issues/4877 is fixed + // { + // query := "MATCH (v:person {name: $p4.b}) WHERE v.person.age>$p2-3 and $p1==true RETURN v ORDER BY $p3[0] LIMIT $p2" + // resp, err := tryToExecuteWithParameter(session, query, params) + // if err != nil { + // t.Fatalf(err.Error()) + // return + // } + // checkResultSet(t, query, resp) + + // assert.Equal(t, 1, resp.GetRowSize()) + // record, err := resp.GetRowValuesByIndex(0) + // if err != nil { + // t.Fatalf(err.Error()) + // return + // } + // valWrap, err := record.GetValueByIndex(0) + // if err != nil { + // t.Fatalf(err.Error()) + // return + // } + // node, err := valWrap.AsNode() + // if err != nil { + // t.Fatalf(err.Error()) + // return + // } + // assert.Equal(t, + // "(\"Bob\" :student{interval: P1MT100.000020000S, 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, "+ + // "hobby: __NULL__, is_girl: false, "+ + // "morning: 07:10:00.000000, name: \"Bob\", "+ + // "property: 1000.0, start_school: 2017-09-10})", + // node.String()) + // } } func TestReconnect(t *testing.T) { diff --git a/connection_pool.go b/connection_pool.go index 3b96779e..54cc3fcc 100644 --- a/connection_pool.go +++ b/connection_pool.go @@ -161,6 +161,7 @@ func (pool *ConnectionPool) getIdleConn() (*connection, error) { } else { tmpNextEle = ele.Next() pool.idleConnectionQueue.Remove(ele) + ele.Value.(*connection).close() } } if newConn == nil { diff --git a/nebula/meta/metaservice.go b/nebula/meta/metaservice.go index b9065c04..797fbe33 100644 --- a/nebula/meta/metaservice.go +++ b/nebula/meta/metaservice.go @@ -262,7 +262,7 @@ type MetaService interface { CreateBackup(ctx context.Context, req *CreateBackupReq) (_r *CreateBackupResp, err error) // Parameters: // - Req - RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *ExecResp, err error) + RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *RestoreMetaResp, err error) // Parameters: // - Req ListCluster(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) @@ -521,7 +521,7 @@ type MetaServiceClientInterface interface { CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) // Parameters: // - Req - RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) + RestoreMeta(req *RestoreMetaReq) (_r *RestoreMetaResp, err error) // Parameters: // - Req ListCluster(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) @@ -2150,7 +2150,7 @@ func (p *MetaServiceClient) recvCreateBackup() (value *CreateBackupResp, err err // Parameters: // - Req -func (p *MetaServiceClient) RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) { +func (p *MetaServiceClient) RestoreMeta(req *RestoreMetaReq) (_r *RestoreMetaResp, err error) { args := MetaServiceRestoreMetaArgs{ Req : req, } @@ -2160,7 +2160,7 @@ func (p *MetaServiceClient) RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err } -func (p *MetaServiceClient) recvRestoreMeta() (value *ExecResp, err error) { +func (p *MetaServiceClient) recvRestoreMeta() (value *RestoreMetaResp, err error) { var result MetaServiceRestoreMetaResult err = p.CC.RecvMsg("restoreMeta", &result) if err != nil { return } @@ -4045,7 +4045,7 @@ func (p *MetaServiceThreadsafeClient) recvCreateBackup() (value *CreateBackupRes // Parameters: // - Req -func (p *MetaServiceThreadsafeClient) RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) { +func (p *MetaServiceThreadsafeClient) RestoreMeta(req *RestoreMetaReq) (_r *RestoreMetaResp, err error) { p.Mu.Lock() defer p.Mu.Unlock() args := MetaServiceRestoreMetaArgs{ @@ -4057,7 +4057,7 @@ func (p *MetaServiceThreadsafeClient) RestoreMeta(req *RestoreMetaReq) (_r *Exec } -func (p *MetaServiceThreadsafeClient) recvRestoreMeta() (value *ExecResp, err error) { +func (p *MetaServiceThreadsafeClient) recvRestoreMeta() (value *RestoreMetaResp, err error) { var result MetaServiceRestoreMetaResult err = p.CC.RecvMsg("restoreMeta", &result) if err != nil { return } @@ -5225,7 +5225,7 @@ func (p *MetaServiceChannelClient) CreateBackup(ctx context.Context, req *Create // Parameters: // - Req -func (p *MetaServiceChannelClient) RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *ExecResp, err error) { +func (p *MetaServiceChannelClient) RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *RestoreMetaResp, err error) { args := MetaServiceRestoreMetaArgs{ Req : req, } @@ -5332,178 +5332,178 @@ func (p *MetaServiceProcessor) FunctionServiceMap() map[string]string { } func NewMetaServiceProcessor(handler MetaService) *MetaServiceProcessor { - self104 := &MetaServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext), functionServiceMap:make(map[string]string)} - self104.processorMap["createSpace"] = &metaServiceProcessorCreateSpace{handler:handler} - self104.processorMap["dropSpace"] = &metaServiceProcessorDropSpace{handler:handler} - self104.processorMap["clearSpace"] = &metaServiceProcessorClearSpace{handler:handler} - self104.processorMap["getSpace"] = &metaServiceProcessorGetSpace{handler:handler} - self104.processorMap["listSpaces"] = &metaServiceProcessorListSpaces{handler:handler} - self104.processorMap["alterSpace"] = &metaServiceProcessorAlterSpace{handler:handler} - self104.processorMap["createSpaceAs"] = &metaServiceProcessorCreateSpaceAs{handler:handler} - self104.processorMap["createTag"] = &metaServiceProcessorCreateTag{handler:handler} - self104.processorMap["alterTag"] = &metaServiceProcessorAlterTag{handler:handler} - self104.processorMap["dropTag"] = &metaServiceProcessorDropTag{handler:handler} - self104.processorMap["getTag"] = &metaServiceProcessorGetTag{handler:handler} - self104.processorMap["listTags"] = &metaServiceProcessorListTags{handler:handler} - self104.processorMap["createEdge"] = &metaServiceProcessorCreateEdge{handler:handler} - self104.processorMap["alterEdge"] = &metaServiceProcessorAlterEdge{handler:handler} - self104.processorMap["dropEdge"] = &metaServiceProcessorDropEdge{handler:handler} - self104.processorMap["getEdge"] = &metaServiceProcessorGetEdge{handler:handler} - self104.processorMap["listEdges"] = &metaServiceProcessorListEdges{handler:handler} - self104.processorMap["addHosts"] = &metaServiceProcessorAddHosts{handler:handler} - self104.processorMap["addHostsIntoZone"] = &metaServiceProcessorAddHostsIntoZone{handler:handler} - self104.processorMap["dropHosts"] = &metaServiceProcessorDropHosts{handler:handler} - self104.processorMap["listHosts"] = &metaServiceProcessorListHosts{handler:handler} - self104.processorMap["getPartsAlloc"] = &metaServiceProcessorGetPartsAlloc{handler:handler} - self104.processorMap["listParts"] = &metaServiceProcessorListParts{handler:handler} - self104.processorMap["getWorkerId"] = &metaServiceProcessorGetWorkerId{handler:handler} - self104.processorMap["createTagIndex"] = &metaServiceProcessorCreateTagIndex{handler:handler} - self104.processorMap["dropTagIndex"] = &metaServiceProcessorDropTagIndex{handler:handler} - self104.processorMap["getTagIndex"] = &metaServiceProcessorGetTagIndex{handler:handler} - self104.processorMap["listTagIndexes"] = &metaServiceProcessorListTagIndexes{handler:handler} - self104.processorMap["rebuildTagIndex"] = &metaServiceProcessorRebuildTagIndex{handler:handler} - self104.processorMap["listTagIndexStatus"] = &metaServiceProcessorListTagIndexStatus{handler:handler} - self104.processorMap["createEdgeIndex"] = &metaServiceProcessorCreateEdgeIndex{handler:handler} - self104.processorMap["dropEdgeIndex"] = &metaServiceProcessorDropEdgeIndex{handler:handler} - self104.processorMap["getEdgeIndex"] = &metaServiceProcessorGetEdgeIndex{handler:handler} - self104.processorMap["listEdgeIndexes"] = &metaServiceProcessorListEdgeIndexes{handler:handler} - self104.processorMap["rebuildEdgeIndex"] = &metaServiceProcessorRebuildEdgeIndex{handler:handler} - self104.processorMap["listEdgeIndexStatus"] = &metaServiceProcessorListEdgeIndexStatus{handler:handler} - self104.processorMap["createUser"] = &metaServiceProcessorCreateUser{handler:handler} - self104.processorMap["dropUser"] = &metaServiceProcessorDropUser{handler:handler} - self104.processorMap["alterUser"] = &metaServiceProcessorAlterUser{handler:handler} - self104.processorMap["grantRole"] = &metaServiceProcessorGrantRole{handler:handler} - self104.processorMap["revokeRole"] = &metaServiceProcessorRevokeRole{handler:handler} - self104.processorMap["listUsers"] = &metaServiceProcessorListUsers{handler:handler} - self104.processorMap["listRoles"] = &metaServiceProcessorListRoles{handler:handler} - self104.processorMap["getUserRoles"] = &metaServiceProcessorGetUserRoles{handler:handler} - self104.processorMap["changePassword"] = &metaServiceProcessorChangePassword{handler:handler} - self104.processorMap["heartBeat"] = &metaServiceProcessorHeartBeat{handler:handler} - self104.processorMap["agentHeartbeat"] = &metaServiceProcessorAgentHeartbeat{handler:handler} - self104.processorMap["regConfig"] = &metaServiceProcessorRegConfig{handler:handler} - self104.processorMap["getConfig"] = &metaServiceProcessorGetConfig{handler:handler} - self104.processorMap["setConfig"] = &metaServiceProcessorSetConfig{handler:handler} - self104.processorMap["listConfigs"] = &metaServiceProcessorListConfigs{handler:handler} - self104.processorMap["createSnapshot"] = &metaServiceProcessorCreateSnapshot{handler:handler} - self104.processorMap["dropSnapshot"] = &metaServiceProcessorDropSnapshot{handler:handler} - self104.processorMap["listSnapshots"] = &metaServiceProcessorListSnapshots{handler:handler} - self104.processorMap["runAdminJob"] = &metaServiceProcessorRunAdminJob{handler:handler} - self104.processorMap["mergeZone"] = &metaServiceProcessorMergeZone{handler:handler} - self104.processorMap["dropZone"] = &metaServiceProcessorDropZone{handler:handler} - self104.processorMap["divideZone"] = &metaServiceProcessorDivideZone{handler:handler} - self104.processorMap["renameZone"] = &metaServiceProcessorRenameZone{handler:handler} - self104.processorMap["getZone"] = &metaServiceProcessorGetZone{handler:handler} - self104.processorMap["listZones"] = &metaServiceProcessorListZones{handler:handler} - self104.processorMap["addListener"] = &metaServiceProcessorAddListener{handler:handler} - self104.processorMap["removeListener"] = &metaServiceProcessorRemoveListener{handler:handler} - self104.processorMap["listListener"] = &metaServiceProcessorListListener{handler:handler} - self104.processorMap["getStats"] = &metaServiceProcessorGetStats{handler:handler} - self104.processorMap["signInService"] = &metaServiceProcessorSignInService{handler:handler} - self104.processorMap["signOutService"] = &metaServiceProcessorSignOutService{handler:handler} - self104.processorMap["listServiceClients"] = &metaServiceProcessorListServiceClients{handler:handler} - self104.processorMap["createFTIndex"] = &metaServiceProcessorCreateFTIndex{handler:handler} - self104.processorMap["dropFTIndex"] = &metaServiceProcessorDropFTIndex{handler:handler} - self104.processorMap["listFTIndexes"] = &metaServiceProcessorListFTIndexes{handler:handler} - self104.processorMap["createSession"] = &metaServiceProcessorCreateSession{handler:handler} - self104.processorMap["updateSessions"] = &metaServiceProcessorUpdateSessions{handler:handler} - self104.processorMap["listSessions"] = &metaServiceProcessorListSessions{handler:handler} - self104.processorMap["getSession"] = &metaServiceProcessorGetSession{handler:handler} - self104.processorMap["removeSession"] = &metaServiceProcessorRemoveSession{handler:handler} - self104.processorMap["killQuery"] = &metaServiceProcessorKillQuery{handler:handler} - self104.processorMap["reportTaskFinish"] = &metaServiceProcessorReportTaskFinish{handler:handler} - self104.processorMap["createBackup"] = &metaServiceProcessorCreateBackup{handler:handler} - self104.processorMap["restoreMeta"] = &metaServiceProcessorRestoreMeta{handler:handler} - self104.processorMap["listCluster"] = &metaServiceProcessorListCluster{handler:handler} - self104.processorMap["getMetaDirInfo"] = &metaServiceProcessorGetMetaDirInfo{handler:handler} - self104.processorMap["verifyClientVersion"] = &metaServiceProcessorVerifyClientVersion{handler:handler} - self104.processorMap["saveGraphVersion"] = &metaServiceProcessorSaveGraphVersion{handler:handler} - self104.processorMap["getSegmentId"] = &metaServiceProcessorGetSegmentId{handler:handler} - self104.functionServiceMap["createSpace"] = "MetaService" - self104.functionServiceMap["dropSpace"] = "MetaService" - self104.functionServiceMap["clearSpace"] = "MetaService" - self104.functionServiceMap["getSpace"] = "MetaService" - self104.functionServiceMap["listSpaces"] = "MetaService" - self104.functionServiceMap["alterSpace"] = "MetaService" - self104.functionServiceMap["createSpaceAs"] = "MetaService" - self104.functionServiceMap["createTag"] = "MetaService" - self104.functionServiceMap["alterTag"] = "MetaService" - self104.functionServiceMap["dropTag"] = "MetaService" - self104.functionServiceMap["getTag"] = "MetaService" - self104.functionServiceMap["listTags"] = "MetaService" - self104.functionServiceMap["createEdge"] = "MetaService" - self104.functionServiceMap["alterEdge"] = "MetaService" - self104.functionServiceMap["dropEdge"] = "MetaService" - self104.functionServiceMap["getEdge"] = "MetaService" - self104.functionServiceMap["listEdges"] = "MetaService" - self104.functionServiceMap["addHosts"] = "MetaService" - self104.functionServiceMap["addHostsIntoZone"] = "MetaService" - self104.functionServiceMap["dropHosts"] = "MetaService" - self104.functionServiceMap["listHosts"] = "MetaService" - self104.functionServiceMap["getPartsAlloc"] = "MetaService" - self104.functionServiceMap["listParts"] = "MetaService" - self104.functionServiceMap["getWorkerId"] = "MetaService" - self104.functionServiceMap["createTagIndex"] = "MetaService" - self104.functionServiceMap["dropTagIndex"] = "MetaService" - self104.functionServiceMap["getTagIndex"] = "MetaService" - self104.functionServiceMap["listTagIndexes"] = "MetaService" - self104.functionServiceMap["rebuildTagIndex"] = "MetaService" - self104.functionServiceMap["listTagIndexStatus"] = "MetaService" - self104.functionServiceMap["createEdgeIndex"] = "MetaService" - self104.functionServiceMap["dropEdgeIndex"] = "MetaService" - self104.functionServiceMap["getEdgeIndex"] = "MetaService" - self104.functionServiceMap["listEdgeIndexes"] = "MetaService" - self104.functionServiceMap["rebuildEdgeIndex"] = "MetaService" - self104.functionServiceMap["listEdgeIndexStatus"] = "MetaService" - self104.functionServiceMap["createUser"] = "MetaService" - self104.functionServiceMap["dropUser"] = "MetaService" - self104.functionServiceMap["alterUser"] = "MetaService" - self104.functionServiceMap["grantRole"] = "MetaService" - self104.functionServiceMap["revokeRole"] = "MetaService" - self104.functionServiceMap["listUsers"] = "MetaService" - self104.functionServiceMap["listRoles"] = "MetaService" - self104.functionServiceMap["getUserRoles"] = "MetaService" - self104.functionServiceMap["changePassword"] = "MetaService" - self104.functionServiceMap["heartBeat"] = "MetaService" - self104.functionServiceMap["agentHeartbeat"] = "MetaService" - self104.functionServiceMap["regConfig"] = "MetaService" - self104.functionServiceMap["getConfig"] = "MetaService" - self104.functionServiceMap["setConfig"] = "MetaService" - self104.functionServiceMap["listConfigs"] = "MetaService" - self104.functionServiceMap["createSnapshot"] = "MetaService" - self104.functionServiceMap["dropSnapshot"] = "MetaService" - self104.functionServiceMap["listSnapshots"] = "MetaService" - self104.functionServiceMap["runAdminJob"] = "MetaService" - self104.functionServiceMap["mergeZone"] = "MetaService" - self104.functionServiceMap["dropZone"] = "MetaService" - self104.functionServiceMap["divideZone"] = "MetaService" - self104.functionServiceMap["renameZone"] = "MetaService" - self104.functionServiceMap["getZone"] = "MetaService" - self104.functionServiceMap["listZones"] = "MetaService" - self104.functionServiceMap["addListener"] = "MetaService" - self104.functionServiceMap["removeListener"] = "MetaService" - self104.functionServiceMap["listListener"] = "MetaService" - self104.functionServiceMap["getStats"] = "MetaService" - self104.functionServiceMap["signInService"] = "MetaService" - self104.functionServiceMap["signOutService"] = "MetaService" - self104.functionServiceMap["listServiceClients"] = "MetaService" - self104.functionServiceMap["createFTIndex"] = "MetaService" - self104.functionServiceMap["dropFTIndex"] = "MetaService" - self104.functionServiceMap["listFTIndexes"] = "MetaService" - self104.functionServiceMap["createSession"] = "MetaService" - self104.functionServiceMap["updateSessions"] = "MetaService" - self104.functionServiceMap["listSessions"] = "MetaService" - self104.functionServiceMap["getSession"] = "MetaService" - self104.functionServiceMap["removeSession"] = "MetaService" - self104.functionServiceMap["killQuery"] = "MetaService" - self104.functionServiceMap["reportTaskFinish"] = "MetaService" - self104.functionServiceMap["createBackup"] = "MetaService" - self104.functionServiceMap["restoreMeta"] = "MetaService" - self104.functionServiceMap["listCluster"] = "MetaService" - self104.functionServiceMap["getMetaDirInfo"] = "MetaService" - self104.functionServiceMap["verifyClientVersion"] = "MetaService" - self104.functionServiceMap["saveGraphVersion"] = "MetaService" - self104.functionServiceMap["getSegmentId"] = "MetaService" - return self104 + self110 := &MetaServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext), functionServiceMap:make(map[string]string)} + self110.processorMap["createSpace"] = &metaServiceProcessorCreateSpace{handler:handler} + self110.processorMap["dropSpace"] = &metaServiceProcessorDropSpace{handler:handler} + self110.processorMap["clearSpace"] = &metaServiceProcessorClearSpace{handler:handler} + self110.processorMap["getSpace"] = &metaServiceProcessorGetSpace{handler:handler} + self110.processorMap["listSpaces"] = &metaServiceProcessorListSpaces{handler:handler} + self110.processorMap["alterSpace"] = &metaServiceProcessorAlterSpace{handler:handler} + self110.processorMap["createSpaceAs"] = &metaServiceProcessorCreateSpaceAs{handler:handler} + self110.processorMap["createTag"] = &metaServiceProcessorCreateTag{handler:handler} + self110.processorMap["alterTag"] = &metaServiceProcessorAlterTag{handler:handler} + self110.processorMap["dropTag"] = &metaServiceProcessorDropTag{handler:handler} + self110.processorMap["getTag"] = &metaServiceProcessorGetTag{handler:handler} + self110.processorMap["listTags"] = &metaServiceProcessorListTags{handler:handler} + self110.processorMap["createEdge"] = &metaServiceProcessorCreateEdge{handler:handler} + self110.processorMap["alterEdge"] = &metaServiceProcessorAlterEdge{handler:handler} + self110.processorMap["dropEdge"] = &metaServiceProcessorDropEdge{handler:handler} + self110.processorMap["getEdge"] = &metaServiceProcessorGetEdge{handler:handler} + self110.processorMap["listEdges"] = &metaServiceProcessorListEdges{handler:handler} + self110.processorMap["addHosts"] = &metaServiceProcessorAddHosts{handler:handler} + self110.processorMap["addHostsIntoZone"] = &metaServiceProcessorAddHostsIntoZone{handler:handler} + self110.processorMap["dropHosts"] = &metaServiceProcessorDropHosts{handler:handler} + self110.processorMap["listHosts"] = &metaServiceProcessorListHosts{handler:handler} + self110.processorMap["getPartsAlloc"] = &metaServiceProcessorGetPartsAlloc{handler:handler} + self110.processorMap["listParts"] = &metaServiceProcessorListParts{handler:handler} + self110.processorMap["getWorkerId"] = &metaServiceProcessorGetWorkerId{handler:handler} + self110.processorMap["createTagIndex"] = &metaServiceProcessorCreateTagIndex{handler:handler} + self110.processorMap["dropTagIndex"] = &metaServiceProcessorDropTagIndex{handler:handler} + self110.processorMap["getTagIndex"] = &metaServiceProcessorGetTagIndex{handler:handler} + self110.processorMap["listTagIndexes"] = &metaServiceProcessorListTagIndexes{handler:handler} + self110.processorMap["rebuildTagIndex"] = &metaServiceProcessorRebuildTagIndex{handler:handler} + self110.processorMap["listTagIndexStatus"] = &metaServiceProcessorListTagIndexStatus{handler:handler} + self110.processorMap["createEdgeIndex"] = &metaServiceProcessorCreateEdgeIndex{handler:handler} + self110.processorMap["dropEdgeIndex"] = &metaServiceProcessorDropEdgeIndex{handler:handler} + self110.processorMap["getEdgeIndex"] = &metaServiceProcessorGetEdgeIndex{handler:handler} + self110.processorMap["listEdgeIndexes"] = &metaServiceProcessorListEdgeIndexes{handler:handler} + self110.processorMap["rebuildEdgeIndex"] = &metaServiceProcessorRebuildEdgeIndex{handler:handler} + self110.processorMap["listEdgeIndexStatus"] = &metaServiceProcessorListEdgeIndexStatus{handler:handler} + self110.processorMap["createUser"] = &metaServiceProcessorCreateUser{handler:handler} + self110.processorMap["dropUser"] = &metaServiceProcessorDropUser{handler:handler} + self110.processorMap["alterUser"] = &metaServiceProcessorAlterUser{handler:handler} + self110.processorMap["grantRole"] = &metaServiceProcessorGrantRole{handler:handler} + self110.processorMap["revokeRole"] = &metaServiceProcessorRevokeRole{handler:handler} + self110.processorMap["listUsers"] = &metaServiceProcessorListUsers{handler:handler} + self110.processorMap["listRoles"] = &metaServiceProcessorListRoles{handler:handler} + self110.processorMap["getUserRoles"] = &metaServiceProcessorGetUserRoles{handler:handler} + self110.processorMap["changePassword"] = &metaServiceProcessorChangePassword{handler:handler} + self110.processorMap["heartBeat"] = &metaServiceProcessorHeartBeat{handler:handler} + self110.processorMap["agentHeartbeat"] = &metaServiceProcessorAgentHeartbeat{handler:handler} + self110.processorMap["regConfig"] = &metaServiceProcessorRegConfig{handler:handler} + self110.processorMap["getConfig"] = &metaServiceProcessorGetConfig{handler:handler} + self110.processorMap["setConfig"] = &metaServiceProcessorSetConfig{handler:handler} + self110.processorMap["listConfigs"] = &metaServiceProcessorListConfigs{handler:handler} + self110.processorMap["createSnapshot"] = &metaServiceProcessorCreateSnapshot{handler:handler} + self110.processorMap["dropSnapshot"] = &metaServiceProcessorDropSnapshot{handler:handler} + self110.processorMap["listSnapshots"] = &metaServiceProcessorListSnapshots{handler:handler} + self110.processorMap["runAdminJob"] = &metaServiceProcessorRunAdminJob{handler:handler} + self110.processorMap["mergeZone"] = &metaServiceProcessorMergeZone{handler:handler} + self110.processorMap["dropZone"] = &metaServiceProcessorDropZone{handler:handler} + self110.processorMap["divideZone"] = &metaServiceProcessorDivideZone{handler:handler} + self110.processorMap["renameZone"] = &metaServiceProcessorRenameZone{handler:handler} + self110.processorMap["getZone"] = &metaServiceProcessorGetZone{handler:handler} + self110.processorMap["listZones"] = &metaServiceProcessorListZones{handler:handler} + self110.processorMap["addListener"] = &metaServiceProcessorAddListener{handler:handler} + self110.processorMap["removeListener"] = &metaServiceProcessorRemoveListener{handler:handler} + self110.processorMap["listListener"] = &metaServiceProcessorListListener{handler:handler} + self110.processorMap["getStats"] = &metaServiceProcessorGetStats{handler:handler} + self110.processorMap["signInService"] = &metaServiceProcessorSignInService{handler:handler} + self110.processorMap["signOutService"] = &metaServiceProcessorSignOutService{handler:handler} + self110.processorMap["listServiceClients"] = &metaServiceProcessorListServiceClients{handler:handler} + self110.processorMap["createFTIndex"] = &metaServiceProcessorCreateFTIndex{handler:handler} + self110.processorMap["dropFTIndex"] = &metaServiceProcessorDropFTIndex{handler:handler} + self110.processorMap["listFTIndexes"] = &metaServiceProcessorListFTIndexes{handler:handler} + self110.processorMap["createSession"] = &metaServiceProcessorCreateSession{handler:handler} + self110.processorMap["updateSessions"] = &metaServiceProcessorUpdateSessions{handler:handler} + self110.processorMap["listSessions"] = &metaServiceProcessorListSessions{handler:handler} + self110.processorMap["getSession"] = &metaServiceProcessorGetSession{handler:handler} + self110.processorMap["removeSession"] = &metaServiceProcessorRemoveSession{handler:handler} + self110.processorMap["killQuery"] = &metaServiceProcessorKillQuery{handler:handler} + self110.processorMap["reportTaskFinish"] = &metaServiceProcessorReportTaskFinish{handler:handler} + self110.processorMap["createBackup"] = &metaServiceProcessorCreateBackup{handler:handler} + self110.processorMap["restoreMeta"] = &metaServiceProcessorRestoreMeta{handler:handler} + self110.processorMap["listCluster"] = &metaServiceProcessorListCluster{handler:handler} + self110.processorMap["getMetaDirInfo"] = &metaServiceProcessorGetMetaDirInfo{handler:handler} + self110.processorMap["verifyClientVersion"] = &metaServiceProcessorVerifyClientVersion{handler:handler} + self110.processorMap["saveGraphVersion"] = &metaServiceProcessorSaveGraphVersion{handler:handler} + self110.processorMap["getSegmentId"] = &metaServiceProcessorGetSegmentId{handler:handler} + self110.functionServiceMap["createSpace"] = "MetaService" + self110.functionServiceMap["dropSpace"] = "MetaService" + self110.functionServiceMap["clearSpace"] = "MetaService" + self110.functionServiceMap["getSpace"] = "MetaService" + self110.functionServiceMap["listSpaces"] = "MetaService" + self110.functionServiceMap["alterSpace"] = "MetaService" + self110.functionServiceMap["createSpaceAs"] = "MetaService" + self110.functionServiceMap["createTag"] = "MetaService" + self110.functionServiceMap["alterTag"] = "MetaService" + self110.functionServiceMap["dropTag"] = "MetaService" + self110.functionServiceMap["getTag"] = "MetaService" + self110.functionServiceMap["listTags"] = "MetaService" + self110.functionServiceMap["createEdge"] = "MetaService" + self110.functionServiceMap["alterEdge"] = "MetaService" + self110.functionServiceMap["dropEdge"] = "MetaService" + self110.functionServiceMap["getEdge"] = "MetaService" + self110.functionServiceMap["listEdges"] = "MetaService" + self110.functionServiceMap["addHosts"] = "MetaService" + self110.functionServiceMap["addHostsIntoZone"] = "MetaService" + self110.functionServiceMap["dropHosts"] = "MetaService" + self110.functionServiceMap["listHosts"] = "MetaService" + self110.functionServiceMap["getPartsAlloc"] = "MetaService" + self110.functionServiceMap["listParts"] = "MetaService" + self110.functionServiceMap["getWorkerId"] = "MetaService" + self110.functionServiceMap["createTagIndex"] = "MetaService" + self110.functionServiceMap["dropTagIndex"] = "MetaService" + self110.functionServiceMap["getTagIndex"] = "MetaService" + self110.functionServiceMap["listTagIndexes"] = "MetaService" + self110.functionServiceMap["rebuildTagIndex"] = "MetaService" + self110.functionServiceMap["listTagIndexStatus"] = "MetaService" + self110.functionServiceMap["createEdgeIndex"] = "MetaService" + self110.functionServiceMap["dropEdgeIndex"] = "MetaService" + self110.functionServiceMap["getEdgeIndex"] = "MetaService" + self110.functionServiceMap["listEdgeIndexes"] = "MetaService" + self110.functionServiceMap["rebuildEdgeIndex"] = "MetaService" + self110.functionServiceMap["listEdgeIndexStatus"] = "MetaService" + self110.functionServiceMap["createUser"] = "MetaService" + self110.functionServiceMap["dropUser"] = "MetaService" + self110.functionServiceMap["alterUser"] = "MetaService" + self110.functionServiceMap["grantRole"] = "MetaService" + self110.functionServiceMap["revokeRole"] = "MetaService" + self110.functionServiceMap["listUsers"] = "MetaService" + self110.functionServiceMap["listRoles"] = "MetaService" + self110.functionServiceMap["getUserRoles"] = "MetaService" + self110.functionServiceMap["changePassword"] = "MetaService" + self110.functionServiceMap["heartBeat"] = "MetaService" + self110.functionServiceMap["agentHeartbeat"] = "MetaService" + self110.functionServiceMap["regConfig"] = "MetaService" + self110.functionServiceMap["getConfig"] = "MetaService" + self110.functionServiceMap["setConfig"] = "MetaService" + self110.functionServiceMap["listConfigs"] = "MetaService" + self110.functionServiceMap["createSnapshot"] = "MetaService" + self110.functionServiceMap["dropSnapshot"] = "MetaService" + self110.functionServiceMap["listSnapshots"] = "MetaService" + self110.functionServiceMap["runAdminJob"] = "MetaService" + self110.functionServiceMap["mergeZone"] = "MetaService" + self110.functionServiceMap["dropZone"] = "MetaService" + self110.functionServiceMap["divideZone"] = "MetaService" + self110.functionServiceMap["renameZone"] = "MetaService" + self110.functionServiceMap["getZone"] = "MetaService" + self110.functionServiceMap["listZones"] = "MetaService" + self110.functionServiceMap["addListener"] = "MetaService" + self110.functionServiceMap["removeListener"] = "MetaService" + self110.functionServiceMap["listListener"] = "MetaService" + self110.functionServiceMap["getStats"] = "MetaService" + self110.functionServiceMap["signInService"] = "MetaService" + self110.functionServiceMap["signOutService"] = "MetaService" + self110.functionServiceMap["listServiceClients"] = "MetaService" + self110.functionServiceMap["createFTIndex"] = "MetaService" + self110.functionServiceMap["dropFTIndex"] = "MetaService" + self110.functionServiceMap["listFTIndexes"] = "MetaService" + self110.functionServiceMap["createSession"] = "MetaService" + self110.functionServiceMap["updateSessions"] = "MetaService" + self110.functionServiceMap["listSessions"] = "MetaService" + self110.functionServiceMap["getSession"] = "MetaService" + self110.functionServiceMap["removeSession"] = "MetaService" + self110.functionServiceMap["killQuery"] = "MetaService" + self110.functionServiceMap["reportTaskFinish"] = "MetaService" + self110.functionServiceMap["createBackup"] = "MetaService" + self110.functionServiceMap["restoreMeta"] = "MetaService" + self110.functionServiceMap["listCluster"] = "MetaService" + self110.functionServiceMap["getMetaDirInfo"] = "MetaService" + self110.functionServiceMap["verifyClientVersion"] = "MetaService" + self110.functionServiceMap["saveGraphVersion"] = "MetaService" + self110.functionServiceMap["getSegmentId"] = "MetaService" + return self110 } type metaServiceProcessorCreateSpace struct { @@ -30222,15 +30222,15 @@ func (p *MetaServiceRestoreMetaArgs) String() string { // - Success type MetaServiceRestoreMetaResult struct { thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` + Success *RestoreMetaResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` } func NewMetaServiceRestoreMetaResult() *MetaServiceRestoreMetaResult { return &MetaServiceRestoreMetaResult{} } -var MetaServiceRestoreMetaResult_Success_DEFAULT *ExecResp -func (p *MetaServiceRestoreMetaResult) GetSuccess() *ExecResp { +var MetaServiceRestoreMetaResult_Success_DEFAULT *RestoreMetaResp +func (p *MetaServiceRestoreMetaResult) GetSuccess() *RestoreMetaResp { if !p.IsSetSuccess() { return MetaServiceRestoreMetaResult_Success_DEFAULT } @@ -30256,12 +30256,12 @@ func (p MetaServiceRestoreMetaResultBuilder) Emit() *MetaServiceRestoreMetaResul } } -func (m *MetaServiceRestoreMetaResultBuilder) Success(success *ExecResp) *MetaServiceRestoreMetaResultBuilder { +func (m *MetaServiceRestoreMetaResultBuilder) Success(success *RestoreMetaResp) *MetaServiceRestoreMetaResultBuilder { m.obj.Success = success return m } -func (m *MetaServiceRestoreMetaResult) SetSuccess(success *ExecResp) *MetaServiceRestoreMetaResult { +func (m *MetaServiceRestoreMetaResult) SetSuccess(success *RestoreMetaResp) *MetaServiceRestoreMetaResult { m.Success = success return m } @@ -30299,7 +30299,7 @@ func (p *MetaServiceRestoreMetaResult) Read(iprot thrift.Protocol) error { } func (p *MetaServiceRestoreMetaResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewExecResp() + p.Success = NewRestoreMetaResp() if err := p.Success.Read(iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) } diff --git a/nebula/meta/ttypes.go b/nebula/meta/ttypes.go index 28ca0266..e04640e2 100644 --- a/nebula/meta/ttypes.go +++ b/nebula/meta/ttypes.go @@ -22943,9 +22943,9 @@ func (p *CreateSnapshotReq) String() string { } // Attributes: -// - Name +// - Names type DropSnapshotReq struct { - Name []byte `thrift:"name,1" db:"name" json:"name"` + Names [][]byte `thrift:"names,1" db:"names" json:"names"` } func NewDropSnapshotReq() *DropSnapshotReq { @@ -22953,8 +22953,8 @@ func NewDropSnapshotReq() *DropSnapshotReq { } -func (p *DropSnapshotReq) GetName() []byte { - return p.Name +func (p *DropSnapshotReq) GetNames() [][]byte { + return p.Names } type DropSnapshotReqBuilder struct { obj *DropSnapshotReq @@ -22968,17 +22968,17 @@ func NewDropSnapshotReqBuilder() *DropSnapshotReqBuilder{ func (p DropSnapshotReqBuilder) Emit() *DropSnapshotReq{ return &DropSnapshotReq{ - Name: p.obj.Name, + Names: p.obj.Names, } } -func (d *DropSnapshotReqBuilder) Name(name []byte) *DropSnapshotReqBuilder { - d.obj.Name = name +func (d *DropSnapshotReqBuilder) Names(names [][]byte) *DropSnapshotReqBuilder { + d.obj.Names = names return d } -func (d *DropSnapshotReq) SetName(name []byte) *DropSnapshotReq { - d.Name = name +func (d *DropSnapshotReq) SetNames(names [][]byte) *DropSnapshotReq { + d.Names = names return d } @@ -23015,10 +23015,23 @@ func (p *DropSnapshotReq) Read(iprot thrift.Protocol) error { } func (p *DropSnapshotReq) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Name = v + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Names = tSlice + for i := 0; i < size; i ++ { + var _elem61 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem61 = v + } + p.Names = append(p.Names, _elem61) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) } return nil } @@ -23035,12 +23048,20 @@ func (p *DropSnapshotReq) Write(oprot thrift.Protocol) error { } func (p *DropSnapshotReq) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) } - if err := oprot.WriteBinary(p.Name); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) } + if err := oprot.WriteFieldBegin("names", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Names)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Names { + 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 1:name: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:names: ", p), err) } return err } @@ -23049,8 +23070,8 @@ func (p *DropSnapshotReq) String() string { return "" } - nameVal := fmt.Sprintf("%v", p.Name) - return fmt.Sprintf("DropSnapshotReq({Name:%s})", nameVal) + namesVal := fmt.Sprintf("%v", p.Names) + return fmt.Sprintf("DropSnapshotReq({Names:%s})", namesVal) } type ListSnapshotsReq struct { @@ -23463,11 +23484,11 @@ func (p *ListSnapshotsResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*Snapshot, 0, size) p.Snapshots = tSlice for i := 0; i < size; i ++ { - _elem61 := NewSnapshot() - if err := _elem61.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem61), err) + _elem62 := NewSnapshot() + if err := _elem62.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) } - p.Snapshots = append(p.Snapshots, _elem61) + p.Snapshots = append(p.Snapshots, _elem62) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -23958,11 +23979,11 @@ func (p *ListIndexStatusResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*IndexStatus, 0, size) p.Statuses = tSlice for i := 0; i < size; i ++ { - _elem62 := NewIndexStatus() - if err := _elem62.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) + _elem63 := NewIndexStatus() + if err := _elem63.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem63), err) } - p.Statuses = append(p.Statuses, _elem62) + p.Statuses = append(p.Statuses, _elem63) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -24140,13 +24161,13 @@ func (p *MergeZoneReq) ReadField1(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Zones = tSlice for i := 0; i < size; i ++ { - var _elem63 []byte + var _elem64 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem63 = v + _elem64 = v } - p.Zones = append(p.Zones, _elem63) + p.Zones = append(p.Zones, _elem64) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -24434,29 +24455,29 @@ func (p *DivideZoneReq) ReadField2(iprot thrift.Protocol) error { tMap := make(map[string][]*nebula0.HostAddr, size) p.ZoneItems = tMap for i := 0; i < size; i ++ { - var _key64 string + var _key65 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key64 = v + _key65 = v } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*nebula0.HostAddr, 0, size) - _val65 := tSlice + _val66 := 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) + _elem67 := nebula0.NewHostAddr() + if err := _elem67.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem67), err) } - _val65 = append(_val65, _elem66) + _val66 = append(_val66, _elem67) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.ZoneItems[_key64] = _val65 + p.ZoneItems[_key65] = _val66 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -24800,11 +24821,11 @@ func (p *AddHostsIntoZoneReq) ReadField1(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Hosts = tSlice for i := 0; i < size; i ++ { - _elem67 := nebula0.NewHostAddr() - if err := _elem67.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem67), err) + _elem68 := nebula0.NewHostAddr() + if err := _elem68.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem68), err) } - p.Hosts = append(p.Hosts, _elem67) + p.Hosts = append(p.Hosts, _elem68) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -25153,11 +25174,11 @@ func (p *GetZoneResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Hosts = tSlice for i := 0; i < size; i ++ { - _elem68 := nebula0.NewHostAddr() - if err := _elem68.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem68), err) + _elem69 := nebula0.NewHostAddr() + if err := _elem69.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem69), err) } - p.Hosts = append(p.Hosts, _elem68) + p.Hosts = append(p.Hosts, _elem69) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -25409,11 +25430,11 @@ func (p *Zone) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Nodes = tSlice for i := 0; i < size; i ++ { - _elem69 := nebula0.NewHostAddr() - if err := _elem69.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem69), err) + _elem70 := nebula0.NewHostAddr() + if err := _elem70.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem70), err) } - p.Nodes = append(p.Nodes, _elem69) + p.Nodes = append(p.Nodes, _elem70) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -25621,11 +25642,11 @@ func (p *ListZonesResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*Zone, 0, size) p.Zones = tSlice for i := 0; i < size; i ++ { - _elem70 := NewZone() - if err := _elem70.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem70), err) + _elem71 := NewZone() + if err := _elem71.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem71), err) } - p.Zones = append(p.Zones, _elem70) + p.Zones = append(p.Zones, _elem71) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -25844,11 +25865,11 @@ func (p *AddListenerReq) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Hosts = tSlice for i := 0; i < size; i ++ { - _elem71 := nebula0.NewHostAddr() - if err := _elem71.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem71), err) + _elem72 := nebula0.NewHostAddr() + if err := _elem72.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem72), err) } - p.Hosts = append(p.Hosts, _elem71) + p.Hosts = append(p.Hosts, _elem72) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -26589,11 +26610,11 @@ func (p *ListListenerResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*ListenerInfo, 0, size) p.Listeners = tSlice for i := 0; i < size; i ++ { - _elem72 := NewListenerInfo() - if err := _elem72.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem72), err) + _elem73 := NewListenerInfo() + if err := _elem73.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem73), err) } - p.Listeners = append(p.Listeners, _elem72) + p.Listeners = append(p.Listeners, _elem73) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -27123,11 +27144,11 @@ func (p *HostBackupInfo) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*nebula0.CheckpointInfo, 0, size) p.Checkpoints = tSlice for i := 0; i < size; i ++ { - _elem73 := nebula0.NewCheckpointInfo() - if err := _elem73.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem73), err) + _elem74 := nebula0.NewCheckpointInfo() + if err := _elem74.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem74), err) } - p.Checkpoints = append(p.Checkpoints, _elem73) + p.Checkpoints = append(p.Checkpoints, _elem74) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -27310,11 +27331,11 @@ func (p *SpaceBackupInfo) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*HostBackupInfo, 0, size) p.HostBackups = tSlice for i := 0; i < size; i ++ { - _elem74 := NewHostBackupInfo() - if err := _elem74.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem74), err) + _elem75 := NewHostBackupInfo() + if err := _elem75.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem75), err) } - p.HostBackups = append(p.HostBackups, _elem74) + p.HostBackups = append(p.HostBackups, _elem75) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -27386,6 +27407,9 @@ func (p *SpaceBackupInfo) String() string { // - Full // - AllSpaces // - CreateTime +// - BaseBackupName +// - StorageHosts +// - ClusterID type BackupMeta struct { SpaceBackups map[nebula0.GraphSpaceID]*SpaceBackupInfo `thrift:"space_backups,1" db:"space_backups" json:"space_backups"` MetaFiles [][]byte `thrift:"meta_files,2" db:"meta_files" json:"meta_files"` @@ -27393,6 +27417,9 @@ type BackupMeta struct { Full bool `thrift:"full,4" db:"full" json:"full"` AllSpaces bool `thrift:"all_spaces,5" db:"all_spaces" json:"all_spaces"` CreateTime int64 `thrift:"create_time,6" db:"create_time" json:"create_time"` + BaseBackupName []byte `thrift:"base_backup_name,7" db:"base_backup_name" json:"base_backup_name"` + StorageHosts []*nebula0.HostAddr `thrift:"storage_hosts,8" db:"storage_hosts" json:"storage_hosts"` + ClusterID ClusterID `thrift:"cluster_id,9" db:"cluster_id" json:"cluster_id"` } func NewBackupMeta() *BackupMeta { @@ -27423,6 +27450,18 @@ func (p *BackupMeta) GetAllSpaces() bool { func (p *BackupMeta) GetCreateTime() int64 { return p.CreateTime } + +func (p *BackupMeta) GetBaseBackupName() []byte { + return p.BaseBackupName +} + +func (p *BackupMeta) GetStorageHosts() []*nebula0.HostAddr { + return p.StorageHosts +} + +func (p *BackupMeta) GetClusterID() ClusterID { + return p.ClusterID +} type BackupMetaBuilder struct { obj *BackupMeta } @@ -27441,6 +27480,9 @@ func (p BackupMetaBuilder) Emit() *BackupMeta{ Full: p.obj.Full, AllSpaces: p.obj.AllSpaces, CreateTime: p.obj.CreateTime, + BaseBackupName: p.obj.BaseBackupName, + StorageHosts: p.obj.StorageHosts, + ClusterID: p.obj.ClusterID, } } @@ -27474,6 +27516,21 @@ func (b *BackupMetaBuilder) CreateTime(createTime int64) *BackupMetaBuilder { return b } +func (b *BackupMetaBuilder) BaseBackupName(baseBackupName []byte) *BackupMetaBuilder { + b.obj.BaseBackupName = baseBackupName + return b +} + +func (b *BackupMetaBuilder) StorageHosts(storageHosts []*nebula0.HostAddr) *BackupMetaBuilder { + b.obj.StorageHosts = storageHosts + return b +} + +func (b *BackupMetaBuilder) ClusterID(clusterID ClusterID) *BackupMetaBuilder { + b.obj.ClusterID = clusterID + return b +} + func (b *BackupMeta) SetSpaceBackups(spaceBackups map[nebula0.GraphSpaceID]*SpaceBackupInfo) *BackupMeta { b.SpaceBackups = spaceBackups return b @@ -27504,6 +27561,21 @@ func (b *BackupMeta) SetCreateTime(createTime int64) *BackupMeta { return b } +func (b *BackupMeta) SetBaseBackupName(baseBackupName []byte) *BackupMeta { + b.BaseBackupName = baseBackupName + return b +} + +func (b *BackupMeta) SetStorageHosts(storageHosts []*nebula0.HostAddr) *BackupMeta { + b.StorageHosts = storageHosts + return b +} + +func (b *BackupMeta) SetClusterID(clusterID ClusterID) *BackupMeta { + b.ClusterID = clusterID + return b +} + func (p *BackupMeta) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -27541,6 +27613,18 @@ func (p *BackupMeta) 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 + } + case 8: + if err := p.ReadField8(iprot); err != nil { + return err + } + case 9: + if err := p.ReadField9(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -27564,18 +27648,18 @@ func (p *BackupMeta) ReadField1(iprot thrift.Protocol) error { tMap := make(map[nebula0.GraphSpaceID]*SpaceBackupInfo, size) p.SpaceBackups = tMap for i := 0; i < size; i ++ { - var _key75 nebula0.GraphSpaceID + var _key76 nebula0.GraphSpaceID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.GraphSpaceID(v) - _key75 = temp + _key76 = temp } - _val76 := NewSpaceBackupInfo() - if err := _val76.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val76), err) + _val77 := NewSpaceBackupInfo() + if err := _val77.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val77), err) } - p.SpaceBackups[_key75] = _val76 + p.SpaceBackups[_key76] = _val77 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -27591,13 +27675,13 @@ func (p *BackupMeta) ReadField2(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.MetaFiles = tSlice for i := 0; i < size; i ++ { - var _elem77 []byte + var _elem78 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem77 = v + _elem78 = v } - p.MetaFiles = append(p.MetaFiles, _elem77) + p.MetaFiles = append(p.MetaFiles, _elem78) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -27641,6 +27725,45 @@ func (p *BackupMeta) ReadField6(iprot thrift.Protocol) error { return nil } +func (p *BackupMeta) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.BaseBackupName = v + } + return nil +} + +func (p *BackupMeta) ReadField8(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.StorageHosts = tSlice + for i := 0; i < size; i ++ { + _elem79 := nebula0.NewHostAddr() + if err := _elem79.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem79), err) + } + p.StorageHosts = append(p.StorageHosts, _elem79) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BackupMeta) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + temp := ClusterID(v) + p.ClusterID = temp + } + return nil +} + func (p *BackupMeta) Write(oprot thrift.Protocol) error { if err := oprot.WriteStructBegin("BackupMeta"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -27650,6 +27773,9 @@ func (p *BackupMeta) 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 := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } if err := oprot.WriteStructEnd(); err != nil { @@ -27736,6 +27862,45 @@ func (p *BackupMeta) writeField6(oprot thrift.Protocol) (err error) { return err } +func (p *BackupMeta) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("base_backup_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:base_backup_name: ", p), err) } + if err := oprot.WriteBinary(p.BaseBackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.base_backup_name (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:base_backup_name: ", p), err) } + return err +} + +func (p *BackupMeta) writeField8(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("storage_hosts", thrift.LIST, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:storage_hosts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StorageHosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StorageHosts { + 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 8:storage_hosts: ", p), err) } + return err +} + +func (p *BackupMeta) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cluster_id", thrift.I64, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:cluster_id: ", p), err) } + if err := oprot.WriteI64(int64(p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:cluster_id: ", p), err) } + return err +} + func (p *BackupMeta) String() string { if p == nil { return "" @@ -27747,13 +27912,20 @@ func (p *BackupMeta) String() string { fullVal := fmt.Sprintf("%v", p.Full) allSpacesVal := fmt.Sprintf("%v", p.AllSpaces) createTimeVal := fmt.Sprintf("%v", p.CreateTime) - return fmt.Sprintf("BackupMeta({SpaceBackups:%s MetaFiles:%s BackupName:%s Full:%s AllSpaces:%s CreateTime:%s})", spaceBackupsVal, metaFilesVal, backupNameVal, fullVal, allSpacesVal, createTimeVal) + baseBackupNameVal := fmt.Sprintf("%v", p.BaseBackupName) + storageHostsVal := fmt.Sprintf("%v", p.StorageHosts) + clusterIDVal := fmt.Sprintf("%v", p.ClusterID) + return fmt.Sprintf("BackupMeta({SpaceBackups:%s MetaFiles:%s BackupName:%s Full:%s AllSpaces:%s CreateTime:%s BaseBackupName:%s StorageHosts:%s ClusterID:%s})", spaceBackupsVal, metaFilesVal, backupNameVal, fullVal, allSpacesVal, createTimeVal, baseBackupNameVal, storageHostsVal, clusterIDVal) } // Attributes: // - Spaces +// - BaseBackupName +// - ClusterID type CreateBackupReq struct { Spaces [][]byte `thrift:"spaces,1,optional" db:"spaces" json:"spaces,omitempty"` + BaseBackupName []byte `thrift:"base_backup_name,2,optional" db:"base_backup_name" json:"base_backup_name,omitempty"` + ClusterID *ClusterID `thrift:"cluster_id,3,optional" db:"cluster_id" json:"cluster_id,omitempty"` } func NewCreateBackupReq() *CreateBackupReq { @@ -27765,10 +27937,30 @@ var CreateBackupReq_Spaces_DEFAULT [][]byte func (p *CreateBackupReq) GetSpaces() [][]byte { return p.Spaces } +var CreateBackupReq_BaseBackupName_DEFAULT []byte + +func (p *CreateBackupReq) GetBaseBackupName() []byte { + return p.BaseBackupName +} +var CreateBackupReq_ClusterID_DEFAULT ClusterID +func (p *CreateBackupReq) GetClusterID() ClusterID { + if !p.IsSetClusterID() { + return CreateBackupReq_ClusterID_DEFAULT + } +return *p.ClusterID +} func (p *CreateBackupReq) IsSetSpaces() bool { return p != nil && p.Spaces != nil } +func (p *CreateBackupReq) IsSetBaseBackupName() bool { + return p != nil && p.BaseBackupName != nil +} + +func (p *CreateBackupReq) IsSetClusterID() bool { + return p != nil && p.ClusterID != nil +} + type CreateBackupReqBuilder struct { obj *CreateBackupReq } @@ -27782,6 +27974,8 @@ func NewCreateBackupReqBuilder() *CreateBackupReqBuilder{ func (p CreateBackupReqBuilder) Emit() *CreateBackupReq{ return &CreateBackupReq{ Spaces: p.obj.Spaces, + BaseBackupName: p.obj.BaseBackupName, + ClusterID: p.obj.ClusterID, } } @@ -27790,11 +27984,31 @@ func (c *CreateBackupReqBuilder) Spaces(spaces [][]byte) *CreateBackupReqBuilder return c } +func (c *CreateBackupReqBuilder) BaseBackupName(baseBackupName []byte) *CreateBackupReqBuilder { + c.obj.BaseBackupName = baseBackupName + return c +} + +func (c *CreateBackupReqBuilder) ClusterID(clusterID *ClusterID) *CreateBackupReqBuilder { + c.obj.ClusterID = clusterID + return c +} + func (c *CreateBackupReq) SetSpaces(spaces [][]byte) *CreateBackupReq { c.Spaces = spaces return c } +func (c *CreateBackupReq) SetBaseBackupName(baseBackupName []byte) *CreateBackupReq { + c.BaseBackupName = baseBackupName + return c +} + +func (c *CreateBackupReq) SetClusterID(clusterID *ClusterID) *CreateBackupReq { + c.ClusterID = clusterID + return c +} + func (p *CreateBackupReq) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -27812,6 +28026,14 @@ func (p *CreateBackupReq) 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 + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -27835,13 +28057,13 @@ func (p *CreateBackupReq) ReadField1(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Spaces = tSlice for i := 0; i < size; i ++ { - var _elem78 []byte + var _elem80 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem78 = v + _elem80 = v } - p.Spaces = append(p.Spaces, _elem78) + p.Spaces = append(p.Spaces, _elem80) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -27849,10 +28071,31 @@ func (p *CreateBackupReq) ReadField1(iprot thrift.Protocol) error { return nil } +func (p *CreateBackupReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.BaseBackupName = v + } + return nil +} + +func (p *CreateBackupReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := ClusterID(v) + p.ClusterID = &temp + } + return nil +} + func (p *CreateBackupReq) Write(oprot thrift.Protocol) error { if err := oprot.WriteStructBegin("CreateBackupReq"); 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 { @@ -27880,13 +28123,44 @@ func (p *CreateBackupReq) writeField1(oprot thrift.Protocol) (err error) { return err } +func (p *CreateBackupReq) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetBaseBackupName() { + if err := oprot.WriteFieldBegin("base_backup_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:base_backup_name: ", p), err) } + if err := oprot.WriteBinary(p.BaseBackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.base_backup_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:base_backup_name: ", p), err) } + } + return err +} + +func (p *CreateBackupReq) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetClusterID() { + if err := oprot.WriteFieldBegin("cluster_id", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cluster_id: ", p), err) } + if err := oprot.WriteI64(int64(*p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cluster_id: ", p), err) } + } + return err +} + func (p *CreateBackupReq) String() string { if p == nil { return "" } spacesVal := fmt.Sprintf("%v", p.Spaces) - return fmt.Sprintf("CreateBackupReq({Spaces:%s})", spacesVal) + baseBackupNameVal := fmt.Sprintf("%v", p.BaseBackupName) + var clusterIDVal string + if p.ClusterID == nil { + clusterIDVal = "" + } else { + clusterIDVal = fmt.Sprintf("%v", *p.ClusterID) + } + return fmt.Sprintf("CreateBackupReq({Spaces:%s BaseBackupName:%s ClusterID:%s})", spacesVal, baseBackupNameVal, clusterIDVal) } // Attributes: @@ -28393,13 +28667,13 @@ func (p *RestoreMetaReq) ReadField1(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Files = tSlice for i := 0; i < size; i ++ { - var _elem79 []byte + var _elem81 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem79 = v + _elem81 = v } - p.Files = append(p.Files, _elem79) + p.Files = append(p.Files, _elem81) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -28415,11 +28689,11 @@ func (p *RestoreMetaReq) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*HostPair, 0, size) p.Hosts = tSlice for i := 0; i < size; i ++ { - _elem80 := NewHostPair() - if err := _elem80.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem80), err) + _elem82 := NewHostPair() + if err := _elem82.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem82), err) } - p.Hosts = append(p.Hosts, _elem80) + p.Hosts = append(p.Hosts, _elem82) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -28486,6 +28760,439 @@ func (p *RestoreMetaReq) String() string { return fmt.Sprintf("RestoreMetaReq({Files:%s Hosts:%s})", filesVal, hostsVal) } +// Attributes: +// - PartID +// - Hosts +type PartInfo struct { + PartID nebula0.PartitionID `thrift:"part_id,1" db:"part_id" json:"part_id"` + Hosts []*nebula0.HostAddr `thrift:"hosts,2" db:"hosts" json:"hosts"` +} + +func NewPartInfo() *PartInfo { + return &PartInfo{} +} + + +func (p *PartInfo) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *PartInfo) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +type PartInfoBuilder struct { + obj *PartInfo +} + +func NewPartInfoBuilder() *PartInfoBuilder{ + return &PartInfoBuilder{ + obj: NewPartInfo(), + } +} + +func (p PartInfoBuilder) Emit() *PartInfo{ + return &PartInfo{ + PartID: p.obj.PartID, + Hosts: p.obj.Hosts, + } +} + +func (p *PartInfoBuilder) PartID(partID nebula0.PartitionID) *PartInfoBuilder { + p.obj.PartID = partID + return p +} + +func (p *PartInfoBuilder) Hosts(hosts []*nebula0.HostAddr) *PartInfoBuilder { + p.obj.Hosts = hosts + return p +} + +func (p *PartInfo) SetPartID(partID nebula0.PartitionID) *PartInfo { + p.PartID = partID + return p +} + +func (p *PartInfo) SetHosts(hosts []*nebula0.HostAddr) *PartInfo { + p.Hosts = hosts + return p +} + +func (p *PartInfo) 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 *PartInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.PartitionID(v) + p.PartID = temp + } + return nil +} + +func (p *PartInfo) 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.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem83 := nebula0.NewHostAddr() + if err := _elem83.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem83), err) + } + p.Hosts = append(p.Hosts, _elem83) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartInfo"); 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 *PartInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:part_id: ", p), err) } + return err +} + +func (p *PartInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2: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 2:hosts: ", p), err) } + return err +} + +func (p *PartInfo) String() string { + if p == nil { + return "" + } + + partIDVal := fmt.Sprintf("%v", p.PartID) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("PartInfo({PartID:%s Hosts:%s})", partIDVal, hostsVal) +} + +// Attributes: +// - Code +// - Leader +// - PartHosts +type RestoreMetaResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + PartHosts map[nebula0.GraphSpaceID][]*PartInfo `thrift:"part_hosts,3" db:"part_hosts" json:"part_hosts"` +} + +func NewRestoreMetaResp() *RestoreMetaResp { + return &RestoreMetaResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *RestoreMetaResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var RestoreMetaResp_Leader_DEFAULT *nebula0.HostAddr +func (p *RestoreMetaResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return RestoreMetaResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *RestoreMetaResp) GetPartHosts() map[nebula0.GraphSpaceID][]*PartInfo { + return p.PartHosts +} +func (p *RestoreMetaResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +type RestoreMetaRespBuilder struct { + obj *RestoreMetaResp +} + +func NewRestoreMetaRespBuilder() *RestoreMetaRespBuilder{ + return &RestoreMetaRespBuilder{ + obj: NewRestoreMetaResp(), + } +} + +func (p RestoreMetaRespBuilder) Emit() *RestoreMetaResp{ + return &RestoreMetaResp{ + Code: p.obj.Code, + Leader: p.obj.Leader, + PartHosts: p.obj.PartHosts, + } +} + +func (r *RestoreMetaRespBuilder) Code(code nebula0.ErrorCode) *RestoreMetaRespBuilder { + r.obj.Code = code + return r +} + +func (r *RestoreMetaRespBuilder) Leader(leader *nebula0.HostAddr) *RestoreMetaRespBuilder { + r.obj.Leader = leader + return r +} + +func (r *RestoreMetaRespBuilder) PartHosts(partHosts map[nebula0.GraphSpaceID][]*PartInfo) *RestoreMetaRespBuilder { + r.obj.PartHosts = partHosts + return r +} + +func (r *RestoreMetaResp) SetCode(code nebula0.ErrorCode) *RestoreMetaResp { + r.Code = code + return r +} + +func (r *RestoreMetaResp) SetLeader(leader *nebula0.HostAddr) *RestoreMetaResp { + r.Leader = leader + return r +} + +func (r *RestoreMetaResp) SetPartHosts(partHosts map[nebula0.GraphSpaceID][]*PartInfo) *RestoreMetaResp { + r.PartHosts = partHosts + return r +} + +func (p *RestoreMetaResp) 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 *RestoreMetaResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.ErrorCode(v) + p.Code = temp + } + return nil +} + +func (p *RestoreMetaResp) ReadField2(iprot thrift.Protocol) error { + p.Leader = nebula0.NewHostAddr() + if err := p.Leader.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *RestoreMetaResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID][]*PartInfo, size) + p.PartHosts = tMap + for i := 0; i < size; i ++ { + var _key84 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.GraphSpaceID(v) + _key84 = temp + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartInfo, 0, size) + _val85 := tSlice + for i := 0; i < size; i ++ { + _elem86 := NewPartInfo() + if err := _elem86.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem86), err) + } + _val85 = append(_val85, _elem86) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PartHosts[_key84] = _val85 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *RestoreMetaResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RestoreMetaResp"); 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 *RestoreMetaResp) 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 *RestoreMetaResp) 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 *RestoreMetaResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_hosts", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_hosts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PartHosts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.PartHosts { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_hosts: ", p), err) } + return err +} + +func (p *RestoreMetaResp) 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) + } + partHostsVal := fmt.Sprintf("%v", p.PartHosts) + return fmt.Sprintf("RestoreMetaResp({Code:%s Leader:%s PartHosts:%s})", codeVal, leaderVal, partHostsVal) +} + // Attributes: // - Host // - User @@ -28874,11 +29581,11 @@ func (p *SignInServiceReq) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*ServiceClient, 0, size) p.Clients = tSlice for i := 0; i < size; i ++ { - _elem81 := NewServiceClient() - if err := _elem81.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem81), err) + _elem87 := NewServiceClient() + if err := _elem87.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem87), err) } - p.Clients = append(p.Clients, _elem81) + p.Clients = append(p.Clients, _elem87) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -29310,30 +30017,30 @@ func (p *ListServiceClientsResp) ReadField3(iprot thrift.Protocol) error { tMap := make(map[ExternalServiceType][]*ServiceClient, size) p.Clients = tMap for i := 0; i < size; i ++ { - var _key82 ExternalServiceType + var _key88 ExternalServiceType if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := ExternalServiceType(v) - _key82 = temp + _key88 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*ServiceClient, 0, size) - _val83 := tSlice + _val89 := tSlice for i := 0; i < size; i ++ { - _elem84 := NewServiceClient() - if err := _elem84.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem84), err) + _elem90 := NewServiceClient() + if err := _elem90.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem90), err) } - _val83 = append(_val83, _elem84) + _val89 = append(_val89, _elem90) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Clients[_key82] = _val83 + p.Clients[_key88] = _val89 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -29567,13 +30274,13 @@ func (p *FTIndex) ReadField3(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.Fields = tSlice for i := 0; i < size; i ++ { - var _elem85 []byte + var _elem91 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem85 = v + _elem91 = v } - p.Fields = append(p.Fields, _elem85) + p.Fields = append(p.Fields, _elem91) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -30184,17 +30891,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 _key86 string + var _key92 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key86 = v + _key92 = v } - _val87 := NewFTIndex() - if err := _val87.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val87), err) + _val93 := NewFTIndex() + if err := _val93.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val93), err) } - p.Indexes[_key86] = _val87 + p.Indexes[_key92] = _val93 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -30920,17 +31627,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 _key88 string + var _key94 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key88 = v + _key94 = v } - _val89 := nebula0.NewValue() - if err := _val89.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val89), err) + _val95 := nebula0.NewValue() + if err := _val95.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val95), err) } - p.Configs[_key88] = _val89 + p.Configs[_key94] = _val95 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -30946,18 +31653,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 _key90 nebula0.ExecutionPlanID + var _key96 nebula0.ExecutionPlanID if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.ExecutionPlanID(v) - _key90 = temp + _key96 = temp } - _val91 := NewQueryDesc() - if err := _val91.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val91), err) + _val97 := NewQueryDesc() + if err := _val97.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val97), err) } - p.Queries[_key90] = _val91 + p.Queries[_key96] = _val97 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -31643,11 +32350,11 @@ func (p *UpdateSessionsReq) ReadField1(iprot thrift.Protocol) error { tSlice := make([]*Session, 0, size) p.Sessions = tSlice for i := 0; i < size; i ++ { - _elem92 := NewSession() - if err := _elem92.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem92), err) + _elem98 := NewSession() + if err := _elem98.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem98), err) } - p.Sessions = append(p.Sessions, _elem92) + p.Sessions = append(p.Sessions, _elem98) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -31843,37 +32550,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 _key93 nebula0.SessionID + var _key99 nebula0.SessionID if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.SessionID(v) - _key93 = temp + _key99 = temp } _, _, size, err := iprot.ReadMapBegin() if err != nil { return thrift.PrependError("error reading map begin: ", err) } tMap := make(map[nebula0.ExecutionPlanID]*QueryDesc, size) - _val94 := tMap + _val100 := tMap for i := 0; i < size; i ++ { - var _key95 nebula0.ExecutionPlanID + var _key101 nebula0.ExecutionPlanID if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.ExecutionPlanID(v) - _key95 = temp + _key101 = temp } - _val96 := NewQueryDesc() - if err := _val96.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val96), err) + _val102 := NewQueryDesc() + if err := _val102.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val102), err) } - _val94[_key95] = _val96 + _val100[_key101] = _val102 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) } - p.KilledQueries[_key93] = _val94 + p.KilledQueries[_key99] = _val100 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -32176,11 +32883,11 @@ func (p *ListSessionsResp) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*Session, 0, size) p.Sessions = tSlice for i := 0; i < size; i ++ { - _elem97 := NewSession() - if err := _elem97.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem97), err) + _elem103 := NewSession() + if err := _elem103.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem103), err) } - p.Sessions = append(p.Sessions, _elem97) + p.Sessions = append(p.Sessions, _elem103) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -32784,33 +33491,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 _key98 nebula0.SessionID + var _key104 nebula0.SessionID if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.SessionID(v) - _key98 = temp + _key104 = temp } _, size, err := iprot.ReadSetBegin() if err != nil { return thrift.PrependError("error reading set begin: ", err) } tSet := make([]nebula0.ExecutionPlanID, 0, size) - _val99 := tSet + _val105 := tSet for i := 0; i < size; i ++ { - var _elem100 nebula0.ExecutionPlanID + var _elem106 nebula0.ExecutionPlanID if v, err := iprot.ReadI64(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.ExecutionPlanID(v) - _elem100 = temp + _elem106 = temp } - _val99 = append(_val99, _elem100) + _val105 = append(_val105, _elem106) } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) } - p.KillQueries[_key98] = _val99 + p.KillQueries[_key104] = _val105 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -33317,29 +34024,29 @@ func (p *ListClusterInfoResp) ReadField3(iprot thrift.Protocol) error { tMap := make(map[string][]*ServiceInfo, size) p.HostServices = tMap for i := 0; i < size; i ++ { - var _key101 string + var _key107 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key101 = v + _key107 = v } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*ServiceInfo, 0, size) - _val102 := tSlice + _val108 := tSlice for i := 0; i < size; i ++ { - _elem103 := NewServiceInfo() - if err := _elem103.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem103), err) + _elem109 := NewServiceInfo() + if err := _elem109.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem109), err) } - _val102 = append(_val102, _elem103) + _val108 = append(_val108, _elem109) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.HostServices[_key101] = _val102 + p.HostServices[_key107] = _val108 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) diff --git a/nebula/storage/graphstorageservice.go b/nebula/storage/graphstorageservice.go index d4f24566..14bcfc62 100644 --- a/nebula/storage/graphstorageservice.go +++ b/nebula/storage/graphstorageservice.go @@ -30,6 +30,9 @@ type GraphStorageService interface { GetNeighbors(ctx context.Context, req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) // Parameters: // - Req + GetDstBySrc(ctx context.Context, req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, err error) + // Parameters: + // - Req GetProps(ctx context.Context, req *GetPropRequest) (_r *GetPropResponse, err error) // Parameters: // - Req @@ -94,6 +97,9 @@ type GraphStorageServiceClientInterface interface { GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) // Parameters: // - Req + GetDstBySrc(req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, err error) + // Parameters: + // - Req GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) // Parameters: // - Req @@ -200,6 +206,26 @@ func (p *GraphStorageServiceClient) recvGetNeighbors() (value *GetNeighborsRespo return result.GetSuccess(), nil } +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetDstBySrc(req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, err error) { + args := GraphStorageServiceGetDstBySrcArgs{ + Req : req, + } + err = p.CC.SendMsg("getDstBySrc", &args, thrift.CALL) + if err != nil { return } + return p.recvGetDstBySrc() +} + + +func (p *GraphStorageServiceClient) recvGetDstBySrc() (value *GetDstBySrcResponse, err error) { + var result GraphStorageServiceGetDstBySrcResult + err = p.CC.RecvMsg("getDstBySrc", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + // Parameters: // - Req func (p *GraphStorageServiceClient) GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) { @@ -639,6 +665,28 @@ func (p *GraphStorageServiceThreadsafeClient) recvGetNeighbors() (value *GetNeig return result.GetSuccess(), nil } +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetDstBySrc(req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceGetDstBySrcArgs{ + Req : req, + } + err = p.CC.SendMsg("getDstBySrc", &args, thrift.CALL) + if err != nil { return } + return p.recvGetDstBySrc() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetDstBySrc() (value *GetDstBySrcResponse, err error) { + var result GraphStorageServiceGetDstBySrcResult + err = p.CC.RecvMsg("getDstBySrc", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + // Parameters: // - Req func (p *GraphStorageServiceThreadsafeClient) GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) { @@ -1091,6 +1139,19 @@ func (p *GraphStorageServiceChannelClient) GetNeighbors(ctx context.Context, req return result.GetSuccess(), nil } +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) GetDstBySrc(ctx context.Context, req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, err error) { + args := GraphStorageServiceGetDstBySrcArgs{ + Req : req, + } + var result GraphStorageServiceGetDstBySrcResult + err = p.RequestChannel.Call(ctx, "getDstBySrc", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + // Parameters: // - Req func (p *GraphStorageServiceChannelClient) GetProps(ctx context.Context, req *GetPropRequest) (_r *GetPropResponse, err error) { @@ -1369,48 +1430,50 @@ func (p *GraphStorageServiceProcessor) FunctionServiceMap() map[string]string { } func NewGraphStorageServiceProcessor(handler GraphStorageService) *GraphStorageServiceProcessor { - self97 := &GraphStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext), functionServiceMap:make(map[string]string)} - self97.processorMap["getNeighbors"] = &graphStorageServiceProcessorGetNeighbors{handler:handler} - self97.processorMap["getProps"] = &graphStorageServiceProcessorGetProps{handler:handler} - self97.processorMap["addVertices"] = &graphStorageServiceProcessorAddVertices{handler:handler} - self97.processorMap["addEdges"] = &graphStorageServiceProcessorAddEdges{handler:handler} - self97.processorMap["deleteEdges"] = &graphStorageServiceProcessorDeleteEdges{handler:handler} - self97.processorMap["deleteVertices"] = &graphStorageServiceProcessorDeleteVertices{handler:handler} - self97.processorMap["deleteTags"] = &graphStorageServiceProcessorDeleteTags{handler:handler} - self97.processorMap["updateVertex"] = &graphStorageServiceProcessorUpdateVertex{handler:handler} - self97.processorMap["updateEdge"] = &graphStorageServiceProcessorUpdateEdge{handler:handler} - self97.processorMap["scanVertex"] = &graphStorageServiceProcessorScanVertex{handler:handler} - self97.processorMap["scanEdge"] = &graphStorageServiceProcessorScanEdge{handler:handler} - self97.processorMap["getUUID"] = &graphStorageServiceProcessorGetUUID{handler:handler} - self97.processorMap["lookupIndex"] = &graphStorageServiceProcessorLookupIndex{handler:handler} - self97.processorMap["lookupAndTraverse"] = &graphStorageServiceProcessorLookupAndTraverse{handler:handler} - self97.processorMap["chainUpdateEdge"] = &graphStorageServiceProcessorChainUpdateEdge{handler:handler} - self97.processorMap["chainAddEdges"] = &graphStorageServiceProcessorChainAddEdges{handler:handler} - self97.processorMap["chainDeleteEdges"] = &graphStorageServiceProcessorChainDeleteEdges{handler:handler} - self97.processorMap["get"] = &graphStorageServiceProcessorGet{handler:handler} - self97.processorMap["put"] = &graphStorageServiceProcessorPut{handler:handler} - self97.processorMap["remove"] = &graphStorageServiceProcessorRemove{handler:handler} - self97.functionServiceMap["getNeighbors"] = "GraphStorageService" - self97.functionServiceMap["getProps"] = "GraphStorageService" - self97.functionServiceMap["addVertices"] = "GraphStorageService" - self97.functionServiceMap["addEdges"] = "GraphStorageService" - self97.functionServiceMap["deleteEdges"] = "GraphStorageService" - self97.functionServiceMap["deleteVertices"] = "GraphStorageService" - self97.functionServiceMap["deleteTags"] = "GraphStorageService" - self97.functionServiceMap["updateVertex"] = "GraphStorageService" - self97.functionServiceMap["updateEdge"] = "GraphStorageService" - self97.functionServiceMap["scanVertex"] = "GraphStorageService" - self97.functionServiceMap["scanEdge"] = "GraphStorageService" - self97.functionServiceMap["getUUID"] = "GraphStorageService" - self97.functionServiceMap["lookupIndex"] = "GraphStorageService" - self97.functionServiceMap["lookupAndTraverse"] = "GraphStorageService" - self97.functionServiceMap["chainUpdateEdge"] = "GraphStorageService" - self97.functionServiceMap["chainAddEdges"] = "GraphStorageService" - self97.functionServiceMap["chainDeleteEdges"] = "GraphStorageService" - self97.functionServiceMap["get"] = "GraphStorageService" - self97.functionServiceMap["put"] = "GraphStorageService" - self97.functionServiceMap["remove"] = "GraphStorageService" - return self97 + self101 := &GraphStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext), functionServiceMap:make(map[string]string)} + self101.processorMap["getNeighbors"] = &graphStorageServiceProcessorGetNeighbors{handler:handler} + self101.processorMap["getDstBySrc"] = &graphStorageServiceProcessorGetDstBySrc{handler:handler} + self101.processorMap["getProps"] = &graphStorageServiceProcessorGetProps{handler:handler} + self101.processorMap["addVertices"] = &graphStorageServiceProcessorAddVertices{handler:handler} + self101.processorMap["addEdges"] = &graphStorageServiceProcessorAddEdges{handler:handler} + self101.processorMap["deleteEdges"] = &graphStorageServiceProcessorDeleteEdges{handler:handler} + self101.processorMap["deleteVertices"] = &graphStorageServiceProcessorDeleteVertices{handler:handler} + self101.processorMap["deleteTags"] = &graphStorageServiceProcessorDeleteTags{handler:handler} + self101.processorMap["updateVertex"] = &graphStorageServiceProcessorUpdateVertex{handler:handler} + self101.processorMap["updateEdge"] = &graphStorageServiceProcessorUpdateEdge{handler:handler} + self101.processorMap["scanVertex"] = &graphStorageServiceProcessorScanVertex{handler:handler} + self101.processorMap["scanEdge"] = &graphStorageServiceProcessorScanEdge{handler:handler} + self101.processorMap["getUUID"] = &graphStorageServiceProcessorGetUUID{handler:handler} + self101.processorMap["lookupIndex"] = &graphStorageServiceProcessorLookupIndex{handler:handler} + self101.processorMap["lookupAndTraverse"] = &graphStorageServiceProcessorLookupAndTraverse{handler:handler} + self101.processorMap["chainUpdateEdge"] = &graphStorageServiceProcessorChainUpdateEdge{handler:handler} + self101.processorMap["chainAddEdges"] = &graphStorageServiceProcessorChainAddEdges{handler:handler} + self101.processorMap["chainDeleteEdges"] = &graphStorageServiceProcessorChainDeleteEdges{handler:handler} + self101.processorMap["get"] = &graphStorageServiceProcessorGet{handler:handler} + self101.processorMap["put"] = &graphStorageServiceProcessorPut{handler:handler} + self101.processorMap["remove"] = &graphStorageServiceProcessorRemove{handler:handler} + self101.functionServiceMap["getNeighbors"] = "GraphStorageService" + self101.functionServiceMap["getDstBySrc"] = "GraphStorageService" + self101.functionServiceMap["getProps"] = "GraphStorageService" + self101.functionServiceMap["addVertices"] = "GraphStorageService" + self101.functionServiceMap["addEdges"] = "GraphStorageService" + self101.functionServiceMap["deleteEdges"] = "GraphStorageService" + self101.functionServiceMap["deleteVertices"] = "GraphStorageService" + self101.functionServiceMap["deleteTags"] = "GraphStorageService" + self101.functionServiceMap["updateVertex"] = "GraphStorageService" + self101.functionServiceMap["updateEdge"] = "GraphStorageService" + self101.functionServiceMap["scanVertex"] = "GraphStorageService" + self101.functionServiceMap["scanEdge"] = "GraphStorageService" + self101.functionServiceMap["getUUID"] = "GraphStorageService" + self101.functionServiceMap["lookupIndex"] = "GraphStorageService" + self101.functionServiceMap["lookupAndTraverse"] = "GraphStorageService" + self101.functionServiceMap["chainUpdateEdge"] = "GraphStorageService" + self101.functionServiceMap["chainAddEdges"] = "GraphStorageService" + self101.functionServiceMap["chainDeleteEdges"] = "GraphStorageService" + self101.functionServiceMap["get"] = "GraphStorageService" + self101.functionServiceMap["put"] = "GraphStorageService" + self101.functionServiceMap["remove"] = "GraphStorageService" + return self101 } type graphStorageServiceProcessorGetNeighbors struct { @@ -1468,6 +1531,61 @@ func (p *graphStorageServiceProcessorGetNeighbors) RunContext(ctx context.Contex return &result, nil } +type graphStorageServiceProcessorGetDstBySrc struct { + handler GraphStorageService +} + +func (p *GraphStorageServiceGetDstBySrcResult) Exception() thrift.WritableException { + if p == nil { return nil } + return nil +} + +func (p *graphStorageServiceProcessorGetDstBySrc) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetDstBySrcArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetDstBySrc) 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("getDstBySrc", 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 *graphStorageServiceProcessorGetDstBySrc) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetDstBySrcArgs) + var result GraphStorageServiceGetDstBySrcResult + if retval, err := p.handler.GetDstBySrc(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getDstBySrc: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + type graphStorageServiceProcessorGetProps struct { handler GraphStorageService } @@ -2768,6 +2886,258 @@ func (p *GraphStorageServiceGetNeighborsResult) String() string { return fmt.Sprintf("GraphStorageServiceGetNeighborsResult({Success:%s})", successVal) } +// Attributes: +// - Req +type GraphStorageServiceGetDstBySrcArgs struct { + thrift.IRequest + Req *GetDstBySrcRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetDstBySrcArgs() *GraphStorageServiceGetDstBySrcArgs { + return &GraphStorageServiceGetDstBySrcArgs{ + Req: NewGetDstBySrcRequest(), + } +} + +var GraphStorageServiceGetDstBySrcArgs_Req_DEFAULT *GetDstBySrcRequest +func (p *GraphStorageServiceGetDstBySrcArgs) GetReq() *GetDstBySrcRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetDstBySrcArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetDstBySrcArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +type GraphStorageServiceGetDstBySrcArgsBuilder struct { + obj *GraphStorageServiceGetDstBySrcArgs +} + +func NewGraphStorageServiceGetDstBySrcArgsBuilder() *GraphStorageServiceGetDstBySrcArgsBuilder{ + return &GraphStorageServiceGetDstBySrcArgsBuilder{ + obj: NewGraphStorageServiceGetDstBySrcArgs(), + } +} + +func (p GraphStorageServiceGetDstBySrcArgsBuilder) Emit() *GraphStorageServiceGetDstBySrcArgs{ + return &GraphStorageServiceGetDstBySrcArgs{ + Req: p.obj.Req, + } +} + +func (g *GraphStorageServiceGetDstBySrcArgsBuilder) Req(req *GetDstBySrcRequest) *GraphStorageServiceGetDstBySrcArgsBuilder { + g.obj.Req = req + return g +} + +func (g *GraphStorageServiceGetDstBySrcArgs) SetReq(req *GetDstBySrcRequest) *GraphStorageServiceGetDstBySrcArgs { + g.Req = req + return g +} + +func (p *GraphStorageServiceGetDstBySrcArgs) 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 *GraphStorageServiceGetDstBySrcArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetDstBySrcRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetDstBySrcArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getDstBySrc_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 *GraphStorageServiceGetDstBySrcArgs) 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 *GraphStorageServiceGetDstBySrcArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceGetDstBySrcArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceGetDstBySrcResult struct { + thrift.IResponse + Success *GetDstBySrcResponse `thrift:"success,0,optional" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetDstBySrcResult() *GraphStorageServiceGetDstBySrcResult { + return &GraphStorageServiceGetDstBySrcResult{} +} + +var GraphStorageServiceGetDstBySrcResult_Success_DEFAULT *GetDstBySrcResponse +func (p *GraphStorageServiceGetDstBySrcResult) GetSuccess() *GetDstBySrcResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetDstBySrcResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetDstBySrcResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +type GraphStorageServiceGetDstBySrcResultBuilder struct { + obj *GraphStorageServiceGetDstBySrcResult +} + +func NewGraphStorageServiceGetDstBySrcResultBuilder() *GraphStorageServiceGetDstBySrcResultBuilder{ + return &GraphStorageServiceGetDstBySrcResultBuilder{ + obj: NewGraphStorageServiceGetDstBySrcResult(), + } +} + +func (p GraphStorageServiceGetDstBySrcResultBuilder) Emit() *GraphStorageServiceGetDstBySrcResult{ + return &GraphStorageServiceGetDstBySrcResult{ + Success: p.obj.Success, + } +} + +func (g *GraphStorageServiceGetDstBySrcResultBuilder) Success(success *GetDstBySrcResponse) *GraphStorageServiceGetDstBySrcResultBuilder { + g.obj.Success = success + return g +} + +func (g *GraphStorageServiceGetDstBySrcResult) SetSuccess(success *GetDstBySrcResponse) *GraphStorageServiceGetDstBySrcResult { + g.Success = success + return g +} + +func (p *GraphStorageServiceGetDstBySrcResult) 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 *GraphStorageServiceGetDstBySrcResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetDstBySrcResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetDstBySrcResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getDstBySrc_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 *GraphStorageServiceGetDstBySrcResult) 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 *GraphStorageServiceGetDstBySrcResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceGetDstBySrcResult({Success:%s})", successVal) +} + // Attributes: // - Req type GraphStorageServiceGetPropsArgs struct { diff --git a/nebula/storage/storageadminservice.go b/nebula/storage/storageadminservice.go index 4b622442..6feaff8e 100644 --- a/nebula/storage/storageadminservice.go +++ b/nebula/storage/storageadminservice.go @@ -1003,36 +1003,36 @@ func (p *StorageAdminServiceProcessor) FunctionServiceMap() map[string]string { } func NewStorageAdminServiceProcessor(handler StorageAdminService) *StorageAdminServiceProcessor { - self219 := &StorageAdminServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext), functionServiceMap:make(map[string]string)} - self219.processorMap["transLeader"] = &storageAdminServiceProcessorTransLeader{handler:handler} - self219.processorMap["addPart"] = &storageAdminServiceProcessorAddPart{handler:handler} - self219.processorMap["addLearner"] = &storageAdminServiceProcessorAddLearner{handler:handler} - self219.processorMap["removePart"] = &storageAdminServiceProcessorRemovePart{handler:handler} - self219.processorMap["memberChange"] = &storageAdminServiceProcessorMemberChange{handler:handler} - self219.processorMap["waitingForCatchUpData"] = &storageAdminServiceProcessorWaitingForCatchUpData{handler:handler} - self219.processorMap["createCheckpoint"] = &storageAdminServiceProcessorCreateCheckpoint{handler:handler} - self219.processorMap["dropCheckpoint"] = &storageAdminServiceProcessorDropCheckpoint{handler:handler} - self219.processorMap["blockingWrites"] = &storageAdminServiceProcessorBlockingWrites{handler:handler} - self219.processorMap["getLeaderParts"] = &storageAdminServiceProcessorGetLeaderParts{handler:handler} - self219.processorMap["checkPeers"] = &storageAdminServiceProcessorCheckPeers{handler:handler} - self219.processorMap["addAdminTask"] = &storageAdminServiceProcessorAddAdminTask{handler:handler} - self219.processorMap["stopAdminTask"] = &storageAdminServiceProcessorStopAdminTask{handler:handler} - self219.processorMap["clearSpace"] = &storageAdminServiceProcessorClearSpace{handler:handler} - self219.functionServiceMap["transLeader"] = "StorageAdminService" - self219.functionServiceMap["addPart"] = "StorageAdminService" - self219.functionServiceMap["addLearner"] = "StorageAdminService" - self219.functionServiceMap["removePart"] = "StorageAdminService" - self219.functionServiceMap["memberChange"] = "StorageAdminService" - self219.functionServiceMap["waitingForCatchUpData"] = "StorageAdminService" - self219.functionServiceMap["createCheckpoint"] = "StorageAdminService" - self219.functionServiceMap["dropCheckpoint"] = "StorageAdminService" - self219.functionServiceMap["blockingWrites"] = "StorageAdminService" - self219.functionServiceMap["getLeaderParts"] = "StorageAdminService" - self219.functionServiceMap["checkPeers"] = "StorageAdminService" - self219.functionServiceMap["addAdminTask"] = "StorageAdminService" - self219.functionServiceMap["stopAdminTask"] = "StorageAdminService" - self219.functionServiceMap["clearSpace"] = "StorageAdminService" - return self219 + self229 := &StorageAdminServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext), functionServiceMap:make(map[string]string)} + self229.processorMap["transLeader"] = &storageAdminServiceProcessorTransLeader{handler:handler} + self229.processorMap["addPart"] = &storageAdminServiceProcessorAddPart{handler:handler} + self229.processorMap["addLearner"] = &storageAdminServiceProcessorAddLearner{handler:handler} + self229.processorMap["removePart"] = &storageAdminServiceProcessorRemovePart{handler:handler} + self229.processorMap["memberChange"] = &storageAdminServiceProcessorMemberChange{handler:handler} + self229.processorMap["waitingForCatchUpData"] = &storageAdminServiceProcessorWaitingForCatchUpData{handler:handler} + self229.processorMap["createCheckpoint"] = &storageAdminServiceProcessorCreateCheckpoint{handler:handler} + self229.processorMap["dropCheckpoint"] = &storageAdminServiceProcessorDropCheckpoint{handler:handler} + self229.processorMap["blockingWrites"] = &storageAdminServiceProcessorBlockingWrites{handler:handler} + self229.processorMap["getLeaderParts"] = &storageAdminServiceProcessorGetLeaderParts{handler:handler} + self229.processorMap["checkPeers"] = &storageAdminServiceProcessorCheckPeers{handler:handler} + self229.processorMap["addAdminTask"] = &storageAdminServiceProcessorAddAdminTask{handler:handler} + self229.processorMap["stopAdminTask"] = &storageAdminServiceProcessorStopAdminTask{handler:handler} + self229.processorMap["clearSpace"] = &storageAdminServiceProcessorClearSpace{handler:handler} + self229.functionServiceMap["transLeader"] = "StorageAdminService" + self229.functionServiceMap["addPart"] = "StorageAdminService" + self229.functionServiceMap["addLearner"] = "StorageAdminService" + self229.functionServiceMap["removePart"] = "StorageAdminService" + self229.functionServiceMap["memberChange"] = "StorageAdminService" + self229.functionServiceMap["waitingForCatchUpData"] = "StorageAdminService" + self229.functionServiceMap["createCheckpoint"] = "StorageAdminService" + self229.functionServiceMap["dropCheckpoint"] = "StorageAdminService" + self229.functionServiceMap["blockingWrites"] = "StorageAdminService" + self229.functionServiceMap["getLeaderParts"] = "StorageAdminService" + self229.functionServiceMap["checkPeers"] = "StorageAdminService" + self229.functionServiceMap["addAdminTask"] = "StorageAdminService" + self229.functionServiceMap["stopAdminTask"] = "StorageAdminService" + self229.functionServiceMap["clearSpace"] = "StorageAdminService" + return self229 } type storageAdminServiceProcessorTransLeader struct { diff --git a/nebula/storage/ttypes.go b/nebula/storage/ttypes.go index 59198baa..60415581 100644 --- a/nebula/storage/ttypes.go +++ b/nebula/storage/ttypes.go @@ -1842,6 +1842,7 @@ func (p *OrderBy) String() string { // - Random // - Limit // - Filter +// - TagFilter type TraverseSpec struct { EdgeTypes []nebula0.EdgeType `thrift:"edge_types,1" db:"edge_types" json:"edge_types"` EdgeDirection EdgeDirection `thrift:"edge_direction,2" db:"edge_direction" json:"edge_direction"` @@ -1854,6 +1855,7 @@ type TraverseSpec struct { Random *bool `thrift:"random,9,optional" db:"random" json:"random,omitempty"` Limit *int64 `thrift:"limit,10,optional" db:"limit" json:"limit,omitempty"` Filter []byte `thrift:"filter,11,optional" db:"filter" json:"filter,omitempty"` + TagFilter []byte `thrift:"tag_filter,12,optional" db:"tag_filter" json:"tag_filter,omitempty"` } func NewTraverseSpec() *TraverseSpec { @@ -1918,6 +1920,11 @@ var TraverseSpec_Filter_DEFAULT []byte func (p *TraverseSpec) GetFilter() []byte { return p.Filter } +var TraverseSpec_TagFilter_DEFAULT []byte + +func (p *TraverseSpec) GetTagFilter() []byte { + return p.TagFilter +} func (p *TraverseSpec) IsSetStatProps() bool { return p != nil && p.StatProps != nil } @@ -1950,6 +1957,10 @@ func (p *TraverseSpec) IsSetFilter() bool { return p != nil && p.Filter != nil } +func (p *TraverseSpec) IsSetTagFilter() bool { + return p != nil && p.TagFilter != nil +} + type TraverseSpecBuilder struct { obj *TraverseSpec } @@ -1973,6 +1984,7 @@ func (p TraverseSpecBuilder) Emit() *TraverseSpec{ Random: p.obj.Random, Limit: p.obj.Limit, Filter: p.obj.Filter, + TagFilter: p.obj.TagFilter, } } @@ -2031,6 +2043,11 @@ func (t *TraverseSpecBuilder) Filter(filter []byte) *TraverseSpecBuilder { return t } +func (t *TraverseSpecBuilder) TagFilter(tagFilter []byte) *TraverseSpecBuilder { + t.obj.TagFilter = tagFilter + return t +} + func (t *TraverseSpec) SetEdgeTypes(edgeTypes []nebula0.EdgeType) *TraverseSpec { t.EdgeTypes = edgeTypes return t @@ -2086,6 +2103,11 @@ func (t *TraverseSpec) SetFilter(filter []byte) *TraverseSpec { return t } +func (t *TraverseSpec) SetTagFilter(tagFilter []byte) *TraverseSpec { + t.TagFilter = tagFilter + return t +} + func (p *TraverseSpec) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -2143,6 +2165,10 @@ func (p *TraverseSpec) Read(iprot thrift.Protocol) error { if err := p.ReadField11(iprot); err != nil { return err } + case 12: + if err := p.ReadField12(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -2327,6 +2353,15 @@ func (p *TraverseSpec) ReadField11(iprot thrift.Protocol) error { return nil } +func (p *TraverseSpec) ReadField12(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 12: ", err) + } else { + p.TagFilter = v + } + return nil +} + func (p *TraverseSpec) Write(oprot thrift.Protocol) error { if err := oprot.WriteStructBegin("TraverseSpec"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -2341,6 +2376,7 @@ func (p *TraverseSpec) Write(oprot thrift.Protocol) error { if err := p.writeField9(oprot); err != nil { return err } if err := p.writeField10(oprot); err != nil { return err } if err := p.writeField11(oprot); err != nil { return err } + if err := p.writeField12(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } if err := oprot.WriteStructEnd(); err != nil { @@ -2527,6 +2563,18 @@ func (p *TraverseSpec) writeField11(oprot thrift.Protocol) (err error) { return err } +func (p *TraverseSpec) writeField12(oprot thrift.Protocol) (err error) { + if p.IsSetTagFilter() { + if err := oprot.WriteFieldBegin("tag_filter", thrift.STRING, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:tag_filter: ", p), err) } + if err := oprot.WriteBinary(p.TagFilter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_filter (12) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:tag_filter: ", p), err) } + } + return err +} + func (p *TraverseSpec) String() string { if p == nil { return "" @@ -2553,7 +2601,8 @@ func (p *TraverseSpec) String() string { limitVal = fmt.Sprintf("%v", *p.Limit) } filterVal := fmt.Sprintf("%v", p.Filter) - return fmt.Sprintf("TraverseSpec({EdgeTypes:%s EdgeDirection:%s Dedup:%s StatProps:%s VertexProps:%s EdgeProps:%s Expressions:%s OrderBy:%s Random:%s Limit:%s Filter:%s})", edgeTypesVal, edgeDirectionVal, dedupVal, statPropsVal, vertexPropsVal, edgePropsVal, expressionsVal, orderByVal, randomVal, limitVal, filterVal) + tagFilterVal := fmt.Sprintf("%v", p.TagFilter) + return fmt.Sprintf("TraverseSpec({EdgeTypes:%s EdgeDirection:%s Dedup:%s StatProps:%s VertexProps:%s EdgeProps:%s Expressions:%s OrderBy:%s Random:%s Limit:%s Filter:%s TagFilter:%s})", edgeTypesVal, edgeDirectionVal, dedupVal, statPropsVal, vertexPropsVal, edgePropsVal, expressionsVal, orderByVal, randomVal, limitVal, filterVal, tagFilterVal) } // Attributes: @@ -2565,7 +2614,7 @@ func (p *TraverseSpec) String() string { type GetNeighborsRequest struct { SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` ColumnNames [][]byte `thrift:"column_names,2" db:"column_names" json:"column_names"` - Parts map[nebula0.PartitionID][]*nebula0.Row `thrift:"parts,3" db:"parts" json:"parts"` + Parts map[nebula0.PartitionID][]*nebula0.Value `thrift:"parts,3" db:"parts" json:"parts"` TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` Common *RequestCommon `thrift:"common,5,optional" db:"common" json:"common,omitempty"` } @@ -2585,7 +2634,7 @@ func (p *GetNeighborsRequest) GetColumnNames() [][]byte { return p.ColumnNames } -func (p *GetNeighborsRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Row { +func (p *GetNeighborsRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Value { return p.Parts } var GetNeighborsRequest_TraverseSpec_DEFAULT *TraverseSpec @@ -2640,7 +2689,7 @@ func (g *GetNeighborsRequestBuilder) ColumnNames(columnNames [][]byte) *GetNeigh return g } -func (g *GetNeighborsRequestBuilder) Parts(parts map[nebula0.PartitionID][]*nebula0.Row) *GetNeighborsRequestBuilder { +func (g *GetNeighborsRequestBuilder) Parts(parts map[nebula0.PartitionID][]*nebula0.Value) *GetNeighborsRequestBuilder { g.obj.Parts = parts return g } @@ -2665,7 +2714,7 @@ func (g *GetNeighborsRequest) SetColumnNames(columnNames [][]byte) *GetNeighbors return g } -func (g *GetNeighborsRequest) SetParts(parts map[nebula0.PartitionID][]*nebula0.Row) *GetNeighborsRequest { +func (g *GetNeighborsRequest) SetParts(parts map[nebula0.PartitionID][]*nebula0.Value) *GetNeighborsRequest { g.Parts = parts return g } @@ -2709,10 +2758,544 @@ func (p *GetNeighborsRequest) Read(iprot thrift.Protocol) error { if err := p.ReadField4(iprot); err != nil { return err } - case 5: - if err := p.ReadField5(iprot); err != nil { - return err - } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetNeighborsRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.GraphSpaceID(v) + p.SpaceID = temp + } + return nil +} + +func (p *GetNeighborsRequest) ReadField2(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.ColumnNames = tSlice + for i := 0; i < size; i ++ { + var _elem13 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem13 = v + } + p.ColumnNames = append(p.ColumnNames, _elem13) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetNeighborsRequest) 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][]*nebula0.Value, size) + p.Parts = tMap + for i := 0; i < size; i ++ { + var _key14 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _key14 = temp + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Value, 0, size) + _val15 := tSlice + for i := 0; i < size; i ++ { + _elem16 := nebula0.NewValue() + if err := _elem16.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) + } + _val15 = append(_val15, _elem16) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key14] = _val15 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetNeighborsRequest) ReadField4(iprot thrift.Protocol) error { + p.TraverseSpec = NewTraverseSpec() + if err := p.TraverseSpec.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TraverseSpec), err) + } + return nil +} + +func (p *GetNeighborsRequest) ReadField5(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) + } + return nil +} + +func (p *GetNeighborsRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetNeighborsRequest"); 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 := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetNeighborsRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_id: ", p), err) } + if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetNeighborsRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_names", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:column_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ColumnNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ColumnNames { + 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 2:column_names: ", p), err) } + return err +} + +func (p *GetNeighborsRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.Parts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Parts { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parts: ", p), err) } + return err +} + +func (p *GetNeighborsRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("traverse_spec", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:traverse_spec: ", p), err) } + if err := p.TraverseSpec.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TraverseSpec), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:traverse_spec: ", p), err) } + return err +} + +func (p *GetNeighborsRequest) writeField5(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 := 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 err +} + +func (p *GetNeighborsRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + columnNamesVal := fmt.Sprintf("%v", p.ColumnNames) + partsVal := fmt.Sprintf("%v", p.Parts) + var traverseSpecVal string + if p.TraverseSpec == nil { + traverseSpecVal = "" + } else { + traverseSpecVal = fmt.Sprintf("%v", p.TraverseSpec) + } + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("GetNeighborsRequest({SpaceID:%s ColumnNames:%s Parts:%s TraverseSpec:%s Common:%s})", spaceIDVal, columnNamesVal, partsVal, traverseSpecVal, commonVal) +} + +// Attributes: +// - Result_ +// - Vertices +type GetNeighborsResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Vertices *nebula0.DataSet `thrift:"vertices,2,optional" db:"vertices" json:"vertices,omitempty"` +} + +func NewGetNeighborsResponse() *GetNeighborsResponse { + return &GetNeighborsResponse{ + Result_: NewResponseCommon(), + } +} + +var GetNeighborsResponse_Result__DEFAULT *ResponseCommon +func (p *GetNeighborsResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetNeighborsResponse_Result__DEFAULT + } +return p.Result_ +} +var GetNeighborsResponse_Vertices_DEFAULT *nebula0.DataSet +func (p *GetNeighborsResponse) GetVertices() *nebula0.DataSet { + if !p.IsSetVertices() { + return GetNeighborsResponse_Vertices_DEFAULT + } +return p.Vertices +} +func (p *GetNeighborsResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetNeighborsResponse) IsSetVertices() bool { + return p != nil && p.Vertices != nil +} + +type GetNeighborsResponseBuilder struct { + obj *GetNeighborsResponse +} + +func NewGetNeighborsResponseBuilder() *GetNeighborsResponseBuilder{ + return &GetNeighborsResponseBuilder{ + obj: NewGetNeighborsResponse(), + } +} + +func (p GetNeighborsResponseBuilder) Emit() *GetNeighborsResponse{ + return &GetNeighborsResponse{ + Result_: p.obj.Result_, + Vertices: p.obj.Vertices, + } +} + +func (g *GetNeighborsResponseBuilder) Result_(result *ResponseCommon) *GetNeighborsResponseBuilder { + g.obj.Result_ = result + return g +} + +func (g *GetNeighborsResponseBuilder) Vertices(vertices *nebula0.DataSet) *GetNeighborsResponseBuilder { + g.obj.Vertices = vertices + return g +} + +func (g *GetNeighborsResponse) SetResult_(result *ResponseCommon) *GetNeighborsResponse { + g.Result_ = result + return g +} + +func (g *GetNeighborsResponse) SetVertices(vertices *nebula0.DataSet) *GetNeighborsResponse { + g.Vertices = vertices + return g +} + +func (p *GetNeighborsResponse) 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 + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 *GetNeighborsResponse) 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 *GetNeighborsResponse) ReadField2(iprot thrift.Protocol) error { + p.Vertices = nebula0.NewDataSet() + if err := p.Vertices.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Vertices), err) + } + return nil +} + +func (p *GetNeighborsResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetNeighborsResponse"); 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 *GetNeighborsResponse) 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 *GetNeighborsResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetVertices() { + if err := oprot.WriteFieldBegin("vertices", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vertices: ", p), err) } + if err := p.Vertices.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Vertices), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vertices: ", p), err) } + } + return err +} + +func (p *GetNeighborsResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var verticesVal string + if p.Vertices == nil { + verticesVal = "" + } else { + verticesVal = fmt.Sprintf("%v", p.Vertices) + } + return fmt.Sprintf("GetNeighborsResponse({Result_:%s Vertices:%s})", resultVal, verticesVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - EdgeTypes +// - Common +type GetDstBySrcRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*nebula0.Value `thrift:"parts,2" db:"parts" json:"parts"` + EdgeTypes []nebula0.EdgeType `thrift:"edge_types,3" db:"edge_types" json:"edge_types"` + Common *RequestCommon `thrift:"common,4,optional" db:"common" json:"common,omitempty"` +} + +func NewGetDstBySrcRequest() *GetDstBySrcRequest { + return &GetDstBySrcRequest{} +} + + +func (p *GetDstBySrcRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetDstBySrcRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Value { + return p.Parts +} + +func (p *GetDstBySrcRequest) GetEdgeTypes() []nebula0.EdgeType { + return p.EdgeTypes +} +var GetDstBySrcRequest_Common_DEFAULT *RequestCommon +func (p *GetDstBySrcRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return GetDstBySrcRequest_Common_DEFAULT + } +return p.Common +} +func (p *GetDstBySrcRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +type GetDstBySrcRequestBuilder struct { + obj *GetDstBySrcRequest +} + +func NewGetDstBySrcRequestBuilder() *GetDstBySrcRequestBuilder{ + return &GetDstBySrcRequestBuilder{ + obj: NewGetDstBySrcRequest(), + } +} + +func (p GetDstBySrcRequestBuilder) Emit() *GetDstBySrcRequest{ + return &GetDstBySrcRequest{ + SpaceID: p.obj.SpaceID, + Parts: p.obj.Parts, + EdgeTypes: p.obj.EdgeTypes, + Common: p.obj.Common, + } +} + +func (g *GetDstBySrcRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetDstBySrcRequestBuilder { + g.obj.SpaceID = spaceID + return g +} + +func (g *GetDstBySrcRequestBuilder) Parts(parts map[nebula0.PartitionID][]*nebula0.Value) *GetDstBySrcRequestBuilder { + g.obj.Parts = parts + return g +} + +func (g *GetDstBySrcRequestBuilder) EdgeTypes(edgeTypes []nebula0.EdgeType) *GetDstBySrcRequestBuilder { + g.obj.EdgeTypes = edgeTypes + return g +} + +func (g *GetDstBySrcRequestBuilder) Common(common *RequestCommon) *GetDstBySrcRequestBuilder { + g.obj.Common = common + return g +} + +func (g *GetDstBySrcRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetDstBySrcRequest { + g.SpaceID = spaceID + return g +} + +func (g *GetDstBySrcRequest) SetParts(parts map[nebula0.PartitionID][]*nebula0.Value) *GetDstBySrcRequest { + g.Parts = parts + return g +} + +func (g *GetDstBySrcRequest) SetEdgeTypes(edgeTypes []nebula0.EdgeType) *GetDstBySrcRequest { + g.EdgeTypes = edgeTypes + return g +} + +func (g *GetDstBySrcRequest) SetCommon(common *RequestCommon) *GetDstBySrcRequest { + g.Common = common + return g +} + +func (p *GetDstBySrcRequest) 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 + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -2728,7 +3311,7 @@ func (p *GetNeighborsRequest) Read(iprot thrift.Protocol) error { return nil } -func (p *GetNeighborsRequest) ReadField1(iprot thrift.Protocol) error { +func (p *GetDstBySrcRequest) ReadField1(iprot thrift.Protocol) error { if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { @@ -2738,60 +3321,38 @@ func (p *GetNeighborsRequest) ReadField1(iprot thrift.Protocol) error { return nil } -func (p *GetNeighborsRequest) ReadField2(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.ColumnNames = tSlice - for i := 0; i < size; i ++ { - var _elem13 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem13 = v - } - p.ColumnNames = append(p.ColumnNames, _elem13) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *GetNeighborsRequest) ReadField3(iprot thrift.Protocol) error { +func (p *GetDstBySrcRequest) ReadField2(iprot thrift.Protocol) error { _, _, size, err := iprot.ReadMapBegin() if err != nil { return thrift.PrependError("error reading map begin: ", err) } - tMap := make(map[nebula0.PartitionID][]*nebula0.Row, size) + tMap := make(map[nebula0.PartitionID][]*nebula0.Value, size) p.Parts = tMap for i := 0; i < size; i ++ { - var _key14 nebula0.PartitionID + var _key17 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key14 = temp + _key17 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } - tSlice := make([]*nebula0.Row, 0, size) - _val15 := tSlice + tSlice := make([]*nebula0.Value, 0, size) + _val18 := tSlice for i := 0; i < size; i ++ { - _elem16 := nebula0.NewRow() - if err := _elem16.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) + _elem19 := nebula0.NewValue() + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) } - _val15 = append(_val15, _elem16) + _val18 = append(_val18, _elem19) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key14] = _val15 + p.Parts[_key17] = _val18 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -2799,15 +3360,30 @@ func (p *GetNeighborsRequest) ReadField3(iprot thrift.Protocol) error { return nil } -func (p *GetNeighborsRequest) ReadField4(iprot thrift.Protocol) error { - p.TraverseSpec = NewTraverseSpec() - if err := p.TraverseSpec.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TraverseSpec), err) +func (p *GetDstBySrcRequest) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.EdgeType, 0, size) + p.EdgeTypes = tSlice + for i := 0; i < size; i ++ { + var _elem20 nebula0.EdgeType + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.EdgeType(v) + _elem20 = temp + } + p.EdgeTypes = append(p.EdgeTypes, _elem20) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *GetNeighborsRequest) ReadField5(iprot thrift.Protocol) error { +func (p *GetDstBySrcRequest) ReadField4(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) @@ -2815,14 +3391,13 @@ func (p *GetNeighborsRequest) ReadField5(iprot thrift.Protocol) error { return nil } -func (p *GetNeighborsRequest) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("GetNeighborsRequest"); err != nil { +func (p *GetDstBySrcRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetDstBySrcRequest"); 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 := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } if err := oprot.WriteStructEnd(); err != nil { @@ -2830,7 +3405,7 @@ func (p *GetNeighborsRequest) Write(oprot thrift.Protocol) error { return nil } -func (p *GetNeighborsRequest) writeField1(oprot thrift.Protocol) (err error) { +func (p *GetDstBySrcRequest) writeField1(oprot thrift.Protocol) (err error) { if err := oprot.WriteFieldBegin("space_id", thrift.I32, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_id: ", p), err) } if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { @@ -2840,27 +3415,9 @@ func (p *GetNeighborsRequest) writeField1(oprot thrift.Protocol) (err error) { return err } -func (p *GetNeighborsRequest) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("column_names", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:column_names: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.ColumnNames)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ColumnNames { - 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 2:column_names: ", p), err) } - return err -} - -func (p *GetNeighborsRequest) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("parts", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parts: ", p), err) } +func (p *GetDstBySrcRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.Parts)); err != nil { return thrift.PrependError("error writing map begin: ", err) } @@ -2883,131 +3440,132 @@ func (p *GetNeighborsRequest) writeField3(oprot thrift.Protocol) (err error) { 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:parts: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } return err } -func (p *GetNeighborsRequest) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("traverse_spec", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:traverse_spec: ", p), err) } - if err := p.TraverseSpec.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TraverseSpec), err) +func (p *GetDstBySrcRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_types", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_types: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.EdgeTypes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeTypes { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:traverse_spec: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_types: ", p), err) } return err } -func (p *GetNeighborsRequest) writeField5(oprot thrift.Protocol) (err error) { +func (p *GetDstBySrcRequest) writeField4(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, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4: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 4:common: ", p), err) } } return err } -func (p *GetNeighborsRequest) String() string { +func (p *GetDstBySrcRequest) String() string { if p == nil { return "" } spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - columnNamesVal := fmt.Sprintf("%v", p.ColumnNames) partsVal := fmt.Sprintf("%v", p.Parts) - var traverseSpecVal string - if p.TraverseSpec == nil { - traverseSpecVal = "" - } else { - traverseSpecVal = fmt.Sprintf("%v", p.TraverseSpec) - } + edgeTypesVal := fmt.Sprintf("%v", p.EdgeTypes) var commonVal string if p.Common == nil { commonVal = "" } else { commonVal = fmt.Sprintf("%v", p.Common) } - return fmt.Sprintf("GetNeighborsRequest({SpaceID:%s ColumnNames:%s Parts:%s TraverseSpec:%s Common:%s})", spaceIDVal, columnNamesVal, partsVal, traverseSpecVal, commonVal) + return fmt.Sprintf("GetDstBySrcRequest({SpaceID:%s Parts:%s EdgeTypes:%s Common:%s})", spaceIDVal, partsVal, edgeTypesVal, commonVal) } // Attributes: // - Result_ -// - Vertices -type GetNeighborsResponse struct { +// - Dsts +type GetDstBySrcResponse struct { Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` - Vertices *nebula0.DataSet `thrift:"vertices,2,optional" db:"vertices" json:"vertices,omitempty"` + Dsts *nebula0.DataSet `thrift:"dsts,2,optional" db:"dsts" json:"dsts,omitempty"` } -func NewGetNeighborsResponse() *GetNeighborsResponse { - return &GetNeighborsResponse{ +func NewGetDstBySrcResponse() *GetDstBySrcResponse { + return &GetDstBySrcResponse{ Result_: NewResponseCommon(), } } -var GetNeighborsResponse_Result__DEFAULT *ResponseCommon -func (p *GetNeighborsResponse) GetResult_() *ResponseCommon { +var GetDstBySrcResponse_Result__DEFAULT *ResponseCommon +func (p *GetDstBySrcResponse) GetResult_() *ResponseCommon { if !p.IsSetResult_() { - return GetNeighborsResponse_Result__DEFAULT + return GetDstBySrcResponse_Result__DEFAULT } return p.Result_ } -var GetNeighborsResponse_Vertices_DEFAULT *nebula0.DataSet -func (p *GetNeighborsResponse) GetVertices() *nebula0.DataSet { - if !p.IsSetVertices() { - return GetNeighborsResponse_Vertices_DEFAULT +var GetDstBySrcResponse_Dsts_DEFAULT *nebula0.DataSet +func (p *GetDstBySrcResponse) GetDsts() *nebula0.DataSet { + if !p.IsSetDsts() { + return GetDstBySrcResponse_Dsts_DEFAULT } -return p.Vertices +return p.Dsts } -func (p *GetNeighborsResponse) IsSetResult_() bool { +func (p *GetDstBySrcResponse) IsSetResult_() bool { return p != nil && p.Result_ != nil } -func (p *GetNeighborsResponse) IsSetVertices() bool { - return p != nil && p.Vertices != nil +func (p *GetDstBySrcResponse) IsSetDsts() bool { + return p != nil && p.Dsts != nil } -type GetNeighborsResponseBuilder struct { - obj *GetNeighborsResponse +type GetDstBySrcResponseBuilder struct { + obj *GetDstBySrcResponse } -func NewGetNeighborsResponseBuilder() *GetNeighborsResponseBuilder{ - return &GetNeighborsResponseBuilder{ - obj: NewGetNeighborsResponse(), +func NewGetDstBySrcResponseBuilder() *GetDstBySrcResponseBuilder{ + return &GetDstBySrcResponseBuilder{ + obj: NewGetDstBySrcResponse(), } } -func (p GetNeighborsResponseBuilder) Emit() *GetNeighborsResponse{ - return &GetNeighborsResponse{ +func (p GetDstBySrcResponseBuilder) Emit() *GetDstBySrcResponse{ + return &GetDstBySrcResponse{ Result_: p.obj.Result_, - Vertices: p.obj.Vertices, + Dsts: p.obj.Dsts, } } -func (g *GetNeighborsResponseBuilder) Result_(result *ResponseCommon) *GetNeighborsResponseBuilder { +func (g *GetDstBySrcResponseBuilder) Result_(result *ResponseCommon) *GetDstBySrcResponseBuilder { g.obj.Result_ = result return g } -func (g *GetNeighborsResponseBuilder) Vertices(vertices *nebula0.DataSet) *GetNeighborsResponseBuilder { - g.obj.Vertices = vertices +func (g *GetDstBySrcResponseBuilder) Dsts(dsts *nebula0.DataSet) *GetDstBySrcResponseBuilder { + g.obj.Dsts = dsts return g } -func (g *GetNeighborsResponse) SetResult_(result *ResponseCommon) *GetNeighborsResponse { +func (g *GetDstBySrcResponse) SetResult_(result *ResponseCommon) *GetDstBySrcResponse { g.Result_ = result return g } -func (g *GetNeighborsResponse) SetVertices(vertices *nebula0.DataSet) *GetNeighborsResponse { - g.Vertices = vertices +func (g *GetDstBySrcResponse) SetDsts(dsts *nebula0.DataSet) *GetDstBySrcResponse { + g.Dsts = dsts return g } -func (p *GetNeighborsResponse) Read(iprot thrift.Protocol) error { +func (p *GetDstBySrcResponse) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -3048,7 +3606,7 @@ func (p *GetNeighborsResponse) Read(iprot thrift.Protocol) error { return nil } -func (p *GetNeighborsResponse) ReadField1(iprot thrift.Protocol) error { +func (p *GetDstBySrcResponse) 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) @@ -3056,16 +3614,16 @@ func (p *GetNeighborsResponse) ReadField1(iprot thrift.Protocol) error { return nil } -func (p *GetNeighborsResponse) ReadField2(iprot thrift.Protocol) error { - p.Vertices = nebula0.NewDataSet() - if err := p.Vertices.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Vertices), err) +func (p *GetDstBySrcResponse) ReadField2(iprot thrift.Protocol) error { + p.Dsts = nebula0.NewDataSet() + if err := p.Dsts.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dsts), err) } return nil } -func (p *GetNeighborsResponse) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("GetNeighborsResponse"); err != nil { +func (p *GetDstBySrcResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetDstBySrcResponse"); 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 } @@ -3076,7 +3634,7 @@ func (p *GetNeighborsResponse) Write(oprot thrift.Protocol) error { return nil } -func (p *GetNeighborsResponse) writeField1(oprot thrift.Protocol) (err error) { +func (p *GetDstBySrcResponse) 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 { @@ -3087,20 +3645,20 @@ func (p *GetNeighborsResponse) writeField1(oprot thrift.Protocol) (err error) { return err } -func (p *GetNeighborsResponse) writeField2(oprot thrift.Protocol) (err error) { - if p.IsSetVertices() { - if err := oprot.WriteFieldBegin("vertices", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vertices: ", p), err) } - if err := p.Vertices.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Vertices), err) +func (p *GetDstBySrcResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetDsts() { + if err := oprot.WriteFieldBegin("dsts", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dsts: ", p), err) } + if err := p.Dsts.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dsts), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vertices: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dsts: ", p), err) } } return err } -func (p *GetNeighborsResponse) String() string { +func (p *GetDstBySrcResponse) String() string { if p == nil { return "" } @@ -3111,13 +3669,13 @@ func (p *GetNeighborsResponse) String() string { } else { resultVal = fmt.Sprintf("%v", p.Result_) } - var verticesVal string - if p.Vertices == nil { - verticesVal = "" + var dstsVal string + if p.Dsts == nil { + dstsVal = "" } else { - verticesVal = fmt.Sprintf("%v", p.Vertices) + dstsVal = fmt.Sprintf("%v", p.Dsts) } - return fmt.Sprintf("GetNeighborsResponse({Result_:%s Vertices:%s})", resultVal, verticesVal) + return fmt.Sprintf("GetDstBySrcResponse({Result_:%s Dsts:%s})", resultVal, dstsVal) } // Attributes: @@ -3568,30 +4126,30 @@ func (p *GetPropRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*nebula0.Row, size) p.Parts = tMap for i := 0; i < size; i ++ { - var _key17 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) - _key17 = temp + _key21 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*nebula0.Row, 0, size) - _val18 := tSlice + _val22 := tSlice for i := 0; i < size; i ++ { - _elem19 := nebula0.NewRow() - if err := _elem19.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + _elem23 := nebula0.NewRow() + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) } - _val18 = append(_val18, _elem19) + _val22 = append(_val22, _elem23) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key17] = _val18 + p.Parts[_key21] = _val22 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -3607,11 +4165,11 @@ func (p *GetPropRequest) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*VertexProp, 0, size) p.VertexProps = tSlice for i := 0; i < size; i ++ { - _elem20 := NewVertexProp() - if err := _elem20.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem20), err) + _elem24 := NewVertexProp() + if err := _elem24.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) } - p.VertexProps = append(p.VertexProps, _elem20) + p.VertexProps = append(p.VertexProps, _elem24) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -3627,11 +4185,11 @@ func (p *GetPropRequest) ReadField4(iprot thrift.Protocol) error { tSlice := make([]*EdgeProp, 0, size) p.EdgeProps = tSlice for i := 0; i < size; i ++ { - _elem21 := NewEdgeProp() - if err := _elem21.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) + _elem25 := NewEdgeProp() + if err := _elem25.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) } - p.EdgeProps = append(p.EdgeProps, _elem21) + p.EdgeProps = append(p.EdgeProps, _elem25) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -3647,11 +4205,11 @@ func (p *GetPropRequest) ReadField5(iprot thrift.Protocol) error { tSlice := make([]*Expr, 0, size) p.Expressions = tSlice for i := 0; i < size; i ++ { - _elem22 := NewExpr() - if err := _elem22.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + _elem26 := NewExpr() + if err := _elem26.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) } - p.Expressions = append(p.Expressions, _elem22) + p.Expressions = append(p.Expressions, _elem26) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -3676,11 +4234,11 @@ func (p *GetPropRequest) ReadField7(iprot thrift.Protocol) error { tSlice := make([]*OrderBy, 0, size) p.OrderBy = tSlice for i := 0; i < size; i ++ { - _elem23 := NewOrderBy() - if err := _elem23.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + _elem27 := NewOrderBy() + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) } - p.OrderBy = append(p.OrderBy, _elem23) + p.OrderBy = append(p.OrderBy, _elem27) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -4224,11 +4782,11 @@ func (p *NewTag_) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*nebula0.Value, 0, size) p.Props = tSlice for i := 0; i < size; i ++ { - _elem24 := nebula0.NewValue() - if err := _elem24.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) + _elem28 := nebula0.NewValue() + if err := _elem28.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) } - p.Props = append(p.Props, _elem24) + p.Props = append(p.Props, _elem28) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -4403,11 +4961,11 @@ func (p *NewVertex_) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*NewTag_, 0, size) p.Tags = tSlice for i := 0; i < size; i ++ { - _elem25 := NewNewTag_() - if err := _elem25.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) + _elem29 := NewNewTag_() + if err := _elem29.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) } - p.Tags = append(p.Tags, _elem25) + p.Tags = append(p.Tags, _elem29) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -4853,11 +5411,11 @@ func (p *NewEdge_) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*nebula0.Value, 0, size) p.Props = tSlice for i := 0; i < size; i ++ { - _elem26 := nebula0.NewValue() - if err := _elem26.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) + _elem30 := nebula0.NewValue() + if err := _elem30.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) } - p.Props = append(p.Props, _elem26) + p.Props = append(p.Props, _elem30) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -5124,30 +5682,30 @@ func (p *AddVerticesRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*NewVertex_, size) p.Parts = tMap for i := 0; i < size; i ++ { - var _key27 nebula0.PartitionID + var _key31 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key27 = temp + _key31 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*NewVertex_, 0, size) - _val28 := tSlice + _val32 := tSlice for i := 0; i < size; i ++ { - _elem29 := NewNewVertex_() - if err := _elem29.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) + _elem33 := NewNewVertex_() + if err := _elem33.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem33), err) } - _val28 = append(_val28, _elem29) + _val32 = append(_val32, _elem33) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key27] = _val28 + p.Parts[_key31] = _val32 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -5163,32 +5721,32 @@ func (p *AddVerticesRequest) ReadField3(iprot thrift.Protocol) error { tMap := make(map[nebula0.TagID][][]byte, size) p.PropNames = tMap for i := 0; i < size; i ++ { - var _key30 nebula0.TagID + var _key34 nebula0.TagID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.TagID(v) - _key30 = temp + _key34 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([][]byte, 0, size) - _val31 := tSlice + _val35 := tSlice for i := 0; i < size; i ++ { - var _elem32 []byte + var _elem36 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem32 = v + _elem36 = v } - _val31 = append(_val31, _elem32) + _val35 = append(_val35, _elem36) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.PropNames[_key30] = _val31 + p.PropNames[_key34] = _val35 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -5559,30 +6117,30 @@ func (p *AddEdgesRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*NewEdge_, size) p.Parts = tMap for i := 0; i < size; i ++ { - var _key33 nebula0.PartitionID + var _key37 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key33 = temp + _key37 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*NewEdge_, 0, size) - _val34 := tSlice + _val38 := tSlice for i := 0; i < size; i ++ { - _elem35 := NewNewEdge_() - if err := _elem35.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) + _elem39 := NewNewEdge_() + if err := _elem39.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem39), err) } - _val34 = append(_val34, _elem35) + _val38 = append(_val38, _elem39) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key33] = _val34 + p.Parts[_key37] = _val38 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -5598,13 +6156,13 @@ func (p *AddEdgesRequest) ReadField3(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.PropNames = tSlice for i := 0; i < size; i ++ { - var _elem36 []byte + var _elem40 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem36 = v + _elem40 = v } - p.PropNames = append(p.PropNames, _elem36) + p.PropNames = append(p.PropNames, _elem40) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -5902,30 +6460,30 @@ func (p *DeleteVerticesRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*nebula0.Value, size) p.Parts = tMap for i := 0; i < size; i ++ { - var _key37 nebula0.PartitionID + var _key41 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key37 = temp + _key41 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*nebula0.Value, 0, size) - _val38 := tSlice + _val42 := tSlice for i := 0; i < size; i ++ { - _elem39 := nebula0.NewValue() - if err := _elem39.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem39), err) + _elem43 := nebula0.NewValue() + if err := _elem43.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err) } - _val38 = append(_val38, _elem39) + _val42 = append(_val42, _elem43) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key37] = _val38 + p.Parts[_key41] = _val42 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -6161,30 +6719,30 @@ func (p *DeleteEdgesRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*EdgeKey, size) p.Parts = tMap for i := 0; i < size; i ++ { - var _key40 nebula0.PartitionID + var _key44 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key40 = temp + _key44 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*EdgeKey, 0, size) - _val41 := tSlice + _val45 := tSlice for i := 0; i < size; i ++ { - _elem42 := NewEdgeKey() - if err := _elem42.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem42), err) + _elem46 := NewEdgeKey() + if err := _elem46.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) } - _val41 = append(_val41, _elem42) + _val45 = append(_val45, _elem46) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key40] = _val41 + p.Parts[_key44] = _val45 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -6397,14 +6955,14 @@ func (p *DelTags) ReadField2(iprot thrift.Protocol) error { tSlice := make([]nebula0.TagID, 0, size) p.Tags = tSlice for i := 0; i < size; i ++ { - var _elem43 nebula0.TagID + var _elem47 nebula0.TagID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.TagID(v) - _elem43 = temp + _elem47 = temp } - p.Tags = append(p.Tags, _elem43) + p.Tags = append(p.Tags, _elem47) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -6607,30 +7165,30 @@ func (p *DeleteTagsRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*DelTags, size) p.Parts = tMap for i := 0; i < size; i ++ { - var _key44 nebula0.PartitionID + var _key48 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key44 = temp + _key48 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*DelTags, 0, size) - _val45 := tSlice + _val49 := tSlice for i := 0; i < size; i ++ { - _elem46 := NewDelTags() - if err := _elem46.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) + _elem50 := NewDelTags() + if err := _elem50.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem50), err) } - _val45 = append(_val45, _elem46) + _val49 = append(_val49, _elem50) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key44] = _val45 + p.Parts[_key48] = _val49 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -7396,11 +7954,11 @@ func (p *UpdateVertexRequest) ReadField5(iprot thrift.Protocol) error { tSlice := make([]*UpdatedProp, 0, size) p.UpdatedProps = tSlice for i := 0; i < size; i ++ { - _elem47 := NewUpdatedProp() - if err := _elem47.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem47), err) + _elem51 := NewUpdatedProp() + if err := _elem51.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) } - p.UpdatedProps = append(p.UpdatedProps, _elem47) + p.UpdatedProps = append(p.UpdatedProps, _elem51) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7425,13 +7983,13 @@ func (p *UpdateVertexRequest) ReadField7(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.ReturnProps = tSlice for i := 0; i < size; i ++ { - var _elem48 []byte + var _elem52 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem48 = v + _elem52 = v } - p.ReturnProps = append(p.ReturnProps, _elem48) + p.ReturnProps = append(p.ReturnProps, _elem52) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7905,11 +8463,11 @@ func (p *UpdateEdgeRequest) ReadField4(iprot thrift.Protocol) error { tSlice := make([]*UpdatedProp, 0, size) p.UpdatedProps = tSlice for i := 0; i < size; i ++ { - _elem49 := NewUpdatedProp() - if err := _elem49.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem49), err) + _elem53 := NewUpdatedProp() + if err := _elem53.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem53), err) } - p.UpdatedProps = append(p.UpdatedProps, _elem49) + p.UpdatedProps = append(p.UpdatedProps, _elem53) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7934,13 +8492,13 @@ func (p *UpdateEdgeRequest) ReadField6(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.ReturnProps = tSlice for i := 0; i < size; i ++ { - var _elem50 []byte + var _elem54 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem50 = v + _elem54 = v } - p.ReturnProps = append(p.ReturnProps, _elem50) + p.ReturnProps = append(p.ReturnProps, _elem54) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9284,11 +9842,11 @@ func (p *IndexQueryContext) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*IndexColumnHint, 0, size) p.ColumnHints = tSlice for i := 0; i < size; i ++ { - _elem51 := NewIndexColumnHint() - if err := _elem51.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) + _elem55 := NewIndexColumnHint() + if err := _elem55.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem55), err) } - p.ColumnHints = append(p.ColumnHints, _elem51) + p.ColumnHints = append(p.ColumnHints, _elem55) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9472,11 +10030,11 @@ func (p *IndexSpec) ReadField1(iprot thrift.Protocol) error { tSlice := make([]*IndexQueryContext, 0, size) p.Contexts = tSlice for i := 0; i < size; i ++ { - _elem52 := NewIndexQueryContext() - if err := _elem52.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + _elem56 := NewIndexQueryContext() + if err := _elem56.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) } - p.Contexts = append(p.Contexts, _elem52) + p.Contexts = append(p.Contexts, _elem56) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9834,14 +10392,14 @@ func (p *LookupIndexRequest) ReadField2(iprot thrift.Protocol) error { tSlice := make([]nebula0.PartitionID, 0, size) p.Parts = tSlice for i := 0; i < size; i ++ { - var _elem53 nebula0.PartitionID + var _elem57 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem53 = temp + _elem57 = temp } - p.Parts = append(p.Parts, _elem53) + p.Parts = append(p.Parts, _elem57) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9865,13 +10423,13 @@ func (p *LookupIndexRequest) ReadField4(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.ReturnColumns = tSlice for i := 0; i < size; i ++ { - var _elem54 []byte + var _elem58 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem54 = v + _elem58 = v } - p.ReturnColumns = append(p.ReturnColumns, _elem54) + p.ReturnColumns = append(p.ReturnColumns, _elem58) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9904,11 +10462,11 @@ func (p *LookupIndexRequest) ReadField7(iprot thrift.Protocol) error { tSlice := make([]*OrderBy, 0, size) p.OrderBy = tSlice for i := 0; i < size; i ++ { - _elem55 := NewOrderBy() - if err := _elem55.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem55), err) + _elem59 := NewOrderBy() + if err := _elem59.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) } - p.OrderBy = append(p.OrderBy, _elem55) + p.OrderBy = append(p.OrderBy, _elem59) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9924,11 +10482,11 @@ func (p *LookupIndexRequest) ReadField8(iprot thrift.Protocol) error { tSlice := make([]*StatProp, 0, size) p.StatColumns = tSlice for i := 0; i < size; i ++ { - _elem56 := NewStatProp() - if err := _elem56.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + _elem60 := NewStatProp() + if err := _elem60.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem60), err) } - p.StatColumns = append(p.StatColumns, _elem56) + p.StatColumns = append(p.StatColumns, _elem60) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10319,14 +10877,14 @@ func (p *LookupAndTraverseRequest) ReadField2(iprot thrift.Protocol) error { tSlice := make([]nebula0.PartitionID, 0, size) p.Parts = tSlice for i := 0; i < size; i ++ { - var _elem57 nebula0.PartitionID + var _elem61 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem57 = temp + _elem61 = temp } - p.Parts = append(p.Parts, _elem57) + p.Parts = append(p.Parts, _elem61) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10889,18 +11447,18 @@ func (p *ScanVertexRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID]*ScanCursor, size) p.Parts = tMap for i := 0; i < size; i ++ { - var _key58 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) - _key58 = temp + _key62 = temp } - _val59 := NewScanCursor() - if err := _val59.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val59), err) + _val63 := NewScanCursor() + if err := _val63.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val63), err) } - p.Parts[_key58] = _val59 + p.Parts[_key62] = _val63 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -10916,11 +11474,11 @@ func (p *ScanVertexRequest) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*VertexProp, 0, size) p.ReturnColumns = tSlice for i := 0; i < size; i ++ { - _elem60 := NewVertexProp() - if err := _elem60.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem60), err) + _elem64 := NewVertexProp() + if err := _elem64.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) } - p.ReturnColumns = append(p.ReturnColumns, _elem60) + p.ReturnColumns = append(p.ReturnColumns, _elem64) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -11479,18 +12037,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 _key65 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key61 = temp + _key65 = temp } - _val62 := NewScanCursor() - if err := _val62.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val62), err) + _val66 := NewScanCursor() + if err := _val66.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val66), err) } - p.Parts[_key61] = _val62 + p.Parts[_key65] = _val66 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -11506,11 +12064,11 @@ func (p *ScanEdgeRequest) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*EdgeProp, 0, size) p.ReturnColumns = tSlice for i := 0; i < size; i ++ { - _elem63 := NewEdgeProp() - if err := _elem63.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem63), err) + _elem67 := NewEdgeProp() + if err := _elem67.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem67), err) } - p.ReturnColumns = append(p.ReturnColumns, _elem63) + p.ReturnColumns = append(p.ReturnColumns, _elem67) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -11921,18 +12479,18 @@ func (p *ScanResponse) ReadField3(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID]*ScanCursor, size) p.Cursors = tMap for i := 0; i < size; i ++ { - var _key64 nebula0.PartitionID + var _key68 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key64 = temp + _key68 = temp } - _val65 := NewScanCursor() - if err := _val65.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val65), err) + _val69 := NewScanCursor() + if err := _val69.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val69), err) } - p.Cursors[_key64] = _val65 + p.Cursors[_key68] = _val69 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -12161,14 +12719,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 _elem66 nebula0.PartitionID + var _elem70 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem66 = temp + _elem70 = temp } - p.Parts = append(p.Parts, _elem66) + p.Parts = append(p.Parts, _elem70) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -12184,13 +12742,13 @@ func (p *TaskPara) ReadField3(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.TaskSpecificParas = tSlice for i := 0; i < size; i ++ { - var _elem67 []byte + var _elem71 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem67 = v + _elem71 = v } - p.TaskSpecificParas = append(p.TaskSpecificParas, _elem67) + p.TaskSpecificParas = append(p.TaskSpecificParas, _elem71) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -12404,32 +12962,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 _key68 nebula0.PartitionID + var _key72 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key68 = temp + _key72 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([][]byte, 0, size) - _val69 := tSlice + _val73 := tSlice for i := 0; i < size; i ++ { - var _elem70 []byte + var _elem74 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem70 = v + _elem74 = v } - _val69 = append(_val69, _elem70) + _val73 = append(_val73, _elem74) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key68] = _val69 + p.Parts[_key72] = _val73 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -12641,19 +13199,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 _key71 string + var _key75 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key71 = v + _key75 = v } - var _val72 []byte + var _val76 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val72 = v + _val76 = v } - p.KeyValues[_key71] = _val72 + p.KeyValues[_key75] = _val76 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -12830,30 +13388,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 _key73 nebula0.PartitionID + var _key77 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key73 = temp + _key77 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*nebula0.KeyValue, 0, size) - _val74 := tSlice + _val78 := tSlice for i := 0; i < size; i ++ { - _elem75 := nebula0.NewKeyValue() - if err := _elem75.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem75), err) + _elem79 := nebula0.NewKeyValue() + if err := _elem79.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem79), err) } - _val74 = append(_val74, _elem75) + _val78 = append(_val78, _elem79) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key73] = _val74 + p.Parts[_key77] = _val78 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -13033,32 +13591,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 _key76 nebula0.PartitionID + var _key80 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key76 = temp + _key80 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([][]byte, 0, size) - _val77 := tSlice + _val81 := 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 } - _val77 = append(_val77, _elem78) + _val81 = append(_val81, _elem82) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key76] = _val77 + p.Parts[_key80] = _val81 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -13695,11 +14253,11 @@ func (p *AddPartReq) ReadField4(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Peers = tSlice for i := 0; i < size; i ++ { - _elem79 := nebula0.NewHostAddr() - if err := _elem79.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem79), err) + _elem83 := nebula0.NewHostAddr() + if err := _elem83.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem83), err) } - p.Peers = append(p.Peers, _elem79) + p.Peers = append(p.Peers, _elem83) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -14778,14 +15336,14 @@ func (p *CreateCPRequest) ReadField1(iprot thrift.Protocol) error { tSlice := make([]nebula0.GraphSpaceID, 0, size) p.SpaceIds = tSlice for i := 0; i < size; i ++ { - var _elem80 nebula0.GraphSpaceID + var _elem84 nebula0.GraphSpaceID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.GraphSpaceID(v) - _elem80 = temp + _elem84 = temp } - p.SpaceIds = append(p.SpaceIds, _elem80) + p.SpaceIds = append(p.SpaceIds, _elem84) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -14963,11 +15521,11 @@ func (p *CreateCPResp) ReadField2(iprot thrift.Protocol) error { tSlice := make([]*nebula0.CheckpointInfo, 0, size) p.Info = tSlice for i := 0; i < size; i ++ { - _elem81 := nebula0.NewCheckpointInfo() - if err := _elem81.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem81), err) + _elem85 := nebula0.NewCheckpointInfo() + if err := _elem85.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem85), err) } - p.Info = append(p.Info, _elem81) + p.Info = append(p.Info, _elem85) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -15127,14 +15685,14 @@ func (p *DropCPRequest) ReadField1(iprot thrift.Protocol) error { tSlice := make([]nebula0.GraphSpaceID, 0, size) p.SpaceIds = tSlice for i := 0; i < size; i ++ { - var _elem82 nebula0.GraphSpaceID + var _elem86 nebula0.GraphSpaceID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.GraphSpaceID(v) - _elem82 = temp + _elem86 = temp } - p.SpaceIds = append(p.SpaceIds, _elem82) + p.SpaceIds = append(p.SpaceIds, _elem86) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -15419,14 +15977,14 @@ func (p *BlockingSignRequest) ReadField1(iprot thrift.Protocol) error { tSlice := make([]nebula0.GraphSpaceID, 0, size) p.SpaceIds = tSlice for i := 0; i < size; i ++ { - var _elem83 nebula0.GraphSpaceID + var _elem87 nebula0.GraphSpaceID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.GraphSpaceID(v) - _elem83 = temp + _elem87 = temp } - p.SpaceIds = append(p.SpaceIds, _elem83) + p.SpaceIds = append(p.SpaceIds, _elem87) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -15717,33 +16275,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 _key84 nebula0.GraphSpaceID + var _key88 nebula0.GraphSpaceID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.GraphSpaceID(v) - _key84 = temp + _key88 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]nebula0.PartitionID, 0, size) - _val85 := tSlice + _val89 := tSlice for i := 0; i < size; i ++ { - var _elem86 nebula0.PartitionID + var _elem90 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem86 = temp + _elem90 = temp } - _val85 = append(_val85, _elem86) + _val89 = append(_val89, _elem90) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.LeaderParts[_key84] = _val85 + p.LeaderParts[_key88] = _val89 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -15953,11 +16511,11 @@ func (p *CheckPeersReq) ReadField3(iprot thrift.Protocol) error { tSlice := make([]*nebula0.HostAddr, 0, size) p.Peers = tSlice for i := 0; i < size; i ++ { - _elem87 := nebula0.NewHostAddr() - if err := _elem87.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem87), err) + _elem91 := nebula0.NewHostAddr() + if err := _elem91.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem91), err) } - p.Peers = append(p.Peers, _elem87) + p.Peers = append(p.Peers, _elem91) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -16160,14 +16718,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 _elem88 nebula0.PartitionID + var _elem92 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem88 = temp + _elem92 = temp } - p.Parts = append(p.Parts, _elem88) + p.Parts = append(p.Parts, _elem92) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -17552,30 +18110,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 _key89 nebula0.PartitionID + var _key93 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key89 = temp + _key93 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*NewEdge_, 0, size) - _val90 := tSlice + _val94 := tSlice for i := 0; i < size; i ++ { - _elem91 := NewNewEdge_() - if err := _elem91.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem91), err) + _elem95 := NewNewEdge_() + if err := _elem95.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem95), err) } - _val90 = append(_val90, _elem91) + _val94 = append(_val94, _elem95) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key89] = _val90 + p.Parts[_key93] = _val94 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -17591,13 +18149,13 @@ func (p *ChainAddEdgesRequest) ReadField3(iprot thrift.Protocol) error { tSlice := make([][]byte, 0, size) p.PropNames = tSlice for i := 0; i < size; i ++ { - var _elem92 []byte + var _elem96 []byte if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem92 = v + _elem96 = v } - p.PropNames = append(p.PropNames, _elem92) + p.PropNames = append(p.PropNames, _elem96) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -17977,14 +18535,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 _elem93 nebula0.PartitionID + var _elem97 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _elem93 = temp + _elem97 = temp } - p.Parts = append(p.Parts, _elem93) + p.Parts = append(p.Parts, _elem97) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -18244,30 +18802,30 @@ func (p *ChainDeleteEdgesRequest) ReadField2(iprot thrift.Protocol) error { tMap := make(map[nebula0.PartitionID][]*EdgeKey, size) p.Parts = tMap for i := 0; i < size; i ++ { - var _key94 nebula0.PartitionID + var _key98 nebula0.PartitionID if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := nebula0.PartitionID(v) - _key94 = temp + _key98 = temp } _, size, err := iprot.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*EdgeKey, 0, size) - _val95 := tSlice + _val99 := tSlice for i := 0; i < size; i ++ { - _elem96 := NewEdgeKey() - if err := _elem96.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem96), err) + _elem100 := NewEdgeKey() + if err := _elem100.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem100), err) } - _val95 = append(_val95, _elem96) + _val99 = append(_val99, _elem100) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } - p.Parts[_key94] = _val95 + p.Parts[_key98] = _val99 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) diff --git a/nebula/ttypes.go b/nebula/ttypes.go index 059fda6c..81c63002 100644 --- a/nebula/ttypes.go +++ b/nebula/ttypes.go @@ -262,6 +262,9 @@ const ( ErrorCode_E_WRONGCLUSTER ErrorCode = -2010 ErrorCode_E_ZONE_NOT_ENOUGH ErrorCode = -2011 ErrorCode_E_ZONE_IS_EMPTY ErrorCode = -2012 + ErrorCode_E_SCHEMA_NAME_EXISTS ErrorCode = -2013 + ErrorCode_E_RELATED_INDEX_EXISTS ErrorCode = -2014 + ErrorCode_E_RELATED_SPACE_EXISTS ErrorCode = -2015 ErrorCode_E_STORE_FAILURE ErrorCode = -2021 ErrorCode_E_STORE_SEGMENT_ILLEGAL ErrorCode = -2022 ErrorCode_E_BAD_BALANCE_PLAN ErrorCode = -2023 @@ -288,6 +291,10 @@ const ( ErrorCode_E_TASK_REPORT_OUT_DATE ErrorCode = -2049 ErrorCode_E_JOB_NOT_IN_SPACE ErrorCode = -2050 ErrorCode_E_JOB_NEED_RECOVER ErrorCode = -2051 + ErrorCode_E_JOB_ALREADY_FINISH ErrorCode = -2052 + ErrorCode_E_JOB_SUBMITTED ErrorCode = -2053 + ErrorCode_E_JOB_NOT_STOPPABLE ErrorCode = -2054 + ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE ErrorCode = -2055 ErrorCode_E_INVALID_JOB ErrorCode = -2065 ErrorCode_E_BACKUP_BUILDING_INDEX ErrorCode = -2066 ErrorCode_E_BACKUP_SPACE_NOT_FOUND ErrorCode = -2067 @@ -413,6 +420,9 @@ var ErrorCodeToName = map[ErrorCode]string { ErrorCode_E_WRONGCLUSTER: "E_WRONGCLUSTER", ErrorCode_E_ZONE_NOT_ENOUGH: "E_ZONE_NOT_ENOUGH", ErrorCode_E_ZONE_IS_EMPTY: "E_ZONE_IS_EMPTY", + ErrorCode_E_SCHEMA_NAME_EXISTS: "E_SCHEMA_NAME_EXISTS", + ErrorCode_E_RELATED_INDEX_EXISTS: "E_RELATED_INDEX_EXISTS", + ErrorCode_E_RELATED_SPACE_EXISTS: "E_RELATED_SPACE_EXISTS", ErrorCode_E_STORE_FAILURE: "E_STORE_FAILURE", ErrorCode_E_STORE_SEGMENT_ILLEGAL: "E_STORE_SEGMENT_ILLEGAL", ErrorCode_E_BAD_BALANCE_PLAN: "E_BAD_BALANCE_PLAN", @@ -439,6 +449,10 @@ var ErrorCodeToName = map[ErrorCode]string { ErrorCode_E_TASK_REPORT_OUT_DATE: "E_TASK_REPORT_OUT_DATE", ErrorCode_E_JOB_NOT_IN_SPACE: "E_JOB_NOT_IN_SPACE", ErrorCode_E_JOB_NEED_RECOVER: "E_JOB_NEED_RECOVER", + ErrorCode_E_JOB_ALREADY_FINISH: "E_JOB_ALREADY_FINISH", + ErrorCode_E_JOB_SUBMITTED: "E_JOB_SUBMITTED", + ErrorCode_E_JOB_NOT_STOPPABLE: "E_JOB_NOT_STOPPABLE", + ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE: "E_JOB_HAS_NO_TARGET_STORAGE", ErrorCode_E_INVALID_JOB: "E_INVALID_JOB", ErrorCode_E_BACKUP_BUILDING_INDEX: "E_BACKUP_BUILDING_INDEX", ErrorCode_E_BACKUP_SPACE_NOT_FOUND: "E_BACKUP_SPACE_NOT_FOUND", @@ -564,6 +578,9 @@ var ErrorCodeToValue = map[string]ErrorCode { "E_WRONGCLUSTER": ErrorCode_E_WRONGCLUSTER, "E_ZONE_NOT_ENOUGH": ErrorCode_E_ZONE_NOT_ENOUGH, "E_ZONE_IS_EMPTY": ErrorCode_E_ZONE_IS_EMPTY, + "E_SCHEMA_NAME_EXISTS": ErrorCode_E_SCHEMA_NAME_EXISTS, + "E_RELATED_INDEX_EXISTS": ErrorCode_E_RELATED_INDEX_EXISTS, + "E_RELATED_SPACE_EXISTS": ErrorCode_E_RELATED_SPACE_EXISTS, "E_STORE_FAILURE": ErrorCode_E_STORE_FAILURE, "E_STORE_SEGMENT_ILLEGAL": ErrorCode_E_STORE_SEGMENT_ILLEGAL, "E_BAD_BALANCE_PLAN": ErrorCode_E_BAD_BALANCE_PLAN, @@ -590,6 +607,10 @@ var ErrorCodeToValue = map[string]ErrorCode { "E_TASK_REPORT_OUT_DATE": ErrorCode_E_TASK_REPORT_OUT_DATE, "E_JOB_NOT_IN_SPACE": ErrorCode_E_JOB_NOT_IN_SPACE, "E_JOB_NEED_RECOVER": ErrorCode_E_JOB_NEED_RECOVER, + "E_JOB_ALREADY_FINISH": ErrorCode_E_JOB_ALREADY_FINISH, + "E_JOB_SUBMITTED": ErrorCode_E_JOB_SUBMITTED, + "E_JOB_NOT_STOPPABLE": ErrorCode_E_JOB_NOT_STOPPABLE, + "E_JOB_HAS_NO_TARGET_STORAGE": ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE, "E_INVALID_JOB": ErrorCode_E_INVALID_JOB, "E_BACKUP_BUILDING_INDEX": ErrorCode_E_BACKUP_BUILDING_INDEX, "E_BACKUP_SPACE_NOT_FOUND": ErrorCode_E_BACKUP_SPACE_NOT_FOUND, @@ -715,6 +736,9 @@ var ErrorCodeNames = []string { "E_WRONGCLUSTER", "E_ZONE_NOT_ENOUGH", "E_ZONE_IS_EMPTY", + "E_SCHEMA_NAME_EXISTS", + "E_RELATED_INDEX_EXISTS", + "E_RELATED_SPACE_EXISTS", "E_STORE_FAILURE", "E_STORE_SEGMENT_ILLEGAL", "E_BAD_BALANCE_PLAN", @@ -741,6 +765,10 @@ var ErrorCodeNames = []string { "E_TASK_REPORT_OUT_DATE", "E_JOB_NOT_IN_SPACE", "E_JOB_NEED_RECOVER", + "E_JOB_ALREADY_FINISH", + "E_JOB_SUBMITTED", + "E_JOB_NOT_STOPPABLE", + "E_JOB_HAS_NO_TARGET_STORAGE", "E_INVALID_JOB", "E_BACKUP_BUILDING_INDEX", "E_BACKUP_SPACE_NOT_FOUND", @@ -866,6 +894,9 @@ var ErrorCodeValues = []ErrorCode { ErrorCode_E_WRONGCLUSTER, ErrorCode_E_ZONE_NOT_ENOUGH, ErrorCode_E_ZONE_IS_EMPTY, + ErrorCode_E_SCHEMA_NAME_EXISTS, + ErrorCode_E_RELATED_INDEX_EXISTS, + ErrorCode_E_RELATED_SPACE_EXISTS, ErrorCode_E_STORE_FAILURE, ErrorCode_E_STORE_SEGMENT_ILLEGAL, ErrorCode_E_BAD_BALANCE_PLAN, @@ -892,6 +923,10 @@ var ErrorCodeValues = []ErrorCode { ErrorCode_E_TASK_REPORT_OUT_DATE, ErrorCode_E_JOB_NOT_IN_SPACE, ErrorCode_E_JOB_NEED_RECOVER, + ErrorCode_E_JOB_ALREADY_FINISH, + ErrorCode_E_JOB_SUBMITTED, + ErrorCode_E_JOB_NOT_STOPPABLE, + ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE, ErrorCode_E_INVALID_JOB, ErrorCode_E_BACKUP_BUILDING_INDEX, ErrorCode_E_BACKUP_SPACE_NOT_FOUND, @@ -6416,9 +6451,13 @@ func (p *Duration) String() string { // Attributes: // - LogID // - TermID +// - CommitLogID +// - CheckpointPath type LogInfo struct { LogID LogID `thrift:"log_id,1" db:"log_id" json:"log_id"` TermID TermID `thrift:"term_id,2" db:"term_id" json:"term_id"` + CommitLogID LogID `thrift:"commit_log_id,3" db:"commit_log_id" json:"commit_log_id"` + CheckpointPath []byte `thrift:"checkpoint_path,4" db:"checkpoint_path" json:"checkpoint_path"` } func NewLogInfo() *LogInfo { @@ -6433,6 +6472,14 @@ func (p *LogInfo) GetLogID() LogID { func (p *LogInfo) GetTermID() TermID { return p.TermID } + +func (p *LogInfo) GetCommitLogID() LogID { + return p.CommitLogID +} + +func (p *LogInfo) GetCheckpointPath() []byte { + return p.CheckpointPath +} type LogInfoBuilder struct { obj *LogInfo } @@ -6447,6 +6494,8 @@ func (p LogInfoBuilder) Emit() *LogInfo{ return &LogInfo{ LogID: p.obj.LogID, TermID: p.obj.TermID, + CommitLogID: p.obj.CommitLogID, + CheckpointPath: p.obj.CheckpointPath, } } @@ -6460,6 +6509,16 @@ func (l *LogInfoBuilder) TermID(termID TermID) *LogInfoBuilder { return l } +func (l *LogInfoBuilder) CommitLogID(commitLogID LogID) *LogInfoBuilder { + l.obj.CommitLogID = commitLogID + return l +} + +func (l *LogInfoBuilder) CheckpointPath(checkpointPath []byte) *LogInfoBuilder { + l.obj.CheckpointPath = checkpointPath + return l +} + func (l *LogInfo) SetLogID(logID LogID) *LogInfo { l.LogID = logID return l @@ -6470,6 +6529,16 @@ func (l *LogInfo) SetTermID(termID TermID) *LogInfo { return l } +func (l *LogInfo) SetCommitLogID(commitLogID LogID) *LogInfo { + l.CommitLogID = commitLogID + return l +} + +func (l *LogInfo) SetCheckpointPath(checkpointPath []byte) *LogInfo { + l.CheckpointPath = checkpointPath + return l +} + func (p *LogInfo) Read(iprot thrift.Protocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -6491,6 +6560,14 @@ func (p *LogInfo) 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 + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -6526,11 +6603,32 @@ func (p *LogInfo) ReadField2(iprot thrift.Protocol) error { return nil } +func (p *LogInfo) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := LogID(v) + p.CommitLogID = temp + } + return nil +} + +func (p *LogInfo) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.CheckpointPath = v + } + return nil +} + func (p *LogInfo) Write(oprot thrift.Protocol) error { if err := oprot.WriteStructBegin("LogInfo"); 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 := p.writeField4(oprot); err != nil { return err } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } if err := oprot.WriteStructEnd(); err != nil { @@ -6558,6 +6656,26 @@ func (p *LogInfo) writeField2(oprot thrift.Protocol) (err error) { return err } +func (p *LogInfo) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("commit_log_id", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:commit_log_id: ", p), err) } + if err := oprot.WriteI64(int64(p.CommitLogID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.commit_log_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:commit_log_id: ", p), err) } + return err +} + +func (p *LogInfo) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("checkpoint_path", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:checkpoint_path: ", p), err) } + if err := oprot.WriteBinary(p.CheckpointPath); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.checkpoint_path (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:checkpoint_path: ", p), err) } + return err +} + func (p *LogInfo) String() string { if p == nil { return "" @@ -6565,7 +6683,9 @@ func (p *LogInfo) String() string { logIDVal := fmt.Sprintf("%v", p.LogID) termIDVal := fmt.Sprintf("%v", p.TermID) - return fmt.Sprintf("LogInfo({LogID:%s TermID:%s})", logIDVal, termIDVal) + commitLogIDVal := fmt.Sprintf("%v", p.CommitLogID) + checkpointPathVal := fmt.Sprintf("%v", p.CheckpointPath) + return fmt.Sprintf("LogInfo({LogID:%s TermID:%s CommitLogID:%s CheckpointPath:%s})", logIDVal, termIDVal, commitLogIDVal, checkpointPathVal) } // Attributes: @@ -6745,11 +6865,11 @@ func (p *DirInfo) String() string { // Attributes: // - SpaceID // - Parts -// - Path +// - DataPath type CheckpointInfo struct { SpaceID GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` Parts map[PartitionID]*LogInfo `thrift:"parts,2" db:"parts" json:"parts"` - Path []byte `thrift:"path,3" db:"path" json:"path"` + DataPath []byte `thrift:"data_path,3" db:"data_path" json:"data_path"` } func NewCheckpointInfo() *CheckpointInfo { @@ -6765,8 +6885,8 @@ func (p *CheckpointInfo) GetParts() map[PartitionID]*LogInfo { return p.Parts } -func (p *CheckpointInfo) GetPath() []byte { - return p.Path +func (p *CheckpointInfo) GetDataPath() []byte { + return p.DataPath } type CheckpointInfoBuilder struct { obj *CheckpointInfo @@ -6782,7 +6902,7 @@ func (p CheckpointInfoBuilder) Emit() *CheckpointInfo{ return &CheckpointInfo{ SpaceID: p.obj.SpaceID, Parts: p.obj.Parts, - Path: p.obj.Path, + DataPath: p.obj.DataPath, } } @@ -6796,8 +6916,8 @@ func (c *CheckpointInfoBuilder) Parts(parts map[PartitionID]*LogInfo) *Checkpoin return c } -func (c *CheckpointInfoBuilder) Path(path []byte) *CheckpointInfoBuilder { - c.obj.Path = path +func (c *CheckpointInfoBuilder) DataPath(dataPath []byte) *CheckpointInfoBuilder { + c.obj.DataPath = dataPath return c } @@ -6811,8 +6931,8 @@ func (c *CheckpointInfo) SetParts(parts map[PartitionID]*LogInfo) *CheckpointInf return c } -func (c *CheckpointInfo) SetPath(path []byte) *CheckpointInfo { - c.Path = path +func (c *CheckpointInfo) SetDataPath(dataPath []byte) *CheckpointInfo { + c.DataPath = dataPath return c } @@ -6897,7 +7017,7 @@ func (p *CheckpointInfo) ReadField3(iprot thrift.Protocol) error { if v, err := iprot.ReadBinary(); err != nil { return thrift.PrependError("error reading field 3: ", err) } else { - p.Path = v + p.DataPath = v } return nil } @@ -6947,12 +7067,12 @@ func (p *CheckpointInfo) writeField2(oprot thrift.Protocol) (err error) { } func (p *CheckpointInfo) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("path", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:path: ", p), err) } - if err := oprot.WriteBinary(p.Path); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.path (3) field write error: ", p), err) } + if err := oprot.WriteFieldBegin("data_path", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:data_path: ", p), err) } + if err := oprot.WriteBinary(p.DataPath); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.data_path (3) field write error: ", p), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:path: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:data_path: ", p), err) } return err } @@ -6963,8 +7083,8 @@ func (p *CheckpointInfo) String() string { spaceIDVal := fmt.Sprintf("%v", p.SpaceID) partsVal := fmt.Sprintf("%v", p.Parts) - pathVal := fmt.Sprintf("%v", p.Path) - return fmt.Sprintf("CheckpointInfo({SpaceID:%s Parts:%s Path:%s})", spaceIDVal, partsVal, pathVal) + dataPathVal := fmt.Sprintf("%v", p.DataPath) + return fmt.Sprintf("CheckpointInfo({SpaceID:%s Parts:%s DataPath:%s})", spaceIDVal, partsVal, dataPathVal) } // Attributes: diff --git a/result_set.go b/result_set.go index d9f2db21..a3eae91b 100644 --- a/result_set.go +++ b/result_set.go @@ -12,6 +12,7 @@ import ( "bytes" "encoding/json" "fmt" + "regexp" "sort" "strings" "time" @@ -1270,24 +1271,36 @@ func (res ResultSet) MakePlanByRow() [][]interface{} { } if planNodeDesc.IsSetProfiles() { - var strArr []string + var profileArr []string for i, profile := range planNodeDesc.GetProfiles() { - otherStats := profile.GetOtherStats() - if otherStats != nil { - strArr = append(strArr, "{") - } - s := fmt.Sprintf("ver: %d, rows: %d, execTime: %dus, totalTime: %dus", - i, profile.GetRows(), profile.GetExecDurationInUs(), profile.GetTotalDurationInUs()) - strArr = append(strArr, s) - - for k, v := range otherStats { - strArr = append(strArr, fmt.Sprintf("%s: %s", k, v)) - } - if otherStats != nil { - strArr = append(strArr, "}") + var statArr []string + statArr = append(statArr, fmt.Sprintf("\"version\":%d", i)) + statArr = append(statArr, fmt.Sprintf("\"rows\":%d", profile.GetRows())) + statArr = append(statArr, fmt.Sprintf("\"execTime\":\"%d(us)\"", profile.GetExecDurationInUs())) + statArr = append(statArr, fmt.Sprintf("\"totalTime\":\"%d(us)\"", profile.GetTotalDurationInUs())) + for k, v := range profile.GetOtherStats() { + s := string(v) + if matched, err := regexp.Match(`^[^{(\[]\w+`, v); err == nil && matched { + if !strings.HasPrefix(s, "\"") { + s = fmt.Sprintf("\"%s", s) + } + if !strings.HasSuffix(s, "\"") { + s = fmt.Sprintf("%s\"", s) + } + } + statArr = append(statArr, fmt.Sprintf("\"%s\": %s", k, s)) } + sort.Strings(statArr) + statStr := fmt.Sprintf("{%s}", strings.Join(statArr, ",\n")) + profileArr = append(profileArr, statStr) + } + allProfiles := strings.Join(profileArr, ",\n") + if len(profileArr) > 1 { + allProfiles = fmt.Sprintf("[%s]", allProfiles) } - row = append(row, strings.Join(strArr, "\n")) + var buffer bytes.Buffer + json.Indent(&buffer, []byte(allProfiles), "", " ") + row = append(row, string(buffer.Bytes())) } else { row = append(row, "") }